/// <summary> /// Creates a waiter using the provided configuration. /// </summary> /// <param name="request">Request to send.</param> /// <param name="config">Wait Configuration</param> /// <param name="targetStates">Desired resource states. If multiple states are provided then the waiter will return once the resource reaches any of the provided states</param> /// <returns>a new Oci.common.Waiter instance</returns> public Waiter <GetLogRequest, GetLogResponse> ForLog(GetLogRequest request, WaiterConfiguration config, params LogLifecycleState[] targetStates) { var agent = new WaiterAgent <GetLogRequest, GetLogResponse>( request, request => client.GetLog(request), response => targetStates.Contains(response.Log.LifecycleState.Value) ); return(new Waiter <GetLogRequest, GetLogResponse>(config, agent)); }
private static async Task GetLog(LoggingManagementClient client, string logGroupId, string logId) { GetLogRequest getLogRequest = new GetLogRequest { LogGroupId = logGroupId, LogId = logId }; logger.Info("Getting log Details for this Log"); logger.Info("============="); GetLogResponse getLogResponse = await client.GetLog(getLogRequest); Log log = getLogResponse.Log; logger.Info($"Name:{log.DisplayName}"); logger.Info($"Log ID:{log.Id}"); logger.Info($"Log Group ID:{log.LogGroupId}"); logger.Info($"Log Lifecycle State:{log.LifecycleState}"); logger.Info($"Time Created:{log.TimeCreated}"); logger.Info($"Time Last Modified:{log.TimeLastModified}"); logger.Info($"Retention Duration:{log.RetentionDuration} days"); }