Monitoring > 1 - Understanding the platform > Monitoring Check Types

1.2 Monitoring Check Types


By the method GetMonitoringCheckTypes you can retrieve the list of check types available.


/// WsMonitoring.GetMonitoringCheckTypes Method (c# .NET)
public static string GetMonitoringCheckTypes(WsMonitoringClient client)
{
    //specify the account login details 
    client.ClientCredentials.UserName.UserName = "ARU-0000";
    client.ClientCredentials.UserName.Password = "0123456789";

    StringBuilder stringBuilder = new StringBuilder();

    try
    {
 // call method GetMonitoringCheckType 
 // obtaining a WsResultOfArrayOfMonitoringCheckTypeEntity item
 WsResultOfArrayOfMonitoringCheckTypeEntity result =
     client.GetMonitoringCheckType();

 // if the call is Success print returned values
 if (result.Success)
 {
     stringBuilder.Append("Operation ends successfully\n");

     // get Value returned from server
     MonitoringCheckTypeEntity[] items = result.Value;

     // for each item print the information
     foreach (MonitoringCheckTypeEntity item in items)
     {
  stringBuilder.Append("\nMonitoringCheckTypeID: ");
  stringBuilder.Append(item.MonitoringCheckTypeID);
  stringBuilder.Append("\nDescription: ");
  stringBuilder.Append(item.Description);
     }
 }
 else
 {
     throw new ApplicationException(result.ResultMessage);
 }
    }
    catch (Exception ex)
    {
 // re-run the error
 throw new ApplicationException(ex.Message);
    }

    return stringBuilder.ToString();
}
/// WsMonitoring.GetMonitoringCheckTypes Method (JAVA)
public static String GetMonitoringCheckTypes(IWsMonitoring client) 
    {
    //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 
    {
        // call method GetMonitoringCheckTypes 
        // obtaining a WsResultOfArrayOfMonitoringCheckTypeEntity item
        WsResultOfArrayOfMonitoringCheckTypeEntity result 
     = client.getMonitoringCheckType();

        //if the call is Success print values
        if (result.isSuccess()) 
 {
     ArrayOfMonitoringCheckTypeEntity items = result.getValue(); 
     List<monitoringchecktypeentity> monitoringCheckTypeEntity = 
  items.getMonitoringCheckTypeEntity();
 
     for (Iterator<monitoringchecktypeentity> it = 
  monitoringCheckTypeEntity.iterator(); it.hasNext();)
     {
         MonitoringCheckTypeEntity item = it.next();
         stringBuilder.append("\nMonitoringCheckTypeID: ");
         stringBuilder.append(item.getMonitoringCheckTypeID());
         stringBuilder.append("\nDescription: ");
         stringBuilder.append(item.getDescription());
             }
        } 
        else 
        {
     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