IWsDBaaSGetOperationsLog Method
|
Returns the list of logs of the DBaaS service for a specified period.
It is also possible get the logs regarding currently working jobs.
Namespace:
Aruba.Cloud.WsDBaaS
Assembly:
WsDBaaS (in WsDBaaS.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax[OperationContractAttribute]
WsResult<List<DBaaSOperationLog>> GetOperationsLog(
GetOperationsLogRequest request
)
<OperationContractAttribute>
Function GetOperationsLog (
request As GetOperationsLogRequest
) As WsResult(Of List(Of DBaaSOperationLog))
[OperationContractAttribute]
WsResult<List<DBaaSOperationLog^>^>^ GetOperationsLog(
GetOperationsLogRequest^ request
)
[<OperationContractAttribute>]
abstract GetOperationsLog :
request : GetOperationsLogRequest -> WsResult<List<DBaaSOperationLog>>
function GetOperationsLog(
request : GetOperationsLogRequest
) : WsResult<List<DBaaSOperationLog>>
Parameters
- request
- Type: Aruba.Cloud.WsDBaaS.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:
WsResultListDBaaSOperationLogList of DBaaSOperationLog
Examples
The following example retrieve a list of logged user's DBaaS operations based on from and to specified dates.
public List<DBaaSOperationLog> 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 (WsDBaaSClient client = this.WsDBaaSClient)
{
WsResultOfArrayOfDBaaSOperationLog result = client.GetOperationsLog(request);
if (result.Success)
return result.Value.ToList();
else
{
this.LogError("GetLogs (DBaaS)", result);
throw new CodedException(this.GetErrorCode(result.ResultCode), result.ResultMessage);
}
}
}
See Also