Пример #1
0
        private void HandleOutput(GetAiPrivateEndpointRequest request)
        {
            var waiterConfig = new WaiterConfiguration
            {
                MaxAttempts           = MaxWaitAttempts,
                GetNextDelayInSeconds = (_) => WaitIntervalSeconds
            };

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

            case Default:
                response = client.GetAiPrivateEndpoint(request).GetAwaiter().GetResult();
                break;
            }
            WriteOutput(response, response.AiPrivateEndpoint);
        }
Пример #2
0
        protected override void ProcessRecord()
        {
            base.ProcessRecord();
            GetAiPrivateEndpointRequest request;

            try
            {
                request = new GetAiPrivateEndpointRequest
                {
                    AiPrivateEndpointId = AiPrivateEndpointId,
                    OpcRequestId        = OpcRequestId
                };

                HandleOutput(request);
                FinishProcessing(response);
            }
            catch (Exception ex)
            {
                TerminatingErrorDuringExecution(ex);
            }
        }
Пример #3
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 <GetAiPrivateEndpointRequest, GetAiPrivateEndpointResponse> ForAiPrivateEndpoint(GetAiPrivateEndpointRequest request, WaiterConfiguration config, params AiPrivateEndpoint.LifecycleStateEnum[] targetStates)
        {
            var agent = new WaiterAgent <GetAiPrivateEndpointRequest, GetAiPrivateEndpointResponse>(
                request,
                request => client.GetAiPrivateEndpoint(request),
                response => targetStates.Contains(response.AiPrivateEndpoint.LifecycleState.Value),
                targetStates.Contains(AiPrivateEndpoint.LifecycleStateEnum.Deleted)
                );

            return(new Waiter <GetAiPrivateEndpointRequest, GetAiPrivateEndpointResponse>(config, agent));
        }
Пример #4
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 <GetAiPrivateEndpointRequest, GetAiPrivateEndpointResponse> ForAiPrivateEndpoint(GetAiPrivateEndpointRequest request, params AiPrivateEndpoint.LifecycleStateEnum[] targetStates)
 {
     return(this.ForAiPrivateEndpoint(request, WaiterConfiguration.DefaultWaiterConfiguration, targetStates));
 }