ProcessLogOperationsGetProcessLogs Method |
Retrieves process log files.
Namespace:
Cobra.WebService.ClientAPI.Application.Tools
Assembly:
Cobra.WebService.ClientAPI (in Cobra.WebService.ClientAPI.dll) Version: 8.4.717.3176 (8.4.0717.3176)
Syntax public IEnumerable<ProcessLog> GetProcessLogs(
ProcessLogFilter processLogFilter
)
Parameters
- processLogFilter
- Type: Cobra.Model.WebServiceProcessLogFilter
A ProcessLogFilter containing filters for the process log files.
Return Value
Type:
IEnumerableProcessLogAn enumerable of ProcessLog class.
Exceptions Exception | Condition |
---|
InvalidOperationException | Thrown when state of the instance of the CobraServices that generated the current Integration is not in opened state. |
Examples
This sample shows how to retrieve process log files.
using Cobra.WebService.ClientAPI;
using Cobra.WebService.ClientAPI.Client;
using Cobra.WebService.ClientAPI.Application.Tools;
.
.
.
CobraServices cobraServices = new CobraServices();
cobraServices.ServiceIdentityData.Username = "SYSADMIN";
cobraServices.ServiceIdentityData.SecurePassword = new SecurePassword();
cobraServices.ServiceIdentityData.SecurePassword.AppendChar('P');
cobraServices.ServiceIdentityData.SecurePassword.AppendChar('A');
cobraServices.ServiceIdentityData.SecurePassword.AppendChar('S');
cobraServices.ServiceIdentityData.SecurePassword.AppendChar('S');
cobraServices.ServiceIdentityData.SecurePassword.AppendChar('W');
cobraServices.ServiceIdentityData.SecurePassword.AppendChar('O');
cobraServices.ServiceIdentityData.SecurePassword.AppendChar('R');
cobraServices.ServiceIdentityData.SecurePassword.AppendChar('D');
cobraServices.ServiceIdentityData.DataSourceKey = "COBRA";
LoginResult loginResult = cobraServices.Login();
if (!loginResult.Success) {
Console.WriteLine("Login failed.");
return;
}
Console.WriteLine("Login Success.");
ProcessLogOperations processLogOperations = cobraServices.CreateServiceOperations<ProcessLogOperations>();
ProcessLogFilter processLogFilter = processLogOperations.CreateProcessLogFilter();
processLogFilter.Uid = "EAL9OYCDJZ3G}J2XTHVFSA";
Console.WriteLine("Retreiving process log files...");
IEnumerable<ProcessLog> processLogs = processLogOperations.GetProcessLogs(processLogFilter);
if (processLogs != null && processLogs.Count() > 0) {
ProcessLog processLog = processLogs.First();
Console.WriteLine("ProcessLog with Uid {0} where the process {1} has been run againsts {2} has been retrieved.", processLog.ProcessLogUid, processLog.Project, processLog.Process);
} else
Console.WriteLine("No ProcessLog retrieved.");
cobraServices.LogOut();
See Also