コード例 #1
0
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.DataPipeline.Model.DeactivatePipelineRequest();

            if (cmdletContext.CancelActive != null)
            {
                request.CancelActive = cmdletContext.CancelActive.Value;
            }
            if (cmdletContext.PipelineId != null)
            {
                request.PipelineId = cmdletContext.PipelineId;
            }

            CmdletOutput output;

            // issue call
            var client = Client ?? CreateClient(_CurrentCredentials, _RegionEndpoint);

            try
            {
                var    response       = CallAWSServiceOperation(client, request);
                object pipelineOutput = null;
                pipelineOutput = cmdletContext.Select(response, this);
                output         = new CmdletOutput
                {
                    PipelineOutput  = pipelineOutput,
                    ServiceResponse = response
                };
            }
            catch (Exception e)
            {
                output = new CmdletOutput {
                    ErrorResponse = e
                };
            }

            return(output);
        }
コード例 #2
0
        /// <summary>
        /// Initiates the asynchronous execution of the DeactivatePipeline operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the DeactivatePipeline operation on AmazonDataPipelineClient.</param>
        /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
        /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
        ///          procedure using the AsyncState property.</param>
        /// 
        /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDeactivatePipeline
        ///         operation.</returns>
        public IAsyncResult BeginDeactivatePipeline(DeactivatePipelineRequest request, AsyncCallback callback, object state)
        {
            var marshaller = new DeactivatePipelineRequestMarshaller();
            var unmarshaller = DeactivatePipelineResponseUnmarshaller.Instance;

            return BeginInvoke<DeactivatePipelineRequest>(request, marshaller, unmarshaller,
                callback, state);
        }
コード例 #3
0
        /// <summary>
        /// Deactivates the specified running pipeline. The pipeline is set to the <code>DEACTIVATING</code>
        /// state until the deactivation process completes.
        /// 
        ///  
        /// <para>
        /// To resume a deactivated pipeline, use <a>ActivatePipeline</a>. By default, the pipeline
        /// resumes from the last completed execution. Optionally, you can specify the date and
        /// time to resume the pipeline.
        /// </para>
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the DeactivatePipeline service method.</param>
        /// 
        /// <returns>The response from the DeactivatePipeline service method, as returned by DataPipeline.</returns>
        /// <exception cref="Amazon.DataPipeline.Model.InternalServiceErrorException">
        /// An internal service error occurred.
        /// </exception>
        /// <exception cref="Amazon.DataPipeline.Model.InvalidRequestException">
        /// The request was not valid. Verify that your request was properly formatted, that the
        /// signature was generated with the correct credentials, and that you haven't exceeded
        /// any of the service limits for your account.
        /// </exception>
        /// <exception cref="Amazon.DataPipeline.Model.PipelineDeletedException">
        /// The specified pipeline has been deleted.
        /// </exception>
        /// <exception cref="Amazon.DataPipeline.Model.PipelineNotFoundException">
        /// The specified pipeline was not found. Verify that you used the correct user and account
        /// identifiers.
        /// </exception>
        public DeactivatePipelineResponse DeactivatePipeline(DeactivatePipelineRequest request)
        {
            var marshaller = new DeactivatePipelineRequestMarshaller();
            var unmarshaller = DeactivatePipelineResponseUnmarshaller.Instance;

            return Invoke<DeactivatePipelineRequest,DeactivatePipelineResponse>(request, marshaller, unmarshaller);
        }
コード例 #4
0
        /// <summary>
        /// Initiates the asynchronous execution of the DeactivatePipeline operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the DeactivatePipeline operation.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        /// <returns>The task object representing the asynchronous operation.</returns>
        public Task<DeactivatePipelineResponse> DeactivatePipelineAsync(DeactivatePipelineRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new DeactivatePipelineRequestMarshaller();
            var unmarshaller = DeactivatePipelineResponseUnmarshaller.Instance;

            return InvokeAsync<DeactivatePipelineRequest,DeactivatePipelineResponse>(request, marshaller, 
                unmarshaller, cancellationToken);
        }
コード例 #5
0
 private Amazon.DataPipeline.Model.DeactivatePipelineResponse CallAWSServiceOperation(IAmazonDataPipeline client, Amazon.DataPipeline.Model.DeactivatePipelineRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Data Pipeline", "DeactivatePipeline");
     try
     {
         #if DESKTOP
         return(client.DeactivatePipeline(request));
         #elif CORECLR
         return(client.DeactivatePipelineAsync(request).GetAwaiter().GetResult());
         #else
                 #error "Unknown build edition"
         #endif
     }
     catch (AmazonServiceException exc)
     {
         var webException = exc.InnerException as System.Net.WebException;
         if (webException != null)
         {
             throw new Exception(Utils.Common.FormatNameResolutionFailureMessage(client.Config, webException.Message), webException);
         }
         throw;
     }
 }