Click or drag to resize

IWsMonitoringGetJobs Method

By the method GetJobs you can retrieve the list of Jobs from Monitoring task
By the method GetJobs you can retrieve the list of Jobs from Monitoring task

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<List<MonitoringJobEntity>> GetJobs()

Return Value

Type: WsResultListMonitoringJobEntity
Examples
By the method GetJobs you can retrieve the list of Jobs from Monitoring task.
/// WsMonitoring.GetJobs Method (c# .NET)
public static string GetJobs(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 GetJobs 
 // obtaining a WsResultOfArrayOfMonitoringJobEntity item
 WsResultOfArrayOfMonitoringJobEntity result =
     client.GetJobs();

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

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

     // for each item print the information
     foreach (MonitoringJobEntity item in items)
     {
  stringBuilder.Append("\nJobID: ");
  stringBuilder.Append(item.JobID);
  stringBuilder.Append("\nJobstatus: ");
  stringBuilder.Append(item.Jobstatus);
     }
 }
 else
 {
     throw new ApplicationException(result.ResultMessage);
 }
    }
    catch (Exception ex)
    {
 // re-run the error
 throw new ApplicationException(ex.Message);
    }

    return stringBuilder.ToString();
}
See Also