Click or drag to resize

IWsCloudStorageGetCloudStorageAccounts Method

By the method GetCloudStorageAccounts you can show the list of your accounts

Namespace:  Aruba.Cloud.WsCloudStorage
Assembly:  WsCloudStorage (in WsCloudStorage.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
[OperationContractAttribute]
WsResult<List<CloudStorageAccount>> GetCloudStorageAccounts()

Return Value

Type: WsResultListCloudStorageAccount
Examples
            //WsCloudStorage.GetCloudStorageAccounts Method (c# .NET)
private static String GetCloudStorageAccounts(WsCloudStorageClient client)
{
    //specify the account login details 
    client.ClientCredentials.UserName.UserName = "ARU-0000";
    client.ClientCredentials.UserName.Password = "1234567890";

    StringBuilder stringBuilder = new StringBuilder();
    try
    {
        //call method GetCloudStorageAccounts,
        //obtaining a WsResultOfArrayOfCloudStorageAccount item
        WsResultOfArrayOfCloudStorageAccount result =
        client.GetCloudStorageAccounts();
        System.Console.WriteLine("result.Success " + result.Success);
        //if the call is not successful, re-run the error indicating the message
        if (result.Success)
        {
            CloudStorageAccount[] arrayOfCloudStorageAccount = result.Value;
            //browse the list and print the values
            foreach (CloudStorageAccount cloudStorageAccount in               
                arrayOfCloudStorageAccount)
            {
                int cloudStorageAccountID = 
                    cloudStorageAccount.CloudStorageAccountID;
                stringBuilder.Append(" cloudStorageAccountID: ");
                stringBuilder.Append(cloudStorageAccountID);
            }
        }
        else
        {
            throw new Exception(result.ResultMessage);
        }
    }
    catch (Exception ex)
    {
        //re-run the error
        throw new Exception(ex.Message);
    }

    return stringBuilder.ToString();
}
See Also