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

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

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

            try
            {
                request = new ChangeComputeCapacityReservationCompartmentRequest
                {
                    CapacityReservationId = CapacityReservationId,
                    ChangeComputeCapacityReservationCompartmentDetails = ChangeComputeCapacityReservationCompartmentDetails,
                    IfMatch       = IfMatch,
                    OpcRequestId  = OpcRequestId,
                    OpcRetryToken = OpcRetryToken
                };

                HandleOutput(request);
                FinishProcessing(response);
            }
            catch (Exception ex)
            {
                TerminatingErrorDuringExecution(ex);
            }
        }
Ejemplo n.º 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 <ChangeComputeCapacityReservationCompartmentRequest, ChangeComputeCapacityReservationCompartmentResponse> ForChangeComputeCapacityReservationCompartment(ChangeComputeCapacityReservationCompartmentRequest request, WaiterConfiguration config, params WorkrequestsService.Models.WorkRequest.StatusEnum[] targetStates)
 {
     return(new Waiter <ChangeComputeCapacityReservationCompartmentRequest, ChangeComputeCapacityReservationCompartmentResponse>(() =>
     {
         var response = client.ChangeComputeCapacityReservationCompartment(request).Result;
         var getWorkRequestRequest = new Oci.WorkrequestsService.Requests.GetWorkRequestRequest
         {
             WorkRequestId = response.OpcWorkRequestId
         };
         workRequestClient.Waiters.ForWorkRequest(getWorkRequestRequest, config, targetStates).Execute();
         return response;
     }));
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Creates a waiter using default wait configuration.
 /// </summary>
 /// <param name="request">Request to send.</param>
 /// <param name="statuses">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 <ChangeComputeCapacityReservationCompartmentRequest, ChangeComputeCapacityReservationCompartmentResponse> ForChangeComputeCapacityReservationCompartment(ChangeComputeCapacityReservationCompartmentRequest request, params WorkrequestsService.Models.WorkRequest.StatusEnum[] targetStates)
 {
     return(this.ForChangeComputeCapacityReservationCompartment(request, WaiterConfiguration.DefaultWaiterConfiguration, targetStates));
 }