Click or drag to resize

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
)

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: WsResultListJelasticOperationLog
List 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)
{
    //set default dates
    DateTime dateFrom = DateTime.Now.AddMonths(-3);
    DateTime dateTo = DateTime.Now;

    if (from.HasValue)
        dateFrom = from.Value;

    if (to.HasValue)
        dateTo = to.Value;

    //creating request
    var request = new GetOperationsLogRequest()
    {
        From = dateFrom,
        To = dateTo,
        ExecutionStatus = ExecutionStatus.Completed
    };

    //sending request:
    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