Click or drag to resize

IWsMonitoringSetPurchaseMonitoringService Method

By the method SetPurchaseMonitoringService you can purchase a Monitoring Service
By the method SetPurchaseMonitoringService you can purchase a Monitoring Service

Namespace:  Aruba.Cloud.WsMonitoring
Assembly:  Aruba.Cloud.WsMonitoring (in Aruba.Cloud.WsMonitoring.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
[OperationContractAttribute]
WsResult<int> SetPurchaseMonitoringService(
	NewMonitoringServiceEntity newMonitoringServiceEntity
)

Parameters

newMonitoringServiceEntity
Type: Aruba.Cloud.Provisioning.Entities.MonitoringSLANewMonitoringServiceEntity

Return Value

Type: WsResultInt32
Examples
By the method SetPurchaseMonitoringService you can purchase a Monitoring Service. Type Integer: monitoring class of service id to purchase.Type String: monitor service name.
/// WsMonitoring.SetPurchaseMonitoringService Method (c# .NET)
public static string SetPurchaseMonitoringService(WsMonitoringClient client,
    int monitorMonitoringClassOfServiceID, String monitorName)
{
    //specify the account login details 
    client.ClientCredentials.UserName.UserName = "ARU-0000";
    client.ClientCredentials.UserName.Password = "0123456789";

    StringBuilder stringBuilder = new StringBuilder();

    try
    {
 // create the request object
 NewMonitoringServiceEntity request = new NewMonitoringServiceEntity();
 request.MonitoringClassOfServiceID = monitorMonitoringClassOfServiceID;
 request.Name = monitorName;

 // call method SetPurchaseMonitoringService 
 // obtaining a WsResultOfint item
 WsResultOfint result = client.SetPurchaseMonitoringService(request);

 //if the call is Success print value
 if (result.Success)
 {
     // get Value returned from server
     stringBuilder.Append(" Operation 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