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

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

            case Default:
                response = client.GetMetastore(request).GetAwaiter().GetResult();
                break;
            }
            WriteOutput(response, response.Metastore);
        }
Exemplo n.º 2
0
        protected override void ProcessRecord()
        {
            base.ProcessRecord();
            GetMetastoreRequest request;

            try
            {
                request = new GetMetastoreRequest
                {
                    MetastoreId  = MetastoreId,
                    OpcRequestId = OpcRequestId
                };

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