Storage > 2 - Account Management > Create Account

2.1 Create Account

By the method SetCreateCloudStorageAccount you can create a Cloud Storage Account.

Parameters
cloudStorageUser
Type: CloudStorageUser
CloudStorageUser type item which contains the information necessary to use the method, you need to specify the username and password for using the Cloud Storage service, also you must specify the Region where you want create the account, the pricing plan for your account and the behavior to adopt exceeded the limit.
 
Returns
The method returns a WsResultOfint item with information on the result of the call to the method and the account id just created.
 
//WsCloudStorage.SetCreateCloudStorageAccount Method (c# .NET)
private static void SetCreateCloudStorageAccount(WsCloudStorageClient client, 
    CloudStorageUser cloudStorageUser )
{

    //specify the account login details 
    client.ClientCredentials.UserName.UserName = "ARU-0000";
    client.ClientCredentials.UserName.Password = "1234567890";
    try
    {
        //call method SetCreateCloudStorageAccount, 
        //obtaining a WsResultOfint item
        WsResultOfint result = 
            client.SetCreateCloudStorageAccount(cloudStorageUser);

        //if the call is not successful, re-run the error indicating the message
        if (!result.Success)
        {
            throw new Exception(result.ResultMessage);
        }
    }
    catch (Exception ex)
    {
        //re-run the error
        throw new Exception(ex.Message);
    }
}
//IWsCloudStorage.SetCreateCloudStorageAccount Method Method (JAVA)
private static String SetCreateCloudStorageAccount(IWsCloudStorage client, 
    CloudStorageUser cloudStorageUser) {
    //specify the account login details     
     ((BindingProvider) wsCloudStorage).getRequestContext()
     .put(BindingProvider.USERNAME_PROPERTY, "ARU-0000");
     ((BindingProvider) wsCloudStorage).getRequestContext()
     .put(BindingProvider.PASSWORD_PROPERTY, "1234567890");

    StringBuilder sb = new StringBuilder();

    try {
        // call method setCreateCloudStorageAccount,
        // obtaining a WsResultOfint item
        WsResultOfint result = 
            client.setCreateCloudStorageAccount(cloudStorageUser);

        //if the call is not successful, re-run the error indicating the message
        if (result.isSuccess()) {
            Integer value = result.getValue();
            sb.append("value: ");
            sb.append(value);
        } else {
            throw new Exception(result.getResultMessage());
        }
    } catch (Exception ex) {
        //show error
        System.out.println(ex);
    }

    //show result
    System.out.println("sb: " + sb.toString());
    return sb.toString();
}
Versione
API: v2.8 URL: https://api.services.cloud.it/wsCloudStorage/v2.8/WsCloudStorage.svc?wsdl