private void HandleOutput(GetHeatWaveClusterRequest request)
        {
            var waiterConfig = new WaiterConfiguration
            {
                MaxAttempts           = MaxWaitAttempts,
                GetNextDelayInSeconds = (_) => WaitIntervalSeconds
            };

            switch (ParameterSetName)
            {
            case LifecycleStateParamSet:
                response = client.Waiters.ForHeatWaveCluster(request, waiterConfig, WaitForLifecycleState).Execute();
                break;

            case Default:
                response = client.GetHeatWaveCluster(request).GetAwaiter().GetResult();
                break;
            }
            WriteOutput(response, response.HeatWaveCluster);
        }
        protected override void ProcessRecord()
        {
            base.ProcessRecord();
            GetHeatWaveClusterRequest request;

            try
            {
                request = new GetHeatWaveClusterRequest
                {
                    DbSystemId   = DbSystemId,
                    OpcRequestId = OpcRequestId,
                    IfNoneMatch  = IfNoneMatch
                };

                HandleOutput(request);
                FinishProcessing(response);
            }
            catch (Exception ex)
            {
                TerminatingErrorDuringExecution(ex);
            }
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Creates a waiter using default wait configuration.
 /// </summary>
 /// <param name="request">Request to send.</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 <GetHeatWaveClusterRequest, GetHeatWaveClusterResponse> ForHeatWaveCluster(GetHeatWaveClusterRequest request, params HeatWaveCluster.LifecycleStateEnum[] targetStates)
 {
     return(this.ForHeatWaveCluster(request, WaiterConfiguration.DefaultWaiterConfiguration, targetStates));
 }
Ejemplo n.º 4
0
        /// <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 <GetHeatWaveClusterRequest, GetHeatWaveClusterResponse> ForHeatWaveCluster(GetHeatWaveClusterRequest request, WaiterConfiguration config, params HeatWaveCluster.LifecycleStateEnum[] targetStates)
        {
            var agent = new WaiterAgent <GetHeatWaveClusterRequest, GetHeatWaveClusterResponse>(
                request,
                request => client.GetHeatWaveCluster(request),
                response => targetStates.Contains(response.HeatWaveCluster.LifecycleState.Value),
                targetStates.Contains(HeatWaveCluster.LifecycleStateEnum.Deleted)
                );

            return(new Waiter <GetHeatWaveClusterRequest, GetHeatWaveClusterResponse>(config, agent));
        }