public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.ConfigService.Model.DeliverConfigSnapshotRequest(); if (cmdletContext.DeliveryChannelName != null) { request.DeliveryChannelName = cmdletContext.DeliveryChannelName; } 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 DeliverConfigSnapshot operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeliverConfigSnapshot 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<DeliverConfigSnapshotResponse> DeliverConfigSnapshotAsync(DeliverConfigSnapshotRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DeliverConfigSnapshotRequestMarshaller(); var unmarshaller = DeliverConfigSnapshotResponseUnmarshaller.Instance; return InvokeAsync<DeliverConfigSnapshotRequest,DeliverConfigSnapshotResponse>(request, marshaller, unmarshaller, cancellationToken); }
/// <summary> /// Schedules delivery of a configuration snapshot to the Amazon S3 bucket in the specified /// delivery channel. After the delivery has started, AWS Config sends following notifications /// using an Amazon SNS topic that you have specified. /// /// <ul> <li>Notification of starting the delivery.</li> <li>Notification of delivery /// completed, if the delivery was successfully completed.</li> <li>Notification of delivery /// failure, if the delivery failed to complete.</li> </ul> /// </summary> /// <param name="deliveryChannelName">The name of the delivery channel through which the snapshot is delivered.</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 DeliverConfigSnapshot service method, as returned by ConfigService.</returns> /// <exception cref="Amazon.ConfigService.Model.NoAvailableConfigurationRecorderException"> /// There are no configuration recorders available to provide the role needed to describe /// your resources. /// </exception> /// <exception cref="Amazon.ConfigService.Model.NoRunningConfigurationRecorderException"> /// There is no configuration recorder running. /// </exception> /// <exception cref="Amazon.ConfigService.Model.NoSuchDeliveryChannelException"> /// You have specified a delivery channel that does not exist. /// </exception> public Task<DeliverConfigSnapshotResponse> DeliverConfigSnapshotAsync(string deliveryChannelName, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var request = new DeliverConfigSnapshotRequest(); request.DeliveryChannelName = deliveryChannelName; return DeliverConfigSnapshotAsync(request, cancellationToken); }
internal DeliverConfigSnapshotResponse DeliverConfigSnapshot(DeliverConfigSnapshotRequest request) { var marshaller = new DeliverConfigSnapshotRequestMarshaller(); var unmarshaller = DeliverConfigSnapshotResponseUnmarshaller.Instance; return Invoke<DeliverConfigSnapshotRequest,DeliverConfigSnapshotResponse>(request, marshaller, unmarshaller); }
/// <summary> /// Initiates the asynchronous execution of the DeliverConfigSnapshot operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeliverConfigSnapshot 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 EndDeliverConfigSnapshot /// operation.</returns> public IAsyncResult BeginDeliverConfigSnapshot(DeliverConfigSnapshotRequest request, AsyncCallback callback, object state) { var marshaller = new DeliverConfigSnapshotRequestMarshaller(); var unmarshaller = DeliverConfigSnapshotResponseUnmarshaller.Instance; return BeginInvoke<DeliverConfigSnapshotRequest>(request, marshaller, unmarshaller, callback, state); }
/// <summary> /// Schedules delivery of a configuration snapshot to the Amazon S3 bucket in the specified /// delivery channel. After the delivery has started, AWS Config sends following notifications /// using an Amazon SNS topic that you have specified. /// /// <ul> <li>Notification of starting the delivery.</li> <li>Notification of delivery /// completed, if the delivery was successfully completed.</li> <li>Notification of delivery /// failure, if the delivery failed to complete.</li> </ul> /// </summary> /// <param name="deliveryChannelName">The name of the delivery channel through which the snapshot is delivered.</param> /// /// <returns>The response from the DeliverConfigSnapshot service method, as returned by ConfigService.</returns> /// <exception cref="Amazon.ConfigService.Model.NoAvailableConfigurationRecorderException"> /// There are no configuration recorders available to provide the role needed to describe /// your resources. /// </exception> /// <exception cref="Amazon.ConfigService.Model.NoRunningConfigurationRecorderException"> /// There is no configuration recorder running. /// </exception> /// <exception cref="Amazon.ConfigService.Model.NoSuchDeliveryChannelException"> /// You have specified a delivery channel that does not exist. /// </exception> public DeliverConfigSnapshotResponse DeliverConfigSnapshot(string deliveryChannelName) { var request = new DeliverConfigSnapshotRequest(); request.DeliveryChannelName = deliveryChannelName; return DeliverConfigSnapshot(request); }
private Amazon.ConfigService.Model.DeliverConfigSnapshotResponse CallAWSServiceOperation(IAmazonConfigService client, Amazon.ConfigService.Model.DeliverConfigSnapshotRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Config", "DeliverConfigSnapshot"); try { #if DESKTOP return(client.DeliverConfigSnapshot(request)); #elif CORECLR return(client.DeliverConfigSnapshotAsync(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; } }