Click or drag to resize

IWsEndUserGetPreConfiguredPackages Method

This method allows to recover pre configured packages.

Namespace:  Aruba.Cloud.WsEndUser
Assembly:  Aruba.Cloud.WsEndUser (in Aruba.Cloud.WsEndUser.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
[OperationContractAttribute]
WsResult<CloudPackage[]> GetPreConfiguredPackages(
	GetPreConfiguredPackagesRequest request
)

Parameters

request
Type: Aruba.Cloud.Provisioning.Entities.SmartVMWareGetPreConfiguredPackagesRequest
Search filters

Return Value

Type: WsResultCloudPackage
List of Packages
Examples
// IWsEndUser.GetPreConfiguredPackages Method (c# .NET)
private static void Test_wsEndUser_GetPreconfiguredPackages()
{
    using (var client = new WsEndUser.WsEndUserClient())
    {
        client.ClientCredentials.UserName.UserName = ARU_0000;
        client.ClientCredentials.UserName.Password = ARU_PSW;
        try
        {
            WsResultOfPreConfiguredPackages result = client.GetPreConfiguredPackages(new GetPreConfiguredPackagesRequestEntity()
            {
                HypervisorType = HypervisorTypes.OpenStackVPSLowCost
            });

            if (result.Success)
            {
                //memorizza nella lista di IPAddress gli IP virtuali ottenuti dal metodo di Aruba WsEndUser
                var res = result.Value;
                StringBuilder sb = new StringBuilder();
                sb.AppendLine("Configured Packages: ");
                foreach (CloudPackage cp in res.CloudPackages)
                {
                    sb.AppendLine("PackageID: " + cp.PackageID);
                    sb.AppendLine("- Price: " + cp.Price);
                    sb.AppendLine("- Description: " + cp.Descriptions[0]);
                    sb.AppendLine("- Cpu Quantity: " + cp.CpuQuantity);
                    sb.AppendLine("- Billing Type: " + cp.BillingType);
                    sb.AppendLine("- Hdd0Quantity: " + cp.Hdd0Quantity);
                }

                sb.AppendLine("");
                sb.AppendLine("Additional IP Services: ");
                foreach (var pi in res.AdditionalIPServices)
                {
                    sb.AppendLine("Product ID: " + pi.ProductInfo.ProductID);
                    sb.AppendLine("- IP Type: " + pi.PublicIPType);
                    sb.AppendLine("- Billing Type: " + pi.ProductInfo.BillingType);
                    sb.AppendLine("- Price: " + pi.ProductInfo.Price);
                }
                Console.WriteLine(sb.ToString());
            }
        }
        catch (Exception ex)
        {
            //rilancia l'errore
            throw new ApplicationException(String.Format(
              "An error has occurred while retrieving PreconfiguredPackages. {0}", ex.Message));
        }
    }
}
See Also