Monitoring > 2 - Management Monitoring Services > Delete Monitoring Service

2.5 Delete Monitoring Service


By the method SetEnqueueDeleteMonitoringService you can delete a Monitoring Service.

Parameters
monitoringServiceID
Type: Integer
monitoring service id.

/// WsMonitoring.SetEnqueueDeleteMonitoringService Method (c# .NET)
public static string SetEnqueueDeleteMonitoringService(WsMonitoringClient client,
   int monitoringServiceID)
{
    //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
 DeleteMonitoringServiceEntity request = new DeleteMonitoringServiceEntity();
 request.MonitoringServiceID = monitoringServiceID;
 
 // call method SetEnqueueDeleteMonitoringService 
 // obtaining a WsResult item
 WsResult result = client.SetEnqueueDeleteMonitoringService(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();
}
/// WsMonitoring.SetEnqueueDeleteMonitoringService Method (JAVA)
public static String SetEnqueueDeleteMonitoringService
    (IWsMonitoring client, 
    Integer monitoringServiceID) 
{
    //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 
    {
        DeleteMonitoringServiceEntity deleteMonitoringServiceEntity = 
     new DeleteMonitoringServiceEntity();
        deleteMonitoringServiceEntity.setMonitoringServiceID(monitoringServiceID);
    
        WsResult result = client.
            setEnqueueDeleteMonitoringService(deleteMonitoringServiceEntity);

        if (!result.isSuccess()) 
 {
     throw new Exception(result.getResultMessage());
        }
    } 
    catch (Exception ex) 
    {
        System.out.println(ex);
    }

return stringBuilder.toString();
}
Version
API: v2.8 URL:https://api.services.cloud.it/wsMonitoring/v2.8/wsMonitoring.svc?wsdl
See also