diff --git a/main.c b/main.c index d2974e9..3bea2e3 100644 --- a/main.c +++ b/main.c @@ -47,7 +47,7 @@ #define OAPI_RAW_OUTPUT 1 -#define OAPI_CLI_VERSION "0.7.0" +#define OAPI_CLI_VERSION "0.8.0" #define OAPI_CLI_UAGENT "oapi-cli/"OAPI_CLI_VERSION"; osc-sdk-c/" @@ -474,6 +474,11 @@ int access_key_parser(void *v_s, char *str, char *aa, struct ptr_array *pa) { TRY(!aa, "State argument missing\n"); s->state = aa; // string string + } else + if ((aret = argcmp(str, "Tag")) == 0 || aret == '=' || aret == '.') { + TRY(!aa, "Tag argument missing\n"); + s->tag = aa; // string string + } else { fprintf(stderr, "'%s' not an argumemt of 'AccessKey'\n", str); @@ -514,6 +519,11 @@ int access_key_secret_key_parser(void *v_s, char *str, char *aa, struct ptr_arra TRY(!aa, "State argument missing\n"); s->state = aa; // string string + } else + if ((aret = argcmp(str, "Tag")) == 0 || aret == '=' || aret == '.') { + TRY(!aa, "Tag argument missing\n"); + s->tag = aa; // string string + } else { fprintf(stderr, "'%s' not an argumemt of 'AccessKeySecretKey'\n", str); @@ -19050,6 +19060,17 @@ int main(int ac, char **av) TRY(!aa, "ExpirationDate argument missing\n"); s->expiration_date = aa; // string string + } else + if ((aret = argcmp(next_a, "Tag")) == 0 || aret == '=' || aret == '.') { + char *eq_ptr = strchr(next_a, '='); + if (eq_ptr) { + TRY((!*eq_ptr), "Tag argument missing\n"); + aa = eq_ptr + 1; + incr = 1; + } + TRY(!aa, "Tag argument missing\n"); + s->tag = aa; // string string + } else if ((aret = argcmp(next_a, "UserName")) == 0 || aret == '=' || aret == '.') { char *eq_ptr = strchr(next_a, '='); @@ -30571,6 +30592,123 @@ int main(int ac, char **av) } osc_deinit_str(&r); } else + if (!strcmp("DeleteUserPolicy", 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_user_policy_arg a = {0}; + struct osc_delete_user_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_user_policy_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_user_policy_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, "PolicyName")) == 0 || aret == '=' || aret == '.') { + char *eq_ptr = strchr(next_a, '='); + if (eq_ptr) { + TRY((!*eq_ptr), "PolicyName argument missing\n"); + aa = eq_ptr + 1; + incr = 1; + } + TRY(!aa, "PolicyName argument missing\n"); + s->policy_name = aa; // string string + + } else + if ((aret = argcmp(next_a, "UserName")) == 0 || aret == '=' || aret == '.') { + char *eq_ptr = strchr(next_a, '='); + if (eq_ptr) { + TRY((!*eq_ptr), "UserName argument missing\n"); + aa = eq_ptr + 1; + incr = 1; + } + TRY(!aa, "UserName argument missing\n"); + s->user_name = aa; // string string + + } else + { + BAD_RET("'%s' is not a valide argument for 'DeleteUserPolicy'\n", next_a); + } + i += incr; + goto delete_user_policy_arg; + } + cret = osc_delete_user_policy(&e, &r, &a); + TRY(cret, "fail to call DeleteUserPolicy: %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("DeleteUser", av[i])) { auto_osc_json_c json_object *jobj = NULL; auto_ptr_array struct ptr_array opa = {0}; @@ -33197,6 +33335,134 @@ int main(int ac, char **av) } osc_deinit_str(&r); } else + if (!strcmp("PutUserPolicy", 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_put_user_policy_arg a = {0}; + struct osc_put_user_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; + + put_user_policy_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 put_user_policy_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, "PolicyDocument")) == 0 || aret == '=' || aret == '.') { + char *eq_ptr = strchr(next_a, '='); + if (eq_ptr) { + TRY((!*eq_ptr), "PolicyDocument argument missing\n"); + aa = eq_ptr + 1; + incr = 1; + } + TRY(!aa, "PolicyDocument argument missing\n"); + s->policy_document = aa; // string string + + } else + if ((aret = argcmp(next_a, "PolicyName")) == 0 || aret == '=' || aret == '.') { + char *eq_ptr = strchr(next_a, '='); + if (eq_ptr) { + TRY((!*eq_ptr), "PolicyName argument missing\n"); + aa = eq_ptr + 1; + incr = 1; + } + TRY(!aa, "PolicyName argument missing\n"); + s->policy_name = aa; // string string + + } else + if ((aret = argcmp(next_a, "UserName")) == 0 || aret == '=' || aret == '.') { + char *eq_ptr = strchr(next_a, '='); + if (eq_ptr) { + TRY((!*eq_ptr), "UserName argument missing\n"); + aa = eq_ptr + 1; + incr = 1; + } + TRY(!aa, "UserName argument missing\n"); + s->user_name = aa; // string string + + } else + { + BAD_RET("'%s' is not a valide argument for 'PutUserPolicy'\n", next_a); + } + i += incr; + goto put_user_policy_arg; + } + cret = osc_put_user_policy(&e, &r, &a); + TRY(cret, "fail to call PutUserPolicy: %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("ReadAccessKeys", av[i])) { auto_osc_json_c json_object *jobj = NULL; auto_ptr_array struct ptr_array opa = {0}; @@ -33281,6 +33547,17 @@ int main(int ac, char **av) s->filters_str = aa; } } else + if ((aret = argcmp(next_a, "Tag")) == 0 || aret == '=' || aret == '.') { + char *eq_ptr = strchr(next_a, '='); + if (eq_ptr) { + TRY((!*eq_ptr), "Tag argument missing\n"); + aa = eq_ptr + 1; + incr = 1; + } + TRY(!aa, "Tag argument missing\n"); + s->tag = aa; // string string + + } else if ((aret = argcmp(next_a, "UserName")) == 0 || aret == '=' || aret == '.') { char *eq_ptr = strchr(next_a, '='); if (eq_ptr) { @@ -40731,6 +41008,229 @@ int main(int ac, char **av) } osc_deinit_str(&r); } else + if (!strcmp("ReadUserPolicies", 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_user_policies_arg a = {0}; + struct osc_read_user_policies_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_user_policies_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_user_policies_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, "UserName")) == 0 || aret == '=' || aret == '.') { + char *eq_ptr = strchr(next_a, '='); + if (eq_ptr) { + TRY((!*eq_ptr), "UserName argument missing\n"); + aa = eq_ptr + 1; + incr = 1; + } + TRY(!aa, "UserName argument missing\n"); + s->user_name = aa; // string string + + } else + { + BAD_RET("'%s' is not a valide argument for 'ReadUserPolicies'\n", next_a); + } + i += incr; + goto read_user_policies_arg; + } + cret = osc_read_user_policies(&e, &r, &a); + TRY(cret, "fail to call ReadUserPolicies: %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("ReadUserPolicy", 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_user_policy_arg a = {0}; + struct osc_read_user_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; + + read_user_policy_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_user_policy_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, "PolicyName")) == 0 || aret == '=' || aret == '.') { + char *eq_ptr = strchr(next_a, '='); + if (eq_ptr) { + TRY((!*eq_ptr), "PolicyName argument missing\n"); + aa = eq_ptr + 1; + incr = 1; + } + TRY(!aa, "PolicyName argument missing\n"); + s->policy_name = aa; // string string + + } else + if ((aret = argcmp(next_a, "UserName")) == 0 || aret == '=' || aret == '.') { + char *eq_ptr = strchr(next_a, '='); + if (eq_ptr) { + TRY((!*eq_ptr), "UserName argument missing\n"); + aa = eq_ptr + 1; + incr = 1; + } + TRY(!aa, "UserName argument missing\n"); + s->user_name = aa; // string string + + } else + { + BAD_RET("'%s' is not a valide argument for 'ReadUserPolicy'\n", next_a); + } + i += incr; + goto read_user_policy_arg; + } + cret = osc_read_user_policy(&e, &r, &a); + TRY(cret, "fail to call ReadUserPolicy: %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("ReadUsers", 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 8c258de..e8ce26d 160000 --- a/osc-sdk-C +++ b/osc-sdk-C @@ -1 +1 @@ -Subproject commit 8c258debcf358173285b065c08f369a9a9c20f16 +Subproject commit e8ce26dcb3232373c71d1e7b3d350bdb054aafb0 diff --git a/osc_sdk.c b/osc_sdk.c index 0b74ac1..a94b678 100644 --- a/osc_sdk.c +++ b/osc_sdk.c @@ -165,6 +165,7 @@ static const char *calls_name[] = { "DeleteTags", "DeleteUserGroupPolicy", "DeleteUserGroup", + "DeleteUserPolicy", "DeleteUser", "DeleteVirtualGateway", "DeleteVmGroup", @@ -186,6 +187,7 @@ static const char *calls_name[] = { "LinkVirtualGateway", "LinkVolume", "PutUserGroupPolicy", + "PutUserPolicy", "ReadAccessKeys", "ReadAccounts", "ReadAdminPassword", @@ -245,6 +247,8 @@ static const char *calls_name[] = { "ReadUserGroup", "ReadUserGroupsPerUser", "ReadUserGroups", + "ReadUserPolicies", + "ReadUserPolicy", "ReadUsers", "ReadVirtualGateways", "ReadVmGroups", @@ -477,6 +481,8 @@ static const char *calls_descriptions[] = { "Usage: oapi-cli DeleteUserGroupPolicy --UserGroupName=usergroupname --PolicyName=policyname [OPTIONS]\n" "Deletes a specified inline policy from a specific group.\n" "\nRequired Argument: UserGroupName PolicyName \n" , "Usage: oapi-cli DeleteUserGroup --UserGroupName=usergroupname [OPTIONS]\n" "Deletes a specified user group.\n\n**[WARNING]**\nThe user group must be empty \n" "of any user and must not have any linked policy. Otherwise, you need to force \n" "the deletion.\nIf you force the deletion, all inline policies will be deleted \n" "with the user group.\n" "\nRequired Argument: UserGroupName \n" +, + "Usage: oapi-cli DeleteUserPolicy --UserName=username --PolicyName=policyname [OPTIONS]\n" "Deletes a specified inline policy from a specific user.\n" "\nRequired Argument: UserName PolicyName \n" , "Usage: oapi-cli DeleteUser --UserName=username [OPTIONS]\n" "Deletes a specified EIM user. The EIM user must not belong to any group, nor \n" "have any key or linked policy.\n" "\nRequired Argument: UserName \n" , @@ -494,7 +500,7 @@ static const char *calls_descriptions[] = { , "Usage: oapi-cli DeleteVpnConnectionRoute --DestinationIpRange=destinationiprange --VpnConnectionId=vpnconnectionid [OPTIONS]\n" "Deletes a static route to a VPN connection previously created using the \n" "CreateVpnConnectionRoute method.\n" "\nRequired Argument: DestinationIpRange VpnConnectionId \n" , - "Usage: oapi-cli DeregisterVmsInLoadBalancer --BackendVmIds=backendvmids --LoadBalancerName=loadbalancername [OPTIONS]\n" "Deregisters a specified virtual machine (VM) from a load balancer.\n" "\nRequired Argument: BackendVmIds LoadBalancerName \n" + "Usage: oapi-cli DeregisterVmsInLoadBalancer --BackendVmIds=backendvmids --LoadBalancerName=loadbalancername [OPTIONS]\n" "> [WARNING]\n> Deprecated: This call is deprecated and will be \n" "removed.\n\nDeregisters a specified virtual machine (VM) from a load balancer.\n" "\nRequired Argument: BackendVmIds LoadBalancerName \n" , "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" , @@ -519,6 +525,8 @@ static const char *calls_descriptions[] = { "Usage: oapi-cli LinkVolume --DeviceName=devicename --VmId=vmid --VolumeId=volumeid [OPTIONS]\n" "Attaches a Block Storage Unit (BSU) volume to a virtual machine (VM).\nThe \n" "volume and the VM must be in the same Subregion. The VM can be running or \n" "stopped. The volume is attached to the specified VM device.\n" "\nRequired Argument: DeviceName VmId VolumeId \n" , "Usage: oapi-cli PutUserGroupPolicy --PolicyName=policyname --PolicyDocument=policydocument --UserGroupName=usergroupname [OPTIONS]\n" "Creates or updates an inline policy included in a specified group.\nThe policy \n" "is automatically applied to all the users of the group after its creation.\n" "\nRequired Argument: PolicyName PolicyDocument UserGroupName \n" +, + "Usage: oapi-cli PutUserPolicy --PolicyName=policyname --PolicyDocument=policydocument --UserName=username [OPTIONS]\n" "Creates or updates an inline policy included in a specified user.\nThe policy \n" "is automatically applied to the user after its creation.\n" "\nRequired Argument: PolicyName PolicyDocument UserName \n" , "Usage: oapi-cli ReadAccessKeys [OPTIONS]\n" "Lists the access key IDs of either your root account or an EIM user.\n" "\nRequired Argument: null \n" , @@ -637,6 +645,10 @@ 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 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 ReadUserPolicies --UserName=username [OPTIONS]\n" "Lists the names of inline policies included in a specified user.\n" "\nRequired Argument: UserName \n" +, + "Usage: oapi-cli ReadUserPolicy --UserName=username --PolicyName=policyname [OPTIONS]\n" "Returns information about an inline policy included in a specified user.\n" "\nRequired Argument: UserName PolicyName \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" , @@ -660,7 +672,7 @@ static const char *calls_descriptions[] = { , "Usage: oapi-cli RebootVms --VmIds=vmids [OPTIONS]\n" "Reboots one or more virtual machines (VMs).\nThis operation sends a reboot \n" "request to one or more specified VMs. This is an asynchronous action that \n" "queues this reboot request. This action only reboots VMs that are valid and \n" "that belong to you.\n" "\nRequired Argument: VmIds \n" , - "Usage: oapi-cli RegisterVmsInLoadBalancer --BackendVmIds=backendvmids --LoadBalancerName=loadbalancername [OPTIONS]\n" "Registers one or more virtual machines (VMs) with a specified load \n" "balancer.\nThe VMs can be in different Subnets and different Subregions than \n" "the load balancer, as long as the VMs and load balancers are all in the public \n" "Cloud or all in the same Net. It may take a little time for a VM to be \n" "registered with the load balancer. Once the VM is registered with a load \n" "balancer, it receives traffic and requests from this load balancer and is \n" "called a backend VM.\n" "\nRequired Argument: BackendVmIds LoadBalancerName \n" + "Usage: oapi-cli RegisterVmsInLoadBalancer --BackendVmIds=backendvmids --LoadBalancerName=loadbalancername [OPTIONS]\n" "> [WARNING]\n> Deprecated: This call is deprecated and will be \n" "removed.\n\nRegisters one or more virtual machines (VMs) with a specified load \n" "balancer.\nThe VMs can be in different Subnets and different Subregions than \n" "the load balancer, as long as the VMs and load balancers are all in the public \n" "Cloud or all in the same Net. It may take a little time for a VM to be \n" "registered with the load balancer. Once the VM is registered with a load \n" "balancer, it receives traffic and requests from this load balancer and is \n" "called a backend VM.\n" "\nRequired Argument: BackendVmIds LoadBalancerName \n" , "Usage: oapi-cli RejectNetPeering --NetPeeringId=netpeeringid [OPTIONS]\n" "Rejects a Net peering request.\nThe Net peering must be in the \n" "`pending-acceptance` state to be rejected. The rejected Net peering is then in \n" "the `rejected` state.\n" "\nRequired Argument: NetPeeringId \n" , @@ -785,6 +797,8 @@ static const char *calls_args_descriptions[] = { " The date and time, or the date, at which you want the access key to expire, in ISO 8601 \n" " format (for example, `2020-06-14T00:00:00.000Z`, or `2020-06-14`). To remove an existing \n" " expiration date, use the method without specifying this parameter.\n" +"--Tag: string\n" + " A tag to add to the access key.\n" "--UserName: string\n" " The name of the EIM user that owns the key to be created. If you do not specify a user \n" " name, this action creates an access key for the user who sends the request (which can be \n" @@ -891,8 +905,11 @@ static const char *calls_args_descriptions[] = { " Information about the DirectLink interface.\n" " --DirectLinkInterface.BgpAsn: long long int\n" " The BGP (Border Gateway Protocol) ASN (Autonomous System Number) on the \n" - " customer's side of the DirectLink interface. This number must be between \n" - " `64512` and `65534`.\n" + " customer's side of the DirectLink interface.
\nThis number must be \n" + " between `1` and `4294967295`, except `50624`, `53306`, and `132418`. \n" + "
\nIf you do not have an ASN, you can choose one between `64512` and \n" + " `65534` (both included), or between `4200000000` and `4294967295` (both \n" + " included).\n" " --DirectLinkInterface.BgpKey: string\n" " The BGP authentication key.\n" " --DirectLinkInterface.ClientPrivateIp: string\n" @@ -1182,12 +1199,12 @@ 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.

