IWsJelasticGetOperationsLog Method
|
Returns the list of logs of the Jelastic service for a specified period.
It is also possible get the logs regarding currently working jobs.
Namespace:
Aruba.Cloud.WsJelastic
Assembly:
WsJelastic (in WsJelastic.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax[OperationContractAttribute]
WsResult<List<JelasticOperationLog>> GetOperationsLog(
GetOperationsLogRequest request
)
<OperationContractAttribute>
Function GetOperationsLog (
request As GetOperationsLogRequest
) As WsResult(Of List(Of JelasticOperationLog))
[OperationContractAttribute]
WsResult<List<JelasticOperationLog^>^>^ GetOperationsLog(
GetOperationsLogRequest^ request
)
[<OperationContractAttribute>]
abstract GetOperationsLog :
request : GetOperationsLogRequest -> WsResult<List<JelasticOperationLog>>
function GetOperationsLog(
request : GetOperationsLogRequest
) : WsResult<List<JelasticOperationLog>>
Parameters
- request
- Type: Aruba.Cloud.WsJelastic.RequestsGetOperationsLogRequest
A GetOperationsLogRequest object, it defines the date range of requests
and if the method must return the currently working jobs information
Return Value
Type:
WsResultListJelasticOperationLogList of JelasticOperationLog
Examples
The following example retrieve a list of logged user's Jelastic operations based on from and to specified dates.
public List<JelasticOperationLog> GetLogs(DateTime? from, DateTime? to)
{
DateTime dateFrom = DateTime.Now.AddMonths(-3);
DateTime dateTo = DateTime.Now;
if (from.HasValue)
dateFrom = from.Value;
if (to.HasValue)
dateTo = to.Value;
var request = new GetOperationsLogRequest()
{
From = dateFrom,
To = dateTo,
ExecutionStatus = ExecutionStatus.Completed
};
using (WsJelasticClient client = this.WsJelasticClient)
{
WsResultOfArrayOfJelasticOperationLog result = client.GetOperationsLog(request);
if (result.Success)
return result.Value.ToList();
else
{
this.LogError("GetLogs (Jelastic)", result);
throw new CodedException(this.GetErrorCode(result.ResultCode), result.ResultMessage);
}
}
}
See Also