Ejemplo n.º 1
0
        protected override void ProcessRecord()
        {
            base.ProcessRecord();

            if (!ConfirmDelete("OCIVirtualNetworkByoipRange", "Remove"))
            {
                return;
            }

            DeleteByoipRangeRequest request;

            try
            {
                request = new DeleteByoipRangeRequest
                {
                    ByoipRangeId = ByoipRangeId,
                    OpcRequestId = OpcRequestId,
                    IfMatch      = IfMatch
                };

                HandleOutput(request);
                FinishProcessing(response);
            }
            catch (Exception ex)
            {
                TerminatingErrorDuringExecution(ex);
            }
        }
Ejemplo n.º 2
0
        private void HandleOutput(DeleteByoipRangeRequest request)
        {
            var waiterConfig = new WaiterConfiguration
            {
                MaxAttempts           = MaxWaitAttempts,
                GetNextDelayInSeconds = (_) => WaitIntervalSeconds
            };

            switch (ParameterSetName)
            {
            case StatusParamSet:
                response = client.Waiters.ForDeleteByoipRange(request, waiterConfig, WaitForStatus).Execute();
                break;

            case Default:
                response = client.DeleteByoipRange(request).GetAwaiter().GetResult();
                break;
            }
            WriteOutput(response, CreateWorkRequestObject(response.OpcWorkRequestId));
        }