\nIf the Net does not belong to \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.
\nThis parameter is \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" @@ -1984,6 +2001,13 @@ static const char *calls_args_descriptions[] = { , "--DryRun: bool\n" " If true, checks whether you have the required permissions to perform the action.\n" +"--PolicyName: string\n" + " The name of the policy document you want to delete (between 1 and 128 characters).\n" +"--UserName: string\n" + " The name of the user you want to delete the policy from.\n" +, + "--DryRun: bool\n" + " If true, checks whether you have the required permissions to perform the action.\n" "--UserName: string\n" " The name of the EIM user you want to delete.\n" , @@ -2157,12 +2181,26 @@ static const char *calls_args_descriptions[] = { , "--DryRun: bool\n" " If true, checks whether you have the required permissions to perform the action.\n" +"--PolicyDocument: string\n" + " The policy document, corresponding to a JSON string that contains the policy. For more \n" + " information, see [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" +"--PolicyName: string\n" + " The name of the policy (between 1 and 128 characters).\n" +"--UserName: string\n" + " The name of the user.\n" +, + "--DryRun: bool\n" + " If true, checks whether you have the required permissions to perform the action.\n" "--Filters: ref FiltersAccessKeys\n" " One or more filters.\n" " --Filters.AccessKeyIds: array string\n" " The IDs of the access keys.\n" " --Filters.States: array string\n" " The states of the access keys (`ACTIVE` \\| `INACTIVE`).\n" +"--Tag: string\n" + " The tag added to the access key.\n" "--UserName: string\n" " The name of the EIM user. By default, the user who sends the request (which can be the root \n" " account).\n" @@ -3282,6 +3320,18 @@ static const char *calls_args_descriptions[] = { , "--DryRun: bool\n" " If true, checks whether you have the required permissions to perform the action.\n" +"--UserName: string\n" + " The name of the user.\n" +, + "--DryRun: bool\n" + " If true, checks whether you have the required permissions to perform the action.\n" +"--PolicyName: string\n" + " The name of the policy.\n" +"--UserName: string\n" + " The name of the user.\n" +, + "--DryRun: bool\n" + " If true, checks whether you have the required permissions to perform the action.\n" "--Filters: ref FiltersUsers\n" " One or more filters.\n" " --Filters.UserIds: array string\n" @@ -4985,6 +5035,11 @@ static int access_key_setter(struct access_key *args, struct osc_str *data) { ARG_TO_JSON_STR("\"State\":", args->state); ret += 1; } + if (args->tag) { + TRY_APPEND_COL(count_args, data); + ARG_TO_JSON_STR("\"Tag\":", args->tag); + ret += 1; + } return !!ret; } @@ -5021,6 +5076,11 @@ static int access_key_secret_key_setter(struct access_key_secret_key *args, stru ARG_TO_JSON_STR("\"State\":", args->state); ret += 1; } + if (args->tag) { + TRY_APPEND_COL(count_args, data); + ARG_TO_JSON_STR("\"Tag\":", args->tag); + ret += 1; + } return !!ret; } @@ -16660,6 +16720,11 @@ static int create_access_key_data(struct osc_env *e, struct osc_create_access_k ARG_TO_JSON_STR("\"ExpirationDate\":", args->expiration_date); ret += 1; } + if (args->tag) { + TRY_APPEND_COL(count_args, data); + ARG_TO_JSON_STR("\"Tag\":", args->tag); + ret += 1; + } if (args->user_name) { TRY_APPEND_COL(count_args, data); ARG_TO_JSON_STR("\"UserName\":", args->user_name); @@ -22248,6 +22313,63 @@ int osc_delete_user_group(struct osc_env *e, struct osc_str *out, struct osc_del osc_deinit_str(&data); return res; } +static int delete_user_policy_data(struct osc_env *e, struct osc_delete_user_policy_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->policy_name) { + TRY_APPEND_COL(count_args, data); + ARG_TO_JSON_STR("\"PolicyName\":", args->policy_name); + ret += 1; + } + if (args->user_name) { + TRY_APPEND_COL(count_args, data); + ARG_TO_JSON_STR("\"UserName\":", args->user_name); + ret += 1; + } + osc_str_append_string(data, "}"); + +no_data: + osc_str_append_string(&end_call, "/api/v1/DeleteUserPolicy"); + curl_easy_setopt(e->c, CURLOPT_URL, end_call.buf); + osc_deinit_str(&end_call); + return !!ret; +} + +int osc_delete_user_policy(struct osc_env *e, struct osc_str *out, struct osc_delete_user_policy_arg *args) +{ + CURLcode res = CURLE_OUT_OF_MEMORY; + struct osc_str data; + int r; + + osc_init_str(&data); + r = delete_user_policy_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_user_data(struct osc_env *e, struct osc_delete_user_arg *args, struct osc_str *data) { struct osc_str end_call; @@ -23516,6 +23638,68 @@ int osc_put_user_group_policy(struct osc_env *e, struct osc_str *out, struct osc osc_deinit_str(&data); return res; } +static int put_user_policy_data(struct osc_env *e, struct osc_put_user_policy_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->policy_document) { + TRY_APPEND_COL(count_args, data); + ARG_TO_JSON_STR("\"PolicyDocument\":", args->policy_document); + ret += 1; + } + if (args->policy_name) { + TRY_APPEND_COL(count_args, data); + ARG_TO_JSON_STR("\"PolicyName\":", args->policy_name); + ret += 1; + } + if (args->user_name) { + TRY_APPEND_COL(count_args, data); + ARG_TO_JSON_STR("\"UserName\":", args->user_name); + ret += 1; + } + osc_str_append_string(data, "}"); + +no_data: + osc_str_append_string(&end_call, "/api/v1/PutUserPolicy"); + curl_easy_setopt(e->c, CURLOPT_URL, end_call.buf); + osc_deinit_str(&end_call); + return !!ret; +} + +int osc_put_user_policy(struct osc_env *e, struct osc_str *out, struct osc_put_user_policy_arg *args) +{ + CURLcode res = CURLE_OUT_OF_MEMORY; + struct osc_str data; + int r; + + osc_init_str(&data); + r = put_user_policy_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_access_keys_data(struct osc_env *e, struct osc_read_access_keys_arg *args, struct osc_str *data) { struct osc_str end_call; @@ -23543,6 +23727,11 @@ static int read_access_keys_data(struct osc_env *e, struct osc_read_access_keys STRY(osc_str_append_string(data, "}" )); ret += 1; } + if (args->tag) { + TRY_APPEND_COL(count_args, data); + ARG_TO_JSON_STR("\"Tag\":", args->tag); + ret += 1; + } if (args->user_name) { TRY_APPEND_COL(count_args, data); ARG_TO_JSON_STR("\"UserName\":", args->user_name); @@ -27118,6 +27307,115 @@ int osc_read_user_groups(struct osc_env *e, struct osc_str *out, struct osc_read osc_deinit_str(&data); return res; } +static int read_user_policies_data(struct osc_env *e, struct osc_read_user_policies_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->user_name) { + TRY_APPEND_COL(count_args, data); + ARG_TO_JSON_STR("\"UserName\":", args->user_name); + ret += 1; + } + osc_str_append_string(data, "}"); + +no_data: + osc_str_append_string(&end_call, "/api/v1/ReadUserPolicies"); + curl_easy_setopt(e->c, CURLOPT_URL, end_call.buf); + osc_deinit_str(&end_call); + return !!ret; +} + +int osc_read_user_policies(struct osc_env *e, struct osc_str *out, struct osc_read_user_policies_arg *args) +{ + CURLcode res = CURLE_OUT_OF_MEMORY; + struct osc_str data; + int r; + + osc_init_str(&data); + r = read_user_policies_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_user_policy_data(struct osc_env *e, struct osc_read_user_policy_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->policy_name) { + TRY_APPEND_COL(count_args, data); + ARG_TO_JSON_STR("\"PolicyName\":", args->policy_name); + ret += 1; + } + if (args->user_name) { + TRY_APPEND_COL(count_args, data); + ARG_TO_JSON_STR("\"UserName\":", args->user_name); + ret += 1; + } + osc_str_append_string(data, "}"); + +no_data: + osc_str_append_string(&end_call, "/api/v1/ReadUserPolicy"); + curl_easy_setopt(e->c, CURLOPT_URL, end_call.buf); + osc_deinit_str(&end_call); + return !!ret; +} + +int osc_read_user_policy(struct osc_env *e, struct osc_str *out, struct osc_read_user_policy_arg *args) +{ + CURLcode res = CURLE_OUT_OF_MEMORY; + struct osc_str data; + int r; + + osc_init_str(&data); + r = read_user_policy_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_users_data(struct osc_env *e, struct osc_read_users_arg *args, struct osc_str *data) { struct osc_str end_call; diff --git a/osc_sdk.h b/osc_sdk.h index 7cac16d..d6196d2 100644 --- a/osc_sdk.h +++ b/osc_sdk.h @@ -77,8 +77,8 @@ struct osc_str { #define OSC_ENV_FREE_AK_SK (OSC_ENV_FREE_AK | OSC_ENV_FREE_SK) -#define OSC_API_VERSION "1.34.0" -#define OSC_SDK_VERSION 0X001300 +#define OSC_API_VERSION "1.34.3" +#define OSC_SDK_VERSION 0X001400 enum osc_auth_method { OSC_AKSK_METHOD, @@ -170,6 +170,10 @@ struct access_key { * calls, or `INACTIVE` if not). */ char *state; + /* + * The tag added to the access key. + */ + char *tag; }; struct access_key_secret_key { @@ -198,6 +202,10 @@ struct access_key_secret_key { * calls, or `INACTIVE` if not). */ char *state; + /* + * A tag added to the access key. + */ + char *tag; }; struct access_log { @@ -968,8 +976,11 @@ struct direct_link { struct direct_link_interface { /* * The BGP (Border Gateway Protocol) ASN (Autonomous System Number) on - * the customer's side of the DirectLink interface. This number must be - * between `64512` and `65534`. + * the customer's side of the DirectLink interface.
\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; @@ -7312,6 +7323,10 @@ struct osc_create_access_key_arg { * method without specifying this parameter. */ char *expiration_date; + /* + * A tag to add to the access key. + */ + char *tag; /* * The name of the EIM user that owns the key to be created. If you do * not specify a user name, this action creates an access key for the @@ -7552,9 +7567,15 @@ struct osc_create_direct_link_interface_arg { * --DirectLinkInterface.BgpAsn: long long int * The BGP (Border Gateway Protocol) ASN (Autonomous System Number) * on the - * customer's side of the DirectLink interface. This number must be - * between - * `64512` and `65534`. + * customer's side of the DirectLink interface.
\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). * --DirectLinkInterface.BgpKey: string * The BGP authentication key. * --DirectLinkInterface.ClientPrivateIp: string @@ -8133,16 +8154,15 @@ struct osc_create_net_peering_arg { /* Required: AccepterNetId SourceNetId */ /* - * 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. + * 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.

\nThis parameter is required if + * 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; @@ -9928,6 +9948,26 @@ struct osc_delete_user_group_arg { char *user_group_name; }; +struct osc_delete_user_policy_arg { + /* Required: UserName PolicyName + */ + /* + * If true, checks whether you have the required permissions to perform + * the action. + */ + int is_set_dry_run; + int dry_run; + /* + * The name of the policy document you want to delete (between 1 and 128 + * characters). + */ + char *policy_name; + /* + * The name of the user you want to delete the policy from. + */ + char *user_name; +}; + struct osc_delete_user_arg { /* Required: UserName */ @@ -10384,6 +10424,34 @@ struct osc_put_user_group_policy_arg { char *user_group_path; }; +struct osc_put_user_policy_arg { + /* Required: PolicyName PolicyDocument UserName + */ + /* + * If true, checks whether you have the required permissions to perform + * the action. + */ + int is_set_dry_run; + int dry_run; + /* + * The policy document, corresponding to a JSON string that contains the + * policy. 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 + * .html). + */ + char *policy_document; + /* + * The name of the policy (between 1 and 128 characters). + */ + char *policy_name; + /* + * The name of the user. + */ + char *user_name; +}; + struct osc_read_access_keys_arg { /* Required: null */ @@ -10403,6 +10471,10 @@ struct osc_read_access_keys_arg { char *filters_str; int is_set_filters; struct filters_access_keys filters; + /* + * The tag added to the access key. + */ + char *tag; /* * The name of the EIM user. By default, the user who sends the request * (which can be the root account). @@ -12508,6 +12580,40 @@ struct osc_read_user_groups_arg { long long int results_per_page; }; +struct osc_read_user_policies_arg { + /* Required: UserName + */ + /* + * If true, checks whether you have the required permissions to perform + * the action. + */ + int is_set_dry_run; + int dry_run; + /* + * The name of the user. + */ + char *user_name; +}; + +struct osc_read_user_policy_arg { + /* Required: UserName PolicyName + */ + /* + * If true, checks whether you have the required permissions to perform + * the action. + */ + int is_set_dry_run; + int dry_run; + /* + * The name of the policy. + */ + char *policy_name; + /* + * The name of the user. + */ + char *user_name; +}; + struct osc_read_users_arg { /* Required: null */ @@ -14762,6 +14868,7 @@ int osc_delete_subnet(struct osc_env *e, struct osc_str *out, struct osc_delete_ int osc_delete_tags(struct osc_env *e, struct osc_str *out, struct osc_delete_tags_arg *args); int osc_delete_user_group_policy(struct osc_env *e, struct osc_str *out, struct osc_delete_user_group_policy_arg *args); int osc_delete_user_group(struct osc_env *e, struct osc_str *out, struct osc_delete_user_group_arg *args); +int osc_delete_user_policy(struct osc_env *e, struct osc_str *out, struct osc_delete_user_policy_arg *args); int osc_delete_user(struct osc_env *e, struct osc_str *out, struct osc_delete_user_arg *args); int osc_delete_virtual_gateway(struct osc_env *e, struct osc_str *out, struct osc_delete_virtual_gateway_arg *args); int osc_delete_vm_group(struct osc_env *e, struct osc_str *out, struct osc_delete_vm_group_arg *args); @@ -14783,6 +14890,7 @@ int osc_link_route_table(struct osc_env *e, struct osc_str *out, struct osc_link int osc_link_virtual_gateway(struct osc_env *e, struct osc_str *out, struct osc_link_virtual_gateway_arg *args); int osc_link_volume(struct osc_env *e, struct osc_str *out, struct osc_link_volume_arg *args); int osc_put_user_group_policy(struct osc_env *e, struct osc_str *out, struct osc_put_user_group_policy_arg *args); +int osc_put_user_policy(struct osc_env *e, struct osc_str *out, struct osc_put_user_policy_arg *args); int osc_read_access_keys(struct osc_env *e, struct osc_str *out, struct osc_read_access_keys_arg *args); int osc_read_accounts(struct osc_env *e, struct osc_str *out, struct osc_read_accounts_arg *args); int osc_read_admin_password(struct osc_env *e, struct osc_str *out, struct osc_read_admin_password_arg *args); @@ -14842,6 +14950,8 @@ int osc_read_user_group_policy(struct osc_env *e, struct osc_str *out, struct os int osc_read_user_group(struct osc_env *e, struct osc_str *out, struct osc_read_user_group_arg *args); int osc_read_user_groups_per_user(struct osc_env *e, struct osc_str *out, struct osc_read_user_groups_per_user_arg *args); int osc_read_user_groups(struct osc_env *e, struct osc_str *out, struct osc_read_user_groups_arg *args); +int osc_read_user_policies(struct osc_env *e, struct osc_str *out, struct osc_read_user_policies_arg *args); +int osc_read_user_policy(struct osc_env *e, struct osc_str *out, struct osc_read_user_policy_arg *args); int osc_read_users(struct osc_env *e, struct osc_str *out, struct osc_read_users_arg *args); int osc_read_virtual_gateways(struct osc_env *e, struct osc_str *out, struct osc_read_virtual_gateways_arg *args); int osc_read_vm_groups(struct osc_env *e, struct osc_str *out, struct osc_read_vm_groups_arg *args); diff --git a/version b/version index faef31a..a3df0a6 100644 --- a/version +++ b/version @@ -1 +1 @@ -0.7.0 +0.8.0