Storage > 2 - Account Management > Change Account Password

2.2 Change Account Password

By the method SetCloudStorageAccountPassword you can change a Cloud Storage Account password.
 
Parameters
password
Type: String
String type item which contains the new password. The password must be alphanumeric and have a minimum length of 9 characters, special characters allowed: '_','-','@',’.'
 
Returns
The method returns a WsResult item with information on the result of the call to the method.
 
//WsCloudStorage.SetCloudStorageAccountPassword Method (c# .NET)
private static void SetCloudStorageAccountPassword(WsCloudStorageClient client, int 
    cloudStorageAccountId, String privateKey)
{

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

        //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.SetCloudStorageAccountPassword Method Method (JAVA)
private static void SetCloudStorageAccountPassword(IWsCloudStorage client, Integer 
    cloudStoraceAccountId, String privateKey) 
{
    //specify the account login details     
     ((BindingProvider) wsCloudStorage).getRequestContext()
     .put(BindingProvider.USERNAME_PROPERTY, "ARU-0000");
     ((BindingProvider) wsCloudStorage).getRequestContext()
     .put(BindingProvider.PASSWORD_PROPERTY, "1234567890");

    try {
        // call method SetCloudStorageAccountPassword,
        // obtaining a WsResult item
        WsResult result = 
            client.setCloudStorageAccountPassword(cloudStoraceAccountId, 
            privateKey);

        //if the call is not successful, re-run the error indicating the message
        if (!result.isSuccess()) {
            throw new Exception(result.getResultMessage().getValue());
        }
    } catch (Exception ex) {
        //show result
        System.out.println(ex);
    }
}
Versione
API: v2.8 URL: https://api.services.cloud.it/wsCloudStorage/v2.8/WsCloudStorage.svc?wsdl