diff --git a/main.c b/main.c index 18ab8f5..d2974e9 100644 --- a/main.c +++ b/main.c @@ -47,7 +47,7 @@ #define OAPI_RAW_OUTPUT 1 -#define OAPI_CLI_VERSION "0.6.0" +#define OAPI_CLI_VERSION "0.7.0" #define OAPI_CLI_UAGENT "oapi-cli/"OAPI_CLI_VERSION"; osc-sdk-c/" @@ -320,9 +320,9 @@ int filters_users_parser(void *s, char *str, char *aa, struct ptr_array *pa); int filters_virtual_gateway_parser(void *s, char *str, char *aa, struct ptr_array *pa); int filters_vm_parser(void *s, char *str, char *aa, struct ptr_array *pa); int filters_vm_group_parser(void *s, char *str, char *aa, struct ptr_array *pa); -int filters_vms_state_parser(void *s, char *str, char *aa, struct ptr_array *pa); int filters_vm_template_parser(void *s, char *str, char *aa, struct ptr_array *pa); int filters_vm_type_parser(void *s, char *str, char *aa, struct ptr_array *pa); +int filters_vms_state_parser(void *s, char *str, char *aa, struct ptr_array *pa); int filters_volume_parser(void *s, char *str, char *aa, struct ptr_array *pa); int filters_vpn_connection_parser(void *s, char *str, char *aa, struct ptr_array *pa); int flexible_gpu_parser(void *s, char *str, char *aa, struct ptr_array *pa); @@ -334,14 +334,14 @@ int inline_policy_parser(void *s, char *str, char *aa, struct ptr_array *pa); int internet_service_parser(void *s, char *str, char *aa, struct ptr_array *pa); int keypair_parser(void *s, char *str, char *aa, struct ptr_array *pa); int keypair_created_parser(void *s, char *str, char *aa, struct ptr_array *pa); -int linked_policy_parser(void *s, char *str, char *aa, struct ptr_array *pa); -int linked_volume_parser(void *s, char *str, char *aa, struct ptr_array *pa); int link_nic_parser(void *s, char *str, char *aa, struct ptr_array *pa); int link_nic_light_parser(void *s, char *str, char *aa, struct ptr_array *pa); int link_nic_to_update_parser(void *s, char *str, char *aa, struct ptr_array *pa); int link_public_ip_parser(void *s, char *str, char *aa, struct ptr_array *pa); int link_public_ip_light_for_vm_parser(void *s, char *str, char *aa, struct ptr_array *pa); int link_route_table_parser(void *s, char *str, char *aa, struct ptr_array *pa); +int linked_policy_parser(void *s, char *str, char *aa, struct ptr_array *pa); +int linked_volume_parser(void *s, char *str, char *aa, struct ptr_array *pa); int listener_parser(void *s, char *str, char *aa, struct ptr_array *pa); int listener_for_creation_parser(void *s, char *str, char *aa, struct ptr_array *pa); int listener_rule_parser(void *s, char *str, char *aa, struct ptr_array *pa); @@ -4158,6 +4158,34 @@ int filters_keypair_parser(void *v_s, char *str, char *aa, struct ptr_array *pa) TRY(!aa, "KeypairFingerprints[] argument missing\n"); SET_NEXT(s->keypair_fingerprints, (aa), pa); } else + if ((aret = argcmp(str, "KeypairIds")) == 0 || aret == '=' || aret == '.') { + if (aret == '.') { + int pos; + char *endptr; + int last = 0; + char *dot_pos = strchr(str, '.'); + + TRY(!(dot_pos++), "KeypairIds argument missing\n"); + pos = strtoul(dot_pos, &endptr, 0); + TRY(endptr == dot_pos, "KeypairIds require an index\n"); + if (s->keypair_ids) { + for (; s->keypair_ids[last]; ++last); + } + if (pos < last) { + s->keypair_ids[pos] = (aa); + } else { + for (int i = last; i < pos; ++i) + SET_NEXT(s->keypair_ids, "", pa); + SET_NEXT(s->keypair_ids, (aa), pa); + } + } else { + TRY(!aa, "KeypairIds argument missing\n"); + s->keypair_ids_str = aa; + } + } else if (!(aret = argcmp(str, "KeypairIds[]")) || aret == '=') { + TRY(!aa, "KeypairIds[] argument missing\n"); + SET_NEXT(s->keypair_ids, (aa), pa); + } else if ((aret = argcmp(str, "KeypairNames")) == 0 || aret == '=' || aret == '.') { if (aret == '.') { int pos; @@ -4214,6 +4242,90 @@ int filters_keypair_parser(void *v_s, char *str, char *aa, struct ptr_array *pa) TRY(!aa, "KeypairTypes[] argument missing\n"); SET_NEXT(s->keypair_types, (aa), pa); } else + if ((aret = argcmp(str, "TagKeys")) == 0 || aret == '=' || aret == '.') { + if (aret == '.') { + int pos; + char *endptr; + int last = 0; + char *dot_pos = strchr(str, '.'); + + TRY(!(dot_pos++), "TagKeys argument missing\n"); + pos = strtoul(dot_pos, &endptr, 0); + TRY(endptr == dot_pos, "TagKeys require an index\n"); + if (s->tag_keys) { + for (; s->tag_keys[last]; ++last); + } + if (pos < last) { + s->tag_keys[pos] = (aa); + } else { + for (int i = last; i < pos; ++i) + SET_NEXT(s->tag_keys, "", pa); + SET_NEXT(s->tag_keys, (aa), pa); + } + } else { + TRY(!aa, "TagKeys argument missing\n"); + s->tag_keys_str = aa; + } + } else if (!(aret = argcmp(str, "TagKeys[]")) || aret == '=') { + TRY(!aa, "TagKeys[] argument missing\n"); + SET_NEXT(s->tag_keys, (aa), pa); + } else + if ((aret = argcmp(str, "TagValues")) == 0 || aret == '=' || aret == '.') { + if (aret == '.') { + int pos; + char *endptr; + int last = 0; + char *dot_pos = strchr(str, '.'); + + TRY(!(dot_pos++), "TagValues argument missing\n"); + pos = strtoul(dot_pos, &endptr, 0); + TRY(endptr == dot_pos, "TagValues require an index\n"); + if (s->tag_values) { + for (; s->tag_values[last]; ++last); + } + if (pos < last) { + s->tag_values[pos] = (aa); + } else { + for (int i = last; i < pos; ++i) + SET_NEXT(s->tag_values, "", pa); + SET_NEXT(s->tag_values, (aa), pa); + } + } else { + TRY(!aa, "TagValues argument missing\n"); + s->tag_values_str = aa; + } + } else if (!(aret = argcmp(str, "TagValues[]")) || aret == '=') { + TRY(!aa, "TagValues[] argument missing\n"); + SET_NEXT(s->tag_values, (aa), pa); + } else + if ((aret = argcmp(str, "Tags")) == 0 || aret == '=' || aret == '.') { + if (aret == '.') { + int pos; + char *endptr; + int last = 0; + char *dot_pos = strchr(str, '.'); + + TRY(!(dot_pos++), "Tags argument missing\n"); + pos = strtoul(dot_pos, &endptr, 0); + TRY(endptr == dot_pos, "Tags require an index\n"); + if (s->tags) { + for (; s->tags[last]; ++last); + } + if (pos < last) { + s->tags[pos] = (aa); + } else { + for (int i = last; i < pos; ++i) + SET_NEXT(s->tags, "", pa); + SET_NEXT(s->tags, (aa), pa); + } + } else { + TRY(!aa, "Tags argument missing\n"); + s->tags_str = aa; + } + } else if (!(aret = argcmp(str, "Tags[]")) || aret == '=') { + TRY(!aa, "Tags[] argument missing\n"); + SET_NEXT(s->tags, (aa), pa); + } else { fprintf(stderr, "'%s' not an argumemt of 'FiltersKeypair'\n", str); return -1; @@ -10904,212 +11016,6 @@ int filters_vm_group_parser(void *v_s, char *str, char *aa, struct ptr_array *pa return 0; } -int filters_vms_state_parser(void *v_s, char *str, char *aa, struct ptr_array *pa) { - struct filters_vms_state *s = v_s; - int aret = 0; - if ((aret = argcmp(str, "MaintenanceEventCodes")) == 0 || aret == '=' || aret == '.') { - if (aret == '.') { - int pos; - char *endptr; - int last = 0; - char *dot_pos = strchr(str, '.'); - - TRY(!(dot_pos++), "MaintenanceEventCodes argument missing\n"); - pos = strtoul(dot_pos, &endptr, 0); - TRY(endptr == dot_pos, "MaintenanceEventCodes require an index\n"); - if (s->maintenance_event_codes) { - for (; s->maintenance_event_codes[last]; ++last); - } - if (pos < last) { - s->maintenance_event_codes[pos] = (aa); - } else { - for (int i = last; i < pos; ++i) - SET_NEXT(s->maintenance_event_codes, "", pa); - SET_NEXT(s->maintenance_event_codes, (aa), pa); - } - } else { - TRY(!aa, "MaintenanceEventCodes argument missing\n"); - s->maintenance_event_codes_str = aa; - } - } else if (!(aret = argcmp(str, "MaintenanceEventCodes[]")) || aret == '=') { - TRY(!aa, "MaintenanceEventCodes[] argument missing\n"); - SET_NEXT(s->maintenance_event_codes, (aa), pa); - } else - if ((aret = argcmp(str, "MaintenanceEventDescriptions")) == 0 || aret == '=' || aret == '.') { - if (aret == '.') { - int pos; - char *endptr; - int last = 0; - char *dot_pos = strchr(str, '.'); - - TRY(!(dot_pos++), "MaintenanceEventDescriptions argument missing\n"); - pos = strtoul(dot_pos, &endptr, 0); - TRY(endptr == dot_pos, "MaintenanceEventDescriptions require an index\n"); - if (s->maintenance_event_descriptions) { - for (; s->maintenance_event_descriptions[last]; ++last); - } - if (pos < last) { - s->maintenance_event_descriptions[pos] = (aa); - } else { - for (int i = last; i < pos; ++i) - SET_NEXT(s->maintenance_event_descriptions, "", pa); - SET_NEXT(s->maintenance_event_descriptions, (aa), pa); - } - } else { - TRY(!aa, "MaintenanceEventDescriptions argument missing\n"); - s->maintenance_event_descriptions_str = aa; - } - } else if (!(aret = argcmp(str, "MaintenanceEventDescriptions[]")) || aret == '=') { - TRY(!aa, "MaintenanceEventDescriptions[] argument missing\n"); - SET_NEXT(s->maintenance_event_descriptions, (aa), pa); - } else - if ((aret = argcmp(str, "MaintenanceEventsNotAfter")) == 0 || aret == '=' || aret == '.') { - if (aret == '.') { - int pos; - char *endptr; - int last = 0; - char *dot_pos = strchr(str, '.'); - - TRY(!(dot_pos++), "MaintenanceEventsNotAfter argument missing\n"); - pos = strtoul(dot_pos, &endptr, 0); - TRY(endptr == dot_pos, "MaintenanceEventsNotAfter require an index\n"); - if (s->maintenance_events_not_after) { - for (; s->maintenance_events_not_after[last]; ++last); - } - if (pos < last) { - s->maintenance_events_not_after[pos] = (aa); - } else { - for (int i = last; i < pos; ++i) - SET_NEXT(s->maintenance_events_not_after, "", pa); - SET_NEXT(s->maintenance_events_not_after, (aa), pa); - } - } else { - TRY(!aa, "MaintenanceEventsNotAfter argument missing\n"); - s->maintenance_events_not_after_str = aa; - } - } else if (!(aret = argcmp(str, "MaintenanceEventsNotAfter[]")) || aret == '=') { - TRY(!aa, "MaintenanceEventsNotAfter[] argument missing\n"); - SET_NEXT(s->maintenance_events_not_after, (aa), pa); - } else - if ((aret = argcmp(str, "MaintenanceEventsNotBefore")) == 0 || aret == '=' || aret == '.') { - if (aret == '.') { - int pos; - char *endptr; - int last = 0; - char *dot_pos = strchr(str, '.'); - - TRY(!(dot_pos++), "MaintenanceEventsNotBefore argument missing\n"); - pos = strtoul(dot_pos, &endptr, 0); - TRY(endptr == dot_pos, "MaintenanceEventsNotBefore require an index\n"); - if (s->maintenance_events_not_before) { - for (; s->maintenance_events_not_before[last]; ++last); - } - if (pos < last) { - s->maintenance_events_not_before[pos] = (aa); - } else { - for (int i = last; i < pos; ++i) - SET_NEXT(s->maintenance_events_not_before, "", pa); - SET_NEXT(s->maintenance_events_not_before, (aa), pa); - } - } else { - TRY(!aa, "MaintenanceEventsNotBefore argument missing\n"); - s->maintenance_events_not_before_str = aa; - } - } else if (!(aret = argcmp(str, "MaintenanceEventsNotBefore[]")) || aret == '=') { - TRY(!aa, "MaintenanceEventsNotBefore[] argument missing\n"); - SET_NEXT(s->maintenance_events_not_before, (aa), pa); - } else - if ((aret = argcmp(str, "SubregionNames")) == 0 || aret == '=' || aret == '.') { - if (aret == '.') { - int pos; - char *endptr; - int last = 0; - char *dot_pos = strchr(str, '.'); - - TRY(!(dot_pos++), "SubregionNames argument missing\n"); - pos = strtoul(dot_pos, &endptr, 0); - TRY(endptr == dot_pos, "SubregionNames require an index\n"); - if (s->subregion_names) { - for (; s->subregion_names[last]; ++last); - } - if (pos < last) { - s->subregion_names[pos] = (aa); - } else { - for (int i = last; i < pos; ++i) - SET_NEXT(s->subregion_names, "", pa); - SET_NEXT(s->subregion_names, (aa), pa); - } - } else { - TRY(!aa, "SubregionNames argument missing\n"); - s->subregion_names_str = aa; - } - } else if (!(aret = argcmp(str, "SubregionNames[]")) || aret == '=') { - TRY(!aa, "SubregionNames[] argument missing\n"); - SET_NEXT(s->subregion_names, (aa), pa); - } else - if ((aret = argcmp(str, "VmIds")) == 0 || aret == '=' || aret == '.') { - if (aret == '.') { - int pos; - char *endptr; - int last = 0; - char *dot_pos = strchr(str, '.'); - - TRY(!(dot_pos++), "VmIds argument missing\n"); - pos = strtoul(dot_pos, &endptr, 0); - TRY(endptr == dot_pos, "VmIds require an index\n"); - if (s->vm_ids) { - for (; s->vm_ids[last]; ++last); - } - if (pos < last) { - s->vm_ids[pos] = (aa); - } else { - for (int i = last; i < pos; ++i) - SET_NEXT(s->vm_ids, "", pa); - SET_NEXT(s->vm_ids, (aa), pa); - } - } else { - TRY(!aa, "VmIds argument missing\n"); - s->vm_ids_str = aa; - } - } else if (!(aret = argcmp(str, "VmIds[]")) || aret == '=') { - TRY(!aa, "VmIds[] argument missing\n"); - SET_NEXT(s->vm_ids, (aa), pa); - } else - if ((aret = argcmp(str, "VmStates")) == 0 || aret == '=' || aret == '.') { - if (aret == '.') { - int pos; - char *endptr; - int last = 0; - char *dot_pos = strchr(str, '.'); - - TRY(!(dot_pos++), "VmStates argument missing\n"); - pos = strtoul(dot_pos, &endptr, 0); - TRY(endptr == dot_pos, "VmStates require an index\n"); - if (s->vm_states) { - for (; s->vm_states[last]; ++last); - } - if (pos < last) { - s->vm_states[pos] = (aa); - } else { - for (int i = last; i < pos; ++i) - SET_NEXT(s->vm_states, "", pa); - SET_NEXT(s->vm_states, (aa), pa); - } - } else { - TRY(!aa, "VmStates argument missing\n"); - s->vm_states_str = aa; - } - } else if (!(aret = argcmp(str, "VmStates[]")) || aret == '=') { - TRY(!aa, "VmStates[] argument missing\n"); - SET_NEXT(s->vm_states, (aa), pa); - } else - { - fprintf(stderr, "'%s' not an argumemt of 'FiltersVmsState'\n", str); - return -1; - } - return 0; -} - int filters_vm_template_parser(void *v_s, char *str, char *aa, struct ptr_array *pa) { struct filters_vm_template *s = v_s; int aret = 0; @@ -11700,6 +11606,212 @@ int filters_vm_type_parser(void *v_s, char *str, char *aa, struct ptr_array *pa) return 0; } +int filters_vms_state_parser(void *v_s, char *str, char *aa, struct ptr_array *pa) { + struct filters_vms_state *s = v_s; + int aret = 0; + if ((aret = argcmp(str, "MaintenanceEventCodes")) == 0 || aret == '=' || aret == '.') { + if (aret == '.') { + int pos; + char *endptr; + int last = 0; + char *dot_pos = strchr(str, '.'); + + TRY(!(dot_pos++), "MaintenanceEventCodes argument missing\n"); + pos = strtoul(dot_pos, &endptr, 0); + TRY(endptr == dot_pos, "MaintenanceEventCodes require an index\n"); + if (s->maintenance_event_codes) { + for (; s->maintenance_event_codes[last]; ++last); + } + if (pos < last) { + s->maintenance_event_codes[pos] = (aa); + } else { + for (int i = last; i < pos; ++i) + SET_NEXT(s->maintenance_event_codes, "", pa); + SET_NEXT(s->maintenance_event_codes, (aa), pa); + } + } else { + TRY(!aa, "MaintenanceEventCodes argument missing\n"); + s->maintenance_event_codes_str = aa; + } + } else if (!(aret = argcmp(str, "MaintenanceEventCodes[]")) || aret == '=') { + TRY(!aa, "MaintenanceEventCodes[] argument missing\n"); + SET_NEXT(s->maintenance_event_codes, (aa), pa); + } else + if ((aret = argcmp(str, "MaintenanceEventDescriptions")) == 0 || aret == '=' || aret == '.') { + if (aret == '.') { + int pos; + char *endptr; + int last = 0; + char *dot_pos = strchr(str, '.'); + + TRY(!(dot_pos++), "MaintenanceEventDescriptions argument missing\n"); + pos = strtoul(dot_pos, &endptr, 0); + TRY(endptr == dot_pos, "MaintenanceEventDescriptions require an index\n"); + if (s->maintenance_event_descriptions) { + for (; s->maintenance_event_descriptions[last]; ++last); + } + if (pos < last) { + s->maintenance_event_descriptions[pos] = (aa); + } else { + for (int i = last; i < pos; ++i) + SET_NEXT(s->maintenance_event_descriptions, "", pa); + SET_NEXT(s->maintenance_event_descriptions, (aa), pa); + } + } else { + TRY(!aa, "MaintenanceEventDescriptions argument missing\n"); + s->maintenance_event_descriptions_str = aa; + } + } else if (!(aret = argcmp(str, "MaintenanceEventDescriptions[]")) || aret == '=') { + TRY(!aa, "MaintenanceEventDescriptions[] argument missing\n"); + SET_NEXT(s->maintenance_event_descriptions, (aa), pa); + } else + if ((aret = argcmp(str, "MaintenanceEventsNotAfter")) == 0 || aret == '=' || aret == '.') { + if (aret == '.') { + int pos; + char *endptr; + int last = 0; + char *dot_pos = strchr(str, '.'); + + TRY(!(dot_pos++), "MaintenanceEventsNotAfter argument missing\n"); + pos = strtoul(dot_pos, &endptr, 0); + TRY(endptr == dot_pos, "MaintenanceEventsNotAfter require an index\n"); + if (s->maintenance_events_not_after) { + for (; s->maintenance_events_not_after[last]; ++last); + } + if (pos < last) { + s->maintenance_events_not_after[pos] = (aa); + } else { + for (int i = last; i < pos; ++i) + SET_NEXT(s->maintenance_events_not_after, "", pa); + SET_NEXT(s->maintenance_events_not_after, (aa), pa); + } + } else { + TRY(!aa, "MaintenanceEventsNotAfter argument missing\n"); + s->maintenance_events_not_after_str = aa; + } + } else if (!(aret = argcmp(str, "MaintenanceEventsNotAfter[]")) || aret == '=') { + TRY(!aa, "MaintenanceEventsNotAfter[] argument missing\n"); + SET_NEXT(s->maintenance_events_not_after, (aa), pa); + } else + if ((aret = argcmp(str, "MaintenanceEventsNotBefore")) == 0 || aret == '=' || aret == '.') { + if (aret == '.') { + int pos; + char *endptr; + int last = 0; + char *dot_pos = strchr(str, '.'); + + TRY(!(dot_pos++), "MaintenanceEventsNotBefore argument missing\n"); + pos = strtoul(dot_pos, &endptr, 0); + TRY(endptr == dot_pos, "MaintenanceEventsNotBefore require an index\n"); + if (s->maintenance_events_not_before) { + for (; s->maintenance_events_not_before[last]; ++last); + } + if (pos < last) { + s->maintenance_events_not_before[pos] = (aa); + } else { + for (int i = last; i < pos; ++i) + SET_NEXT(s->maintenance_events_not_before, "", pa); + SET_NEXT(s->maintenance_events_not_before, (aa), pa); + } + } else { + TRY(!aa, "MaintenanceEventsNotBefore argument missing\n"); + s->maintenance_events_not_before_str = aa; + } + } else if (!(aret = argcmp(str, "MaintenanceEventsNotBefore[]")) || aret == '=') { + TRY(!aa, "MaintenanceEventsNotBefore[] argument missing\n"); + SET_NEXT(s->maintenance_events_not_before, (aa), pa); + } else + if ((aret = argcmp(str, "SubregionNames")) == 0 || aret == '=' || aret == '.') { + if (aret == '.') { + int pos; + char *endptr; + int last = 0; + char *dot_pos = strchr(str, '.'); + + TRY(!(dot_pos++), "SubregionNames argument missing\n"); + pos = strtoul(dot_pos, &endptr, 0); + TRY(endptr == dot_pos, "SubregionNames require an index\n"); + if (s->subregion_names) { + for (; s->subregion_names[last]; ++last); + } + if (pos < last) { + s->subregion_names[pos] = (aa); + } else { + for (int i = last; i < pos; ++i) + SET_NEXT(s->subregion_names, "", pa); + SET_NEXT(s->subregion_names, (aa), pa); + } + } else { + TRY(!aa, "SubregionNames argument missing\n"); + s->subregion_names_str = aa; + } + } else if (!(aret = argcmp(str, "SubregionNames[]")) || aret == '=') { + TRY(!aa, "SubregionNames[] argument missing\n"); + SET_NEXT(s->subregion_names, (aa), pa); + } else + if ((aret = argcmp(str, "VmIds")) == 0 || aret == '=' || aret == '.') { + if (aret == '.') { + int pos; + char *endptr; + int last = 0; + char *dot_pos = strchr(str, '.'); + + TRY(!(dot_pos++), "VmIds argument missing\n"); + pos = strtoul(dot_pos, &endptr, 0); + TRY(endptr == dot_pos, "VmIds require an index\n"); + if (s->vm_ids) { + for (; s->vm_ids[last]; ++last); + } + if (pos < last) { + s->vm_ids[pos] = (aa); + } else { + for (int i = last; i < pos; ++i) + SET_NEXT(s->vm_ids, "", pa); + SET_NEXT(s->vm_ids, (aa), pa); + } + } else { + TRY(!aa, "VmIds argument missing\n"); + s->vm_ids_str = aa; + } + } else if (!(aret = argcmp(str, "VmIds[]")) || aret == '=') { + TRY(!aa, "VmIds[] argument missing\n"); + SET_NEXT(s->vm_ids, (aa), pa); + } else + if ((aret = argcmp(str, "VmStates")) == 0 || aret == '=' || aret == '.') { + if (aret == '.') { + int pos; + char *endptr; + int last = 0; + char *dot_pos = strchr(str, '.'); + + TRY(!(dot_pos++), "VmStates argument missing\n"); + pos = strtoul(dot_pos, &endptr, 0); + TRY(endptr == dot_pos, "VmStates require an index\n"); + if (s->vm_states) { + for (; s->vm_states[last]; ++last); + } + if (pos < last) { + s->vm_states[pos] = (aa); + } else { + for (int i = last; i < pos; ++i) + SET_NEXT(s->vm_states, "", pa); + SET_NEXT(s->vm_states, (aa), pa); + } + } else { + TRY(!aa, "VmStates argument missing\n"); + s->vm_states_str = aa; + } + } else if (!(aret = argcmp(str, "VmStates[]")) || aret == '=') { + TRY(!aa, "VmStates[] argument missing\n"); + SET_NEXT(s->vm_states, (aa), pa); + } else + { + fprintf(stderr, "'%s' not an argumemt of 'FiltersVmsState'\n", str); + return -1; + } + return 0; +} + int filters_volume_parser(void *v_s, char *str, char *aa, struct ptr_array *pa) { struct filters_volume *s = v_s; int aret = 0; @@ -12901,6 +13013,11 @@ int keypair_parser(void *v_s, char *str, char *aa, struct ptr_array *pa) { TRY(!aa, "KeypairFingerprint argument missing\n"); s->keypair_fingerprint = aa; // string string + } else + if ((aret = argcmp(str, "KeypairId")) == 0 || aret == '=' || aret == '.') { + TRY(!aa, "KeypairId argument missing\n"); + s->keypair_id = aa; // string string + } else if ((aret = argcmp(str, "KeypairName")) == 0 || aret == '=' || aret == '.') { TRY(!aa, "KeypairName argument missing\n"); @@ -12912,6 +13029,31 @@ int keypair_parser(void *v_s, char *str, char *aa, struct ptr_array *pa) { s->keypair_type = aa; // string string } else + if ((aret = argcmp(str, "Tags")) == 0 || aret == '=' || aret == '.') { + char *dot_pos = strchr(str, '.'); + + if (dot_pos) { + int pos; + char *endptr; + + ++dot_pos; + pos = strtoul(dot_pos, &endptr, 0); + if (endptr == dot_pos) + BAD_RET("'Tags' require an index (example array ref ResourceTag.Tags.0)\n"); + else if (*endptr != '.') + BAD_RET("'Tags' require a .\n"); + TRY_ALLOC_AT(s,tags, pa, pos, sizeof(*s->tags)); + cascade_struct = &s->tags[pos]; + cascade_parser = resource_tag_parser; + if (endptr[1] == '.') { + ++endptr; + } + STRY(resource_tag_parser(&s->tags[pos], endptr + 1, aa, pa)); + } else { + TRY(!aa, "Tags argument missing\n"); + s->tags_str = aa; // array ref ResourceTag ref + } + } else { fprintf(stderr, "'%s' not an argumemt of 'Keypair'\n", str); return -1; @@ -12926,6 +13068,11 @@ int keypair_created_parser(void *v_s, char *str, char *aa, struct ptr_array *pa) TRY(!aa, "KeypairFingerprint argument missing\n"); s->keypair_fingerprint = aa; // string string + } else + if ((aret = argcmp(str, "KeypairId")) == 0 || aret == '=' || aret == '.') { + TRY(!aa, "KeypairId argument missing\n"); + s->keypair_id = aa; // string string + } else if ((aret = argcmp(str, "KeypairName")) == 0 || aret == '=' || aret == '.') { TRY(!aa, "KeypairName argument missing\n"); @@ -12942,83 +13089,33 @@ int keypair_created_parser(void *v_s, char *str, char *aa, struct ptr_array *pa) s->private_key = aa; // string string } else - { - fprintf(stderr, "'%s' not an argumemt of 'KeypairCreated'\n", str); - return -1; - } - return 0; -} - -int linked_policy_parser(void *v_s, char *str, char *aa, struct ptr_array *pa) { - struct linked_policy *s = v_s; - int aret = 0; - if ((aret = argcmp(str, "CreationDate")) == 0 || aret == '=' || aret == '.') { - TRY(!aa, "CreationDate argument missing\n"); - s->creation_date = aa; // string string - - } else - if ((aret = argcmp(str, "LastModificationDate")) == 0 || aret == '=' || aret == '.') { - TRY(!aa, "LastModificationDate argument missing\n"); - s->last_modification_date = aa; // string string - - } else - if ((aret = argcmp(str, "Orn")) == 0 || aret == '=' || aret == '.') { - TRY(!aa, "Orn argument missing\n"); - s->orn = aa; // string string - - } else - if ((aret = argcmp(str, "PolicyId")) == 0 || aret == '=' || aret == '.') { - TRY(!aa, "PolicyId argument missing\n"); - s->policy_id = aa; // string string - - } else - if ((aret = argcmp(str, "PolicyName")) == 0 || aret == '=' || aret == '.') { - TRY(!aa, "PolicyName argument missing\n"); - s->policy_name = aa; // string string + if ((aret = argcmp(str, "Tags")) == 0 || aret == '=' || aret == '.') { + char *dot_pos = strchr(str, '.'); - } else - { - fprintf(stderr, "'%s' not an argumemt of 'LinkedPolicy'\n", str); - return -1; - } - return 0; -} + if (dot_pos) { + int pos; + char *endptr; -int linked_volume_parser(void *v_s, char *str, char *aa, struct ptr_array *pa) { - struct linked_volume *s = v_s; - int aret = 0; - if ((aret = argcmp(str, "DeleteOnVmDeletion")) == 0 || aret == '=' || aret == '.') { - s->is_set_delete_on_vm_deletion = 1; - if (!aa || !strcasecmp(aa, "true")) { - s->delete_on_vm_deletion = 1; - } else if (!strcasecmp(aa, "false")) { - s->delete_on_vm_deletion = 0; + ++dot_pos; + pos = strtoul(dot_pos, &endptr, 0); + if (endptr == dot_pos) + BAD_RET("'Tags' require an index (example array ref ResourceTag.Tags.0)\n"); + else if (*endptr != '.') + BAD_RET("'Tags' require a .\n"); + TRY_ALLOC_AT(s,tags, pa, pos, sizeof(*s->tags)); + cascade_struct = &s->tags[pos]; + cascade_parser = resource_tag_parser; + if (endptr[1] == '.') { + ++endptr; + } + STRY(resource_tag_parser(&s->tags[pos], endptr + 1, aa, pa)); } else { - BAD_RET("DeleteOnVmDeletion require true/false\n"); - } - } else - if ((aret = argcmp(str, "DeviceName")) == 0 || aret == '=' || aret == '.') { - TRY(!aa, "DeviceName argument missing\n"); - s->device_name = aa; // string string - - } else - if ((aret = argcmp(str, "State")) == 0 || aret == '=' || aret == '.') { - TRY(!aa, "State argument missing\n"); - s->state = aa; // string string - - } else - if ((aret = argcmp(str, "VmId")) == 0 || aret == '=' || aret == '.') { - TRY(!aa, "VmId argument missing\n"); - s->vm_id = aa; // string string - - } else - if ((aret = argcmp(str, "VolumeId")) == 0 || aret == '=' || aret == '.') { - TRY(!aa, "VolumeId argument missing\n"); - s->volume_id = aa; // string string - + TRY(!aa, "Tags argument missing\n"); + s->tags_str = aa; // array ref ResourceTag ref + } } else { - fprintf(stderr, "'%s' not an argumemt of 'LinkedVolume'\n", str); + fprintf(stderr, "'%s' not an argumemt of 'KeypairCreated'\n", str); return -1; } return 0; @@ -13229,6 +13326,81 @@ int link_route_table_parser(void *v_s, char *str, char *aa, struct ptr_array *pa return 0; } +int linked_policy_parser(void *v_s, char *str, char *aa, struct ptr_array *pa) { + struct linked_policy *s = v_s; + int aret = 0; + if ((aret = argcmp(str, "CreationDate")) == 0 || aret == '=' || aret == '.') { + TRY(!aa, "CreationDate argument missing\n"); + s->creation_date = aa; // string string + + } else + if ((aret = argcmp(str, "LastModificationDate")) == 0 || aret == '=' || aret == '.') { + TRY(!aa, "LastModificationDate argument missing\n"); + s->last_modification_date = aa; // string string + + } else + if ((aret = argcmp(str, "Orn")) == 0 || aret == '=' || aret == '.') { + TRY(!aa, "Orn argument missing\n"); + s->orn = aa; // string string + + } else + if ((aret = argcmp(str, "PolicyId")) == 0 || aret == '=' || aret == '.') { + TRY(!aa, "PolicyId argument missing\n"); + s->policy_id = aa; // string string + + } else + if ((aret = argcmp(str, "PolicyName")) == 0 || aret == '=' || aret == '.') { + TRY(!aa, "PolicyName argument missing\n"); + s->policy_name = aa; // string string + + } else + { + fprintf(stderr, "'%s' not an argumemt of 'LinkedPolicy'\n", str); + return -1; + } + return 0; +} + +int linked_volume_parser(void *v_s, char *str, char *aa, struct ptr_array *pa) { + struct linked_volume *s = v_s; + int aret = 0; + if ((aret = argcmp(str, "DeleteOnVmDeletion")) == 0 || aret == '=' || aret == '.') { + s->is_set_delete_on_vm_deletion = 1; + if (!aa || !strcasecmp(aa, "true")) { + s->delete_on_vm_deletion = 1; + } else if (!strcasecmp(aa, "false")) { + s->delete_on_vm_deletion = 0; + } else { + BAD_RET("DeleteOnVmDeletion require true/false\n"); + } + } else + if ((aret = argcmp(str, "DeviceName")) == 0 || aret == '=' || aret == '.') { + TRY(!aa, "DeviceName argument missing\n"); + s->device_name = aa; // string string + + } else + if ((aret = argcmp(str, "State")) == 0 || aret == '=' || aret == '.') { + TRY(!aa, "State argument missing\n"); + s->state = aa; // string string + + } else + if ((aret = argcmp(str, "VmId")) == 0 || aret == '=' || aret == '.') { + TRY(!aa, "VmId argument missing\n"); + s->vm_id = aa; // string string + + } else + if ((aret = argcmp(str, "VolumeId")) == 0 || aret == '=' || aret == '.') { + TRY(!aa, "VolumeId argument missing\n"); + s->volume_id = aa; // string string + + } else + { + fprintf(stderr, "'%s' not an argumemt of 'LinkedVolume'\n", str); + return -1; + } + return 0; +} + int listener_parser(void *v_s, char *str, char *aa, struct ptr_array *pa) { struct listener *s = v_s; int aret = 0; @@ -25968,19 +26140,136 @@ int main(int ac, char **av) } osc_deinit_str(&r); } else - if (!strcmp("CreateVpnConnectionRoute", av[i])) { + if (!strcmp("CreateVpnConnectionRoute", av[i])) { + auto_osc_json_c json_object *jobj = NULL; + auto_ptr_array struct ptr_array opa = {0}; + struct ptr_array *pa = &opa; + struct osc_create_vpn_connection_route_arg a = {0}; + struct osc_create_vpn_connection_route_arg *s = &a; + __attribute__((cleanup(files_cnt_cleanup))) char *files_cnt[MAX_FILES_PER_CMD] = {NULL}; + int cret; + + cascade_struct = NULL; + cascade_parser = NULL; + + create_vpn_connection_route_arg: + + if (i + 1 < ac && av[i + 1][0] == '.' && av[i + 1][1] == '.') { + char *next_a = &av[i + 1][2]; + char *aa = i + 2 < ac ? av[i + 2] : 0; + int incr = 2; + char *eq_ptr = strchr(next_a, '='); + + CHK_BAD_RET(!cascade_struct, "cascade need to be se first\n"); + if (eq_ptr) { + CHK_BAD_RET(!*eq_ptr, "cascade need an argument\n"); + incr = 1; + aa = eq_ptr + 1; + } else { + CHK_BAD_RET(!aa, "cascade need an argument\n"); + META_ARGS({CHK_BAD_RET(aa[0] == '-', "cascade need an argument"); }) + } + STRY(cascade_parser(cascade_struct, next_a, aa, pa)); + i += incr; + goto create_vpn_connection_route_arg; + } + + if (i + 1 < ac && av[i + 1][0] == '-' && av[i + 1][1] == '-' && strcmp(av[i + 1] + 2, "set-var")) { + char *next_a = &av[i + 1][2]; + char *str = next_a; + char *aa = i + 2 < ac ? av[i + 2] : 0; + int aret = 0; + int incr = aa ? 2 : 1; + + (void)str; + if (aa && aa[0] == '-' && aa[1] == '-' && aa[2] != '-') { + META_ARGS({ aa = 0; incr = 1; }); + } + if ((aret = argcmp(next_a, "DestinationIpRange")) == 0 || aret == '=' || aret == '.') { + char *eq_ptr = strchr(next_a, '='); + if (eq_ptr) { + TRY((!*eq_ptr), "DestinationIpRange argument missing\n"); + aa = eq_ptr + 1; + incr = 1; + } + TRY(!aa, "DestinationIpRange argument missing\n"); + s->destination_ip_range = aa; // string string + + } else + if ((aret = argcmp(next_a, "DryRun")) == 0 || aret == '=' || aret == '.') { + char *eq_ptr = strchr(next_a, '='); + if (eq_ptr) { + TRY((!*eq_ptr), "DryRun argument missing\n"); + aa = eq_ptr + 1; + incr = 1; + } + s->is_set_dry_run = 1; + if (!aa || !strcasecmp(aa, "true")) { + s->dry_run = 1; + } else if (!strcasecmp(aa, "false")) { + s->dry_run = 0; + } else { + BAD_RET("DryRun require true/false\n"); + } + } else + if ((aret = argcmp(next_a, "VpnConnectionId")) == 0 || aret == '=' || aret == '.') { + char *eq_ptr = strchr(next_a, '='); + if (eq_ptr) { + TRY((!*eq_ptr), "VpnConnectionId argument missing\n"); + aa = eq_ptr + 1; + incr = 1; + } + TRY(!aa, "VpnConnectionId argument missing\n"); + s->vpn_connection_id = aa; // string string + + } else + { + BAD_RET("'%s' is not a valide argument for 'CreateVpnConnectionRoute'\n", next_a); + } + i += incr; + goto create_vpn_connection_route_arg; + } + cret = osc_create_vpn_connection_route(&e, &r, &a); + TRY(cret, "fail to call CreateVpnConnectionRoute: %s\n", curl_easy_strerror(cret)); + CHK_BAD_RET(!r.buf, "connection sucessful, but empty responce\n"); + jobj = NULL; + if (program_flag & OAPI_RAW_OUTPUT) + puts(r.buf); + else { + jobj = json_tokener_parse(r.buf); + puts(json_object_to_json_string_ext(jobj, + JSON_C_TO_STRING_PRETTY | JSON_C_TO_STRING_NOSLASHESCAPE | + color_flag)); + } + while (i + 1 < ac && !strcmp(av[i + 1], "--set-var")) { + ++i; + TRY(i + 1 >= ac, "--set-var require an argument"); + if (!jobj) + jobj = json_tokener_parse(r.buf); + if (parse_variable(jobj, av, ac, i)) + return -1; + ++i; + } + + if (jobj) { + json_object_put(jobj); + jobj = NULL; + } + osc_deinit_str(&r); + } else + if (!strcmp("DeleteAccessKey", av[i])) { auto_osc_json_c json_object *jobj = NULL; auto_ptr_array struct ptr_array opa = {0}; struct ptr_array *pa = &opa; - struct osc_create_vpn_connection_route_arg a = {0}; - struct osc_create_vpn_connection_route_arg *s = &a; + struct osc_delete_access_key_arg a = {0}; + struct osc_delete_access_key_arg *s = &a; __attribute__((cleanup(files_cnt_cleanup))) char *files_cnt[MAX_FILES_PER_CMD] = {NULL}; int cret; cascade_struct = NULL; cascade_parser = NULL; - create_vpn_connection_route_arg: + delete_access_key_arg: if (i + 1 < ac && av[i + 1][0] == '.' && av[i + 1][1] == '.') { char *next_a = &av[i + 1][2]; @@ -25999,7 +26288,7 @@ int main(int ac, char **av) } STRY(cascade_parser(cascade_struct, next_a, aa, pa)); i += incr; - goto create_vpn_connection_route_arg; + goto delete_access_key_arg; } if (i + 1 < ac && av[i + 1][0] == '-' && av[i + 1][1] == '-' && strcmp(av[i + 1] + 2, "set-var")) { @@ -26013,15 +26302,15 @@ 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, "DestinationIpRange")) == 0 || aret == '=' || aret == '.') { + if ((aret = argcmp(next_a, "AccessKeyId")) == 0 || aret == '=' || aret == '.') { char *eq_ptr = strchr(next_a, '='); if (eq_ptr) { - TRY((!*eq_ptr), "DestinationIpRange argument missing\n"); + TRY((!*eq_ptr), "AccessKeyId argument missing\n"); aa = eq_ptr + 1; incr = 1; } - TRY(!aa, "DestinationIpRange argument missing\n"); - s->destination_ip_range = aa; // string string + TRY(!aa, "AccessKeyId argument missing\n"); + s->access_key_id = aa; // string string } else if ((aret = argcmp(next_a, "DryRun")) == 0 || aret == '=' || aret == '.') { @@ -26040,25 +26329,25 @@ int main(int ac, char **av) BAD_RET("DryRun require true/false\n"); } } else - if ((aret = argcmp(next_a, "VpnConnectionId")) == 0 || aret == '=' || aret == '.') { + if ((aret = argcmp(next_a, "UserName")) == 0 || aret == '=' || aret == '.') { char *eq_ptr = strchr(next_a, '='); if (eq_ptr) { - TRY((!*eq_ptr), "VpnConnectionId argument missing\n"); + TRY((!*eq_ptr), "UserName argument missing\n"); aa = eq_ptr + 1; incr = 1; } - TRY(!aa, "VpnConnectionId argument missing\n"); - s->vpn_connection_id = aa; // string string + TRY(!aa, "UserName argument missing\n"); + s->user_name = aa; // string string } else { - BAD_RET("'%s' is not a valide argument for 'CreateVpnConnectionRoute'\n", next_a); + BAD_RET("'%s' is not a valide argument for 'DeleteAccessKey'\n", next_a); } i += incr; - goto create_vpn_connection_route_arg; + goto delete_access_key_arg; } - cret = osc_create_vpn_connection_route(&e, &r, &a); - TRY(cret, "fail to call CreateVpnConnectionRoute: %s\n", curl_easy_strerror(cret)); + cret = osc_delete_access_key(&e, &r, &a); + TRY(cret, "fail to call DeleteAccessKey: %s\n", curl_easy_strerror(cret)); CHK_BAD_RET(!r.buf, "connection sucessful, but empty responce\n"); jobj = NULL; if (program_flag & OAPI_RAW_OUTPUT) @@ -26085,19 +26374,19 @@ int main(int ac, char **av) } osc_deinit_str(&r); } else - if (!strcmp("DeleteAccessKey", av[i])) { + if (!strcmp("DeleteApiAccessRule", av[i])) { auto_osc_json_c json_object *jobj = NULL; auto_ptr_array struct ptr_array opa = {0}; struct ptr_array *pa = &opa; - struct osc_delete_access_key_arg a = {0}; - struct osc_delete_access_key_arg *s = &a; + struct osc_delete_api_access_rule_arg a = {0}; + struct osc_delete_api_access_rule_arg *s = &a; __attribute__((cleanup(files_cnt_cleanup))) char *files_cnt[MAX_FILES_PER_CMD] = {NULL}; int cret; cascade_struct = NULL; cascade_parser = NULL; - delete_access_key_arg: + delete_api_access_rule_arg: if (i + 1 < ac && av[i + 1][0] == '.' && av[i + 1][1] == '.') { char *next_a = &av[i + 1][2]; @@ -26116,7 +26405,7 @@ int main(int ac, char **av) } STRY(cascade_parser(cascade_struct, next_a, aa, pa)); i += incr; - goto delete_access_key_arg; + goto delete_api_access_rule_arg; } if (i + 1 < ac && av[i + 1][0] == '-' && av[i + 1][1] == '-' && strcmp(av[i + 1] + 2, "set-var")) { @@ -26130,15 +26419,15 @@ 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, "AccessKeyId")) == 0 || aret == '=' || aret == '.') { + if ((aret = argcmp(next_a, "ApiAccessRuleId")) == 0 || aret == '=' || aret == '.') { char *eq_ptr = strchr(next_a, '='); if (eq_ptr) { - TRY((!*eq_ptr), "AccessKeyId argument missing\n"); + TRY((!*eq_ptr), "ApiAccessRuleId argument missing\n"); aa = eq_ptr + 1; incr = 1; } - TRY(!aa, "AccessKeyId argument missing\n"); - s->access_key_id = aa; // string string + TRY(!aa, "ApiAccessRuleId argument missing\n"); + s->api_access_rule_id = aa; // string string } else if ((aret = argcmp(next_a, "DryRun")) == 0 || aret == '=' || aret == '.') { @@ -26157,25 +26446,120 @@ int main(int ac, char **av) BAD_RET("DryRun require true/false\n"); } } else - if ((aret = argcmp(next_a, "UserName")) == 0 || aret == '=' || aret == '.') { + { + BAD_RET("'%s' is not a valide argument for 'DeleteApiAccessRule'\n", next_a); + } + i += incr; + goto delete_api_access_rule_arg; + } + cret = osc_delete_api_access_rule(&e, &r, &a); + TRY(cret, "fail to call DeleteApiAccessRule: %s\n", curl_easy_strerror(cret)); + CHK_BAD_RET(!r.buf, "connection sucessful, but empty responce\n"); + jobj = NULL; + if (program_flag & OAPI_RAW_OUTPUT) + puts(r.buf); + else { + jobj = json_tokener_parse(r.buf); + puts(json_object_to_json_string_ext(jobj, + JSON_C_TO_STRING_PRETTY | JSON_C_TO_STRING_NOSLASHESCAPE | + color_flag)); + } + while (i + 1 < ac && !strcmp(av[i + 1], "--set-var")) { + ++i; + TRY(i + 1 >= ac, "--set-var require an argument"); + if (!jobj) + jobj = json_tokener_parse(r.buf); + if (parse_variable(jobj, av, ac, i)) + return -1; + ++i; + } + + if (jobj) { + json_object_put(jobj); + jobj = NULL; + } + osc_deinit_str(&r); + } else + if (!strcmp("DeleteCa", av[i])) { + auto_osc_json_c json_object *jobj = NULL; + auto_ptr_array struct ptr_array opa = {0}; + struct ptr_array *pa = &opa; + struct osc_delete_ca_arg a = {0}; + struct osc_delete_ca_arg *s = &a; + __attribute__((cleanup(files_cnt_cleanup))) char *files_cnt[MAX_FILES_PER_CMD] = {NULL}; + int cret; + + cascade_struct = NULL; + cascade_parser = NULL; + + delete_ca_arg: + + if (i + 1 < ac && av[i + 1][0] == '.' && av[i + 1][1] == '.') { + char *next_a = &av[i + 1][2]; + char *aa = i + 2 < ac ? av[i + 2] : 0; + int incr = 2; + char *eq_ptr = strchr(next_a, '='); + + CHK_BAD_RET(!cascade_struct, "cascade need to be se first\n"); + if (eq_ptr) { + CHK_BAD_RET(!*eq_ptr, "cascade need an argument\n"); + incr = 1; + aa = eq_ptr + 1; + } else { + CHK_BAD_RET(!aa, "cascade need an argument\n"); + META_ARGS({CHK_BAD_RET(aa[0] == '-', "cascade need an argument"); }) + } + STRY(cascade_parser(cascade_struct, next_a, aa, pa)); + i += incr; + goto delete_ca_arg; + } + + if (i + 1 < ac && av[i + 1][0] == '-' && av[i + 1][1] == '-' && strcmp(av[i + 1] + 2, "set-var")) { + char *next_a = &av[i + 1][2]; + char *str = next_a; + char *aa = i + 2 < ac ? av[i + 2] : 0; + int aret = 0; + int incr = aa ? 2 : 1; + + (void)str; + if (aa && aa[0] == '-' && aa[1] == '-' && aa[2] != '-') { + META_ARGS({ aa = 0; incr = 1; }); + } + if ((aret = argcmp(next_a, "CaId")) == 0 || aret == '=' || aret == '.') { char *eq_ptr = strchr(next_a, '='); if (eq_ptr) { - TRY((!*eq_ptr), "UserName argument missing\n"); + TRY((!*eq_ptr), "CaId argument missing\n"); aa = eq_ptr + 1; incr = 1; } - TRY(!aa, "UserName argument missing\n"); - s->user_name = aa; // string string + TRY(!aa, "CaId argument missing\n"); + s->ca_id = aa; // string string } else + if ((aret = argcmp(next_a, "DryRun")) == 0 || aret == '=' || aret == '.') { + char *eq_ptr = strchr(next_a, '='); + if (eq_ptr) { + TRY((!*eq_ptr), "DryRun argument missing\n"); + aa = eq_ptr + 1; + incr = 1; + } + s->is_set_dry_run = 1; + if (!aa || !strcasecmp(aa, "true")) { + s->dry_run = 1; + } else if (!strcasecmp(aa, "false")) { + s->dry_run = 0; + } else { + BAD_RET("DryRun require true/false\n"); + } + } else { - BAD_RET("'%s' is not a valide argument for 'DeleteAccessKey'\n", next_a); + BAD_RET("'%s' is not a valide argument for 'DeleteCa'\n", next_a); } i += incr; - goto delete_access_key_arg; + goto delete_ca_arg; } - cret = osc_delete_access_key(&e, &r, &a); - TRY(cret, "fail to call DeleteAccessKey: %s\n", curl_easy_strerror(cret)); + cret = osc_delete_ca(&e, &r, &a); + TRY(cret, "fail to call DeleteCa: %s\n", curl_easy_strerror(cret)); CHK_BAD_RET(!r.buf, "connection sucessful, but empty responce\n"); jobj = NULL; if (program_flag & OAPI_RAW_OUTPUT) @@ -26202,19 +26586,19 @@ int main(int ac, char **av) } osc_deinit_str(&r); } else - if (!strcmp("DeleteApiAccessRule", av[i])) { + if (!strcmp("DeleteClientGateway", av[i])) { auto_osc_json_c json_object *jobj = NULL; auto_ptr_array struct ptr_array opa = {0}; struct ptr_array *pa = &opa; - struct osc_delete_api_access_rule_arg a = {0}; - struct osc_delete_api_access_rule_arg *s = &a; + struct osc_delete_client_gateway_arg a = {0}; + struct osc_delete_client_gateway_arg *s = &a; __attribute__((cleanup(files_cnt_cleanup))) char *files_cnt[MAX_FILES_PER_CMD] = {NULL}; int cret; cascade_struct = NULL; cascade_parser = NULL; - delete_api_access_rule_arg: + delete_client_gateway_arg: if (i + 1 < ac && av[i + 1][0] == '.' && av[i + 1][1] == '.') { char *next_a = &av[i + 1][2]; @@ -26233,7 +26617,7 @@ int main(int ac, char **av) } STRY(cascade_parser(cascade_struct, next_a, aa, pa)); i += incr; - goto delete_api_access_rule_arg; + goto delete_client_gateway_arg; } if (i + 1 < ac && av[i + 1][0] == '-' && av[i + 1][1] == '-' && strcmp(av[i + 1] + 2, "set-var")) { @@ -26247,15 +26631,15 @@ 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, "ApiAccessRuleId")) == 0 || aret == '=' || aret == '.') { + if ((aret = argcmp(next_a, "ClientGatewayId")) == 0 || aret == '=' || aret == '.') { char *eq_ptr = strchr(next_a, '='); if (eq_ptr) { - TRY((!*eq_ptr), "ApiAccessRuleId argument missing\n"); + TRY((!*eq_ptr), "ClientGatewayId argument missing\n"); aa = eq_ptr + 1; incr = 1; } - TRY(!aa, "ApiAccessRuleId argument missing\n"); - s->api_access_rule_id = aa; // string string + TRY(!aa, "ClientGatewayId argument missing\n"); + s->client_gateway_id = aa; // string string } else if ((aret = argcmp(next_a, "DryRun")) == 0 || aret == '=' || aret == '.') { @@ -26275,13 +26659,13 @@ int main(int ac, char **av) } } else { - BAD_RET("'%s' is not a valide argument for 'DeleteApiAccessRule'\n", next_a); + BAD_RET("'%s' is not a valide argument for 'DeleteClientGateway'\n", next_a); } i += incr; - goto delete_api_access_rule_arg; + goto delete_client_gateway_arg; } - cret = osc_delete_api_access_rule(&e, &r, &a); - TRY(cret, "fail to call DeleteApiAccessRule: %s\n", curl_easy_strerror(cret)); + cret = osc_delete_client_gateway(&e, &r, &a); + TRY(cret, "fail to call DeleteClientGateway: %s\n", curl_easy_strerror(cret)); CHK_BAD_RET(!r.buf, "connection sucessful, but empty responce\n"); jobj = NULL; if (program_flag & OAPI_RAW_OUTPUT) @@ -26308,19 +26692,19 @@ int main(int ac, char **av) } osc_deinit_str(&r); } else - if (!strcmp("DeleteCa", av[i])) { + if (!strcmp("DeleteDedicatedGroup", av[i])) { auto_osc_json_c json_object *jobj = NULL; auto_ptr_array struct ptr_array opa = {0}; struct ptr_array *pa = &opa; - struct osc_delete_ca_arg a = {0}; - struct osc_delete_ca_arg *s = &a; + struct osc_delete_dedicated_group_arg a = {0}; + struct osc_delete_dedicated_group_arg *s = &a; __attribute__((cleanup(files_cnt_cleanup))) char *files_cnt[MAX_FILES_PER_CMD] = {NULL}; int cret; cascade_struct = NULL; cascade_parser = NULL; - delete_ca_arg: + delete_dedicated_group_arg: if (i + 1 < ac && av[i + 1][0] == '.' && av[i + 1][1] == '.') { char *next_a = &av[i + 1][2]; @@ -26339,7 +26723,7 @@ int main(int ac, char **av) } STRY(cascade_parser(cascade_struct, next_a, aa, pa)); i += incr; - goto delete_ca_arg; + goto delete_dedicated_group_arg; } if (i + 1 < ac && av[i + 1][0] == '-' && av[i + 1][1] == '-' && strcmp(av[i + 1] + 2, "set-var")) { @@ -26353,15 +26737,15 @@ 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, "CaId")) == 0 || aret == '=' || aret == '.') { + if ((aret = argcmp(next_a, "DedicatedGroupId")) == 0 || aret == '=' || aret == '.') { char *eq_ptr = strchr(next_a, '='); if (eq_ptr) { - TRY((!*eq_ptr), "CaId argument missing\n"); + TRY((!*eq_ptr), "DedicatedGroupId argument missing\n"); aa = eq_ptr + 1; incr = 1; } - TRY(!aa, "CaId argument missing\n"); - s->ca_id = aa; // string string + TRY(!aa, "DedicatedGroupId argument missing\n"); + s->dedicated_group_id = aa; // string string } else if ((aret = argcmp(next_a, "DryRun")) == 0 || aret == '=' || aret == '.') { @@ -26380,14 +26764,30 @@ int main(int ac, char **av) BAD_RET("DryRun require true/false\n"); } } else + if ((aret = argcmp(next_a, "Force")) == 0 || aret == '=' || aret == '.') { + char *eq_ptr = strchr(next_a, '='); + if (eq_ptr) { + TRY((!*eq_ptr), "Force argument missing\n"); + aa = eq_ptr + 1; + incr = 1; + } + s->is_set_force = 1; + if (!aa || !strcasecmp(aa, "true")) { + s->force = 1; + } else if (!strcasecmp(aa, "false")) { + s->force = 0; + } else { + BAD_RET("Force require true/false\n"); + } + } else { - BAD_RET("'%s' is not a valide argument for 'DeleteCa'\n", next_a); + BAD_RET("'%s' is not a valide argument for 'DeleteDedicatedGroup'\n", next_a); } i += incr; - goto delete_ca_arg; + goto delete_dedicated_group_arg; } - cret = osc_delete_ca(&e, &r, &a); - TRY(cret, "fail to call DeleteCa: %s\n", curl_easy_strerror(cret)); + cret = osc_delete_dedicated_group(&e, &r, &a); + TRY(cret, "fail to call DeleteDedicatedGroup: %s\n", curl_easy_strerror(cret)); CHK_BAD_RET(!r.buf, "connection sucessful, but empty responce\n"); jobj = NULL; if (program_flag & OAPI_RAW_OUTPUT) @@ -26414,19 +26814,19 @@ int main(int ac, char **av) } osc_deinit_str(&r); } else - if (!strcmp("DeleteClientGateway", av[i])) { + if (!strcmp("DeleteDhcpOptions", av[i])) { auto_osc_json_c json_object *jobj = NULL; auto_ptr_array struct ptr_array opa = {0}; struct ptr_array *pa = &opa; - struct osc_delete_client_gateway_arg a = {0}; - struct osc_delete_client_gateway_arg *s = &a; + struct osc_delete_dhcp_options_arg a = {0}; + struct osc_delete_dhcp_options_arg *s = &a; __attribute__((cleanup(files_cnt_cleanup))) char *files_cnt[MAX_FILES_PER_CMD] = {NULL}; int cret; cascade_struct = NULL; cascade_parser = NULL; - delete_client_gateway_arg: + delete_dhcp_options_arg: if (i + 1 < ac && av[i + 1][0] == '.' && av[i + 1][1] == '.') { char *next_a = &av[i + 1][2]; @@ -26445,7 +26845,7 @@ int main(int ac, char **av) } STRY(cascade_parser(cascade_struct, next_a, aa, pa)); i += incr; - goto delete_client_gateway_arg; + goto delete_dhcp_options_arg; } if (i + 1 < ac && av[i + 1][0] == '-' && av[i + 1][1] == '-' && strcmp(av[i + 1] + 2, "set-var")) { @@ -26459,15 +26859,15 @@ 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, "ClientGatewayId")) == 0 || aret == '=' || aret == '.') { + if ((aret = argcmp(next_a, "DhcpOptionsSetId")) == 0 || aret == '=' || aret == '.') { char *eq_ptr = strchr(next_a, '='); if (eq_ptr) { - TRY((!*eq_ptr), "ClientGatewayId argument missing\n"); + TRY((!*eq_ptr), "DhcpOptionsSetId argument missing\n"); aa = eq_ptr + 1; incr = 1; } - TRY(!aa, "ClientGatewayId argument missing\n"); - s->client_gateway_id = aa; // string string + TRY(!aa, "DhcpOptionsSetId argument missing\n"); + s->dhcp_options_set_id = aa; // string string } else if ((aret = argcmp(next_a, "DryRun")) == 0 || aret == '=' || aret == '.') { @@ -26487,13 +26887,13 @@ int main(int ac, char **av) } } else { - BAD_RET("'%s' is not a valide argument for 'DeleteClientGateway'\n", next_a); + BAD_RET("'%s' is not a valide argument for 'DeleteDhcpOptions'\n", next_a); } i += incr; - goto delete_client_gateway_arg; + goto delete_dhcp_options_arg; } - cret = osc_delete_client_gateway(&e, &r, &a); - TRY(cret, "fail to call DeleteClientGateway: %s\n", curl_easy_strerror(cret)); + cret = osc_delete_dhcp_options(&e, &r, &a); + TRY(cret, "fail to call DeleteDhcpOptions: %s\n", curl_easy_strerror(cret)); CHK_BAD_RET(!r.buf, "connection sucessful, but empty responce\n"); jobj = NULL; if (program_flag & OAPI_RAW_OUTPUT) @@ -26520,19 +26920,19 @@ int main(int ac, char **av) } osc_deinit_str(&r); } else - if (!strcmp("DeleteDedicatedGroup", av[i])) { + if (!strcmp("DeleteDirectLinkInterface", av[i])) { auto_osc_json_c json_object *jobj = NULL; auto_ptr_array struct ptr_array opa = {0}; struct ptr_array *pa = &opa; - struct osc_delete_dedicated_group_arg a = {0}; - struct osc_delete_dedicated_group_arg *s = &a; + struct osc_delete_direct_link_interface_arg a = {0}; + struct osc_delete_direct_link_interface_arg *s = &a; __attribute__((cleanup(files_cnt_cleanup))) char *files_cnt[MAX_FILES_PER_CMD] = {NULL}; int cret; cascade_struct = NULL; cascade_parser = NULL; - delete_dedicated_group_arg: + delete_direct_link_interface_arg: if (i + 1 < ac && av[i + 1][0] == '.' && av[i + 1][1] == '.') { char *next_a = &av[i + 1][2]; @@ -26551,7 +26951,7 @@ int main(int ac, char **av) } STRY(cascade_parser(cascade_struct, next_a, aa, pa)); i += incr; - goto delete_dedicated_group_arg; + goto delete_direct_link_interface_arg; } if (i + 1 < ac && av[i + 1][0] == '-' && av[i + 1][1] == '-' && strcmp(av[i + 1] + 2, "set-var")) { @@ -26565,15 +26965,15 @@ 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, "DedicatedGroupId")) == 0 || aret == '=' || aret == '.') { + if ((aret = argcmp(next_a, "DirectLinkInterfaceId")) == 0 || aret == '=' || aret == '.') { char *eq_ptr = strchr(next_a, '='); if (eq_ptr) { - TRY((!*eq_ptr), "DedicatedGroupId argument missing\n"); + TRY((!*eq_ptr), "DirectLinkInterfaceId argument missing\n"); aa = eq_ptr + 1; incr = 1; } - TRY(!aa, "DedicatedGroupId argument missing\n"); - s->dedicated_group_id = aa; // string string + TRY(!aa, "DirectLinkInterfaceId argument missing\n"); + s->direct_link_interface_id = aa; // string string } else if ((aret = argcmp(next_a, "DryRun")) == 0 || aret == '=' || aret == '.') { @@ -26592,30 +26992,14 @@ int main(int ac, char **av) BAD_RET("DryRun require true/false\n"); } } else - if ((aret = argcmp(next_a, "Force")) == 0 || aret == '=' || aret == '.') { - char *eq_ptr = strchr(next_a, '='); - if (eq_ptr) { - TRY((!*eq_ptr), "Force argument missing\n"); - aa = eq_ptr + 1; - incr = 1; - } - s->is_set_force = 1; - if (!aa || !strcasecmp(aa, "true")) { - s->force = 1; - } else if (!strcasecmp(aa, "false")) { - s->force = 0; - } else { - BAD_RET("Force require true/false\n"); - } - } else { - BAD_RET("'%s' is not a valide argument for 'DeleteDedicatedGroup'\n", next_a); + BAD_RET("'%s' is not a valide argument for 'DeleteDirectLinkInterface'\n", next_a); } i += incr; - goto delete_dedicated_group_arg; + goto delete_direct_link_interface_arg; } - cret = osc_delete_dedicated_group(&e, &r, &a); - TRY(cret, "fail to call DeleteDedicatedGroup: %s\n", curl_easy_strerror(cret)); + cret = osc_delete_direct_link_interface(&e, &r, &a); + TRY(cret, "fail to call DeleteDirectLinkInterface: %s\n", curl_easy_strerror(cret)); CHK_BAD_RET(!r.buf, "connection sucessful, but empty responce\n"); jobj = NULL; if (program_flag & OAPI_RAW_OUTPUT) @@ -26642,19 +27026,19 @@ int main(int ac, char **av) } osc_deinit_str(&r); } else - if (!strcmp("DeleteDhcpOptions", av[i])) { + if (!strcmp("DeleteDirectLink", av[i])) { auto_osc_json_c json_object *jobj = NULL; auto_ptr_array struct ptr_array opa = {0}; struct ptr_array *pa = &opa; - struct osc_delete_dhcp_options_arg a = {0}; - struct osc_delete_dhcp_options_arg *s = &a; + struct osc_delete_direct_link_arg a = {0}; + struct osc_delete_direct_link_arg *s = &a; __attribute__((cleanup(files_cnt_cleanup))) char *files_cnt[MAX_FILES_PER_CMD] = {NULL}; int cret; cascade_struct = NULL; cascade_parser = NULL; - delete_dhcp_options_arg: + delete_direct_link_arg: if (i + 1 < ac && av[i + 1][0] == '.' && av[i + 1][1] == '.') { char *next_a = &av[i + 1][2]; @@ -26673,7 +27057,7 @@ int main(int ac, char **av) } STRY(cascade_parser(cascade_struct, next_a, aa, pa)); i += incr; - goto delete_dhcp_options_arg; + goto delete_direct_link_arg; } if (i + 1 < ac && av[i + 1][0] == '-' && av[i + 1][1] == '-' && strcmp(av[i + 1] + 2, "set-var")) { @@ -26687,15 +27071,15 @@ 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, "DhcpOptionsSetId")) == 0 || aret == '=' || aret == '.') { + if ((aret = argcmp(next_a, "DirectLinkId")) == 0 || aret == '=' || aret == '.') { char *eq_ptr = strchr(next_a, '='); if (eq_ptr) { - TRY((!*eq_ptr), "DhcpOptionsSetId argument missing\n"); + TRY((!*eq_ptr), "DirectLinkId argument missing\n"); aa = eq_ptr + 1; incr = 1; } - TRY(!aa, "DhcpOptionsSetId argument missing\n"); - s->dhcp_options_set_id = aa; // string string + TRY(!aa, "DirectLinkId argument missing\n"); + s->direct_link_id = aa; // string string } else if ((aret = argcmp(next_a, "DryRun")) == 0 || aret == '=' || aret == '.') { @@ -26715,13 +27099,13 @@ int main(int ac, char **av) } } else { - BAD_RET("'%s' is not a valide argument for 'DeleteDhcpOptions'\n", next_a); + BAD_RET("'%s' is not a valide argument for 'DeleteDirectLink'\n", next_a); } i += incr; - goto delete_dhcp_options_arg; + goto delete_direct_link_arg; } - cret = osc_delete_dhcp_options(&e, &r, &a); - TRY(cret, "fail to call DeleteDhcpOptions: %s\n", curl_easy_strerror(cret)); + cret = osc_delete_direct_link(&e, &r, &a); + TRY(cret, "fail to call DeleteDirectLink: %s\n", curl_easy_strerror(cret)); CHK_BAD_RET(!r.buf, "connection sucessful, but empty responce\n"); jobj = NULL; if (program_flag & OAPI_RAW_OUTPUT) @@ -26748,19 +27132,19 @@ int main(int ac, char **av) } osc_deinit_str(&r); } else - if (!strcmp("DeleteDirectLinkInterface", av[i])) { + if (!strcmp("DeleteExportTask", av[i])) { auto_osc_json_c json_object *jobj = NULL; auto_ptr_array struct ptr_array opa = {0}; struct ptr_array *pa = &opa; - struct osc_delete_direct_link_interface_arg a = {0}; - struct osc_delete_direct_link_interface_arg *s = &a; + struct osc_delete_export_task_arg a = {0}; + struct osc_delete_export_task_arg *s = &a; __attribute__((cleanup(files_cnt_cleanup))) char *files_cnt[MAX_FILES_PER_CMD] = {NULL}; int cret; cascade_struct = NULL; cascade_parser = NULL; - delete_direct_link_interface_arg: + delete_export_task_arg: if (i + 1 < ac && av[i + 1][0] == '.' && av[i + 1][1] == '.') { char *next_a = &av[i + 1][2]; @@ -26779,7 +27163,7 @@ int main(int ac, char **av) } STRY(cascade_parser(cascade_struct, next_a, aa, pa)); i += incr; - goto delete_direct_link_interface_arg; + goto delete_export_task_arg; } if (i + 1 < ac && av[i + 1][0] == '-' && av[i + 1][1] == '-' && strcmp(av[i + 1] + 2, "set-var")) { @@ -26793,17 +27177,6 @@ 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, "DirectLinkInterfaceId")) == 0 || aret == '=' || aret == '.') { - char *eq_ptr = strchr(next_a, '='); - if (eq_ptr) { - TRY((!*eq_ptr), "DirectLinkInterfaceId argument missing\n"); - aa = eq_ptr + 1; - incr = 1; - } - TRY(!aa, "DirectLinkInterfaceId argument missing\n"); - s->direct_link_interface_id = aa; // string string - - } else if ((aret = argcmp(next_a, "DryRun")) == 0 || aret == '=' || aret == '.') { char *eq_ptr = strchr(next_a, '='); if (eq_ptr) { @@ -26820,120 +27193,25 @@ int main(int ac, char **av) BAD_RET("DryRun require true/false\n"); } } else - { - BAD_RET("'%s' is not a valide argument for 'DeleteDirectLinkInterface'\n", next_a); - } - i += incr; - goto delete_direct_link_interface_arg; - } - cret = osc_delete_direct_link_interface(&e, &r, &a); - TRY(cret, "fail to call DeleteDirectLinkInterface: %s\n", curl_easy_strerror(cret)); - CHK_BAD_RET(!r.buf, "connection sucessful, but empty responce\n"); - jobj = NULL; - if (program_flag & OAPI_RAW_OUTPUT) - puts(r.buf); - else { - jobj = json_tokener_parse(r.buf); - puts(json_object_to_json_string_ext(jobj, - JSON_C_TO_STRING_PRETTY | JSON_C_TO_STRING_NOSLASHESCAPE | - color_flag)); - } - while (i + 1 < ac && !strcmp(av[i + 1], "--set-var")) { - ++i; - TRY(i + 1 >= ac, "--set-var require an argument"); - if (!jobj) - jobj = json_tokener_parse(r.buf); - if (parse_variable(jobj, av, ac, i)) - return -1; - ++i; - } - - if (jobj) { - json_object_put(jobj); - jobj = NULL; - } - osc_deinit_str(&r); - } else - if (!strcmp("DeleteDirectLink", av[i])) { - auto_osc_json_c json_object *jobj = NULL; - auto_ptr_array struct ptr_array opa = {0}; - struct ptr_array *pa = &opa; - struct osc_delete_direct_link_arg a = {0}; - struct osc_delete_direct_link_arg *s = &a; - __attribute__((cleanup(files_cnt_cleanup))) char *files_cnt[MAX_FILES_PER_CMD] = {NULL}; - int cret; - - cascade_struct = NULL; - cascade_parser = NULL; - - delete_direct_link_arg: - - if (i + 1 < ac && av[i + 1][0] == '.' && av[i + 1][1] == '.') { - char *next_a = &av[i + 1][2]; - char *aa = i + 2 < ac ? av[i + 2] : 0; - int incr = 2; - char *eq_ptr = strchr(next_a, '='); - - CHK_BAD_RET(!cascade_struct, "cascade need to be se first\n"); - if (eq_ptr) { - CHK_BAD_RET(!*eq_ptr, "cascade need an argument\n"); - incr = 1; - aa = eq_ptr + 1; - } else { - CHK_BAD_RET(!aa, "cascade need an argument\n"); - META_ARGS({CHK_BAD_RET(aa[0] == '-', "cascade need an argument"); }) - } - STRY(cascade_parser(cascade_struct, next_a, aa, pa)); - i += incr; - goto delete_direct_link_arg; - } - - if (i + 1 < ac && av[i + 1][0] == '-' && av[i + 1][1] == '-' && strcmp(av[i + 1] + 2, "set-var")) { - char *next_a = &av[i + 1][2]; - char *str = next_a; - char *aa = i + 2 < ac ? av[i + 2] : 0; - int aret = 0; - int incr = aa ? 2 : 1; - - (void)str; - if (aa && aa[0] == '-' && aa[1] == '-' && aa[2] != '-') { - META_ARGS({ aa = 0; incr = 1; }); - } - if ((aret = argcmp(next_a, "DirectLinkId")) == 0 || aret == '=' || aret == '.') { + if ((aret = argcmp(next_a, "ExportTaskId")) == 0 || aret == '=' || aret == '.') { char *eq_ptr = strchr(next_a, '='); if (eq_ptr) { - TRY((!*eq_ptr), "DirectLinkId argument missing\n"); + TRY((!*eq_ptr), "ExportTaskId argument missing\n"); aa = eq_ptr + 1; incr = 1; } - TRY(!aa, "DirectLinkId argument missing\n"); - s->direct_link_id = aa; // string string + TRY(!aa, "ExportTaskId argument missing\n"); + s->export_task_id = aa; // string string } else - if ((aret = argcmp(next_a, "DryRun")) == 0 || aret == '=' || aret == '.') { - char *eq_ptr = strchr(next_a, '='); - if (eq_ptr) { - TRY((!*eq_ptr), "DryRun argument missing\n"); - aa = eq_ptr + 1; - incr = 1; - } - s->is_set_dry_run = 1; - if (!aa || !strcasecmp(aa, "true")) { - s->dry_run = 1; - } else if (!strcasecmp(aa, "false")) { - s->dry_run = 0; - } else { - BAD_RET("DryRun require true/false\n"); - } - } else { - BAD_RET("'%s' is not a valide argument for 'DeleteDirectLink'\n", next_a); + BAD_RET("'%s' is not a valide argument for 'DeleteExportTask'\n", next_a); } i += incr; - goto delete_direct_link_arg; + goto delete_export_task_arg; } - cret = osc_delete_direct_link(&e, &r, &a); - TRY(cret, "fail to call DeleteDirectLink: %s\n", curl_easy_strerror(cret)); + cret = osc_delete_export_task(&e, &r, &a); + TRY(cret, "fail to call DeleteExportTask: %s\n", curl_easy_strerror(cret)); CHK_BAD_RET(!r.buf, "connection sucessful, but empty responce\n"); jobj = NULL; if (program_flag & OAPI_RAW_OUTPUT) @@ -26960,19 +27238,19 @@ int main(int ac, char **av) } osc_deinit_str(&r); } else - if (!strcmp("DeleteExportTask", av[i])) { + if (!strcmp("DeleteFlexibleGpu", av[i])) { auto_osc_json_c json_object *jobj = NULL; auto_ptr_array struct ptr_array opa = {0}; struct ptr_array *pa = &opa; - struct osc_delete_export_task_arg a = {0}; - struct osc_delete_export_task_arg *s = &a; + struct osc_delete_flexible_gpu_arg a = {0}; + struct osc_delete_flexible_gpu_arg *s = &a; __attribute__((cleanup(files_cnt_cleanup))) char *files_cnt[MAX_FILES_PER_CMD] = {NULL}; int cret; cascade_struct = NULL; cascade_parser = NULL; - delete_export_task_arg: + delete_flexible_gpu_arg: if (i + 1 < ac && av[i + 1][0] == '.' && av[i + 1][1] == '.') { char *next_a = &av[i + 1][2]; @@ -26991,7 +27269,7 @@ int main(int ac, char **av) } STRY(cascade_parser(cascade_struct, next_a, aa, pa)); i += incr; - goto delete_export_task_arg; + goto delete_flexible_gpu_arg; } if (i + 1 < ac && av[i + 1][0] == '-' && av[i + 1][1] == '-' && strcmp(av[i + 1] + 2, "set-var")) { @@ -27021,25 +27299,25 @@ int main(int ac, char **av) BAD_RET("DryRun require true/false\n"); } } else - if ((aret = argcmp(next_a, "ExportTaskId")) == 0 || aret == '=' || aret == '.') { + if ((aret = argcmp(next_a, "FlexibleGpuId")) == 0 || aret == '=' || aret == '.') { char *eq_ptr = strchr(next_a, '='); if (eq_ptr) { - TRY((!*eq_ptr), "ExportTaskId argument missing\n"); + TRY((!*eq_ptr), "FlexibleGpuId argument missing\n"); aa = eq_ptr + 1; incr = 1; } - TRY(!aa, "ExportTaskId argument missing\n"); - s->export_task_id = aa; // string string + TRY(!aa, "FlexibleGpuId argument missing\n"); + s->flexible_gpu_id = aa; // string string } else { - BAD_RET("'%s' is not a valide argument for 'DeleteExportTask'\n", next_a); + BAD_RET("'%s' is not a valide argument for 'DeleteFlexibleGpu'\n", next_a); } i += incr; - goto delete_export_task_arg; + goto delete_flexible_gpu_arg; } - cret = osc_delete_export_task(&e, &r, &a); - TRY(cret, "fail to call DeleteExportTask: %s\n", curl_easy_strerror(cret)); + cret = osc_delete_flexible_gpu(&e, &r, &a); + TRY(cret, "fail to call DeleteFlexibleGpu: %s\n", curl_easy_strerror(cret)); CHK_BAD_RET(!r.buf, "connection sucessful, but empty responce\n"); jobj = NULL; if (program_flag & OAPI_RAW_OUTPUT) @@ -27066,19 +27344,19 @@ int main(int ac, char **av) } osc_deinit_str(&r); } else - if (!strcmp("DeleteFlexibleGpu", av[i])) { + if (!strcmp("DeleteImage", av[i])) { auto_osc_json_c json_object *jobj = NULL; auto_ptr_array struct ptr_array opa = {0}; struct ptr_array *pa = &opa; - struct osc_delete_flexible_gpu_arg a = {0}; - struct osc_delete_flexible_gpu_arg *s = &a; + struct osc_delete_image_arg a = {0}; + struct osc_delete_image_arg *s = &a; __attribute__((cleanup(files_cnt_cleanup))) char *files_cnt[MAX_FILES_PER_CMD] = {NULL}; int cret; cascade_struct = NULL; cascade_parser = NULL; - delete_flexible_gpu_arg: + delete_image_arg: if (i + 1 < ac && av[i + 1][0] == '.' && av[i + 1][1] == '.') { char *next_a = &av[i + 1][2]; @@ -27097,7 +27375,7 @@ int main(int ac, char **av) } STRY(cascade_parser(cascade_struct, next_a, aa, pa)); i += incr; - goto delete_flexible_gpu_arg; + goto delete_image_arg; } if (i + 1 < ac && av[i + 1][0] == '-' && av[i + 1][1] == '-' && strcmp(av[i + 1] + 2, "set-var")) { @@ -27127,25 +27405,25 @@ int main(int ac, char **av) BAD_RET("DryRun require true/false\n"); } } else - if ((aret = argcmp(next_a, "FlexibleGpuId")) == 0 || aret == '=' || aret == '.') { + if ((aret = argcmp(next_a, "ImageId")) == 0 || aret == '=' || aret == '.') { char *eq_ptr = strchr(next_a, '='); if (eq_ptr) { - TRY((!*eq_ptr), "FlexibleGpuId argument missing\n"); + TRY((!*eq_ptr), "ImageId argument missing\n"); aa = eq_ptr + 1; incr = 1; } - TRY(!aa, "FlexibleGpuId argument missing\n"); - s->flexible_gpu_id = aa; // string string + TRY(!aa, "ImageId argument missing\n"); + s->image_id = aa; // string string } else { - BAD_RET("'%s' is not a valide argument for 'DeleteFlexibleGpu'\n", next_a); + BAD_RET("'%s' is not a valide argument for 'DeleteImage'\n", next_a); } i += incr; - goto delete_flexible_gpu_arg; + goto delete_image_arg; } - cret = osc_delete_flexible_gpu(&e, &r, &a); - TRY(cret, "fail to call DeleteFlexibleGpu: %s\n", curl_easy_strerror(cret)); + cret = osc_delete_image(&e, &r, &a); + TRY(cret, "fail to call DeleteImage: %s\n", curl_easy_strerror(cret)); CHK_BAD_RET(!r.buf, "connection sucessful, but empty responce\n"); jobj = NULL; if (program_flag & OAPI_RAW_OUTPUT) @@ -27172,19 +27450,19 @@ int main(int ac, char **av) } osc_deinit_str(&r); } else - if (!strcmp("DeleteImage", av[i])) { + if (!strcmp("DeleteInternetService", av[i])) { auto_osc_json_c json_object *jobj = NULL; auto_ptr_array struct ptr_array opa = {0}; struct ptr_array *pa = &opa; - struct osc_delete_image_arg a = {0}; - struct osc_delete_image_arg *s = &a; + struct osc_delete_internet_service_arg a = {0}; + struct osc_delete_internet_service_arg *s = &a; __attribute__((cleanup(files_cnt_cleanup))) char *files_cnt[MAX_FILES_PER_CMD] = {NULL}; int cret; cascade_struct = NULL; cascade_parser = NULL; - delete_image_arg: + delete_internet_service_arg: if (i + 1 < ac && av[i + 1][0] == '.' && av[i + 1][1] == '.') { char *next_a = &av[i + 1][2]; @@ -27203,7 +27481,7 @@ int main(int ac, char **av) } STRY(cascade_parser(cascade_struct, next_a, aa, pa)); i += incr; - goto delete_image_arg; + goto delete_internet_service_arg; } if (i + 1 < ac && av[i + 1][0] == '-' && av[i + 1][1] == '-' && strcmp(av[i + 1] + 2, "set-var")) { @@ -27233,25 +27511,25 @@ int main(int ac, char **av) BAD_RET("DryRun require true/false\n"); } } else - if ((aret = argcmp(next_a, "ImageId")) == 0 || aret == '=' || aret == '.') { + if ((aret = argcmp(next_a, "InternetServiceId")) == 0 || aret == '=' || aret == '.') { char *eq_ptr = strchr(next_a, '='); if (eq_ptr) { - TRY((!*eq_ptr), "ImageId argument missing\n"); + TRY((!*eq_ptr), "InternetServiceId argument missing\n"); aa = eq_ptr + 1; incr = 1; } - TRY(!aa, "ImageId argument missing\n"); - s->image_id = aa; // string string + TRY(!aa, "InternetServiceId argument missing\n"); + s->internet_service_id = aa; // string string } else { - BAD_RET("'%s' is not a valide argument for 'DeleteImage'\n", next_a); + BAD_RET("'%s' is not a valide argument for 'DeleteInternetService'\n", next_a); } i += incr; - goto delete_image_arg; + goto delete_internet_service_arg; } - cret = osc_delete_image(&e, &r, &a); - TRY(cret, "fail to call DeleteImage: %s\n", curl_easy_strerror(cret)); + cret = osc_delete_internet_service(&e, &r, &a); + TRY(cret, "fail to call DeleteInternetService: %s\n", curl_easy_strerror(cret)); CHK_BAD_RET(!r.buf, "connection sucessful, but empty responce\n"); jobj = NULL; if (program_flag & OAPI_RAW_OUTPUT) @@ -27278,19 +27556,19 @@ int main(int ac, char **av) } osc_deinit_str(&r); } else - if (!strcmp("DeleteInternetService", av[i])) { + if (!strcmp("DeleteKeypair", av[i])) { auto_osc_json_c json_object *jobj = NULL; auto_ptr_array struct ptr_array opa = {0}; struct ptr_array *pa = &opa; - struct osc_delete_internet_service_arg a = {0}; - struct osc_delete_internet_service_arg *s = &a; + struct osc_delete_keypair_arg a = {0}; + struct osc_delete_keypair_arg *s = &a; __attribute__((cleanup(files_cnt_cleanup))) char *files_cnt[MAX_FILES_PER_CMD] = {NULL}; int cret; cascade_struct = NULL; cascade_parser = NULL; - delete_internet_service_arg: + delete_keypair_arg: if (i + 1 < ac && av[i + 1][0] == '.' && av[i + 1][1] == '.') { char *next_a = &av[i + 1][2]; @@ -27309,7 +27587,7 @@ int main(int ac, char **av) } STRY(cascade_parser(cascade_struct, next_a, aa, pa)); i += incr; - goto delete_internet_service_arg; + goto delete_keypair_arg; } if (i + 1 < ac && av[i + 1][0] == '-' && av[i + 1][1] == '-' && strcmp(av[i + 1] + 2, "set-var")) { @@ -27339,112 +27617,17 @@ int main(int ac, char **av) BAD_RET("DryRun require true/false\n"); } } else - if ((aret = argcmp(next_a, "InternetServiceId")) == 0 || aret == '=' || aret == '.') { + if ((aret = argcmp(next_a, "KeypairId")) == 0 || aret == '=' || aret == '.') { char *eq_ptr = strchr(next_a, '='); if (eq_ptr) { - TRY((!*eq_ptr), "InternetServiceId argument missing\n"); + TRY((!*eq_ptr), "KeypairId argument missing\n"); aa = eq_ptr + 1; incr = 1; } - TRY(!aa, "InternetServiceId argument missing\n"); - s->internet_service_id = aa; // string string + TRY(!aa, "KeypairId argument missing\n"); + s->keypair_id = aa; // string string } else - { - BAD_RET("'%s' is not a valide argument for 'DeleteInternetService'\n", next_a); - } - i += incr; - goto delete_internet_service_arg; - } - cret = osc_delete_internet_service(&e, &r, &a); - TRY(cret, "fail to call DeleteInternetService: %s\n", curl_easy_strerror(cret)); - CHK_BAD_RET(!r.buf, "connection sucessful, but empty responce\n"); - jobj = NULL; - if (program_flag & OAPI_RAW_OUTPUT) - puts(r.buf); - else { - jobj = json_tokener_parse(r.buf); - puts(json_object_to_json_string_ext(jobj, - JSON_C_TO_STRING_PRETTY | JSON_C_TO_STRING_NOSLASHESCAPE | - color_flag)); - } - while (i + 1 < ac && !strcmp(av[i + 1], "--set-var")) { - ++i; - TRY(i + 1 >= ac, "--set-var require an argument"); - if (!jobj) - jobj = json_tokener_parse(r.buf); - if (parse_variable(jobj, av, ac, i)) - return -1; - ++i; - } - - if (jobj) { - json_object_put(jobj); - jobj = NULL; - } - osc_deinit_str(&r); - } else - if (!strcmp("DeleteKeypair", av[i])) { - auto_osc_json_c json_object *jobj = NULL; - auto_ptr_array struct ptr_array opa = {0}; - struct ptr_array *pa = &opa; - struct osc_delete_keypair_arg a = {0}; - struct osc_delete_keypair_arg *s = &a; - __attribute__((cleanup(files_cnt_cleanup))) char *files_cnt[MAX_FILES_PER_CMD] = {NULL}; - int cret; - - cascade_struct = NULL; - cascade_parser = NULL; - - delete_keypair_arg: - - if (i + 1 < ac && av[i + 1][0] == '.' && av[i + 1][1] == '.') { - char *next_a = &av[i + 1][2]; - char *aa = i + 2 < ac ? av[i + 2] : 0; - int incr = 2; - char *eq_ptr = strchr(next_a, '='); - - CHK_BAD_RET(!cascade_struct, "cascade need to be se first\n"); - if (eq_ptr) { - CHK_BAD_RET(!*eq_ptr, "cascade need an argument\n"); - incr = 1; - aa = eq_ptr + 1; - } else { - CHK_BAD_RET(!aa, "cascade need an argument\n"); - META_ARGS({CHK_BAD_RET(aa[0] == '-', "cascade need an argument"); }) - } - STRY(cascade_parser(cascade_struct, next_a, aa, pa)); - i += incr; - goto delete_keypair_arg; - } - - if (i + 1 < ac && av[i + 1][0] == '-' && av[i + 1][1] == '-' && strcmp(av[i + 1] + 2, "set-var")) { - char *next_a = &av[i + 1][2]; - char *str = next_a; - char *aa = i + 2 < ac ? av[i + 2] : 0; - int aret = 0; - int incr = aa ? 2 : 1; - - (void)str; - if (aa && aa[0] == '-' && aa[1] == '-' && aa[2] != '-') { - META_ARGS({ aa = 0; incr = 1; }); - } - if ((aret = argcmp(next_a, "DryRun")) == 0 || aret == '=' || aret == '.') { - char *eq_ptr = strchr(next_a, '='); - if (eq_ptr) { - TRY((!*eq_ptr), "DryRun argument missing\n"); - aa = eq_ptr + 1; - incr = 1; - } - s->is_set_dry_run = 1; - if (!aa || !strcasecmp(aa, "true")) { - s->dry_run = 1; - } else if (!strcasecmp(aa, "false")) { - s->dry_run = 0; - } else { - BAD_RET("DryRun require true/false\n"); - } - } else if ((aret = argcmp(next_a, "KeypairName")) == 0 || aret == '=' || aret == '.') { char *eq_ptr = strchr(next_a, '='); if (eq_ptr) { @@ -27959,19 +28142,179 @@ int main(int ac, char **av) } osc_deinit_str(&r); } else - if (!strcmp("DeleteLoadBalancerTags", av[i])) { + if (!strcmp("DeleteLoadBalancerTags", av[i])) { + auto_osc_json_c json_object *jobj = NULL; + auto_ptr_array struct ptr_array opa = {0}; + struct ptr_array *pa = &opa; + struct osc_delete_load_balancer_tags_arg a = {0}; + struct osc_delete_load_balancer_tags_arg *s = &a; + __attribute__((cleanup(files_cnt_cleanup))) char *files_cnt[MAX_FILES_PER_CMD] = {NULL}; + int cret; + + cascade_struct = NULL; + cascade_parser = NULL; + + delete_load_balancer_tags_arg: + + if (i + 1 < ac && av[i + 1][0] == '.' && av[i + 1][1] == '.') { + char *next_a = &av[i + 1][2]; + char *aa = i + 2 < ac ? av[i + 2] : 0; + int incr = 2; + char *eq_ptr = strchr(next_a, '='); + + CHK_BAD_RET(!cascade_struct, "cascade need to be se first\n"); + if (eq_ptr) { + CHK_BAD_RET(!*eq_ptr, "cascade need an argument\n"); + incr = 1; + aa = eq_ptr + 1; + } else { + CHK_BAD_RET(!aa, "cascade need an argument\n"); + META_ARGS({CHK_BAD_RET(aa[0] == '-', "cascade need an argument"); }) + } + STRY(cascade_parser(cascade_struct, next_a, aa, pa)); + i += incr; + goto delete_load_balancer_tags_arg; + } + + if (i + 1 < ac && av[i + 1][0] == '-' && av[i + 1][1] == '-' && strcmp(av[i + 1] + 2, "set-var")) { + char *next_a = &av[i + 1][2]; + char *str = next_a; + char *aa = i + 2 < ac ? av[i + 2] : 0; + int aret = 0; + int incr = aa ? 2 : 1; + + (void)str; + if (aa && aa[0] == '-' && aa[1] == '-' && aa[2] != '-') { + META_ARGS({ aa = 0; incr = 1; }); + } + if ((aret = argcmp(next_a, "DryRun")) == 0 || aret == '=' || aret == '.') { + char *eq_ptr = strchr(next_a, '='); + if (eq_ptr) { + TRY((!*eq_ptr), "DryRun argument missing\n"); + aa = eq_ptr + 1; + incr = 1; + } + s->is_set_dry_run = 1; + if (!aa || !strcasecmp(aa, "true")) { + s->dry_run = 1; + } else if (!strcasecmp(aa, "false")) { + s->dry_run = 0; + } else { + BAD_RET("DryRun require true/false\n"); + } + } else + if ((aret = argcmp(next_a, "LoadBalancerNames")) == 0 || aret == '=' || aret == '.') { + char *eq_ptr = strchr(next_a, '='); + if (eq_ptr) { + TRY((!*eq_ptr), "LoadBalancerNames 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++), "LoadBalancerNames argument missing\n"); + pos = strtoul(dot_pos, &endptr, 0); + TRY(endptr == dot_pos, "LoadBalancerNames require an index\n"); + if (s->load_balancer_names) { + for (; s->load_balancer_names[last]; ++last); + } + if (pos < last) { + s->load_balancer_names[pos] = (aa); + } else { + for (int i = last; i < pos; ++i) + SET_NEXT(s->load_balancer_names, "", pa); + SET_NEXT(s->load_balancer_names, (aa), pa); + } + } else { + TRY(!aa, "LoadBalancerNames argument missing\n"); + s->load_balancer_names_str = aa; + } + } else if (!(aret = argcmp(str, "LoadBalancerNames[]")) || aret == '=') { + TRY(!aa, "LoadBalancerNames[] argument missing\n"); + SET_NEXT(s->load_balancer_names, (aa), pa); + } else + if ((aret = argcmp(next_a, "Tags")) == 0 || aret == '=' || aret == '.') { + char *eq_ptr = strchr(next_a, '='); + if (eq_ptr) { + TRY((!*eq_ptr), "Tags argument missing\n"); + aa = eq_ptr + 1; + incr = 1; + } + char *dot_pos = strchr(str, '.'); + + if (dot_pos) { + int pos; + char *endptr; + + ++dot_pos; + pos = strtoul(dot_pos, &endptr, 0); + if (endptr == dot_pos) + BAD_RET("'Tags' require an index (example array ref ResourceLoadBalancerTag.Tags.0)\n"); + else if (*endptr != '.') + BAD_RET("'Tags' require a .\n"); + TRY_ALLOC_AT(s,tags, pa, pos, sizeof(*s->tags)); + cascade_struct = &s->tags[pos]; + cascade_parser = resource_load_balancer_tag_parser; + if (endptr[1] == '.') { + ++endptr; + } + STRY(resource_load_balancer_tag_parser(&s->tags[pos], endptr + 1, aa, pa)); + } else { + TRY(!aa, "Tags argument missing\n"); + s->tags_str = aa; // array ref ResourceLoadBalancerTag ref + } + } else + { + BAD_RET("'%s' is not a valide argument for 'DeleteLoadBalancerTags'\n", next_a); + } + i += incr; + goto delete_load_balancer_tags_arg; + } + cret = osc_delete_load_balancer_tags(&e, &r, &a); + TRY(cret, "fail to call DeleteLoadBalancerTags: %s\n", curl_easy_strerror(cret)); + CHK_BAD_RET(!r.buf, "connection sucessful, but empty responce\n"); + jobj = NULL; + if (program_flag & OAPI_RAW_OUTPUT) + puts(r.buf); + else { + jobj = json_tokener_parse(r.buf); + puts(json_object_to_json_string_ext(jobj, + JSON_C_TO_STRING_PRETTY | JSON_C_TO_STRING_NOSLASHESCAPE | + color_flag)); + } + while (i + 1 < ac && !strcmp(av[i + 1], "--set-var")) { + ++i; + TRY(i + 1 >= ac, "--set-var require an argument"); + if (!jobj) + jobj = json_tokener_parse(r.buf); + if (parse_variable(jobj, av, ac, i)) + return -1; + ++i; + } + + if (jobj) { + json_object_put(jobj); + jobj = NULL; + } + osc_deinit_str(&r); + } else + if (!strcmp("DeleteNatService", av[i])) { auto_osc_json_c json_object *jobj = NULL; auto_ptr_array struct ptr_array opa = {0}; struct ptr_array *pa = &opa; - struct osc_delete_load_balancer_tags_arg a = {0}; - struct osc_delete_load_balancer_tags_arg *s = &a; + struct osc_delete_nat_service_arg a = {0}; + struct osc_delete_nat_service_arg *s = &a; __attribute__((cleanup(files_cnt_cleanup))) char *files_cnt[MAX_FILES_PER_CMD] = {NULL}; int cret; cascade_struct = NULL; cascade_parser = NULL; - delete_load_balancer_tags_arg: + delete_nat_service_arg: if (i + 1 < ac && av[i + 1][0] == '.' && av[i + 1][1] == '.') { char *next_a = &av[i + 1][2]; @@ -27990,7 +28333,7 @@ int main(int ac, char **av) } STRY(cascade_parser(cascade_struct, next_a, aa, pa)); i += incr; - goto delete_load_balancer_tags_arg; + goto delete_nat_service_arg; } if (i + 1 < ac && av[i + 1][0] == '-' && av[i + 1][1] == '-' && strcmp(av[i + 1] + 2, "set-var")) { @@ -28020,79 +28363,131 @@ int main(int ac, char **av) BAD_RET("DryRun require true/false\n"); } } else - if ((aret = argcmp(next_a, "LoadBalancerNames")) == 0 || aret == '=' || aret == '.') { + if ((aret = argcmp(next_a, "NatServiceId")) == 0 || aret == '=' || aret == '.') { char *eq_ptr = strchr(next_a, '='); if (eq_ptr) { - TRY((!*eq_ptr), "LoadBalancerNames argument missing\n"); + TRY((!*eq_ptr), "NatServiceId argument missing\n"); aa = eq_ptr + 1; incr = 1; } - if (aret == '.') { - int pos; - char *endptr; - int last = 0; - char *dot_pos = strchr(str, '.'); + TRY(!aa, "NatServiceId argument missing\n"); + s->nat_service_id = aa; // string string - TRY(!(dot_pos++), "LoadBalancerNames argument missing\n"); - pos = strtoul(dot_pos, &endptr, 0); - TRY(endptr == dot_pos, "LoadBalancerNames require an index\n"); - if (s->load_balancer_names) { - for (; s->load_balancer_names[last]; ++last); - } - if (pos < last) { - s->load_balancer_names[pos] = (aa); - } else { - for (int i = last; i < pos; ++i) - SET_NEXT(s->load_balancer_names, "", pa); - SET_NEXT(s->load_balancer_names, (aa), pa); - } - } else { - TRY(!aa, "LoadBalancerNames argument missing\n"); - s->load_balancer_names_str = aa; - } - } else if (!(aret = argcmp(str, "LoadBalancerNames[]")) || aret == '=') { - TRY(!aa, "LoadBalancerNames[] argument missing\n"); - SET_NEXT(s->load_balancer_names, (aa), pa); } else - if ((aret = argcmp(next_a, "Tags")) == 0 || aret == '=' || aret == '.') { + { + BAD_RET("'%s' is not a valide argument for 'DeleteNatService'\n", next_a); + } + i += incr; + goto delete_nat_service_arg; + } + cret = osc_delete_nat_service(&e, &r, &a); + TRY(cret, "fail to call DeleteNatService: %s\n", curl_easy_strerror(cret)); + CHK_BAD_RET(!r.buf, "connection sucessful, but empty responce\n"); + jobj = NULL; + if (program_flag & OAPI_RAW_OUTPUT) + puts(r.buf); + else { + jobj = json_tokener_parse(r.buf); + puts(json_object_to_json_string_ext(jobj, + JSON_C_TO_STRING_PRETTY | JSON_C_TO_STRING_NOSLASHESCAPE | + color_flag)); + } + while (i + 1 < ac && !strcmp(av[i + 1], "--set-var")) { + ++i; + TRY(i + 1 >= ac, "--set-var require an argument"); + if (!jobj) + jobj = json_tokener_parse(r.buf); + if (parse_variable(jobj, av, ac, i)) + return -1; + ++i; + } + + if (jobj) { + json_object_put(jobj); + jobj = NULL; + } + osc_deinit_str(&r); + } else + if (!strcmp("DeleteNetAccessPoint", av[i])) { + auto_osc_json_c json_object *jobj = NULL; + auto_ptr_array struct ptr_array opa = {0}; + struct ptr_array *pa = &opa; + struct osc_delete_net_access_point_arg a = {0}; + struct osc_delete_net_access_point_arg *s = &a; + __attribute__((cleanup(files_cnt_cleanup))) char *files_cnt[MAX_FILES_PER_CMD] = {NULL}; + int cret; + + cascade_struct = NULL; + cascade_parser = NULL; + + delete_net_access_point_arg: + + if (i + 1 < ac && av[i + 1][0] == '.' && av[i + 1][1] == '.') { + char *next_a = &av[i + 1][2]; + char *aa = i + 2 < ac ? av[i + 2] : 0; + int incr = 2; + char *eq_ptr = strchr(next_a, '='); + + CHK_BAD_RET(!cascade_struct, "cascade need to be se first\n"); + if (eq_ptr) { + CHK_BAD_RET(!*eq_ptr, "cascade need an argument\n"); + incr = 1; + aa = eq_ptr + 1; + } else { + CHK_BAD_RET(!aa, "cascade need an argument\n"); + META_ARGS({CHK_BAD_RET(aa[0] == '-', "cascade need an argument"); }) + } + STRY(cascade_parser(cascade_struct, next_a, aa, pa)); + i += incr; + goto delete_net_access_point_arg; + } + + if (i + 1 < ac && av[i + 1][0] == '-' && av[i + 1][1] == '-' && strcmp(av[i + 1] + 2, "set-var")) { + char *next_a = &av[i + 1][2]; + char *str = next_a; + char *aa = i + 2 < ac ? av[i + 2] : 0; + int aret = 0; + int incr = aa ? 2 : 1; + + (void)str; + if (aa && aa[0] == '-' && aa[1] == '-' && aa[2] != '-') { + META_ARGS({ aa = 0; incr = 1; }); + } + if ((aret = argcmp(next_a, "DryRun")) == 0 || aret == '=' || aret == '.') { char *eq_ptr = strchr(next_a, '='); if (eq_ptr) { - TRY((!*eq_ptr), "Tags argument missing\n"); + TRY((!*eq_ptr), "DryRun argument missing\n"); aa = eq_ptr + 1; incr = 1; } - char *dot_pos = strchr(str, '.'); - - if (dot_pos) { - int pos; - char *endptr; - - ++dot_pos; - pos = strtoul(dot_pos, &endptr, 0); - if (endptr == dot_pos) - BAD_RET("'Tags' require an index (example array ref ResourceLoadBalancerTag.Tags.0)\n"); - else if (*endptr != '.') - BAD_RET("'Tags' require a .\n"); - TRY_ALLOC_AT(s,tags, pa, pos, sizeof(*s->tags)); - cascade_struct = &s->tags[pos]; - cascade_parser = resource_load_balancer_tag_parser; - if (endptr[1] == '.') { - ++endptr; - } - STRY(resource_load_balancer_tag_parser(&s->tags[pos], endptr + 1, aa, pa)); + s->is_set_dry_run = 1; + if (!aa || !strcasecmp(aa, "true")) { + s->dry_run = 1; + } else if (!strcasecmp(aa, "false")) { + s->dry_run = 0; } else { - TRY(!aa, "Tags argument missing\n"); - s->tags_str = aa; // array ref ResourceLoadBalancerTag ref - } + BAD_RET("DryRun require true/false\n"); + } + } else + if ((aret = argcmp(next_a, "NetAccessPointId")) == 0 || aret == '=' || aret == '.') { + char *eq_ptr = strchr(next_a, '='); + if (eq_ptr) { + TRY((!*eq_ptr), "NetAccessPointId argument missing\n"); + aa = eq_ptr + 1; + incr = 1; + } + TRY(!aa, "NetAccessPointId argument missing\n"); + s->net_access_point_id = aa; // string string + } else { - BAD_RET("'%s' is not a valide argument for 'DeleteLoadBalancerTags'\n", next_a); + BAD_RET("'%s' is not a valide argument for 'DeleteNetAccessPoint'\n", next_a); } i += incr; - goto delete_load_balancer_tags_arg; + goto delete_net_access_point_arg; } - cret = osc_delete_load_balancer_tags(&e, &r, &a); - TRY(cret, "fail to call DeleteLoadBalancerTags: %s\n", curl_easy_strerror(cret)); + cret = osc_delete_net_access_point(&e, &r, &a); + TRY(cret, "fail to call DeleteNetAccessPoint: %s\n", curl_easy_strerror(cret)); CHK_BAD_RET(!r.buf, "connection sucessful, but empty responce\n"); jobj = NULL; if (program_flag & OAPI_RAW_OUTPUT) @@ -28119,19 +28514,19 @@ int main(int ac, char **av) } osc_deinit_str(&r); } else - if (!strcmp("DeleteNatService", av[i])) { + if (!strcmp("DeleteNetPeering", av[i])) { auto_osc_json_c json_object *jobj = NULL; auto_ptr_array struct ptr_array opa = {0}; struct ptr_array *pa = &opa; - struct osc_delete_nat_service_arg a = {0}; - struct osc_delete_nat_service_arg *s = &a; + struct osc_delete_net_peering_arg a = {0}; + struct osc_delete_net_peering_arg *s = &a; __attribute__((cleanup(files_cnt_cleanup))) char *files_cnt[MAX_FILES_PER_CMD] = {NULL}; int cret; cascade_struct = NULL; cascade_parser = NULL; - delete_nat_service_arg: + delete_net_peering_arg: if (i + 1 < ac && av[i + 1][0] == '.' && av[i + 1][1] == '.') { char *next_a = &av[i + 1][2]; @@ -28150,7 +28545,7 @@ int main(int ac, char **av) } STRY(cascade_parser(cascade_struct, next_a, aa, pa)); i += incr; - goto delete_nat_service_arg; + goto delete_net_peering_arg; } if (i + 1 < ac && av[i + 1][0] == '-' && av[i + 1][1] == '-' && strcmp(av[i + 1] + 2, "set-var")) { @@ -28180,25 +28575,25 @@ int main(int ac, char **av) BAD_RET("DryRun require true/false\n"); } } else - if ((aret = argcmp(next_a, "NatServiceId")) == 0 || aret == '=' || aret == '.') { + if ((aret = argcmp(next_a, "NetPeeringId")) == 0 || aret == '=' || aret == '.') { char *eq_ptr = strchr(next_a, '='); if (eq_ptr) { - TRY((!*eq_ptr), "NatServiceId argument missing\n"); + TRY((!*eq_ptr), "NetPeeringId argument missing\n"); aa = eq_ptr + 1; incr = 1; } - TRY(!aa, "NatServiceId argument missing\n"); - s->nat_service_id = aa; // string string + TRY(!aa, "NetPeeringId argument missing\n"); + s->net_peering_id = aa; // string string } else { - BAD_RET("'%s' is not a valide argument for 'DeleteNatService'\n", next_a); + BAD_RET("'%s' is not a valide argument for 'DeleteNetPeering'\n", next_a); } i += incr; - goto delete_nat_service_arg; + goto delete_net_peering_arg; } - cret = osc_delete_nat_service(&e, &r, &a); - TRY(cret, "fail to call DeleteNatService: %s\n", curl_easy_strerror(cret)); + cret = osc_delete_net_peering(&e, &r, &a); + TRY(cret, "fail to call DeleteNetPeering: %s\n", curl_easy_strerror(cret)); CHK_BAD_RET(!r.buf, "connection sucessful, but empty responce\n"); jobj = NULL; if (program_flag & OAPI_RAW_OUTPUT) @@ -28225,19 +28620,19 @@ int main(int ac, char **av) } osc_deinit_str(&r); } else - if (!strcmp("DeleteNetAccessPoint", av[i])) { + if (!strcmp("DeleteNet", av[i])) { auto_osc_json_c json_object *jobj = NULL; auto_ptr_array struct ptr_array opa = {0}; struct ptr_array *pa = &opa; - struct osc_delete_net_access_point_arg a = {0}; - struct osc_delete_net_access_point_arg *s = &a; + struct osc_delete_net_arg a = {0}; + struct osc_delete_net_arg *s = &a; __attribute__((cleanup(files_cnt_cleanup))) char *files_cnt[MAX_FILES_PER_CMD] = {NULL}; int cret; cascade_struct = NULL; cascade_parser = NULL; - delete_net_access_point_arg: + delete_net_arg: if (i + 1 < ac && av[i + 1][0] == '.' && av[i + 1][1] == '.') { char *next_a = &av[i + 1][2]; @@ -28256,7 +28651,7 @@ int main(int ac, char **av) } STRY(cascade_parser(cascade_struct, next_a, aa, pa)); i += incr; - goto delete_net_access_point_arg; + goto delete_net_arg; } if (i + 1 < ac && av[i + 1][0] == '-' && av[i + 1][1] == '-' && strcmp(av[i + 1] + 2, "set-var")) { @@ -28286,25 +28681,25 @@ int main(int ac, char **av) BAD_RET("DryRun require true/false\n"); } } else - if ((aret = argcmp(next_a, "NetAccessPointId")) == 0 || aret == '=' || aret == '.') { + if ((aret = argcmp(next_a, "NetId")) == 0 || aret == '=' || aret == '.') { char *eq_ptr = strchr(next_a, '='); if (eq_ptr) { - TRY((!*eq_ptr), "NetAccessPointId argument missing\n"); + TRY((!*eq_ptr), "NetId argument missing\n"); aa = eq_ptr + 1; incr = 1; } - TRY(!aa, "NetAccessPointId argument missing\n"); - s->net_access_point_id = aa; // string string + TRY(!aa, "NetId argument missing\n"); + s->net_id = aa; // string string } else { - BAD_RET("'%s' is not a valide argument for 'DeleteNetAccessPoint'\n", next_a); + BAD_RET("'%s' is not a valide argument for 'DeleteNet'\n", next_a); } i += incr; - goto delete_net_access_point_arg; + goto delete_net_arg; } - cret = osc_delete_net_access_point(&e, &r, &a); - TRY(cret, "fail to call DeleteNetAccessPoint: %s\n", curl_easy_strerror(cret)); + cret = osc_delete_net(&e, &r, &a); + TRY(cret, "fail to call DeleteNet: %s\n", curl_easy_strerror(cret)); CHK_BAD_RET(!r.buf, "connection sucessful, but empty responce\n"); jobj = NULL; if (program_flag & OAPI_RAW_OUTPUT) @@ -28331,19 +28726,19 @@ int main(int ac, char **av) } osc_deinit_str(&r); } else - if (!strcmp("DeleteNetPeering", av[i])) { + if (!strcmp("DeleteNic", av[i])) { auto_osc_json_c json_object *jobj = NULL; auto_ptr_array struct ptr_array opa = {0}; struct ptr_array *pa = &opa; - struct osc_delete_net_peering_arg a = {0}; - struct osc_delete_net_peering_arg *s = &a; + struct osc_delete_nic_arg a = {0}; + struct osc_delete_nic_arg *s = &a; __attribute__((cleanup(files_cnt_cleanup))) char *files_cnt[MAX_FILES_PER_CMD] = {NULL}; int cret; cascade_struct = NULL; cascade_parser = NULL; - delete_net_peering_arg: + delete_nic_arg: if (i + 1 < ac && av[i + 1][0] == '.' && av[i + 1][1] == '.') { char *next_a = &av[i + 1][2]; @@ -28362,7 +28757,7 @@ int main(int ac, char **av) } STRY(cascade_parser(cascade_struct, next_a, aa, pa)); i += incr; - goto delete_net_peering_arg; + goto delete_nic_arg; } if (i + 1 < ac && av[i + 1][0] == '-' && av[i + 1][1] == '-' && strcmp(av[i + 1] + 2, "set-var")) { @@ -28392,25 +28787,25 @@ int main(int ac, char **av) BAD_RET("DryRun require true/false\n"); } } else - if ((aret = argcmp(next_a, "NetPeeringId")) == 0 || aret == '=' || aret == '.') { + if ((aret = argcmp(next_a, "NicId")) == 0 || aret == '=' || aret == '.') { char *eq_ptr = strchr(next_a, '='); if (eq_ptr) { - TRY((!*eq_ptr), "NetPeeringId argument missing\n"); + TRY((!*eq_ptr), "NicId argument missing\n"); aa = eq_ptr + 1; incr = 1; } - TRY(!aa, "NetPeeringId argument missing\n"); - s->net_peering_id = aa; // string string + TRY(!aa, "NicId argument missing\n"); + s->nic_id = aa; // string string } else { - BAD_RET("'%s' is not a valide argument for 'DeleteNetPeering'\n", next_a); + BAD_RET("'%s' is not a valide argument for 'DeleteNic'\n", next_a); } i += incr; - goto delete_net_peering_arg; + goto delete_nic_arg; } - cret = osc_delete_net_peering(&e, &r, &a); - TRY(cret, "fail to call DeleteNetPeering: %s\n", curl_easy_strerror(cret)); + cret = osc_delete_nic(&e, &r, &a); + TRY(cret, "fail to call DeleteNic: %s\n", curl_easy_strerror(cret)); CHK_BAD_RET(!r.buf, "connection sucessful, but empty responce\n"); jobj = NULL; if (program_flag & OAPI_RAW_OUTPUT) @@ -28437,19 +28832,19 @@ int main(int ac, char **av) } osc_deinit_str(&r); } else - if (!strcmp("DeleteNet", av[i])) { + if (!strcmp("DeletePolicy", av[i])) { auto_osc_json_c json_object *jobj = NULL; auto_ptr_array struct ptr_array opa = {0}; struct ptr_array *pa = &opa; - struct osc_delete_net_arg a = {0}; - struct osc_delete_net_arg *s = &a; + struct osc_delete_policy_arg a = {0}; + struct osc_delete_policy_arg *s = &a; __attribute__((cleanup(files_cnt_cleanup))) char *files_cnt[MAX_FILES_PER_CMD] = {NULL}; int cret; cascade_struct = NULL; cascade_parser = NULL; - delete_net_arg: + delete_policy_arg: if (i + 1 < ac && av[i + 1][0] == '.' && av[i + 1][1] == '.') { char *next_a = &av[i + 1][2]; @@ -28468,7 +28863,7 @@ int main(int ac, char **av) } STRY(cascade_parser(cascade_struct, next_a, aa, pa)); i += incr; - goto delete_net_arg; + goto delete_policy_arg; } if (i + 1 < ac && av[i + 1][0] == '-' && av[i + 1][1] == '-' && strcmp(av[i + 1] + 2, "set-var")) { @@ -28498,25 +28893,25 @@ int main(int ac, char **av) BAD_RET("DryRun require true/false\n"); } } else - if ((aret = argcmp(next_a, "NetId")) == 0 || aret == '=' || aret == '.') { + if ((aret = argcmp(next_a, "PolicyOrn")) == 0 || aret == '=' || aret == '.') { char *eq_ptr = strchr(next_a, '='); if (eq_ptr) { - TRY((!*eq_ptr), "NetId argument missing\n"); + TRY((!*eq_ptr), "PolicyOrn argument missing\n"); aa = eq_ptr + 1; incr = 1; } - TRY(!aa, "NetId argument missing\n"); - s->net_id = aa; // string string + TRY(!aa, "PolicyOrn argument missing\n"); + s->policy_orn = aa; // string string } else { - BAD_RET("'%s' is not a valide argument for 'DeleteNet'\n", next_a); + BAD_RET("'%s' is not a valide argument for 'DeletePolicy'\n", next_a); } i += incr; - goto delete_net_arg; + goto delete_policy_arg; } - cret = osc_delete_net(&e, &r, &a); - TRY(cret, "fail to call DeleteNet: %s\n", curl_easy_strerror(cret)); + cret = osc_delete_policy(&e, &r, &a); + TRY(cret, "fail to call DeletePolicy: %s\n", curl_easy_strerror(cret)); CHK_BAD_RET(!r.buf, "connection sucessful, but empty responce\n"); jobj = NULL; if (program_flag & OAPI_RAW_OUTPUT) @@ -28543,19 +28938,19 @@ int main(int ac, char **av) } osc_deinit_str(&r); } else - if (!strcmp("DeleteNic", av[i])) { + if (!strcmp("DeletePolicyVersion", av[i])) { auto_osc_json_c json_object *jobj = NULL; auto_ptr_array struct ptr_array opa = {0}; struct ptr_array *pa = &opa; - struct osc_delete_nic_arg a = {0}; - struct osc_delete_nic_arg *s = &a; + struct osc_delete_policy_version_arg a = {0}; + struct osc_delete_policy_version_arg *s = &a; __attribute__((cleanup(files_cnt_cleanup))) char *files_cnt[MAX_FILES_PER_CMD] = {NULL}; int cret; cascade_struct = NULL; cascade_parser = NULL; - delete_nic_arg: + delete_policy_version_arg: if (i + 1 < ac && av[i + 1][0] == '.' && av[i + 1][1] == '.') { char *next_a = &av[i + 1][2]; @@ -28574,7 +28969,7 @@ int main(int ac, char **av) } STRY(cascade_parser(cascade_struct, next_a, aa, pa)); i += incr; - goto delete_nic_arg; + goto delete_policy_version_arg; } if (i + 1 < ac && av[i + 1][0] == '-' && av[i + 1][1] == '-' && strcmp(av[i + 1] + 2, "set-var")) { @@ -28588,41 +28983,36 @@ 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, "DryRun")) == 0 || aret == '=' || aret == '.') { + if ((aret = argcmp(next_a, "PolicyOrn")) == 0 || aret == '=' || aret == '.') { char *eq_ptr = strchr(next_a, '='); if (eq_ptr) { - TRY((!*eq_ptr), "DryRun argument missing\n"); + TRY((!*eq_ptr), "PolicyOrn argument missing\n"); aa = eq_ptr + 1; incr = 1; } - s->is_set_dry_run = 1; - if (!aa || !strcasecmp(aa, "true")) { - s->dry_run = 1; - } else if (!strcasecmp(aa, "false")) { - s->dry_run = 0; - } else { - BAD_RET("DryRun require true/false\n"); - } - } else - if ((aret = argcmp(next_a, "NicId")) == 0 || aret == '=' || aret == '.') { + TRY(!aa, "PolicyOrn argument missing\n"); + s->policy_orn = aa; // string string + + } else + if ((aret = argcmp(next_a, "VersionId")) == 0 || aret == '=' || aret == '.') { char *eq_ptr = strchr(next_a, '='); if (eq_ptr) { - TRY((!*eq_ptr), "NicId argument missing\n"); + TRY((!*eq_ptr), "VersionId argument missing\n"); aa = eq_ptr + 1; incr = 1; } - TRY(!aa, "NicId argument missing\n"); - s->nic_id = aa; // string string + TRY(!aa, "VersionId argument missing\n"); + s->version_id = aa; // string string } else { - BAD_RET("'%s' is not a valide argument for 'DeleteNic'\n", next_a); + BAD_RET("'%s' is not a valide argument for 'DeletePolicyVersion'\n", next_a); } i += incr; - goto delete_nic_arg; + goto delete_policy_version_arg; } - cret = osc_delete_nic(&e, &r, &a); - TRY(cret, "fail to call DeleteNic: %s\n", curl_easy_strerror(cret)); + cret = osc_delete_policy_version(&e, &r, &a); + TRY(cret, "fail to call DeletePolicyVersion: %s\n", curl_easy_strerror(cret)); CHK_BAD_RET(!r.buf, "connection sucessful, but empty responce\n"); jobj = NULL; if (program_flag & OAPI_RAW_OUTPUT) @@ -28649,19 +29039,19 @@ int main(int ac, char **av) } osc_deinit_str(&r); } else - if (!strcmp("DeletePolicy", av[i])) { + if (!strcmp("DeleteProductType", av[i])) { auto_osc_json_c json_object *jobj = NULL; auto_ptr_array struct ptr_array opa = {0}; struct ptr_array *pa = &opa; - struct osc_delete_policy_arg a = {0}; - struct osc_delete_policy_arg *s = &a; + struct osc_delete_product_type_arg a = {0}; + struct osc_delete_product_type_arg *s = &a; __attribute__((cleanup(files_cnt_cleanup))) char *files_cnt[MAX_FILES_PER_CMD] = {NULL}; int cret; cascade_struct = NULL; cascade_parser = NULL; - delete_policy_arg: + delete_product_type_arg: if (i + 1 < ac && av[i + 1][0] == '.' && av[i + 1][1] == '.') { char *next_a = &av[i + 1][2]; @@ -28680,7 +29070,7 @@ int main(int ac, char **av) } STRY(cascade_parser(cascade_struct, next_a, aa, pa)); i += incr; - goto delete_policy_arg; + goto delete_product_type_arg; } if (i + 1 < ac && av[i + 1][0] == '-' && av[i + 1][1] == '-' && strcmp(av[i + 1] + 2, "set-var")) { @@ -28710,126 +29100,41 @@ int main(int ac, char **av) BAD_RET("DryRun require true/false\n"); } } else - if ((aret = argcmp(next_a, "PolicyOrn")) == 0 || aret == '=' || aret == '.') { - char *eq_ptr = strchr(next_a, '='); - if (eq_ptr) { - TRY((!*eq_ptr), "PolicyOrn argument missing\n"); - aa = eq_ptr + 1; - incr = 1; - } - TRY(!aa, "PolicyOrn argument missing\n"); - s->policy_orn = aa; // string string - - } else - { - BAD_RET("'%s' is not a valide argument for 'DeletePolicy'\n", next_a); - } - i += incr; - goto delete_policy_arg; - } - cret = osc_delete_policy(&e, &r, &a); - TRY(cret, "fail to call DeletePolicy: %s\n", curl_easy_strerror(cret)); - CHK_BAD_RET(!r.buf, "connection sucessful, but empty responce\n"); - jobj = NULL; - if (program_flag & OAPI_RAW_OUTPUT) - puts(r.buf); - else { - jobj = json_tokener_parse(r.buf); - puts(json_object_to_json_string_ext(jobj, - JSON_C_TO_STRING_PRETTY | JSON_C_TO_STRING_NOSLASHESCAPE | - color_flag)); - } - while (i + 1 < ac && !strcmp(av[i + 1], "--set-var")) { - ++i; - TRY(i + 1 >= ac, "--set-var require an argument"); - if (!jobj) - jobj = json_tokener_parse(r.buf); - if (parse_variable(jobj, av, ac, i)) - return -1; - ++i; - } - - if (jobj) { - json_object_put(jobj); - jobj = NULL; - } - osc_deinit_str(&r); - } else - if (!strcmp("DeletePolicyVersion", av[i])) { - auto_osc_json_c json_object *jobj = NULL; - auto_ptr_array struct ptr_array opa = {0}; - struct ptr_array *pa = &opa; - struct osc_delete_policy_version_arg a = {0}; - struct osc_delete_policy_version_arg *s = &a; - __attribute__((cleanup(files_cnt_cleanup))) char *files_cnt[MAX_FILES_PER_CMD] = {NULL}; - int cret; - - cascade_struct = NULL; - cascade_parser = NULL; - - delete_policy_version_arg: - - if (i + 1 < ac && av[i + 1][0] == '.' && av[i + 1][1] == '.') { - char *next_a = &av[i + 1][2]; - char *aa = i + 2 < ac ? av[i + 2] : 0; - int incr = 2; - char *eq_ptr = strchr(next_a, '='); - - CHK_BAD_RET(!cascade_struct, "cascade need to be se first\n"); - if (eq_ptr) { - CHK_BAD_RET(!*eq_ptr, "cascade need an argument\n"); - incr = 1; - aa = eq_ptr + 1; - } else { - CHK_BAD_RET(!aa, "cascade need an argument\n"); - META_ARGS({CHK_BAD_RET(aa[0] == '-', "cascade need an argument"); }) - } - STRY(cascade_parser(cascade_struct, next_a, aa, pa)); - i += incr; - goto delete_policy_version_arg; - } - - if (i + 1 < ac && av[i + 1][0] == '-' && av[i + 1][1] == '-' && strcmp(av[i + 1] + 2, "set-var")) { - char *next_a = &av[i + 1][2]; - char *str = next_a; - char *aa = i + 2 < ac ? av[i + 2] : 0; - int aret = 0; - int incr = aa ? 2 : 1; - - (void)str; - if (aa && aa[0] == '-' && aa[1] == '-' && aa[2] != '-') { - META_ARGS({ aa = 0; incr = 1; }); - } - if ((aret = argcmp(next_a, "PolicyOrn")) == 0 || aret == '=' || aret == '.') { + if ((aret = argcmp(next_a, "Force")) == 0 || aret == '=' || aret == '.') { char *eq_ptr = strchr(next_a, '='); if (eq_ptr) { - TRY((!*eq_ptr), "PolicyOrn argument missing\n"); + TRY((!*eq_ptr), "Force argument missing\n"); aa = eq_ptr + 1; incr = 1; } - TRY(!aa, "PolicyOrn argument missing\n"); - s->policy_orn = aa; // string string - - } else - if ((aret = argcmp(next_a, "VersionId")) == 0 || aret == '=' || aret == '.') { + s->is_set_force = 1; + if (!aa || !strcasecmp(aa, "true")) { + s->force = 1; + } else if (!strcasecmp(aa, "false")) { + s->force = 0; + } else { + BAD_RET("Force require true/false\n"); + } + } else + if ((aret = argcmp(next_a, "ProductTypeId")) == 0 || aret == '=' || aret == '.') { char *eq_ptr = strchr(next_a, '='); if (eq_ptr) { - TRY((!*eq_ptr), "VersionId argument missing\n"); + TRY((!*eq_ptr), "ProductTypeId argument missing\n"); aa = eq_ptr + 1; incr = 1; } - TRY(!aa, "VersionId argument missing\n"); - s->version_id = aa; // string string + TRY(!aa, "ProductTypeId argument missing\n"); + s->product_type_id = aa; // string string } else { - BAD_RET("'%s' is not a valide argument for 'DeletePolicyVersion'\n", next_a); + BAD_RET("'%s' is not a valide argument for 'DeleteProductType'\n", next_a); } i += incr; - goto delete_policy_version_arg; + goto delete_product_type_arg; } - cret = osc_delete_policy_version(&e, &r, &a); - TRY(cret, "fail to call DeletePolicyVersion: %s\n", curl_easy_strerror(cret)); + cret = osc_delete_product_type(&e, &r, &a); + TRY(cret, "fail to call DeleteProductType: %s\n", curl_easy_strerror(cret)); CHK_BAD_RET(!r.buf, "connection sucessful, but empty responce\n"); jobj = NULL; if (program_flag & OAPI_RAW_OUTPUT) @@ -38715,112 +39020,6 @@ int main(int ac, char **av) } osc_deinit_str(&r); } else - if (!strcmp("ReadSecretAccessKey", av[i])) { - auto_osc_json_c json_object *jobj = NULL; - auto_ptr_array struct ptr_array opa = {0}; - struct ptr_array *pa = &opa; - struct osc_read_secret_access_key_arg a = {0}; - struct osc_read_secret_access_key_arg *s = &a; - __attribute__((cleanup(files_cnt_cleanup))) char *files_cnt[MAX_FILES_PER_CMD] = {NULL}; - int cret; - - cascade_struct = NULL; - cascade_parser = NULL; - - read_secret_access_key_arg: - - if (i + 1 < ac && av[i + 1][0] == '.' && av[i + 1][1] == '.') { - char *next_a = &av[i + 1][2]; - char *aa = i + 2 < ac ? av[i + 2] : 0; - int incr = 2; - char *eq_ptr = strchr(next_a, '='); - - CHK_BAD_RET(!cascade_struct, "cascade need to be se first\n"); - if (eq_ptr) { - CHK_BAD_RET(!*eq_ptr, "cascade need an argument\n"); - incr = 1; - aa = eq_ptr + 1; - } else { - CHK_BAD_RET(!aa, "cascade need an argument\n"); - META_ARGS({CHK_BAD_RET(aa[0] == '-', "cascade need an argument"); }) - } - STRY(cascade_parser(cascade_struct, next_a, aa, pa)); - i += incr; - goto read_secret_access_key_arg; - } - - if (i + 1 < ac && av[i + 1][0] == '-' && av[i + 1][1] == '-' && strcmp(av[i + 1] + 2, "set-var")) { - char *next_a = &av[i + 1][2]; - char *str = next_a; - char *aa = i + 2 < ac ? av[i + 2] : 0; - int aret = 0; - int incr = aa ? 2 : 1; - - (void)str; - if (aa && aa[0] == '-' && aa[1] == '-' && aa[2] != '-') { - META_ARGS({ aa = 0; incr = 1; }); - } - if ((aret = argcmp(next_a, "AccessKeyId")) == 0 || aret == '=' || aret == '.') { - char *eq_ptr = strchr(next_a, '='); - if (eq_ptr) { - TRY((!*eq_ptr), "AccessKeyId argument missing\n"); - aa = eq_ptr + 1; - incr = 1; - } - TRY(!aa, "AccessKeyId argument missing\n"); - s->access_key_id = aa; // string string - - } else - if ((aret = argcmp(next_a, "DryRun")) == 0 || aret == '=' || aret == '.') { - char *eq_ptr = strchr(next_a, '='); - if (eq_ptr) { - TRY((!*eq_ptr), "DryRun argument missing\n"); - aa = eq_ptr + 1; - incr = 1; - } - s->is_set_dry_run = 1; - if (!aa || !strcasecmp(aa, "true")) { - s->dry_run = 1; - } else if (!strcasecmp(aa, "false")) { - s->dry_run = 0; - } else { - BAD_RET("DryRun require true/false\n"); - } - } else - { - BAD_RET("'%s' is not a valide argument for 'ReadSecretAccessKey'\n", next_a); - } - i += incr; - goto read_secret_access_key_arg; - } - cret = osc_read_secret_access_key(&e, &r, &a); - TRY(cret, "fail to call ReadSecretAccessKey: %s\n", curl_easy_strerror(cret)); - CHK_BAD_RET(!r.buf, "connection sucessful, but empty responce\n"); - jobj = NULL; - if (program_flag & OAPI_RAW_OUTPUT) - puts(r.buf); - else { - jobj = json_tokener_parse(r.buf); - puts(json_object_to_json_string_ext(jobj, - JSON_C_TO_STRING_PRETTY | JSON_C_TO_STRING_NOSLASHESCAPE | - color_flag)); - } - while (i + 1 < ac && !strcmp(av[i + 1], "--set-var")) { - ++i; - TRY(i + 1 >= ac, "--set-var require an argument"); - if (!jobj) - jobj = json_tokener_parse(r.buf); - if (parse_variable(jobj, av, ac, i)) - return -1; - ++i; - } - - if (jobj) { - json_object_put(jobj); - jobj = NULL; - } - osc_deinit_str(&r); - } else if (!strcmp("ReadSecurityGroups", av[i])) { auto_osc_json_c json_object *jobj = NULL; auto_ptr_array struct ptr_array opa = {0}; diff --git a/osc-sdk-C b/osc-sdk-C index 147d1b3..8c258de 160000 --- a/osc-sdk-C +++ b/osc-sdk-C @@ -1 +1 @@ -Subproject commit 147d1b3fd6c40cc9da3df09c719ddd5227c25e5c +Subproject commit 8c258debcf358173285b065c08f369a9a9c20f16 diff --git a/osc_sdk.c b/osc_sdk.c index 341ccdd..0b74ac1 100644 --- a/osc_sdk.c +++ b/osc_sdk.c @@ -153,6 +153,7 @@ static const char *calls_name[] = { "DeleteNic", "DeletePolicy", "DeletePolicyVersion", + "DeleteProductType", "DeletePublicIp", "DeleteRoute", "DeleteRouteTable", @@ -231,7 +232,6 @@ static const char *calls_name[] = { "ReadQuotas", "ReadRegions", "ReadRouteTables", - "ReadSecretAccessKey", "ReadSecurityGroups", "ReadServerCertificates", "ReadSnapshotExportTasks", @@ -334,9 +334,9 @@ static const char *calls_descriptions[] = { , "Usage: oapi-cli CreateImageExportTask --OsuExport=osuexport --ImageId=imageid [OPTIONS]\n" "Exports an OUTSCALE machine image (OMI) to an OUTSCALE Object Storage (OOS) \n" "bucket.\nThis enables you to copy an OMI between accounts in different \n" "Regions.\nThis action creates the necessary snapshots and manifest file in the \n" "bucket. The OMI can then be imported to another account using a pre-signed URL \n" "of its manifest file. For more information, see [Creating a Pre-Signed \n" "URL](https://docs.outscale.com/en/userguide/Creating-a-Pre-Signed-URL.html).\nTo\n" " copy an OMI in the same Region, you can also use the \n" "[CreateImage](#createimage) method.\n\n**[IMPORTANT]**\nYou cannot export a \n" "shared or public OMI, as they do not belong to you. To do so, you must first \n" "copy it to your account. The copy then belongs to you and you can export \n" "it.\nFor more information, see [About \n" "OMIs](https://docs.outscale.com/en/userguide/About-OMIs.html).\n" "\nRequired Argument: OsuExport ImageId \n" , - "Usage: oapi-cli CreateImage [OPTIONS]\n" "Creates an OUTSCALE machine image (OMI).\nYou can use this method in different \n" "ways:\n* **Creating from a VM**: You create an OMI from one of your virtual \n" "machines (VMs).
\n* **Copying an OMI**: You copy an existing OMI. The source \n" "OMI can be one of your own OMIs, or an OMI owned by another account that has \n" "granted you permission via the [UpdateImage](#updateimage) method.
\n* \n" "**Registering from a snapshot**: You register an OMI from an existing snapshot. \n" "The source snapshot can be one of your own snapshots, or a snapshot owned by \n" "another account that has granted you permission via the \n" "[UpdateSnapshot](#updatesnapshot) method.
\n* **Registering from a bucket by \n" "using a manifest file**: You register an OMI from the manifest file of an OMI \n" "that was exported to an OUTSCALE Object Storage (OOS) bucket. First, the owner \n" "of the source OMI must export it to the bucket by using the \n" "[CreateImageExportTask](#createimageexporttask) method. Then, they must grant \n" "you permission to read the manifest file via a pre-signed URL. For more \n" "information, see [Creating a Pre-Signed \n" "URL](https://docs.outscale.com/en/userguide/Creating-a-Pre-Signed-URL.html).\n\n\n" "**[TIP]**\nRegistering from a bucket enables you to copy an OMI across \n" "Regions.\n\nFor more information, see [About \n" "OMIs](https://docs.outscale.com/en/userguide/About-OMIs.html).\n" "\nRequired Argument: null \n" + "Usage: oapi-cli CreateImage [OPTIONS]\n" "Creates an OUTSCALE machine image (OMI).\nYou can use this method for different \n" "use cases:\n* **Creating from a VM**: You create an OMI from one of your \n" "virtual machines (VMs).
\n* **Copying an OMI**: You copy an existing OMI. \n" "The source OMI can be one of your own OMIs, or an OMI owned by another account \n" "that has granted you permission via the [UpdateImage](#updateimage) \n" "method.
\n* **Registering from a snapshot**: You register an OMI from an \n" "existing snapshot. The source snapshot can be one of your own snapshots, or a \n" "snapshot owned by another account that has granted you permission via the \n" "[UpdateSnapshot](#updatesnapshot) method.
\n* **Registering from a bucket by \n" "using a manifest file**: You register an OMI from the manifest file of an OMI \n" "that was exported to an OUTSCALE Object Storage (OOS) bucket. First, the owner \n" "of the source OMI must export it to the bucket by using the \n" "[CreateImageExportTask](#createimageexporttask) method. Then, they must grant \n" "you permission to read the manifest file via a pre-signed URL. For more \n" "information, see [Creating a Pre-Signed \n" "URL](https://docs.outscale.com/en/userguide/Creating-a-Pre-Signed-URL.html).\n\n\n" "**[TIP]**\nRegistering from a bucket enables you to copy an OMI across \n" "Regions.\n\nFor more information, see [About \n" "OMIs](https://docs.outscale.com/en/userguide/About-OMIs.html).\n" "\nRequired Argument: null \n" , - "Usage: oapi-cli CreateInternetService [OPTIONS]\n" "Creates an Internet service you can use with a Net.\nAn Internet service \n" "enables virtual machines (VMs) launched in a Net to connect to the Internet. It \n" "allows routing of incoming and outgoing Internet traffic and management of \n" "public IP addresses.\nFor more information, see [About Internet \n" "Services](https://docs.outscale.com/en/userguide/About-Internet-Services.html).\n" "\nRequired Argument: null \n" + "Usage: oapi-cli CreateInternetService [OPTIONS]\n" "Creates an internet service you can use with a Net.\nAn internet service \n" "enables virtual machines (VMs) launched in a Net to connect to the Internet. It \n" "allows routing of incoming and outgoing Internet traffic and management of \n" "public IP addresses.\nFor more information, see [About Internet \n" "Services](https://docs.outscale.com/en/userguide/About-Internet-Services.html).\n" "\nRequired Argument: null \n" , "Usage: oapi-cli CreateKeypair --KeypairName=keypairname [OPTIONS]\n" "Creates a keypair to use with your virtual machines (VMs).\nYou can use this \n" "method in two different ways:\n* **Creating a keypair**: In that case, 3DS \n" "OUTSCALE creates a 2048-bit RSA keypair, stores its public key in your account, \n" "and returns its private key in the response of the call so that you can save it \n" "in a file.\nWhen you save the returned private key, make sure you replace the \n" "`\\n` escape sequences with real line breaks.\n* **Importing a keypair created \n" "locally**: If you already have a keypair that you have created locally with a \n" "third-party tool, you can import its public key in your account. The following \n" "types of key can be imported: RSA (2048 bits or preferably 4096 bits), Ed25519, \n" "and ECDSA (256 bits, 384 bits, or 521 bits). The following formats can be used: \n" "PEM, PKCS8, RFC4716, and OpenSSH.\n\nFor more information, see [About \n" "Keypairs](https://docs.outscale.com/en/userguide/About-Keypairs.html).\n" "\nRequired Argument: KeypairName \n" , @@ -384,7 +384,7 @@ static const char *calls_descriptions[] = { , "Usage: oapi-cli CreateSubnet --IpRange=iprange --NetId=netid [OPTIONS]\n" "Creates a Subnet in an existing Net.\nTo create a Subnet in a Net, you have to \n" "provide the ID of the Net and the IP range for the Subnet (its network range). \n" "Once the Subnet is created, you cannot modify its IP range.\nFor more \n" "information, see [About \n" "Nets](https://docs.outscale.com/en/userguide/About-Nets.html).\n" "\nRequired Argument: IpRange NetId \n" , - "Usage: oapi-cli CreateTags --ResourceIds=resourceids --Tags=tags [OPTIONS]\n" "Adds one or more tags to the specified resources.\nIf a tag with the same key \n" "already exists for the resource, the tag value is replaced.\nYou can tag the \n" "following resources using their IDs:\n\n* Virtual machines (VMs) \n" "(i-xxxxxxxx)\n* OMIs (ami-xxxxxxxx)\n* Volumes (vol-xxxxxxxx)\n* Snapshots \n" "(snap-xxxxxxxx)\n* Public IPs (eipalloc-xxxxxxxx)\n* Security groups \n" "(sg-xxxxxxxx)\n* Route tables (rtb-xxxxxxxx)\n* Network interface cards (NIC) \n" "(eni-xxxxxxxx)\n* Nets (vpc-xxxxxxxx)\n* Subnets (subnet-xxxxxxxx)\n* Net \n" "peerings (vpcx-xxxxxxxx)\n* Net endpoints (vpce-xxxxxxxx)\n* NAT services \n" "(nat-xxxxxxxx)\n* Internet services (igw-xxxxxxxx)\n* Client gateways \n" "(cgw-xxxxxxxx)\n* Virtual gateways (vgw-xxxxxxxx)\n* VPN connections \n" "(vpn-xxxxxxxx)\n* DHCP options (dopt-xxxxxxxx)\n* OMI export tasks \n" "(image-export-xxxxxxxx)\n* Snapshot export tasks (snap-export-xxxxxxxx)\n\nFor \n" "more information, see [About \n" "Tags](https://docs.outscale.com/en/userguide/About-Tags.html).\n" "\nRequired Argument: ResourceIds Tags \n" + "Usage: oapi-cli CreateTags --ResourceIds=resourceids --Tags=tags [OPTIONS]\n" "Adds one or more tags to the specified resources.\nIf a tag with the same key \n" "already exists for the resource, the tag value is replaced.\nYou can tag the \n" "following resources using their IDs:\n\n* Client gateways (cgw-xxxxxxxx)\n* \n" "DHCP options (dopt-xxxxxxxx)\n* Images (ami-xxxxxxxx)\n* Internet services \n" "(igw-xxxxxxxx)\n* Keypairs (key-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx)\n* NAT \n" "services (nat-xxxxxxxx)\n* Net endpoints (vpce-xxxxxxxx)\n* Net peerings \n" "(vpcx-xxxxxxxx)\n* Nets (vpc-xxxxxxxx)\n* Network interface cards (NIC) \n" "(eni-xxxxxxxx)\n* OMI export tasks (image-export-xxxxxxxx)\n* OMIs \n" "(ami-xxxxxxxx)\n* Public IPs (eipalloc-xxxxxxxx)\n* Route tables \n" "(rtb-xxxxxxxx)\n* Security groups (sg-xxxxxxxx)\n* Snapshot export tasks \n" "(snap-export-xxxxxxxx)\n* Snapshots (snap-xxxxxxxx)\n* Subnets \n" "(subnet-xxxxxxxx)\n* Virtual gateways (vgw-xxxxxxxx)\n* Virtual machines (VMs) \n" "(i-xxxxxxxx)\n* Volumes (vol-xxxxxxxx)\n* VPN connections (vpn-xxxxxxxx)\n\nFor \n" "more information, see [About \n" "Tags](https://docs.outscale.com/en/userguide/About-Tags.html).\n" "\nRequired Argument: ResourceIds Tags \n" , "Usage: oapi-cli CreateUserGroup --UserGroupName=usergroupname [OPTIONS]\n" "Creates a group to which you can add users.\nYou can also add an inline policy \n" "or link a managed policy to the group, which is applied to all its users.\n" "\nRequired Argument: UserGroupName \n" , @@ -406,7 +406,7 @@ static const char *calls_descriptions[] = { , "Usage: oapi-cli DeleteAccessKey --AccessKeyId=accesskeyid [OPTIONS]\n" "Deletes the specified access key of either your root account or an EIM \n" "user.\nThe access key of an EIM user must be in the `INACTIVE` state to be \n" "deleted.\n" "\nRequired Argument: AccessKeyId \n" , - "Usage: oapi-cli DeleteApiAccessRule --ApiAccessRuleId=apiaccessruleid [OPTIONS]\n" "Deletes a specified API access rule.\n\n**[IMPORTANT]** \nYou cannot delete the \n" "last remaining API access rule. However, if you delete all the API access rules \n" "that allow you to access the APIs, you need to contact the Support team to \n" "regain access. For more information, see [Technical \n" "Support](https://docs.outscale.com/en/userguide/Technical-Support.html).\n" "\nRequired Argument: ApiAccessRuleId \n" + "Usage: oapi-cli DeleteApiAccessRule --ApiAccessRuleId=apiaccessruleid [OPTIONS]\n" "Deletes a specified API access rule.\n\n**[IMPORTANT]**\nYou cannot delete the \n" "last remaining API access rule. However, if you delete all the API access rules \n" "that allow you to access the APIs, you need to contact the Support team to \n" "regain access. For more information, see [Technical \n" "Support](https://docs.outscale.com/en/userguide/Technical-Support.html).\n" "\nRequired Argument: ApiAccessRuleId \n" , "Usage: oapi-cli DeleteCa --CaId=caid [OPTIONS]\n" "Deletes a specified Client Certificate Authority (CA).\n" "\nRequired Argument: CaId \n" , @@ -426,9 +426,9 @@ static const char *calls_descriptions[] = { , "Usage: oapi-cli DeleteImage --ImageId=imageid [OPTIONS]\n" "Deletes an OUTSCALE machine image (OMI) so that you cannot use it anymore to \n" "launch virtual machines (VMs). However, you can still use VMs already launched \n" "from this OMI.\n" "\nRequired Argument: ImageId \n" , - "Usage: oapi-cli DeleteInternetService --InternetServiceId=internetserviceid [OPTIONS]\n" "Deletes an Internet service.\nBefore deleting an Internet service, you must \n" "detach it from any Net it is attached to.\n" "\nRequired Argument: InternetServiceId \n" + "Usage: oapi-cli DeleteInternetService --InternetServiceId=internetserviceid [OPTIONS]\n" "Deletes an internet service.\nBefore deleting an internet service, you must \n" "detach it from any Net it is attached to.\n" "\nRequired Argument: InternetServiceId \n" , - "Usage: oapi-cli DeleteKeypair --KeypairName=keypairname [OPTIONS]\n" "Deletes the specified keypair.\nThis action deletes the public key stored by \n" "3DS OUTSCALE, thus deleting the keypair.\n" "\nRequired Argument: KeypairName \n" + "Usage: oapi-cli DeleteKeypair [OPTIONS]\n" "Deletes the specified keypair.\nThis action deletes the public key stored by \n" "3DS OUTSCALE, thus deleting the keypair.\n" "\nRequired Argument: null \n" , "Usage: oapi-cli DeleteListenerRule --ListenerRuleName=listenerrulename [OPTIONS]\n" "Deletes a listener rule.\nThe previously active rule is disabled after deletion.\n" "\nRequired Argument: ListenerRuleName \n" , @@ -446,13 +446,15 @@ static const char *calls_descriptions[] = { , "Usage: oapi-cli DeleteNetPeering --NetPeeringId=netpeeringid [OPTIONS]\n" "Deletes a Net peering.\nIf the Net peering is in the `active` state, it can be \n" "deleted either by the owner of the requester Net or the owner of the peer \n" "Net.\nIf it is in the `pending-acceptance` state, it can be deleted only by the \n" "owner of the requester Net.\nIf it is in the `rejected`, `failed`, or `expired` \n" "states, it cannot be deleted.\n" "\nRequired Argument: NetPeeringId \n" , - "Usage: oapi-cli DeleteNet --NetId=netid [OPTIONS]\n" "Deletes a specified Net.\nBefore deleting the Net, you need to delete or detach \n" "all the resources associated with the Net:\n\n* Virtual machines (VMs)\n* Net \n" "peerings\n* Custom route tables\n* Public IPs allocated to resources in the \n" "Net\n* Network Interface Cards (NICs) created in the Subnets\n* Virtual \n" "gateways, Internet services and NAT services\n* Load balancers\n* Security \n" "groups\n* Subnets\n" "\nRequired Argument: NetId \n" + "Usage: oapi-cli DeleteNet --NetId=netid [OPTIONS]\n" "Deletes a specified Net.\nBefore deleting the Net, you need to delete or detach \n" "all the resources associated with the Net:\n\n* Virtual machines (VMs)\n* Net \n" "peerings\n* Custom route tables\n* Public IPs allocated to resources in the \n" "Net\n* Network Interface Cards (NICs) created in the Subnets\n* Virtual \n" "gateways, internet services and NAT services\n* Load balancers\n* Security \n" "groups\n* Subnets\n" "\nRequired Argument: NetId \n" , "Usage: oapi-cli DeleteNic --NicId=nicid [OPTIONS]\n" "Deletes the specified network interface card (NIC).\nThe network interface must \n" "not be attached to any virtual machine (VM).\n" "\nRequired Argument: NicId \n" , - "Usage: oapi-cli DeletePolicy --PolicyOrn=policyorn [OPTIONS]\n" "Deletes a managed policy.\nBefore deleting a managed policy, you must unlink \n" "all users linked to it and delete all the versions of the policy using the \n" "`DeletePolicyVersion` method.\n" "\nRequired Argument: PolicyOrn \n" + "Usage: oapi-cli DeletePolicy --PolicyOrn=policyorn [OPTIONS]\n" "Deletes a managed policy.\nBefore deleting a managed policy, you must unlink \n" "all users linked to it and delete all the versions of the policy, except the \n" "default one, using the `DeletePolicyVersion` method.\n" "\nRequired Argument: PolicyOrn \n" , "Usage: oapi-cli DeletePolicyVersion --PolicyOrn=policyorn --VersionId=versionid [OPTIONS]\n" "Deletes a specified version of a managed policy, if it is not set as the \n" "default one.\n" "\nRequired Argument: PolicyOrn VersionId \n" +, + "Usage: oapi-cli DeleteProductType --ProductTypeId=producttypeid [OPTIONS]\n" "Deletes a specified product type that belongs to you.\n\n**[WARNING]**\nThe \n" "product type must not be associated with one or more OMIs to be deleted. \n" "Otherwise, you need to force the deletion.\nIf you force the deletion, the \n" "product type is deleted and remains associated with the OMIs.\n" "\nRequired Argument: ProductTypeId \n" , "Usage: oapi-cli DeletePublicIp [OPTIONS]\n" "Releases a public IP.\nYou can release a public IP associated with your \n" "account. This address is released in the public IP pool and can be used by \n" "someone else. Before releasing a public IP, ensure you updated all your \n" "resources communicating with this address.\n" "\nRequired Argument: null \n" , @@ -496,7 +498,7 @@ static const char *calls_descriptions[] = { , "Usage: oapi-cli LinkFlexibleGpu --FlexibleGpuId=flexiblegpuid --VmId=vmid [OPTIONS]\n" "Attaches one of your allocated flexible GPUs (fGPUs) to one of your virtual \n" "machines (VMs).\nTo complete the linking of the fGPU, you need to do a \n" "stop/start of the VM. A simple restart is not sufficient, as the linking of the \n" "fGPU is done when the VM goes through the `stopped` state. For the difference \n" "between stop/start and restart, see [About VM \n" "Lifecycle](https://docs.outscale.com/en/userguide/About-VM-Lifecycle.html).\n\n*\n" "*[NOTE]**\nYou can attach fGPUs only to VMs with the `highest` (1) performance \n" "flag. For more information see [About Flexible \n" "GPUs](https://docs.outscale.com/en/userguide/About-Flexible-GPUs.html) and [VM \n" "Types](https://docs.outscale.com/en/userguide/VM-Types.html).\n" "\nRequired Argument: FlexibleGpuId VmId \n" , - "Usage: oapi-cli LinkInternetService --InternetServiceId=internetserviceid --NetId=netid [OPTIONS]\n" "Attaches an Internet service to a Net.\nTo enable the connection between the \n" "Internet and a Net, you must attach an Internet service to this Net.\n" "\nRequired Argument: InternetServiceId NetId \n" + "Usage: oapi-cli LinkInternetService --InternetServiceId=internetserviceid --NetId=netid [OPTIONS]\n" "Attaches an internet service to a Net.\nTo enable the connection between the \n" "Internet and a Net, you must attach an internet service to this Net.\n" "\nRequired Argument: InternetServiceId NetId \n" , "Usage: oapi-cli LinkLoadBalancerBackendMachines --LoadBalancerName=loadbalancername [OPTIONS]\n" "Attaches one or more virtual machines (VMs) to a specified load balancer. You \n" "need to specify at least the `BackendIps` or the `BackendVmIds` parameter.\nThe \n" "VMs can be in different Subnets and different Subregions than the load \n" "balancer, as long as the VMs and load balancers are all in the public Cloud or \n" "all in the same Net. It may take a little time for a VM to be registered with \n" "the load balancer. Once the VM is registered with a load balancer, it receives \n" "traffic and requests from this load balancer and is called a backend VM.\n" "\nRequired Argument: LoadBalancerName \n" , @@ -508,7 +510,7 @@ static const char *calls_descriptions[] = { , "Usage: oapi-cli LinkPrivateIps --NicId=nicid [OPTIONS]\n" "Assigns one or more secondary private IPs to a specified network interface card \n" "(NIC). This action is only available in a Net. The private IPs to be assigned \n" "can be added individually using the `PrivateIps` parameter, or you can specify \n" "the number of private IPs to be automatically chosen within the Subnet range \n" "using the `SecondaryPrivateIpCount` parameter. You can specify only one of \n" "these two parameters. If none of these parameters are specified, a private IP \n" "is chosen within the Subnet range.\n" "\nRequired Argument: NicId \n" , - "Usage: oapi-cli LinkPublicIp [OPTIONS]\n" "Associates a public IP with a virtual machine (VM) or a network interface card \n" "(NIC), in the public Cloud or in a Net. You can associate a public IP with only \n" "one VM or network interface at a time.\nTo associate a public IP in a Net, \n" "ensure that the Net has an Internet service attached. For more information, see \n" "the [LinkInternetService](#linkinternetservice) method.\nBy default, the public \n" "IP is disassociated every time you stop and start the VM. For a persistent \n" "association, you can add the `osc.fcu.eip.auto-attach` tag to the VM with the \n" "public IP as value. For more information, see the [CreateTags](#createtags) \n" "method.\n\n**[IMPORTANT]**\nYou can associate a public IP with a network \n" "address translation (NAT) service only when creating the NAT service. To modify \n" "its public IP, you need to delete the NAT service and re-create it with the new \n" "public IP. For more information, see the [CreateNatService](#createnatservice) \n" "method.\n" "\nRequired Argument: null \n" + "Usage: oapi-cli LinkPublicIp [OPTIONS]\n" "Associates a public IP with a virtual machine (VM) or a network interface card \n" "(NIC), in the public Cloud or in a Net. You can associate a public IP with only \n" "one VM or network interface at a time.\nTo associate a public IP in a Net, \n" "ensure that the Net has an internet service attached. For more information, see \n" "the [LinkInternetService](#linkinternetservice) method.\nBy default, the public \n" "IP is disassociated every time you stop and start the VM. For a persistent \n" "association, you can add the `osc.fcu.eip.auto-attach` tag to the VM with the \n" "public IP as value. For more information, see the [CreateTags](#createtags) \n" "method.\n\n**[IMPORTANT]**\nYou can associate a public IP with a network \n" "address translation (NAT) service only when creating the NAT service. To modify \n" "its public IP, you need to delete the NAT service and re-create it with the new \n" "public IP. For more information, see the [CreateNatService](#createnatservice) \n" "method.\n" "\nRequired Argument: null \n" , "Usage: oapi-cli LinkRouteTable --RouteTableId=routetableid --SubnetId=subnetid [OPTIONS]\n" "Associates a Subnet with a route table.\nThe Subnet and the route table must be \n" "in the same Net. The traffic is routed according to the route table defined \n" "within this Net. You can associate a route table with several Subnets.\n" "\nRequired Argument: RouteTableId SubnetId \n" , @@ -538,7 +540,7 @@ static const char *calls_descriptions[] = { , "Usage: oapi-cli ReadClientGateways [OPTIONS]\n" "Lists one or more of your client gateways.\n" "\nRequired Argument: null \n" , - "Usage: oapi-cli ReadConsoleOutput --VmId=vmid [OPTIONS]\n" "Gets the console output for a virtual machine (VM). This console provides the \n" "most recent 64 KiB output.\n\n**[IMPORTANT]**\nOn Windows VMs, the console is \n" "handled only on the first boot. It returns no output after the first boot.\n" "\nRequired Argument: VmId \n" + "Usage: oapi-cli ReadConsoleOutput --VmId=vmid [OPTIONS]\n" "Gets the console output for a virtual machine (VM). This console is not in \n" "real-time. It is refreshed every two seconds and provides the most recent 64 \n" "KiB output.\n\n**[IMPORTANT]**\nOn Windows VMs, the console is handled only on \n" "the first boot. It returns no output after the first boot.\n" "\nRequired Argument: VmId \n" , "Usage: oapi-cli ReadConsumptionAccount --FromDate=fromdate --ToDate=todate [OPTIONS]\n" "Gets information about the consumption of your account for each billable \n" "resource within the specified time period.\n" "\nRequired Argument: FromDate ToDate \n" , @@ -560,7 +562,7 @@ static const char *calls_descriptions[] = { , "Usage: oapi-cli ReadImages [OPTIONS]\n" "Lists one or more OUTSCALE machine images (OMIs) you can use.\n" "\nRequired Argument: null \n" , - "Usage: oapi-cli ReadInternetServices [OPTIONS]\n" "Lists one or more of your Internet services.\nAn Internet service enables \n" "virtual machines (VMs) launched in a Net to connect to the Internet. It allows \n" "routing of incoming and outgoing Internet traffic and management of public IP \n" "addresses.\n" "\nRequired Argument: null \n" + "Usage: oapi-cli ReadInternetServices [OPTIONS]\n" "Lists one or more of your internet services.\nAn internet service enables \n" "virtual machines (VMs) launched in a Net to connect to the Internet. It allows \n" "routing of incoming and outgoing Internet traffic and management of public IP \n" "addresses.\n" "\nRequired Argument: null \n" , "Usage: oapi-cli ReadKeypairs [OPTIONS]\n" "Lists one or more of your keypairs.\n" "\nRequired Argument: null \n" , @@ -609,8 +611,6 @@ static const char *calls_descriptions[] = { "Usage: oapi-cli ReadRegions [OPTIONS]\n" "Lists one or more Regions of the OUTSCALE Cloud.\nFor more information, see \n" "[About Regions and \n" "Subregions](https://docs.outscale.com/en/userguide/About-Regions-and-Subregions.\n" "html).\n" "\nRequired Argument: null \n" , "Usage: oapi-cli ReadRouteTables [OPTIONS]\n" "Lists one or more of your route tables.\nIn your Net, each Subnet must be \n" "associated with a route table. If a Subnet is not explicitly associated with a \n" "route table, it is implicitly associated with the main route table of the Net.\n" "\nRequired Argument: null \n" -, - "Usage: oapi-cli ReadSecretAccessKey --AccessKeyId=accesskeyid [OPTIONS]\n" "> [WARNING]\n> Deprecated: This call will be removed after October 1, \n" "2024.\n\nLists information about the specified access key of your root account, \n" "including its secret key.\n" "\nRequired Argument: AccessKeyId \n" , "Usage: oapi-cli ReadSecurityGroups [OPTIONS]\n" "Lists one or more security groups.\nYou can specify either the name of the \n" "security groups or their IDs.\n" "\nRequired Argument: null \n" , @@ -636,9 +636,9 @@ static const char *calls_descriptions[] = { , "Usage: oapi-cli ReadUserGroupsPerUser --UserName=username [OPTIONS]\n" "Lists the groups a specified user belongs to.\n" "\nRequired Argument: UserName \n" , - "Usage: oapi-cli ReadUserGroups [OPTIONS]\n" "Lists the groups with the specified path prefix.\nIf you do not specify any \n" "path prefix, this action returns all the groups (or an empty list if there are \n" "none).\n" "\nRequired Argument: null \n" + "Usage: oapi-cli ReadUserGroups [OPTIONS]\n" "Lists all the user groups of the account.\nThe response can be filtered using \n" "either the PathPrefix or the UserGroupIds.\n" "\nRequired Argument: null \n" , - "Usage: oapi-cli ReadUsers [OPTIONS]\n" "Lists all EIM users that have a specified path.\nIf you do not specify a path, \n" "this action returns a list of all users in the account (or an empty list if \n" "there are none).\n" "\nRequired Argument: null \n" + "Usage: oapi-cli ReadUsers [OPTIONS]\n" "Lists all EIM users in the account.\nThe response can be filtered using the \n" "UserIds.\n" "\nRequired Argument: null \n" , "Usage: oapi-cli ReadVirtualGateways [OPTIONS]\n" "Lists one or more virtual gateways.\n" "\nRequired Argument: null \n" , @@ -678,7 +678,7 @@ static const char *calls_descriptions[] = { , "Usage: oapi-cli UnlinkFlexibleGpu --FlexibleGpuId=flexiblegpuid [OPTIONS]\n" "Detaches a flexible GPU (fGPU) from a virtual machine (VM).\nThe fGPU is in the \n" "`detaching` state until the VM is stopped, after which it becomes `allocated`. \n" "It is then available again for attachment to a VM.\n" "\nRequired Argument: FlexibleGpuId \n" , - "Usage: oapi-cli UnlinkInternetService --InternetServiceId=internetserviceid --NetId=netid [OPTIONS]\n" "Detaches an Internet service from a Net.\nThis action disables and detaches an \n" "Internet service from a Net. The Net must not contain virtual machines (VMs) \n" "using public IPs nor internet-facing load balancers.\n" "\nRequired Argument: InternetServiceId NetId \n" + "Usage: oapi-cli UnlinkInternetService --InternetServiceId=internetserviceid --NetId=netid [OPTIONS]\n" "Detaches an internet service from a Net.\nThis action disables and detaches an \n" "internet service from a Net. The Net must not contain virtual machines (VMs) \n" "using public IPs nor internet-facing load balancers.\n" "\nRequired Argument: InternetServiceId NetId \n" , "Usage: oapi-cli UnlinkLoadBalancerBackendMachines --LoadBalancerName=loadbalancername [OPTIONS]\n" "Detaches one or more backend virtual machines (VMs) from a load balancer. You \n" "need to specify at least the `BackendIps` or the `BackendVmIds` parameter.\n" "\nRequired Argument: LoadBalancerName \n" , @@ -698,13 +698,13 @@ static const char *calls_descriptions[] = { , "Usage: oapi-cli UnlinkVolume --VolumeId=volumeid [OPTIONS]\n" "Detaches a Block Storage Unit (BSU) volume from a virtual machine (VM).\nTo \n" "detach the root device of a VM, this VM must be stopped.\n" "\nRequired Argument: VolumeId \n" , - "Usage: oapi-cli UpdateAccessKey --AccessKeyId=accesskeyid --State=state [OPTIONS]\n" "Modifies the attributes of the specified access key of either your root account \n" "or an EIM user.\n" "\nRequired Argument: AccessKeyId State \n" + "Usage: oapi-cli UpdateAccessKey --AccessKeyId=accesskeyid --State=state [OPTIONS]\n" "Modifies the attributes of the specified access key of either your root account \n" "or an EIM user.\nThe parameter `ExpirationDate` is not required when updating \n" "the state of your access key. However, if you do not specify the expiration \n" "date of an access key when updating its state, it is then set to not expire.\n" "\nRequired Argument: AccessKeyId State \n" , "Usage: oapi-cli UpdateAccount [OPTIONS]\n" "Updates the account information for the account that sends the request.\n" "\nRequired Argument: null \n" , "Usage: oapi-cli UpdateApiAccessPolicy --MaxAccessKeyExpirationSeconds=maxaccesskeyexpirationseconds --RequireTrustedEnv=requiretrustedenv [OPTIONS]\n" "Updates the API access policy of your account.\n\n**[IMPORTANT]**\nOnly one API \n" "access policy can be associated with your account.\n" "\nRequired Argument: MaxAccessKeyExpirationSeconds RequireTrustedEnv \n" , - "Usage: oapi-cli UpdateApiAccessRule --ApiAccessRuleId=apiaccessruleid [OPTIONS]\n" "Modifies a specified API access rule.\n\n**[WARNING]** \n- The new rule you \n" "specify fully replaces the old rule. Therefore, for a parameter that is not \n" "specified, any previously set value is deleted.\n- If, as result of your \n" "modification, you no longer have access to the APIs, you will need to contact \n" "the Support team to regain access. For more information, see [Technical \n" "Support](https://docs.outscale.com/en/userguide/Technical-Support.html).\n" "\nRequired Argument: ApiAccessRuleId \n" + "Usage: oapi-cli UpdateApiAccessRule --ApiAccessRuleId=apiaccessruleid [OPTIONS]\n" "Modifies a specified API access rule.\n\n**[WARNING]**\n- The new rule you \n" "specify fully replaces the old rule. Therefore, for a parameter that is not \n" "specified, any previously set value is deleted.\n- If, as result of your \n" "modification, you no longer have access to the APIs, you will need to contact \n" "the Support team to regain access. For more information, see [Technical \n" "Support](https://docs.outscale.com/en/userguide/Technical-Support.html).\n" "\nRequired Argument: ApiAccessRuleId \n" , "Usage: oapi-cli UpdateCa --CaId=caid [OPTIONS]\n" "Modifies the specified attribute of a Client Certificate Authority (CA).\n" "\nRequired Argument: CaId \n" , @@ -848,8 +848,9 @@ static const char *calls_args_descriptions[] = { "--BgpAsn: long long int\n" " The Autonomous System Number (ASN) used by the Border Gateway Protocol (BGP) to find the \n" " path to your client gateway through the Internet.
\nThis number must be between `1` \n" - " and `4294967295`. If you do not have an ASN, you can choose one between 64512 and 65534, or \n" - " between 4200000000 and 4294967294.\n" + " and `4294967295`, except `50624`, `53306`, and `132418`.
\nIf you do not have an ASN, \n" + " you can choose one between `64512` and `65534` (both included), or between `4200000000` and \n" + " `4294967295` (both included).\n" "--ConnectionType: string\n" " The communication protocol used to establish tunnel with your client gateway (always \n" " `ipsec.1`).\n" @@ -954,9 +955,9 @@ static const char *calls_args_descriptions[] = { " The prefix for the key of the OOS object.\n" , "--Architecture: string\n" - " **(when registering from a snapshot)** The architecture of the OMI (`i386` or `x86_64`).\n" + " **When registering from a snapshot:** The architecture of the OMI (`i386` or `x86_64`).\n" "--BlockDeviceMappings: array ref BlockDeviceMappingImage\n" - " **(when registering from a snapshot)** One or more block device mappings.\n" + " **(required) When registering from a snapshot:** One or more block device mappings.\n" " One or more parameters used to automatically set up volumes when the VM \n" " is created.\n" " --BlockDeviceMappings.INDEX.Bsu: ref BsuToCreate\n" @@ -994,26 +995,28 @@ static const char *calls_args_descriptions[] = { "--DryRun: bool\n" " If true, checks whether you have the required permissions to perform the action.\n" "--FileLocation: string\n" - " **(when registering from a bucket by using a manifest file)** The pre-signed URL of the \n" - " manifest file for the OMI you want to register. For more information, see [Creating a \n" - " Pre-signed URL](https://docs.outscale.com/en/userguide/Creating-a-Pre-Signed-URL.html).\n" + " **(required) When registering from a bucket by using a manifest file:** The pre-signed URL \n" + " of the manifest file for the OMI you want to register. For more information, see [Creating \n" + " a Pre-signed URL](https://docs.outscale.com/en/userguide/Creating-a-Pre-Signed-URL.html).\n" "--ImageName: string\n" " A unique name for the new OMI.\nConstraints: 3-128 alphanumeric characters, underscores \n" " (`_`), spaces (` `), parentheses (`()`), slashes (`/`), periods (`.`), or dashes (`-`).\n" "--NoReboot: bool\n" - " **(when creating from a VM)** If false, the VM shuts down before creating the OMI and then \n" + " **When creating from a VM:** If false, the VM shuts down before creating the OMI and then \n" " reboots. If true, the VM does not.\n" "--ProductCodes: array string\n" " The product codes associated with the OMI.\n" "--RootDeviceName: string\n" - " **(when registering from a snapshot)** The name of the root device for the new OMI.\n" + " **(required) When registering from a snapshot:** The name of the root device for the new \n" + " OMI.\n" "--SourceImageId: string\n" - " **(when copying an OMI)** The ID of the OMI you want to copy.\n" + " **(required) When copying an OMI:** The ID of the OMI you want to copy.\n" "--SourceRegionName: string\n" - " **(when copying an OMI)** The name of the source Region (always the same as the Region of \n" - " your account).\n" + " **(required) When copying an OMI:** The name of the source Region (always the same as the \n" + " Region of your account).\n" "--VmId: string\n" - " **(when creating from a VM)** The ID of the VM from which you want to create the OMI.\n" + " **(required) When creating from a VM:** The ID of the VM from which you want to create the \n" + " OMI.\n" , "--DryRun: bool\n" " If true, checks whether you have the required permissions to perform the action.\n" @@ -1179,10 +1182,13 @@ static const char *calls_args_descriptions[] = { " The name of the service (in the format `com.outscale.region.service`).\n" , "--AccepterNetId: string\n" - " The ID of the Net you want to connect with.\n" + " The ID of the Net you want to connect with.

\nIf the Net does not belong to \n" + " you, you must also specify the `AccepterOwnerId` parameter with the account ID owning the \n" + " Net you want to connect with.\n" "--AccepterOwnerId: string\n" " The account ID of the owner of the Net you want to connect with. By default, the account ID \n" - " of the owner of the Net from which the peering request is sent.\n" + " of the owner of the Net from which the peering request is sent.
\nThis parameter is \n" + " required if the Net you want to connect with does not belong to you.\n" "--DryRun: bool\n" " If true, checks whether you have the required permissions to perform the action.\n" "--SourceNetId: string\n" @@ -1219,8 +1225,9 @@ static const char *calls_args_descriptions[] = { "--Description: string\n" " A description for the policy.\n" "--Document: string\n" - " The policy document, corresponding to a JSON string that contains the policy. For more \n" - " information, see [EIM Reference \n" + " The policy document, corresponding to a JSON string that contains the policy. This policy \n" + " document can contain a maximum of 5120 non-whitespace characters. For more information, see \n" + " [EIM Reference \n" " Information](https://docs.outscale.com/en/userguide/EIM-Reference-Information.html) and \n" " [EIM Policy Generator](https://docs.outscale.com/en/userguide/EIM-Policy-Generator.html).\n" "--DryRun: bool\n" @@ -1231,8 +1238,9 @@ static const char *calls_args_descriptions[] = { " The name of the policy.\n" , "--Document: string\n" - " The policy document, corresponding to a JSON string that contains the policy. For more \n" - " information, see [EIM Reference \n" + " The policy document, corresponding to a JSON string that contains the policy. This policy \n" + " document can contain a maximum of 5120 non-whitespace characters. For more information, see \n" + " [EIM Reference \n" " Information](https://docs.outscale.com/en/userguide/EIM-Reference-Information.html) and \n" " [EIM Policy Generator](https://docs.outscale.com/en/userguide/EIM-Policy-Generator.html).\n" "--PolicyOrn: string\n" @@ -1257,7 +1265,7 @@ static const char *calls_args_descriptions[] = { "--DryRun: bool\n" " If true, checks whether you have the required permissions to perform the action.\n" "--GatewayId: string\n" - " The ID of an Internet service or virtual gateway attached to your Net.\n" + " The ID of an internet service or virtual gateway attached to your Net.\n" "--NatServiceId: string\n" " The ID of a NAT service.\n" "--NetPeeringId: string\n" @@ -1757,10 +1765,12 @@ static const char *calls_args_descriptions[] = { "--DryRun: bool\n" " If true, checks whether you have the required permissions to perform the action.\n" "--InternetServiceId: string\n" - " The ID of the Internet service you want to delete.\n" + " The ID of the internet service you want to delete.\n" , "--DryRun: bool\n" " If true, checks whether you have the required permissions to perform the action.\n" +"--KeypairId: string\n" + " The ID of the keypair you want to delete.\n" "--KeypairName: string\n" " The name of the keypair you want to delete.\n" , @@ -1838,6 +1848,13 @@ static const char *calls_args_descriptions[] = { , "--DryRun: bool\n" " If true, checks whether you have the required permissions to perform the action.\n" +"--Force: bool\n" + " If true, forces the deletion of the product type associated with one or more OMIs.\n" +"--ProductTypeId: string\n" + " The ID of the product type you want to delete.\n" +, + "--DryRun: bool\n" + " If true, checks whether you have the required permissions to perform the action.\n" "--PublicIp: string\n" " The public IP. In the public Cloud, this parameter is required.\n" "--PublicIpId: string\n" @@ -2024,9 +2041,9 @@ static const char *calls_args_descriptions[] = { "--DryRun: bool\n" " If true, checks whether you have the required permissions to perform the action.\n" "--InternetServiceId: string\n" - " The ID of the Internet service you want to attach.\n" + " The ID of the internet service you want to attach.\n" "--NetId: string\n" - " The ID of the Net to which you want to attach the Internet service.\n" + " The ID of the Net to which you want to attach the internet service.\n" , "--BackendIps: array string\n" " One or more public IPs of backend VMs.\n" @@ -2528,19 +2545,19 @@ static const char *calls_args_descriptions[] = { "--Filters: ref FiltersInternetService\n" " One or more filters.\n" " --Filters.InternetServiceIds: array string\n" - " The IDs of the Internet services.\n" + " The IDs of the internet services.\n" " --Filters.LinkNetIds: array string\n" - " The IDs of the Nets the Internet services are attached to.\n" + " The IDs of the Nets the internet services are attached to.\n" " --Filters.LinkStates: array string\n" - " The current states of the attachments between the Internet services and \n" - " the Nets (only `available`, if the Internet gateway is attached to a \n" + " The current states of the attachments between the internet services and \n" + " the Nets (only `available`, if the internet gateway is attached to a \n" " Net).\n" " --Filters.TagKeys: array string\n" - " The keys of the tags associated with the Internet services.\n" + " The keys of the tags associated with the internet services.\n" " --Filters.TagValues: array string\n" - " The values of the tags associated with the Internet services.\n" + " The values of the tags associated with the internet services.\n" " --Filters.Tags: array string\n" - " The key/value combination of the tags associated with the Internet \n" + " The key/value combination of the tags associated with the internet \n" " services, in the following format: \n" " \"Filters\":{\"Tags\":[\"TAGKEY=TAGVALUE\"]}.\n" "--NextPageToken: string\n" @@ -2555,11 +2572,21 @@ static const char *calls_args_descriptions[] = { " One or more filters.\n" " --Filters.KeypairFingerprints: array string\n" " The fingerprints of the keypairs.\n" + " --Filters.KeypairIds: array string\n" + " The IDs of the keypairs.\n" " --Filters.KeypairNames: array string\n" " The names of the keypairs.\n" " --Filters.KeypairTypes: array string\n" " The types of the keypairs (`ssh-rsa`, `ssh-ed25519`, \n" " `ecdsa-sha2-nistp256`, `ecdsa-sha2-nistp384`, or `ecdsa-sha2-nistp521`).\n" + " --Filters.TagKeys: array string\n" + " The keys of the tags associated with the keypairs.\n" + " --Filters.TagValues: array string\n" + " The values of the tags associated with the keypairs.\n" + " --Filters.Tags: array string\n" + " The key/value combination of the tags associated with the keypairs, in \n" + " the 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" @@ -2845,7 +2872,9 @@ static const char *calls_args_descriptions[] = { " The path prefix you can use to filter the results. If not specified, it \n" " is set to a slash (`/`).\n" " --Filters.Scope: string\n" - " The scope to filter policies (`OWS` \\| `LOCAL`).\n" + " The scope of the policies. A policy can either be created by Outscale \n" + " (`OWS`), and therefore applies to all accounts, or be created by its \n" + " users (`LOCAL`).\n" "--FirstItem: long long int\n" " The item starting the list of policies requested.\n" "--ResultsPerPage: long long int\n" @@ -2993,11 +3022,6 @@ static const char *calls_args_descriptions[] = { "--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" -, - "--AccessKeyId: string\n" - " The ID of the access key.\n" -"--DryRun: bool\n" - " If true, checks whether you have the required permissions to perform the action.\n" , "--DryRun: bool\n" " If true, checks whether you have the required permissions to perform the action.\n" @@ -3184,11 +3208,11 @@ static const char *calls_args_descriptions[] = { " --Filters.ResourceIds: array string\n" " The IDs of the resources with which the tags are associated.\n" " --Filters.ResourceTypes: array string\n" - " The resource type (`vm` \\| `image` \\| `volume` \\| `snapshot` \\| \n" - " `public-ip` \\| `security-group` \\| `route-table` \\| `nic` \\| `net` \n" - " \\| `subnet` \\| `net-peering` \\| `net-access-point` \\| `nat-service` \n" - " \\| `internet-service` \\| `client-gateway` \\| `virtual-gateway` \\| \n" - " `vpn-connection` \\| `dhcp-options` \\| `task`).\n" + " The resource type (`customer-gateway` \\| `dhcpoptions` \\| `image` \\| \n" + " `instance` \\| `keypair` \\| `natgateway` \\| `network-interface` \\| \n" + " `public-ip` \\| `route-table` \\| `security-group` \\| `snapshot` \\| \n" + " `subnet` \\| `task` \\| `virtual-private-gateway` \\| `volume` \\| `vpc` \n" + " \\| `vpc-endpoint` \\| `vpc-peering-connection`\\| `vpn-connection`).\n" " --Filters.Values: array string\n" " The values of the tags that are assigned to the resources. You can use \n" " this filter alongside the `TagKeys` filter. In that case, you filter the \n" @@ -3499,7 +3523,7 @@ static const char *calls_args_descriptions[] = { " --Filters.ReservationIds: array string\n" " The IDs of the reservation of the VMs, created every time you launch \n" " VMs. These reservation IDs can be associated with several VMs when you \n" - " lauch a group of VMs using the same launch request.\n" + " launch a group of VMs using the same launch request.\n" " --Filters.RootDeviceNames: array string\n" " The names of the root devices for the VMs (for example, `/dev/sda1`)\n" " --Filters.RootDeviceTypes: array string\n" @@ -3735,9 +3759,9 @@ static const char *calls_args_descriptions[] = { "--DryRun: bool\n" " If true, checks whether you have the required permissions to perform the action.\n" "--InternetServiceId: string\n" - " The ID of the Internet service you want to detach.\n" + " The ID of the internet service you want to detach.\n" "--NetId: string\n" - " The ID of the Net from which you want to detach the Internet service.\n" + " The ID of the Net from which you want to detach the internet service.\n" , "--BackendIps: array string\n" " One or more public IPs of backend VMs.\n" @@ -4067,7 +4091,7 @@ static const char *calls_args_descriptions[] = { "--DryRun: bool\n" " If true, checks whether you have the required permissions to perform the action.\n" "--GatewayId: string\n" - " The ID of an Internet service or virtual gateway attached to your Net.\n" + " The ID of an internet service or virtual gateway attached to your Net.\n" "--NatServiceId: string\n" " The ID of a NAT service.\n" "--NetPeeringId: string\n" @@ -4307,7 +4331,7 @@ static const char *calls_args_descriptions[] = { " --VpnOptions.Phase2Options.Phase2IntegrityAlgorithms: array string\n" " The integrity algorithms allowed for the VPN tunnel for phase 2.\n" " --VpnOptions.Phase2Options.Phase2LifetimeSeconds: long long int\n" - " The lifetime for phase 2 of the Internet Key Exchange (IKE) negociation \n" + " The lifetime for phase 2 of the Internet Key Exchange (IKE) negotiation \n" " process, in seconds.\n" " --VpnOptions.Phase2Options.PreSharedKey: string\n" " The pre-shared key to establish the initial authentication between the \n" @@ -4811,9 +4835,9 @@ static int filters_users_setter(struct filters_users *args, struct osc_str *data static int filters_virtual_gateway_setter(struct filters_virtual_gateway *args, struct osc_str *data); static int filters_vm_setter(struct filters_vm *args, struct osc_str *data); static int filters_vm_group_setter(struct filters_vm_group *args, struct osc_str *data); -static int filters_vms_state_setter(struct filters_vms_state *args, struct osc_str *data); static int filters_vm_template_setter(struct filters_vm_template *args, struct osc_str *data); static int filters_vm_type_setter(struct filters_vm_type *args, struct osc_str *data); +static int filters_vms_state_setter(struct filters_vms_state *args, struct osc_str *data); static int filters_volume_setter(struct filters_volume *args, struct osc_str *data); static int filters_vpn_connection_setter(struct filters_vpn_connection *args, struct osc_str *data); static int flexible_gpu_setter(struct flexible_gpu *args, struct osc_str *data); @@ -4825,14 +4849,14 @@ static int inline_policy_setter(struct inline_policy *args, struct osc_str *data static int internet_service_setter(struct internet_service *args, struct osc_str *data); static int keypair_setter(struct keypair *args, struct osc_str *data); static int keypair_created_setter(struct keypair_created *args, struct osc_str *data); -static int linked_policy_setter(struct linked_policy *args, struct osc_str *data); -static int linked_volume_setter(struct linked_volume *args, struct osc_str *data); static int link_nic_setter(struct link_nic *args, struct osc_str *data); static int link_nic_light_setter(struct link_nic_light *args, struct osc_str *data); static int link_nic_to_update_setter(struct link_nic_to_update *args, struct osc_str *data); static int link_public_ip_setter(struct link_public_ip *args, struct osc_str *data); static int link_public_ip_light_for_vm_setter(struct link_public_ip_light_for_vm *args, struct osc_str *data); static int link_route_table_setter(struct link_route_table *args, struct osc_str *data); +static int linked_policy_setter(struct linked_policy *args, struct osc_str *data); +static int linked_volume_setter(struct linked_volume *args, struct osc_str *data); static int listener_setter(struct listener *args, struct osc_str *data); static int listener_for_creation_setter(struct listener_for_creation *args, struct osc_str *data); static int listener_rule_setter(struct listener_rule *args, struct osc_str *data); @@ -7323,6 +7347,22 @@ static int filters_keypair_setter(struct filters_keypair *args, struct osc_str * ARG_TO_JSON(KeypairFingerprints, string, args->keypair_fingerprints_str); ret += 1; } + if (args->keypair_ids) { + char **as; + + TRY_APPEND_COL(count_args, data); + STRY(osc_str_append_string(data, "\"KeypairIds\":[" )); + for (as = args->keypair_ids; *as; ++as) { + if (as != args->keypair_ids) + STRY(osc_str_append_string(data, "," )); + ARG_TO_JSON_STR("", *as); + } + STRY(osc_str_append_string(data, "]" )); + ret += 1; + } else if (args->keypair_ids_str) { + ARG_TO_JSON(KeypairIds, string, args->keypair_ids_str); + ret += 1; + } if (args->keypair_names) { char **as; @@ -7355,6 +7395,54 @@ static int filters_keypair_setter(struct filters_keypair *args, struct osc_str * ARG_TO_JSON(KeypairTypes, string, args->keypair_types_str); ret += 1; } + if (args->tag_keys) { + char **as; + + TRY_APPEND_COL(count_args, data); + STRY(osc_str_append_string(data, "\"TagKeys\":[" )); + for (as = args->tag_keys; *as; ++as) { + if (as != args->tag_keys) + STRY(osc_str_append_string(data, "," )); + ARG_TO_JSON_STR("", *as); + } + STRY(osc_str_append_string(data, "]" )); + ret += 1; + } else if (args->tag_keys_str) { + ARG_TO_JSON(TagKeys, string, args->tag_keys_str); + ret += 1; + } + if (args->tag_values) { + char **as; + + TRY_APPEND_COL(count_args, data); + STRY(osc_str_append_string(data, "\"TagValues\":[" )); + for (as = args->tag_values; *as; ++as) { + if (as != args->tag_values) + STRY(osc_str_append_string(data, "," )); + ARG_TO_JSON_STR("", *as); + } + STRY(osc_str_append_string(data, "]" )); + ret += 1; + } else if (args->tag_values_str) { + ARG_TO_JSON(TagValues, string, args->tag_values_str); + ret += 1; + } + if (args->tags) { + char **as; + + TRY_APPEND_COL(count_args, data); + STRY(osc_str_append_string(data, "\"Tags\":[" )); + for (as = args->tags; *as; ++as) { + if (as != args->tags) + STRY(osc_str_append_string(data, "," )); + ARG_TO_JSON_STR("", *as); + } + STRY(osc_str_append_string(data, "]" )); + ret += 1; + } else if (args->tags_str) { + ARG_TO_JSON(Tags, string, args->tags_str); + ret += 1; + } return !!ret; } @@ -11171,124 +11259,6 @@ static int filters_vm_group_setter(struct filters_vm_group *args, struct osc_str return !!ret; } -static int filters_vms_state_setter(struct filters_vms_state *args, struct osc_str *data) { - int count_args = 0; - int ret = 0; - if (args->maintenance_event_codes) { - char **as; - - TRY_APPEND_COL(count_args, data); - STRY(osc_str_append_string(data, "\"MaintenanceEventCodes\":[" )); - for (as = args->maintenance_event_codes; *as; ++as) { - if (as != args->maintenance_event_codes) - STRY(osc_str_append_string(data, "," )); - ARG_TO_JSON_STR("", *as); - } - STRY(osc_str_append_string(data, "]" )); - ret += 1; - } else if (args->maintenance_event_codes_str) { - ARG_TO_JSON(MaintenanceEventCodes, string, args->maintenance_event_codes_str); - ret += 1; - } - if (args->maintenance_event_descriptions) { - char **as; - - TRY_APPEND_COL(count_args, data); - STRY(osc_str_append_string(data, "\"MaintenanceEventDescriptions\":[" )); - for (as = args->maintenance_event_descriptions; *as; ++as) { - if (as != args->maintenance_event_descriptions) - STRY(osc_str_append_string(data, "," )); - ARG_TO_JSON_STR("", *as); - } - STRY(osc_str_append_string(data, "]" )); - ret += 1; - } else if (args->maintenance_event_descriptions_str) { - ARG_TO_JSON(MaintenanceEventDescriptions, string, args->maintenance_event_descriptions_str); - ret += 1; - } - if (args->maintenance_events_not_after) { - char **as; - - TRY_APPEND_COL(count_args, data); - STRY(osc_str_append_string(data, "\"MaintenanceEventsNotAfter\":[" )); - for (as = args->maintenance_events_not_after; *as; ++as) { - if (as != args->maintenance_events_not_after) - STRY(osc_str_append_string(data, "," )); - ARG_TO_JSON_STR("", *as); - } - STRY(osc_str_append_string(data, "]" )); - ret += 1; - } else if (args->maintenance_events_not_after_str) { - ARG_TO_JSON(MaintenanceEventsNotAfter, string, args->maintenance_events_not_after_str); - ret += 1; - } - if (args->maintenance_events_not_before) { - char **as; - - TRY_APPEND_COL(count_args, data); - STRY(osc_str_append_string(data, "\"MaintenanceEventsNotBefore\":[" )); - for (as = args->maintenance_events_not_before; *as; ++as) { - if (as != args->maintenance_events_not_before) - STRY(osc_str_append_string(data, "," )); - ARG_TO_JSON_STR("", *as); - } - STRY(osc_str_append_string(data, "]" )); - ret += 1; - } else if (args->maintenance_events_not_before_str) { - ARG_TO_JSON(MaintenanceEventsNotBefore, string, args->maintenance_events_not_before_str); - ret += 1; - } - if (args->subregion_names) { - char **as; - - TRY_APPEND_COL(count_args, data); - STRY(osc_str_append_string(data, "\"SubregionNames\":[" )); - for (as = args->subregion_names; *as; ++as) { - if (as != args->subregion_names) - STRY(osc_str_append_string(data, "," )); - ARG_TO_JSON_STR("", *as); - } - STRY(osc_str_append_string(data, "]" )); - ret += 1; - } else if (args->subregion_names_str) { - ARG_TO_JSON(SubregionNames, string, args->subregion_names_str); - ret += 1; - } - if (args->vm_ids) { - char **as; - - TRY_APPEND_COL(count_args, data); - STRY(osc_str_append_string(data, "\"VmIds\":[" )); - for (as = args->vm_ids; *as; ++as) { - if (as != args->vm_ids) - STRY(osc_str_append_string(data, "," )); - ARG_TO_JSON_STR("", *as); - } - STRY(osc_str_append_string(data, "]" )); - ret += 1; - } else if (args->vm_ids_str) { - ARG_TO_JSON(VmIds, string, args->vm_ids_str); - ret += 1; - } - if (args->vm_states) { - char **as; - - TRY_APPEND_COL(count_args, data); - STRY(osc_str_append_string(data, "\"VmStates\":[" )); - for (as = args->vm_states; *as; ++as) { - if (as != args->vm_states) - STRY(osc_str_append_string(data, "," )); - ARG_TO_JSON_STR("", *as); - } - STRY(osc_str_append_string(data, "]" )); - ret += 1; - } else if (args->vm_states_str) { - ARG_TO_JSON(VmStates, string, args->vm_states_str); - ret += 1; - } - - return !!ret; -} static int filters_vm_template_setter(struct filters_vm_template *args, struct osc_str *data) { int count_args = 0; int ret = 0; @@ -11625,6 +11595,124 @@ static int filters_vm_type_setter(struct filters_vm_type *args, struct osc_str * return !!ret; } +static int filters_vms_state_setter(struct filters_vms_state *args, struct osc_str *data) { + int count_args = 0; + int ret = 0; + if (args->maintenance_event_codes) { + char **as; + + TRY_APPEND_COL(count_args, data); + STRY(osc_str_append_string(data, "\"MaintenanceEventCodes\":[" )); + for (as = args->maintenance_event_codes; *as; ++as) { + if (as != args->maintenance_event_codes) + STRY(osc_str_append_string(data, "," )); + ARG_TO_JSON_STR("", *as); + } + STRY(osc_str_append_string(data, "]" )); + ret += 1; + } else if (args->maintenance_event_codes_str) { + ARG_TO_JSON(MaintenanceEventCodes, string, args->maintenance_event_codes_str); + ret += 1; + } + if (args->maintenance_event_descriptions) { + char **as; + + TRY_APPEND_COL(count_args, data); + STRY(osc_str_append_string(data, "\"MaintenanceEventDescriptions\":[" )); + for (as = args->maintenance_event_descriptions; *as; ++as) { + if (as != args->maintenance_event_descriptions) + STRY(osc_str_append_string(data, "," )); + ARG_TO_JSON_STR("", *as); + } + STRY(osc_str_append_string(data, "]" )); + ret += 1; + } else if (args->maintenance_event_descriptions_str) { + ARG_TO_JSON(MaintenanceEventDescriptions, string, args->maintenance_event_descriptions_str); + ret += 1; + } + if (args->maintenance_events_not_after) { + char **as; + + TRY_APPEND_COL(count_args, data); + STRY(osc_str_append_string(data, "\"MaintenanceEventsNotAfter\":[" )); + for (as = args->maintenance_events_not_after; *as; ++as) { + if (as != args->maintenance_events_not_after) + STRY(osc_str_append_string(data, "," )); + ARG_TO_JSON_STR("", *as); + } + STRY(osc_str_append_string(data, "]" )); + ret += 1; + } else if (args->maintenance_events_not_after_str) { + ARG_TO_JSON(MaintenanceEventsNotAfter, string, args->maintenance_events_not_after_str); + ret += 1; + } + if (args->maintenance_events_not_before) { + char **as; + + TRY_APPEND_COL(count_args, data); + STRY(osc_str_append_string(data, "\"MaintenanceEventsNotBefore\":[" )); + for (as = args->maintenance_events_not_before; *as; ++as) { + if (as != args->maintenance_events_not_before) + STRY(osc_str_append_string(data, "," )); + ARG_TO_JSON_STR("", *as); + } + STRY(osc_str_append_string(data, "]" )); + ret += 1; + } else if (args->maintenance_events_not_before_str) { + ARG_TO_JSON(MaintenanceEventsNotBefore, string, args->maintenance_events_not_before_str); + ret += 1; + } + if (args->subregion_names) { + char **as; + + TRY_APPEND_COL(count_args, data); + STRY(osc_str_append_string(data, "\"SubregionNames\":[" )); + for (as = args->subregion_names; *as; ++as) { + if (as != args->subregion_names) + STRY(osc_str_append_string(data, "," )); + ARG_TO_JSON_STR("", *as); + } + STRY(osc_str_append_string(data, "]" )); + ret += 1; + } else if (args->subregion_names_str) { + ARG_TO_JSON(SubregionNames, string, args->subregion_names_str); + ret += 1; + } + if (args->vm_ids) { + char **as; + + TRY_APPEND_COL(count_args, data); + STRY(osc_str_append_string(data, "\"VmIds\":[" )); + for (as = args->vm_ids; *as; ++as) { + if (as != args->vm_ids) + STRY(osc_str_append_string(data, "," )); + ARG_TO_JSON_STR("", *as); + } + STRY(osc_str_append_string(data, "]" )); + ret += 1; + } else if (args->vm_ids_str) { + ARG_TO_JSON(VmIds, string, args->vm_ids_str); + ret += 1; + } + if (args->vm_states) { + char **as; + + TRY_APPEND_COL(count_args, data); + STRY(osc_str_append_string(data, "\"VmStates\":[" )); + for (as = args->vm_states; *as; ++as) { + if (as != args->vm_states) + STRY(osc_str_append_string(data, "," )); + ARG_TO_JSON_STR("", *as); + } + STRY(osc_str_append_string(data, "]" )); + ret += 1; + } else if (args->vm_states_str) { + ARG_TO_JSON(VmStates, string, args->vm_states_str); + ret += 1; + } + + return !!ret; +} static int filters_volume_setter(struct filters_volume *args, struct osc_str *data) { int count_args = 0; int ret = 0; @@ -12395,28 +12483,7 @@ static int internet_service_setter(struct internet_service *args, struct osc_str return !!ret; } -static int keypair_setter(struct keypair *args, struct osc_str *data) { - int count_args = 0; - int ret = 0; - if (args->keypair_fingerprint) { - TRY_APPEND_COL(count_args, data); - ARG_TO_JSON_STR("\"KeypairFingerprint\":", args->keypair_fingerprint); - ret += 1; - } - if (args->keypair_name) { - TRY_APPEND_COL(count_args, data); - ARG_TO_JSON_STR("\"KeypairName\":", args->keypair_name); - ret += 1; - } - if (args->keypair_type) { - TRY_APPEND_COL(count_args, data); - ARG_TO_JSON_STR("\"KeypairType\":", args->keypair_type); - ret += 1; - } - - return !!ret; -} -static int keypair_created_setter(struct keypair_created *args, struct osc_str *data) { +static int keypair_setter(struct keypair *args, struct osc_str *data) { int count_args = 0; int ret = 0; if (args->keypair_fingerprint) { @@ -12424,6 +12491,11 @@ static int keypair_created_setter(struct keypair_created *args, struct osc_str * ARG_TO_JSON_STR("\"KeypairFingerprint\":", args->keypair_fingerprint); ret += 1; } + if (args->keypair_id) { + TRY_APPEND_COL(count_args, data); + ARG_TO_JSON_STR("\"KeypairId\":", args->keypair_id); + ret += 1; + } if (args->keypair_name) { TRY_APPEND_COL(count_args, data); ARG_TO_JSON_STR("\"KeypairName\":", args->keypair_name); @@ -12434,71 +12506,72 @@ static int keypair_created_setter(struct keypair_created *args, struct osc_str * ARG_TO_JSON_STR("\"KeypairType\":", args->keypair_type); ret += 1; } - if (args->private_key) { - TRY_APPEND_COL(count_args, data); - ARG_TO_JSON_STR("\"PrivateKey\":", args->private_key); - ret += 1; + if (args->tags) { + TRY_APPEND_COL(count_args, data); + STRY(osc_str_append_string(data, "\"Tags\":[" )); + for (int i = 0; i < args->nb_tags; ++i) { + struct resource_tag *p = &args->tags[i]; + if (p != args->tags) + STRY(osc_str_append_string(data, "," )); + STRY(osc_str_append_string(data, "{ " )); + STRY(resource_tag_setter(p, data) < 0); + STRY(osc_str_append_string(data, "}" )); + } + STRY(osc_str_append_string(data, "]" )); + ret += 1; + } else + if (args->tags_str) { + ARG_TO_JSON(Tags, string, args->tags_str); + ret += 1; } return !!ret; } -static int linked_policy_setter(struct linked_policy *args, struct osc_str *data) { +static int keypair_created_setter(struct keypair_created *args, struct osc_str *data) { int count_args = 0; int ret = 0; - if (args->creation_date) { - TRY_APPEND_COL(count_args, data); - ARG_TO_JSON_STR("\"CreationDate\":", args->creation_date); - ret += 1; - } - if (args->last_modification_date) { - TRY_APPEND_COL(count_args, data); - ARG_TO_JSON_STR("\"LastModificationDate\":", args->last_modification_date); - ret += 1; - } - if (args->orn) { - TRY_APPEND_COL(count_args, data); - ARG_TO_JSON_STR("\"Orn\":", args->orn); - ret += 1; - } - if (args->policy_id) { + if (args->keypair_fingerprint) { TRY_APPEND_COL(count_args, data); - ARG_TO_JSON_STR("\"PolicyId\":", args->policy_id); + ARG_TO_JSON_STR("\"KeypairFingerprint\":", args->keypair_fingerprint); ret += 1; } - if (args->policy_name) { + if (args->keypair_id) { TRY_APPEND_COL(count_args, data); - ARG_TO_JSON_STR("\"PolicyName\":", args->policy_name); - ret += 1; - } - - return !!ret; -} -static int linked_volume_setter(struct linked_volume *args, struct osc_str *data) { - int count_args = 0; - int ret = 0; - if (args->is_set_delete_on_vm_deletion) { - ARG_TO_JSON(DeleteOnVmDeletion, bool, args->delete_on_vm_deletion); + ARG_TO_JSON_STR("\"KeypairId\":", args->keypair_id); ret += 1; } - if (args->device_name) { + if (args->keypair_name) { TRY_APPEND_COL(count_args, data); - ARG_TO_JSON_STR("\"DeviceName\":", args->device_name); + ARG_TO_JSON_STR("\"KeypairName\":", args->keypair_name); ret += 1; } - if (args->state) { + if (args->keypair_type) { TRY_APPEND_COL(count_args, data); - ARG_TO_JSON_STR("\"State\":", args->state); + ARG_TO_JSON_STR("\"KeypairType\":", args->keypair_type); ret += 1; } - if (args->vm_id) { + if (args->private_key) { TRY_APPEND_COL(count_args, data); - ARG_TO_JSON_STR("\"VmId\":", args->vm_id); + ARG_TO_JSON_STR("\"PrivateKey\":", args->private_key); ret += 1; } - if (args->volume_id) { - TRY_APPEND_COL(count_args, data); - ARG_TO_JSON_STR("\"VolumeId\":", args->volume_id); - ret += 1; + if (args->tags) { + TRY_APPEND_COL(count_args, data); + STRY(osc_str_append_string(data, "\"Tags\":[" )); + for (int i = 0; i < args->nb_tags; ++i) { + struct resource_tag *p = &args->tags[i]; + if (p != args->tags) + STRY(osc_str_append_string(data, "," )); + STRY(osc_str_append_string(data, "{ " )); + STRY(resource_tag_setter(p, data) < 0); + STRY(osc_str_append_string(data, "}" )); + } + STRY(osc_str_append_string(data, "]" )); + ret += 1; + } else + if (args->tags_str) { + ARG_TO_JSON(Tags, string, args->tags_str); + ret += 1; } return !!ret; @@ -12658,6 +12731,67 @@ static int link_route_table_setter(struct link_route_table *args, struct osc_str return !!ret; } +static int linked_policy_setter(struct linked_policy *args, struct osc_str *data) { + int count_args = 0; + int ret = 0; + if (args->creation_date) { + TRY_APPEND_COL(count_args, data); + ARG_TO_JSON_STR("\"CreationDate\":", args->creation_date); + ret += 1; + } + if (args->last_modification_date) { + TRY_APPEND_COL(count_args, data); + ARG_TO_JSON_STR("\"LastModificationDate\":", args->last_modification_date); + ret += 1; + } + if (args->orn) { + TRY_APPEND_COL(count_args, data); + ARG_TO_JSON_STR("\"Orn\":", args->orn); + ret += 1; + } + if (args->policy_id) { + TRY_APPEND_COL(count_args, data); + ARG_TO_JSON_STR("\"PolicyId\":", args->policy_id); + ret += 1; + } + if (args->policy_name) { + TRY_APPEND_COL(count_args, data); + ARG_TO_JSON_STR("\"PolicyName\":", args->policy_name); + ret += 1; + } + + return !!ret; +} +static int linked_volume_setter(struct linked_volume *args, struct osc_str *data) { + int count_args = 0; + int ret = 0; + if (args->is_set_delete_on_vm_deletion) { + ARG_TO_JSON(DeleteOnVmDeletion, bool, args->delete_on_vm_deletion); + ret += 1; + } + if (args->device_name) { + TRY_APPEND_COL(count_args, data); + ARG_TO_JSON_STR("\"DeviceName\":", args->device_name); + ret += 1; + } + if (args->state) { + TRY_APPEND_COL(count_args, data); + ARG_TO_JSON_STR("\"State\":", args->state); + ret += 1; + } + if (args->vm_id) { + TRY_APPEND_COL(count_args, data); + ARG_TO_JSON_STR("\"VmId\":", args->vm_id); + ret += 1; + } + if (args->volume_id) { + TRY_APPEND_COL(count_args, data); + ARG_TO_JSON_STR("\"VolumeId\":", args->volume_id); + ret += 1; + } + + return !!ret; +} static int listener_setter(struct listener *args, struct osc_str *data) { int count_args = 0; int ret = 0; @@ -20657,6 +20791,11 @@ static int delete_keypair_data(struct osc_env *e, struct osc_delete_keypair_arg ARG_TO_JSON(DryRun, bool, args->dry_run); ret += 1; } + if (args->keypair_id) { + TRY_APPEND_COL(count_args, data); + ARG_TO_JSON_STR("\"KeypairId\":", args->keypair_id); + ret += 1; + } if (args->keypair_name) { TRY_APPEND_COL(count_args, data); ARG_TO_JSON_STR("\"KeypairName\":", args->keypair_name); @@ -21367,6 +21506,62 @@ int osc_delete_policy_version(struct osc_env *e, struct osc_str *out, struct osc osc_deinit_str(&data); return res; } +static int delete_product_type_data(struct osc_env *e, struct osc_delete_product_type_arg *args, struct osc_str *data) +{ + struct osc_str end_call; + int ret = 0; + int count_args = 0; + + (void)count_args; /* if use only query/header and path, this is unused */ + osc_init_str(&end_call); + osc_str_append_string(&end_call, e->endpoint.buf); + if (!args) + goto no_data; + + osc_str_append_string(data, "{"); + if (args->is_set_dry_run) { + ARG_TO_JSON(DryRun, bool, args->dry_run); + ret += 1; + } + if (args->is_set_force) { + ARG_TO_JSON(Force, bool, args->force); + ret += 1; + } + if (args->product_type_id) { + TRY_APPEND_COL(count_args, data); + ARG_TO_JSON_STR("\"ProductTypeId\":", args->product_type_id); + ret += 1; + } + osc_str_append_string(data, "}"); + +no_data: + osc_str_append_string(&end_call, "/api/v1/DeleteProductType"); + curl_easy_setopt(e->c, CURLOPT_URL, end_call.buf); + osc_deinit_str(&end_call); + return !!ret; +} + +int osc_delete_product_type(struct osc_env *e, struct osc_str *out, struct osc_delete_product_type_arg *args) +{ + CURLcode res = CURLE_OUT_OF_MEMORY; + struct osc_str data; + int r; + + osc_init_str(&data); + r = delete_product_type_data(e, args, &data); + if (r < 0) + goto out; + + curl_easy_setopt(e->c, CURLOPT_POSTFIELDS, r ? data.buf : ""); + curl_easy_setopt(e->c, CURLOPT_WRITEDATA, out); + if (e->flag & OSC_VERBOSE_MODE) { + printf("\n%s\n\n", data.buf); + } + res = curl_easy_perform(e->c); +out: + osc_deinit_str(&data); + return res; +} static int delete_public_ip_data(struct osc_env *e, struct osc_delete_public_ip_arg *args, struct osc_str *data) { struct osc_str end_call; @@ -26106,58 +26301,6 @@ int osc_read_route_tables(struct osc_env *e, struct osc_str *out, struct osc_rea osc_deinit_str(&data); return res; } -static int read_secret_access_key_data(struct osc_env *e, struct osc_read_secret_access_key_arg *args, struct osc_str *data) -{ - struct osc_str end_call; - int ret = 0; - int count_args = 0; - - (void)count_args; /* if use only query/header and path, this is unused */ - osc_init_str(&end_call); - osc_str_append_string(&end_call, e->endpoint.buf); - if (!args) - goto no_data; - - osc_str_append_string(data, "{"); - if (args->access_key_id) { - TRY_APPEND_COL(count_args, data); - ARG_TO_JSON_STR("\"AccessKeyId\":", args->access_key_id); - ret += 1; - } - if (args->is_set_dry_run) { - ARG_TO_JSON(DryRun, bool, args->dry_run); - ret += 1; - } - osc_str_append_string(data, "}"); - -no_data: - osc_str_append_string(&end_call, "/api/v1/ReadSecretAccessKey"); - curl_easy_setopt(e->c, CURLOPT_URL, end_call.buf); - osc_deinit_str(&end_call); - return !!ret; -} - -int osc_read_secret_access_key(struct osc_env *e, struct osc_str *out, struct osc_read_secret_access_key_arg *args) -{ - CURLcode res = CURLE_OUT_OF_MEMORY; - struct osc_str data; - int r; - - osc_init_str(&data); - r = read_secret_access_key_data(e, args, &data); - if (r < 0) - goto out; - - curl_easy_setopt(e->c, CURLOPT_POSTFIELDS, r ? data.buf : ""); - curl_easy_setopt(e->c, CURLOPT_WRITEDATA, out); - if (e->flag & OSC_VERBOSE_MODE) { - printf("\n%s\n\n", data.buf); - } - res = curl_easy_perform(e->c); -out: - osc_deinit_str(&data); - return res; -} static int read_security_groups_data(struct osc_env *e, struct osc_read_security_groups_arg *args, struct osc_str *data) { struct osc_str end_call; diff --git a/osc_sdk.h b/osc_sdk.h index 4e2beb1..7cac16d 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.33.1" -#define OSC_SDK_VERSION 0X001200 +#define OSC_API_VERSION "1.34.0" +#define OSC_SDK_VERSION 0X001300 enum osc_auth_method { OSC_AKSK_METHOD, @@ -1540,34 +1540,34 @@ struct filters_image { struct filters_internet_service { /* - * The IDs of the Internet services. + * The IDs of the internet services. */ char *internet_service_ids_str; char **internet_service_ids; /* - * The IDs of the Nets the Internet services are attached to. + * The IDs of the Nets the internet services are attached to. */ char *link_net_ids_str; char **link_net_ids; /* - * The current states of the attachments between the Internet services - * and the Nets (only `available`, if the Internet gateway is attached + * The current states of the attachments between the internet services + * and the Nets (only `available`, if the internet gateway is attached * to a Net). */ char *link_states_str; char **link_states; /* - * The keys of the tags associated with the Internet services. + * The keys of the tags associated with the internet services. */ char *tag_keys_str; char **tag_keys; /* - * The values of the tags associated with the Internet services. + * The values of the tags associated with the internet services. */ char *tag_values_str; char **tag_values; /* - * The key/value combination of the tags associated with the Internet + * The key/value combination of the tags associated with the internet * services, in the following format: * "Filters":{"Tags":["TAGKEY=TAGVALUE"]}. */ @@ -1581,6 +1581,11 @@ struct filters_keypair { */ char *keypair_fingerprints_str; char **keypair_fingerprints; + /* + * The IDs of the keypairs. + */ + char *keypair_ids_str; + char **keypair_ids; /* * The names of the keypairs. */ @@ -1593,6 +1598,23 @@ struct filters_keypair { */ char *keypair_types_str; char **keypair_types; + /* + * The keys of the tags associated with the keypairs. + */ + char *tag_keys_str; + char **tag_keys; + /* + * The values of the tags associated with the keypairs. + */ + char *tag_values_str; + char **tag_values; + /* + * The key/value combination of the tags associated with the keypairs, + * in the following format: + * "Filters":{"Tags":["TAGKEY=TAGVALUE"]}. + */ + char *tags_str; + char **tags; }; struct filters_listener_rule { @@ -2462,11 +2484,12 @@ struct filters_tag { char *resource_ids_str; char **resource_ids; /* - * The resource type (`vm` \\| `image` \\| `volume` \\| `snapshot` \\| - * `public-ip` \\| `security-group` \\| `route-table` \\| `nic` \\| - * `net` \\| `subnet` \\| `net-peering` \\| `net-access-point` \\| - * `nat-service` \\| `internet-service` \\| `client-gateway` \\| - * `virtual-gateway` \\| `vpn-connection` \\| `dhcp-options` \\| `task`). + * The resource type (`customer-gateway` \\| `dhcpoptions` \\| `image` + * \\| `instance` \\| `keypair` \\| `natgateway` \\| `network-interface` + * \\| `public-ip` \\| `route-table` \\| `security-group` \\| `snapshot` + * \\| `subnet` \\| `task` \\| `virtual-private-gateway` \\| `volume` + * \\| `vpc` \\| `vpc-endpoint` \\| `vpc-peering-connection`\\| + * `vpn-connection`). */ char *resource_types_str; char **resource_types; @@ -2785,7 +2808,7 @@ struct filters_vm { /* * The IDs of the reservation of the VMs, created every time you launch * VMs. These reservation IDs can be associated with several VMs when - * you lauch a group of VMs using the same launch request. + * you launch a group of VMs using the same launch request. */ char *reservation_ids_str; char **reservation_ids; @@ -3621,20 +3644,20 @@ struct inline_policy { struct internet_service { /* - * The ID of the Internet service. + * The ID of the internet service. */ char *internet_service_id; /* - * The ID of the Net attached to the Internet service. + * The ID of the Net attached to the internet service. */ char *net_id; /* - * The state of the attachment of the Internet service to the Net + * The state of the attachment of the internet service to the Net * (always `available`). */ char *state; /* - * One or more tags associated with the Internet service. + * One or more tags associated with the internet service. * Information about the tag. * --Tags.INDEX.Key: string * The key of the tag, with a minimum of 1 character. @@ -3651,6 +3674,10 @@ struct keypair { * The MD5 public key fingerprint as specified in section 4 of RFC 4716. */ char *keypair_fingerprint; + /* + * The ID of the keypair. + */ + char *keypair_id; /* * The name of the keypair. */ @@ -3661,6 +3688,17 @@ struct keypair { * `ecdsa-sha2-nistp521`). */ char *keypair_type; + /* + * One or more tags associated with the keypair. + * Information about the tag. + * --Tags.INDEX.Key: string + * The key of the tag, with a minimum of 1 character. + * --Tags.INDEX.Value: string + * The value of the tag, between 0 and 255 characters. + */ + char *tags_str; + int nb_tags; + struct resource_tag *tags; }; struct keypair_created { @@ -3668,6 +3706,10 @@ struct keypair_created { * The MD5 public key fingerprint, as specified in section 4 of RFC 4716. */ char *keypair_fingerprint; + /* + * The ID of the keypair. + */ + char *keypair_id; /* * The name of the keypair. */ @@ -3685,6 +3727,17 @@ struct keypair_created { * breaks. */ char *private_key; + /* + * One or more tags associated with the keypair. + * Information about the tag. + * --Tags.INDEX.Key: string + * The key of the tag, with a minimum of 1 character. + * --Tags.INDEX.Value: string + * The value of the tag, between 0 and 255 characters. + */ + char *tags_str; + int nb_tags; + struct resource_tag *tags; }; struct link_nic { @@ -5074,7 +5127,7 @@ struct phase2_options { char **phase2_integrity_algorithms; /* * The lifetime for phase 2 of the Internet Key Exchange (IKE) - * negociation process, in seconds. + * negotiation process, in seconds. */ int is_set_phase2_lifetime_seconds; long long int phase2_lifetime_seconds; @@ -5478,7 +5531,9 @@ struct read_policies_filters { */ char *path_prefix; /* - * The scope to filter policies (`OWS` \\| `LOCAL`). + * The scope of the policies. A policy can either be created by Outscale + * (`OWS`), and therefore applies to all accounts, or be created by its + * users (`LOCAL`). */ char *scope; }; @@ -5527,7 +5582,7 @@ struct route { */ char *destination_service_id; /* - * The ID of the Internet service or virtual gateway attached to the Net. + * The ID of the internet service or virtual gateway attached to the Net. */ char *gateway_id; /* @@ -5636,7 +5691,7 @@ struct route_table { * --Routes.INDEX.DestinationServiceId: string * The ID of the OUTSCALE service. * --Routes.INDEX.GatewayId: string - * The ID of the Internet service or virtual gateway attached to the + * The ID of the internet service or virtual gateway attached to the * Net. * --Routes.INDEX.NatServiceId: string * The ID of a NAT service attached to the Net. @@ -6916,7 +6971,7 @@ struct vpn_options { * The integrity algorithms allowed for the VPN tunnel for phase 2. * --Phase2Options.Phase2LifetimeSeconds: long long int * The lifetime for phase 2 of the Internet Key Exchange (IKE) - * negociation + * negotiation * process, in seconds. * --Phase2Options.PreSharedKey: string * The pre-shared key to establish the initial authentication @@ -7073,7 +7128,7 @@ struct vpn_connection { * 2. * --VpnOptions.Phase2Options.Phase2LifetimeSeconds: long long int * The lifetime for phase 2 of the Internet Key Exchange (IKE) - * negociation + * negotiation * process, in seconds. * --VpnOptions.Phase2Options.PreSharedKey: string * The pre-shared key to establish the initial authentication @@ -7395,9 +7450,10 @@ struct osc_create_client_gateway_arg { /* * The Autonomous System Number (ASN) used by the Border Gateway * Protocol (BGP) to find the path to your client gateway through the - * Internet.
\nThis number must be between `1` and `4294967295`. If - * you do not have an ASN, you can choose one between 64512 and 65534, - * or between 4200000000 and 4294967294. + * Internet.
\nThis number must be between `1` and `4294967295`, + * except `50624`, `53306`, and `132418`.
\nIf you do not have an + * ASN, you can choose one between `64512` and `65534` (both included), + * or between `4200000000` and `4294967295` (both included). */ int is_set_bgp_asn; long long int bgp_asn; @@ -7624,13 +7680,13 @@ struct osc_create_image_arg { /* Required: null */ /* - * **(when registering from a snapshot)** The architecture of the OMI + * **When registering from a snapshot:** The architecture of the OMI * (`i386` or `x86_64`). */ char *architecture; /* - * **(when registering from a snapshot)** One or more block device - * mappings. + * **(required) When registering from a snapshot:** One or more block + * device mappings. * One or more parameters used to automatically set up volumes when * the VM * is created. @@ -7694,9 +7750,9 @@ struct osc_create_image_arg { int is_set_dry_run; int dry_run; /* - * **(when registering from a bucket by using a manifest file)** The - * pre-signed URL of the manifest file for the OMI you want to register. - * For more information, see [Creating a Pre-signed + * **(required) When registering from a bucket by using a manifest + * file:** The pre-signed URL of the manifest file for the OMI you want + * to register. For more information, see [Creating a Pre-signed * URL](https://docs.outscale.com/en/userguide/Creating-a-Pre-Signed-URL. * html). */ @@ -7708,7 +7764,7 @@ struct osc_create_image_arg { */ char *image_name; /* - * **(when creating from a VM)** If false, the VM shuts down before + * **When creating from a VM:** If false, the VM shuts down before * creating the OMI and then reboots. If true, the VM does not. */ int is_set_no_reboot; @@ -7719,22 +7775,23 @@ struct osc_create_image_arg { char *product_codes_str; char **product_codes; /* - * **(when registering from a snapshot)** The name of the root device - * for the new OMI. + * **(required) When registering from a snapshot:** The name of the root + * device for the new OMI. */ char *root_device_name; /* - * **(when copying an OMI)** The ID of the OMI you want to copy. + * **(required) When copying an OMI:** The ID of the OMI you want to + * copy. */ char *source_image_id; /* - * **(when copying an OMI)** The name of the source Region (always the - * same as the Region of your account). + * **(required) When copying an OMI:** The name of the source Region + * (always the same as the Region of your account). */ char *source_region_name; /* - * **(when creating from a VM)** The ID of the VM from which you want to - * create the OMI. + * **(required) When creating from a VM:** The ID of the VM from which + * you want to create the OMI. */ char *vm_id; }; @@ -8076,13 +8133,17 @@ struct osc_create_net_peering_arg { /* Required: AccepterNetId SourceNetId */ /* - * The ID of the Net you want to connect with. + * The ID of the Net you want to connect with.

\nIf the + * Net does not belong to you, you must also specify the + * `AccepterOwnerId` parameter with the account ID owning the Net you + * want to connect with. */ char *accepter_net_id; /* * The account ID of the owner of the Net you want to connect with. By * default, the account ID of the owner of the Net from which the - * peering request is sent. + * peering request is sent.

\nThis parameter is required if + * the Net you want to connect with does not belong to you. */ char *accepter_owner_id; /* @@ -8168,7 +8229,8 @@ struct osc_create_policy_arg { char *description; /* * The policy document, corresponding to a JSON string that contains the - * policy. For more information, see [EIM Reference + * policy. This policy document can contain a maximum of 5120 + * non-whitespace characters. For more information, see [EIM Reference * Information](https://docs.outscale.com/en/userguide/EIM-Reference-Info * rmation.html) and [EIM Policy * Generator](https://docs.outscale.com/en/userguide/EIM-Policy-Generator @@ -8196,7 +8258,8 @@ struct osc_create_policy_version_arg { */ /* * The policy document, corresponding to a JSON string that contains the - * policy. For more information, see [EIM Reference + * policy. This policy document can contain a maximum of 5120 + * non-whitespace characters. For more information, see [EIM Reference * Information](https://docs.outscale.com/en/userguide/EIM-Reference-Info * rmation.html) and [EIM Policy * Generator](https://docs.outscale.com/en/userguide/EIM-Policy-Generator @@ -8263,7 +8326,7 @@ struct osc_create_route_arg { int is_set_dry_run; int dry_run; /* - * The ID of an Internet service or virtual gateway attached to your Net. + * The ID of an internet service or virtual gateway attached to your Net. */ char *gateway_id; /* @@ -9318,13 +9381,13 @@ struct osc_delete_internet_service_arg { int is_set_dry_run; int dry_run; /* - * The ID of the Internet service you want to delete. + * The ID of the internet service you want to delete. */ char *internet_service_id; }; struct osc_delete_keypair_arg { - /* Required: KeypairName + /* Required: null */ /* * If true, checks whether you have the required permissions to perform @@ -9332,6 +9395,10 @@ struct osc_delete_keypair_arg { */ int is_set_dry_run; int dry_run; + /* + * The ID of the keypair you want to delete. + */ + char *keypair_id; /* * The name of the keypair you want to delete. */ @@ -9541,6 +9608,27 @@ struct osc_delete_policy_version_arg { char *version_id; }; +struct osc_delete_product_type_arg { + /* Required: ProductTypeId + */ + /* + * If true, checks whether you have the required permissions to perform + * the action. + */ + int is_set_dry_run; + int dry_run; + /* + * If true, forces the deletion of the product type associated with one + * or more OMIs. + */ + int is_set_force; + int force; + /* + * The ID of the product type you want to delete. + */ + char *product_type_id; +}; + struct osc_delete_public_ip_arg { /* Required: null */ @@ -10015,11 +10103,11 @@ struct osc_link_internet_service_arg { int is_set_dry_run; int dry_run; /* - * The ID of the Internet service you want to attach. + * The ID of the internet service you want to attach. */ char *internet_service_id; /* - * The ID of the Net to which you want to attach the Internet service. + * The ID of the Net to which you want to attach the internet service. */ char *net_id; }; @@ -11028,22 +11116,22 @@ struct osc_read_internet_services_arg { /* * One or more filters. * --Filters.InternetServiceIds: array string - * The IDs of the Internet services. + * The IDs of the internet services. * --Filters.LinkNetIds: array string - * The IDs of the Nets the Internet services are attached to. + * The IDs of the Nets the internet services are attached to. * --Filters.LinkStates: array string - * The current states of the attachments between the Internet + * The current states of the attachments between the internet * services and - * the Nets (only `available`, if the Internet gateway is attached + * the Nets (only `available`, if the internet gateway is attached * to a * Net). * --Filters.TagKeys: array string - * The keys of the tags associated with the Internet services. + * The keys of the tags associated with the internet services. * --Filters.TagValues: array string - * The values of the tags associated with the Internet services. + * The values of the tags associated with the internet services. * --Filters.Tags: array string * The key/value combination of the tags associated with the - * Internet + * internet * services, in the following format: * * "Filters":{"Tags":["TAGKEY=TAGVALUE"]}. @@ -11077,12 +11165,24 @@ struct osc_read_keypairs_arg { * One or more filters. * --Filters.KeypairFingerprints: array string * The fingerprints of the keypairs. + * --Filters.KeypairIds: array string + * The IDs of the keypairs. * --Filters.KeypairNames: array string * The names of the keypairs. * --Filters.KeypairTypes: array string * The types of the keypairs (`ssh-rsa`, `ssh-ed25519`, * `ecdsa-sha2-nistp256`, `ecdsa-sha2-nistp384`, or * `ecdsa-sha2-nistp521`). + * --Filters.TagKeys: array string + * The keys of the tags associated with the keypairs. + * --Filters.TagValues: array string + * The values of the tags associated with the keypairs. + * --Filters.Tags: array string + * The key/value combination of the tags associated with the + * keypairs, in + * the following format: + * + * "Filters":{"Tags":["TAGKEY=TAGVALUE"]}. */ char *filters_str; int is_set_filters; @@ -11601,7 +11701,11 @@ struct osc_read_policies_arg { * specified, it * is set to a slash (`/`). * --Filters.Scope: string - * The scope to filter policies (`OWS` \\| `LOCAL`). + * The scope of the policies. A policy can either be created by + * Outscale + * (`OWS`), and therefore applies to all accounts, or be created by + * its + * users (`LOCAL`). */ char *filters_str; int is_set_filters; @@ -11905,21 +12009,6 @@ struct osc_read_route_tables_arg { long long int results_per_page; }; -struct osc_read_secret_access_key_arg { - /* Required: AccessKeyId - */ - /* - * The ID of the access key. - */ - char *access_key_id; - /* - * If true, checks whether you have the required permissions to perform - * the action. - */ - int is_set_dry_run; - int dry_run; -}; - struct osc_read_security_groups_arg { /* Required: null */ @@ -12240,15 +12329,16 @@ struct osc_read_tags_arg { * --Filters.ResourceIds: array string * The IDs of the resources with which the tags are associated. * --Filters.ResourceTypes: array string - * The resource type (`vm` \\| `image` \\| `volume` \\| `snapshot` + * The resource type (`customer-gateway` \\| `dhcpoptions` \\| + * `image` \\| + * `instance` \\| `keypair` \\| `natgateway` \\| `network-interface` * \\| - * `public-ip` \\| `security-group` \\| `route-table` \\| `nic` \\| - * `net` - * \\| `subnet` \\| `net-peering` \\| `net-access-point` \\| - * `nat-service` - * \\| `internet-service` \\| `client-gateway` \\| `virtual-gateway` + * `public-ip` \\| `route-table` \\| `security-group` \\| `snapshot` * \\| - * `vpn-connection` \\| `dhcp-options` \\| `task`). + * `subnet` \\| `task` \\| `virtual-private-gateway` \\| `volume` + * \\| `vpc` + * \\| `vpc-endpoint` \\| `vpc-peering-connection`\\| + * `vpn-connection`). * --Filters.Values: array string * The values of the tags that are assigned to the resources. You * can use @@ -12781,7 +12871,7 @@ struct osc_read_vms_arg { * launch * VMs. These reservation IDs can be associated with several VMs * when you - * lauch a group of VMs using the same launch request. + * launch a group of VMs using the same launch request. * --Filters.RootDeviceNames: array string * The names of the root devices for the VMs (for example, * `/dev/sda1`) @@ -13234,11 +13324,11 @@ struct osc_unlink_internet_service_arg { int is_set_dry_run; int dry_run; /* - * The ID of the Internet service you want to detach. + * The ID of the internet service you want to detach. */ char *internet_service_id; /* - * The ID of the Net from which you want to detach the Internet service. + * The ID of the Net from which you want to detach the internet service. */ char *net_id; }; @@ -13992,7 +14082,7 @@ struct osc_update_route_arg { int is_set_dry_run; int dry_run; /* - * The ID of an Internet service or virtual gateway attached to your Net. + * The ID of an internet service or virtual gateway attached to your Net. */ char *gateway_id; /* @@ -14480,7 +14570,7 @@ struct osc_update_vpn_connection_arg { * 2. * --VpnOptions.Phase2Options.Phase2LifetimeSeconds: long long int * The lifetime for phase 2 of the Internet Key Exchange (IKE) - * negociation + * negotiation * process, in seconds. * --VpnOptions.Phase2Options.PreSharedKey: string * The pre-shared key to establish the initial authentication @@ -14660,6 +14750,7 @@ int osc_delete_net(struct osc_env *e, struct osc_str *out, struct osc_delete_net int osc_delete_nic(struct osc_env *e, struct osc_str *out, struct osc_delete_nic_arg *args); int osc_delete_policy(struct osc_env *e, struct osc_str *out, struct osc_delete_policy_arg *args); int osc_delete_policy_version(struct osc_env *e, struct osc_str *out, struct osc_delete_policy_version_arg *args); +int osc_delete_product_type(struct osc_env *e, struct osc_str *out, struct osc_delete_product_type_arg *args); int osc_delete_public_ip(struct osc_env *e, struct osc_str *out, struct osc_delete_public_ip_arg *args); int osc_delete_route(struct osc_env *e, struct osc_str *out, struct osc_delete_route_arg *args); int osc_delete_route_table(struct osc_env *e, struct osc_str *out, struct osc_delete_route_table_arg *args); @@ -14738,7 +14829,6 @@ int osc_read_public_ips(struct osc_env *e, struct osc_str *out, struct osc_read_ int osc_read_quotas(struct osc_env *e, struct osc_str *out, struct osc_read_quotas_arg *args); int osc_read_regions(struct osc_env *e, struct osc_str *out, struct osc_read_regions_arg *args); int osc_read_route_tables(struct osc_env *e, struct osc_str *out, struct osc_read_route_tables_arg *args); -int osc_read_secret_access_key(struct osc_env *e, struct osc_str *out, struct osc_read_secret_access_key_arg *args); int osc_read_security_groups(struct osc_env *e, struct osc_str *out, struct osc_read_security_groups_arg *args); int osc_read_server_certificates(struct osc_env *e, struct osc_str *out, struct osc_read_server_certificates_arg *args); int osc_read_snapshot_export_tasks(struct osc_env *e, struct osc_str *out, struct osc_read_snapshot_export_tasks_arg *args); diff --git a/version b/version index a918a2a..faef31a 100644 --- a/version +++ b/version @@ -1 +1 @@ -0.6.0 +0.7.0