IWsLicenseSetEnqueuePurchasePleskLicense Method |
Namespace: Aruba.Cloud.WsLicense
[OperationContractAttribute] WsResult SetEnqueuePurchasePleskLicense( int licensePleskTypeID, List<AddonLicense> addonPleskLicenses )
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)); } }