Ejemplo n.º 1
0
        private void HandleOutput(MigrateVaultKeyRequest request)
        {
            var waiterConfig = new WaiterConfiguration
            {
                MaxAttempts           = MaxWaitAttempts,
                GetNextDelayInSeconds = (_) => WaitIntervalSeconds
            };

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

            case Default:
                response = client.MigrateVaultKey(request).GetAwaiter().GetResult();
                break;
            }
            WriteOutput(response, response.Database);
        }
Ejemplo n.º 2
0
        protected override void ProcessRecord()
        {
            base.ProcessRecord();
            MigrateVaultKeyRequest request;

            try
            {
                request = new MigrateVaultKeyRequest
                {
                    DatabaseId             = DatabaseId,
                    MigrateVaultKeyDetails = MigrateVaultKeyDetails,
                    IfMatch       = IfMatch,
                    OpcRetryToken = OpcRetryToken,
                    OpcRequestId  = OpcRequestId
                };

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