Click or drag to resize

IWsLicenseSetEnqueuePurchasePleskLicense Method

Append the activity of acquiring a license plesk and license type addon. Using the method SetEnqueuePurchaseLicense() to Aruba WsEndUser you can buy a license specifying the license mother with licenses Addon and the corresponding quantities. The acquisition of licenses plesk can be composed of a license of type 'base' and by a series of additional add-on. Additional add-ons have a relation of compatibility with the base license: not all the add-ons may be compatible with the basic license date. The add-on have a relation of compatibility with other add-on: not all the add-ons can simultaneously be added to a basic license, but the presence of some add-on rule out the possibility of adding other.

Namespace:  Aruba.Cloud.WsLicense
Assembly:  Aruba.Cloud.WsLicense (in Aruba.Cloud.WsLicense.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
[OperationContractAttribute]
WsResult SetEnqueuePurchasePleskLicense(
	int licensePleskTypeID,
	List<AddonLicense> addonPleskLicenses
)

Parameters

licensePleskTypeID
Type: SystemInt32
addonPleskLicenses
Type: System.Collections.GenericListAddonLicense

Return Value

Type: WsResult
The method returns an object WsResult containing information on the outcome of the method call. For further details on the information returned by the method see the class definition WsResult.
Examples
private static void PurchasePleskLicense()
{
  try
  {
    // creates a new object called addonLicense containing licenses Addon to buy
    List<AddonLicense> addonPleskLicenses = new List<AddonLicense>();

    //Es.: LicensePleskTypeAddonID: 9 = Plesk License Module Language
    addonPleskLicenses.Add(new AddonLicense(){LicensePleskTypeAddonID=1,Quantity=100});

    //Base license as ID in the table / column [LicensePleskTypes].[LicensePleskTypeID]

    //Es.: licensePleskTypeID: 6 = Plesk License Windows

    int licensePleskTypeID = 6;

    // makes the call to the method SetEnqueuePurchaseLicense, obtaining an object WsResult
    WsResult result = client.SetEnqueuePurchaseLicense(licensePleskTypeID, addonPleskLicenses);

    // if the call fails, it raises the error message
    if (!result.Success)
    {
      throw new ApplicationException(
        String.Format("An error has occurred while invoking SetEnqueuePurchaseLicense(). {0}", result.ResultMessage));
    }
  }
  catch (Exception ex)
  {
    // raises the generic error
    throw new ApplicationException(
      String.Format("An error has occurred while purchasing a plesk license {0}", ex.Message));
  }
}
See Also