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

            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 StartConfigurationRecorder operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the StartConfigurationRecorder 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<StartConfigurationRecorderResponse> StartConfigurationRecorderAsync(StartConfigurationRecorderRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new StartConfigurationRecorderRequestMarshaller();
            var unmarshaller = StartConfigurationRecorderResponseUnmarshaller.Instance;

            return InvokeAsync<StartConfigurationRecorderRequest,StartConfigurationRecorderResponse>(request, marshaller, 
                unmarshaller, cancellationToken);
        }
 /// <summary>
 /// Starts recording configurations of the AWS resources you have selected to record in
 /// your AWS account.
 /// 
 ///  
 /// <para>
 /// You must have created at least one delivery channel to successfully start the configuration
 /// recorder.
 /// </para>
 /// </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 StartConfigurationRecorder service method, as returned by ConfigService.</returns>
 /// <exception cref="Amazon.ConfigService.Model.NoAvailableDeliveryChannelException">
 /// There is no delivery channel available to record configurations.
 /// </exception>
 /// <exception cref="Amazon.ConfigService.Model.NoSuchConfigurationRecorderException">
 /// You have specified a configuration recorder that does not exist.
 /// </exception>
 public Task<StartConfigurationRecorderResponse> StartConfigurationRecorderAsync(string configurationRecorderName, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
 {
     var request = new StartConfigurationRecorderRequest();
     request.ConfigurationRecorderName = configurationRecorderName;
     return StartConfigurationRecorderAsync(request, cancellationToken);
 }
        internal StartConfigurationRecorderResponse StartConfigurationRecorder(StartConfigurationRecorderRequest request)
        {
            var marshaller = new StartConfigurationRecorderRequestMarshaller();
            var unmarshaller = StartConfigurationRecorderResponseUnmarshaller.Instance;

            return Invoke<StartConfigurationRecorderRequest,StartConfigurationRecorderResponse>(request, marshaller, unmarshaller);
        }
        /// <summary>
        /// Initiates the asynchronous execution of the StartConfigurationRecorder operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the StartConfigurationRecorder 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 EndStartConfigurationRecorder
        ///         operation.</returns>
        public IAsyncResult BeginStartConfigurationRecorder(StartConfigurationRecorderRequest request, AsyncCallback callback, object state)
        {
            var marshaller = new StartConfigurationRecorderRequestMarshaller();
            var unmarshaller = StartConfigurationRecorderResponseUnmarshaller.Instance;

            return BeginInvoke<StartConfigurationRecorderRequest>(request, marshaller, unmarshaller,
                callback, state);
        }
 /// <summary>
 /// Starts recording configurations of all the resources associated with the account.
 /// 
 ///  
 /// <para>
 /// You must have created at least one delivery channel to successfully start the configuration
 /// recorder.
 /// </para>
 /// </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 StartConfigurationRecorder service method, as returned by ConfigService.</returns>
 /// <exception cref="Amazon.ConfigService.Model.NoAvailableDeliveryChannelException">
 /// There is no delivery channel available to record configurations.
 /// </exception>
 /// <exception cref="Amazon.ConfigService.Model.NoSuchConfigurationRecorderException">
 /// You have specified a configuration recorder that does not exist.
 /// </exception>
 public StartConfigurationRecorderResponse StartConfigurationRecorder(string configurationRecorderName)
 {
     var request = new StartConfigurationRecorderRequest();
     request.ConfigurationRecorderName = configurationRecorderName;
     return StartConfigurationRecorder(request);
 }
Example #7
0
 private Amazon.ConfigService.Model.StartConfigurationRecorderResponse CallAWSServiceOperation(IAmazonConfigService client, Amazon.ConfigService.Model.StartConfigurationRecorderRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Config", "StartConfigurationRecorder");
     try
     {
         #if DESKTOP
         return(client.StartConfigurationRecorder(request));
         #elif CORECLR
         return(client.StartConfigurationRecorderAsync(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;
     }
 }