コード例 #1
0
        private void HandleOutput(UpgradeDrgRequest request)
        {
            var waiterConfig = new WaiterConfiguration
            {
                MaxAttempts           = MaxWaitAttempts,
                GetNextDelayInSeconds = (_) => WaitIntervalSeconds
            };

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

            case Default:
                response = client.UpgradeDrg(request).GetAwaiter().GetResult();
                break;
            }
            WriteOutput(response, CreateWorkRequestObject(response.OpcWorkRequestId));
        }
コード例 #2
0
        protected override void ProcessRecord()
        {
            base.ProcessRecord();
            UpgradeDrgRequest request;

            try
            {
                request = new UpgradeDrgRequest
                {
                    DrgId         = DrgId,
                    OpcRequestId  = OpcRequestId,
                    OpcRetryToken = OpcRetryToken
                };

                HandleOutput(request);
                FinishProcessing(response);
            }
            catch (Exception ex)
            {
                TerminatingErrorDuringExecution(ex);
            }
        }