Monitoring > 2 - Management Monitoring Services > Upgrade Monitoring Service

2.4 Upgrade Monitoring Service


By the method SetUpgradeMonitoringService you can upgrade the Class of Service about a Monitoring Service.

Parameters
monitoringServiceID
Type: Integer
monitoring service id.

monitoringClassOfServiceID
Type: Integer
class of service id.


/// WsMonitoring.SetUpgradeMonitoringService Method (c# .NET)
public static string SetUpgradeMonitoringService(WsMonitoringClient client,
    int monitoringClassOfServiceID, 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
 UpgradeMonitoringServiceEntity request = new UpgradeMonitoringServiceEntity();
 request.MonitoringServiceID = monitoringServiceID;
 request.MonitoringClassOfServiceID = monitoringClassOfServiceID;

 // call method SetUpgradeMonitoringService 
 // obtaining a WsResult item
 WsResult result = client.SetUpgradeMonitoringService(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.SetUpgradeMonitoringService Method (JAVA)
public static String SetUpgradeMonitoringService(IWsMonitoring client, 
    Integer monitoringClassOfServiceID,
    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 
    {
        UpgradeMonitoringServiceEntity upgradeMonitoringServiceEntity = 
     new UpgradeMonitoringServiceEntity();
        upgradeMonitoringServiceEntity.
     setMonitoringClassOfServiceID(monitoringClassOfServiceID);
        upgradeMonitoringServiceEntity.
     setMonitoringServiceID(monitoringServiceID);
    
        WsResult result = 
            client.setUpgradeMonitoringService(upgradeMonitoringServiceEntity);

        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