Computing > 11 - Private Cloud > Get private cloud resources types

11.2 Get private cloud resources types

By the method GetPrivateCloudResourcesTypes you can retrieve the resources type for private cloud.
 
    /// IWsEndUser.GetPrivateCloudResourcesTypes Method (c# .NET)
    public static string GetPrivateCloudResourcesTypes(WsEndUserClient client)
    {
        //specify the account login details 
        client.ClientCredentials.UserName.UserName = "ARU-0000";
        client.ClientCredentials.UserName.Password = "0123456789";

        StringBuilder stringBuilder = new StringBuilder();

        try
        {
            // call method WsResultOfPrivateCloudResurcesTypes 
            // obtaining a WsResultOfPrivateCloudEntities item
            WsResultOfPrivateCloudResurcesTypes result =
                client.GetPrivateCloudResourcesTypes();

            // if the call is Success print returned values
            if (result.Success)
            {
                stringBuilder.Append("Operation ends successfully\n");

                // get Value returned from server
                PrivateCloudResurcesTypes items = result.Value;

                // print some general information
                stringBuilder.Append("\nMinimumCpuRamRatio: ");
                stringBuilder.Append(items.MinimumCpuRamRatio);

                if (items.CPUs != null)
                {
                    stringBuilder.Append("CPU Products\n");

                    // for each CPU item print the information
                    foreach (CPUProduct cpuProduct in items.CPUs)
                    {
                        stringBuilder.Append("\nCPUTypeID: ");
                        stringBuilder.Append(cpuProduct.CPUTypeID);
                        stringBuilder.Append("\nProductID: ");
                        stringBuilder.Append(cpuProduct.ProductID);
                        stringBuilder.Append("\nMaxBound: ");
                        stringBuilder.Append(cpuProduct.MaxBound);
                        stringBuilder.Append("\nMinCreateBound: ");
                        stringBuilder.Append(cpuProduct.MinCreateBound);
                    }
                }

                if (items.Disks != null)
                {
                    stringBuilder.Append("Disk Products\n");

                    // for each Disk item print the information
                    foreach (DiskProduct diskProduct in items.Disks)
                    {
                        stringBuilder.Append("\nProductID: ");
                        stringBuilder.Append(diskProduct.ProductID);
                        stringBuilder.Append("\nDiskTypeID: ");
                        stringBuilder.Append(diskProduct.DiskTypeID);
                        stringBuilder.Append("\nDiskType: ");
                        stringBuilder.Append(diskProduct.DiskType);

                        stringBuilder.Append("\nMaxBound: ");
                        stringBuilder.Append(diskProduct.MaxBound);
                        stringBuilder.Append("\nMinCreateBound: ");
                        stringBuilder.Append(diskProduct.MinCreateBound);
                    }
                }
            }
            else
            {
                throw new ApplicationException(result.ResultMessage);
            }
        }
        catch (Exception ex)
        {
            // re-run the error
            throw new ApplicationException(ex.Message);
        }

        return stringBuilder.ToString();
    }
    
    /// IWsEndUser.GetPrivateCloudResourcesTypes Method (JAVA)
    public static String GetPrivateCloudResourcesTypes(IWsEndUser client) 
    {
        //specify the account login details 
        ((BindingProvider) client).getRequestContext()
            .put(BindingProvider.USERNAME_PROPERTY, "ARU-0000");
        ((BindingProvider) client).getRequestContext()
            .put(BindingProvider.PASSWORD_PROPERTY, "0123456789");

        StringBuilder stringBuilder = new StringBuilder();

        try 
        {
            // call method getPrivateCloudResourcesTypes 
            // obtaining a WsResultOfPrivateCloudResurcesTypes item
            WsResultOfPrivateCloudResurcesTypes result =
                client.getPrivateCloudResourcesTypes();

            //if the call is Success print values
            if (result.isSuccess()) 
            {
                stringBuilder.append("Operation ends successfully\n");
                
                // get Value returned from server
                PrivateCloudResurcesTypes items = result.getValue(); 

                // print some general information
                stringBuilder.append("\nMinimumCpuRamRatio: ");
                stringBuilder.append(items.getMinimumCpuRamRatio());

                ArrayOfCPUProduct cpus = items.getCPUs();
                if (cpus != null)
                {
                    stringBuilder.append("CPU Products\n");
                    
                    for (CPUProduct cpuProduct : cpus.getCPUProduct()) 
                    {
                        stringBuilder.append("\nCPUTypeID: ");
                        stringBuilder.append(cpuProduct.getCPUTypeID());
                        stringBuilder.append("\nProductID: ");
                        stringBuilder.append(cpuProduct.getProductID());
                        stringBuilder.append("\nMaxBound: ");
                        stringBuilder.append(cpuProduct.getMaxBound());
                        stringBuilder.append("\nMinCreateBound: ");
                        stringBuilder.append(cpuProduct.getMinCreateBound());
                    }
                }

                ArrayOfDiskProduct disks = items.getDisks();
                if (disks != null)
                {
                    stringBuilder.append("Disk Products\n");
                    
                    for (DiskProduct diskProduct : disks.getDiskProduct()) 
                    {
                        stringBuilder.append("\nProductID: ");
                        stringBuilder.append(diskProduct.getProductID());
                        stringBuilder.append("\nDiskTypeID: ");
                        stringBuilder.append(diskProduct.getDiskTypeID());
                        stringBuilder.append("\nDiskType: ");
                        stringBuilder.append(diskProduct.getDiskType());

                        stringBuilder.append("\nMaxBound: ");
                        stringBuilder.append(diskProduct.getMaxBound());
                        stringBuilder.append("\nMinCreateBound: ");
                        stringBuilder.append(diskProduct.getMinCreateBound());
                    }
                }
            } 
            else 
            {
                throw new Exception(result.getResultMessage());
            }
        } 
        catch (Exception ex) 
        {
            System.out.println(ex);
        }

        return stringBuilder.toString();
    }
    
Version
API: v2.8 URL:https://api.dc1.computing.cloud.it/WsEndUser/v2.8/WsEndUser.svc?wsdl