Click or drag to resize

IWsEndUserSetEnqueuePurchasePrivateCloud Method

By the method SetEnqueuePurchasePrivateCloud you can puchase a private cloud. The method require to specify the name of private cloud, a description, the username and password, a telephone number, an email and the resources quantity

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<PurchasePrivateCloudResponse> SetEnqueuePurchasePrivateCloud(
	PurchasePrivateCloudRequest request
)

Parameters

request
Type: PurchasePrivateCloudRequest
Purchase request Private Cloud

Return Value

Type: WsResultPurchasePrivateCloudResponse
Contains the details of the newly inserted Private Cloud

Return Value

Type: WsResultPurchasePrivateCloudResponse
Remarks
The WsEndUser authenticates the user and retrieves the WcfPlatform which performs as a first validation of the data. After the validation of input data, are added up the prices of individual resources requested, the WcfBilling verifies that the user has sufficient credit for the purchase and the product is the price list. After a successful validation, the WcfPlatform dealing with the inclusion of the request in the tables of privateCloud, the corresponding record in the Job resource and reserves the credit through WcfBilling.
Examples
        /// IWsEndUser.SetEnqueuePurchasePrivateCloud Method (c# .NET)
public static string SetEnqueuePurchasePrivateCloud(WsEndUserClient client,
    PurchasePrivateCloud purchasePrivateCloud)
{
    //specify the account login details 
    client.ClientCredentials.UserName.UserName = "ARU-0000";
    client.ClientCredentials.UserName.Password = "0123456789";

    StringBuilder stringBuilder = new StringBuilder();

    try
    {
    // call method setEnqueuePurchasePrivateCloud 
    // obtaining a WsResultOfint item
    WsResultOfPurchasedPrivateCloud result = 
               client.SetEnqueuePurchasePrivateCloud(purchasePrivateCloud);

    //if the call is Success print value
    if (result.Success)
    {
        // get Value returned from server
        stringBuilder.Append(" Operation ends successfully. Result Code : ");
        stringBuilder.Append(result.ResultCode);
    }
    else
    {
        throw new ApplicationException(result.ResultMessage);
    }
    }
    catch (Exception ex)
    {
    // re-run the error
    throw new ApplicationException(ex.Message);
    }

    return stringBuilder.ToString();
}
See Also