예제 #1
0
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.ConfigService.Model.StopConfigurationRecorderRequest();

            if (cmdletContext.ConfigurationRecorderName != null)
            {
                request.ConfigurationRecorderName = cmdletContext.ConfigurationRecorderName;
            }

            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);
        }
        /// <summary>
        /// Initiates the asynchronous execution of the StopConfigurationRecorder operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the StopConfigurationRecorder 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<StopConfigurationRecorderResponse> StopConfigurationRecorderAsync(StopConfigurationRecorderRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new StopConfigurationRecorderRequestMarshaller();
            var unmarshaller = StopConfigurationRecorderResponseUnmarshaller.Instance;

            return InvokeAsync<StopConfigurationRecorderRequest,StopConfigurationRecorderResponse>(request, marshaller, 
                unmarshaller, cancellationToken);
        }
 /// <summary>
 /// Stops recording configurations of the AWS resources you have selected to record in
 /// your AWS account.
 /// </summary>
 /// <param name="configurationRecorderName">The name of the recorder object that records each configuration change made to the resources.</param>
 /// <param name="cancellationToken">
 ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
 /// </param>
 /// 
 /// <returns>The response from the StopConfigurationRecorder service method, as returned by ConfigService.</returns>
 /// <exception cref="Amazon.ConfigService.Model.NoSuchConfigurationRecorderException">
 /// You have specified a configuration recorder that does not exist.
 /// </exception>
 public Task<StopConfigurationRecorderResponse> StopConfigurationRecorderAsync(string configurationRecorderName, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
 {
     var request = new StopConfigurationRecorderRequest();
     request.ConfigurationRecorderName = configurationRecorderName;
     return StopConfigurationRecorderAsync(request, cancellationToken);
 }
        internal StopConfigurationRecorderResponse StopConfigurationRecorder(StopConfigurationRecorderRequest request)
        {
            var marshaller = new StopConfigurationRecorderRequestMarshaller();
            var unmarshaller = StopConfigurationRecorderResponseUnmarshaller.Instance;

            return Invoke<StopConfigurationRecorderRequest,StopConfigurationRecorderResponse>(request, marshaller, unmarshaller);
        }
        /// <summary>
        /// Initiates the asynchronous execution of the StopConfigurationRecorder operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the StopConfigurationRecorder operation on AmazonConfigServiceClient.</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 EndStopConfigurationRecorder
        ///         operation.</returns>
        public IAsyncResult BeginStopConfigurationRecorder(StopConfigurationRecorderRequest request, AsyncCallback callback, object state)
        {
            var marshaller = new StopConfigurationRecorderRequestMarshaller();
            var unmarshaller = StopConfigurationRecorderResponseUnmarshaller.Instance;

            return BeginInvoke<StopConfigurationRecorderRequest>(request, marshaller, unmarshaller,
                callback, state);
        }
 /// <summary>
 /// Stops recording configurations of all the resources associated with the account.
 /// </summary>
 /// <param name="configurationRecorderName">The name of the recorder object that records each configuration change made to the resources.</param>
 /// 
 /// <returns>The response from the StopConfigurationRecorder service method, as returned by ConfigService.</returns>
 /// <exception cref="Amazon.ConfigService.Model.NoSuchConfigurationRecorderException">
 /// You have specified a configuration recorder that does not exist.
 /// </exception>
 public StopConfigurationRecorderResponse StopConfigurationRecorder(string configurationRecorderName)
 {
     var request = new StopConfigurationRecorderRequest();
     request.ConfigurationRecorderName = configurationRecorderName;
     return StopConfigurationRecorder(request);
 }
예제 #7
0
 private Amazon.ConfigService.Model.StopConfigurationRecorderResponse CallAWSServiceOperation(IAmazonConfigService client, Amazon.ConfigService.Model.StopConfigurationRecorderRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Config", "StopConfigurationRecorder");
     try
     {
         #if DESKTOP
         return(client.StopConfigurationRecorder(request));
         #elif CORECLR
         return(client.StopConfigurationRecorderAsync(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;
     }
 }