public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.ElastiCache.Model.RebootCacheClusterRequest(); if (cmdletContext.CacheClusterId != null) { request.CacheClusterId = cmdletContext.CacheClusterId; } if (cmdletContext.CacheNodeIdsToReboot != null) { request.CacheNodeIdsToReboot = cmdletContext.CacheNodeIdsToReboot; } 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 RebootCacheCluster operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the RebootCacheCluster 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<RebootCacheClusterResponse> RebootCacheClusterAsync(RebootCacheClusterRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new RebootCacheClusterRequestMarshaller(); var unmarshaller = RebootCacheClusterResponseUnmarshaller.Instance; return InvokeAsync<RebootCacheClusterRequest,RebootCacheClusterResponse>(request, marshaller, unmarshaller, cancellationToken); }
/// <summary> /// The <i>RebootCacheCluster</i> operation reboots some, or all, of the cache nodes within /// a provisioned cache cluster. This API will apply any modified cache parameter groups /// to the cache cluster. The reboot action takes place as soon as possible, and results /// in a momentary outage to the cache cluster. During the reboot, the cache cluster status /// is set to REBOOTING. /// /// /// <para> /// The reboot causes the contents of the cache (for each cache node being rebooted) to /// be lost. /// </para> /// /// <para> /// When the reboot is complete, a cache cluster event is created. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the RebootCacheCluster service method.</param> /// /// <returns>The response from the RebootCacheCluster service method, as returned by ElastiCache.</returns> /// <exception cref="Amazon.ElastiCache.Model.CacheClusterNotFoundException"> /// The requested cache cluster ID does not refer to an existing cache cluster. /// </exception> /// <exception cref="Amazon.ElastiCache.Model.InvalidCacheClusterStateException"> /// The requested cache cluster is not in the <i>available</i> state. /// </exception> public RebootCacheClusterResponse RebootCacheCluster(RebootCacheClusterRequest request) { var marshaller = new RebootCacheClusterRequestMarshaller(); var unmarshaller = RebootCacheClusterResponseUnmarshaller.Instance; return Invoke<RebootCacheClusterRequest,RebootCacheClusterResponse>(request, marshaller, unmarshaller); }
/// <summary> /// Initiates the asynchronous execution of the RebootCacheCluster operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the RebootCacheCluster operation on AmazonElastiCacheClient.</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 EndRebootCacheCluster /// operation.</returns> public IAsyncResult BeginRebootCacheCluster(RebootCacheClusterRequest request, AsyncCallback callback, object state) { var marshaller = new RebootCacheClusterRequestMarshaller(); var unmarshaller = RebootCacheClusterResponseUnmarshaller.Instance; return BeginInvoke<RebootCacheClusterRequest>(request, marshaller, unmarshaller, callback, state); }
/// <summary> /// Initiates the asynchronous execution of the RebootCacheCluster operation. /// <seealso cref="Amazon.ElastiCache.IAmazonElastiCache.RebootCacheCluster"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the RebootCacheCluster 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<RebootCacheClusterResponse> RebootCacheClusterAsync(RebootCacheClusterRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new RebootCacheClusterRequestMarshaller(); var unmarshaller = RebootCacheClusterResponseUnmarshaller.GetInstance(); return Invoke<IRequest, RebootCacheClusterRequest, RebootCacheClusterResponse>(request, marshaller, unmarshaller, signer, cancellationToken); }
/// <summary> /// <para>The <i>RebootCacheCluster</i> operation reboots some, or all, of the cache cluster nodes within a provisioned cache cluster. This API /// will apply any modified cache parameter groups to the cache cluster. The reboot action takes place as soon as possible, and results in a /// momentary outage to the cache cluster. During the reboot, the cache cluster status is set to REBOOTING.</para> <para>The reboot causes the /// contents of the cache (for each cache cluster node being rebooted) to be lost.</para> <para>When the reboot is complete, a cache cluster /// event is created.</para> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the RebootCacheCluster service method on /// AmazonElastiCache.</param> /// /// <returns>The response from the RebootCacheCluster service method, as returned by AmazonElastiCache.</returns> /// /// <exception cref="T:Amazon.ElastiCache.Model.CacheClusterNotFoundException" /> /// <exception cref="T:Amazon.ElastiCache.Model.InvalidCacheClusterStateException" /> public RebootCacheClusterResponse RebootCacheCluster(RebootCacheClusterRequest request) { var task = RebootCacheClusterAsync(request); try { return task.Result; } catch(AggregateException e) { ExceptionDispatchInfo.Capture(e.InnerException).Throw(); return null; } }
IAsyncResult invokeRebootCacheCluster(RebootCacheClusterRequest rebootCacheClusterRequest, AsyncCallback callback, object state, bool synchronized) { IRequest irequest = new RebootCacheClusterRequestMarshaller().Marshall(rebootCacheClusterRequest); var unmarshaller = RebootCacheClusterResponseUnmarshaller.GetInstance(); AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller); Invoke(result); return result; }
/// <summary> /// Initiates the asynchronous execution of the RebootCacheCluster operation. /// <seealso cref="Amazon.ElastiCache.IAmazonElastiCache.RebootCacheCluster"/> /// </summary> /// /// <param name="rebootCacheClusterRequest">Container for the necessary parameters to execute the RebootCacheCluster operation on /// AmazonElastiCache.</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 /// EndRebootCacheCluster operation.</returns> public IAsyncResult BeginRebootCacheCluster(RebootCacheClusterRequest rebootCacheClusterRequest, AsyncCallback callback, object state) { return invokeRebootCacheCluster(rebootCacheClusterRequest, callback, state, false); }
/// <summary> /// <para>The <i>RebootCacheCluster</i> operation reboots some, or all, of the cache cluster nodes within a provisioned cache cluster. This API /// will apply any modified cache parameter groups to the cache cluster. The reboot action takes place as soon as possible, and results in a /// momentary outage to the cache cluster. During the reboot, the cache cluster status is set to REBOOTING.</para> <para>The reboot causes the /// contents of the cache (for each cache cluster node being rebooted) to be lost.</para> <para>When the reboot is complete, a cache cluster /// event is created.</para> /// </summary> /// /// <param name="rebootCacheClusterRequest">Container for the necessary parameters to execute the RebootCacheCluster service method on /// AmazonElastiCache.</param> /// /// <returns>The response from the RebootCacheCluster service method, as returned by AmazonElastiCache.</returns> /// /// <exception cref="CacheClusterNotFoundException"/> /// <exception cref="InvalidCacheClusterStateException"/> public RebootCacheClusterResponse RebootCacheCluster(RebootCacheClusterRequest rebootCacheClusterRequest) { IAsyncResult asyncResult = invokeRebootCacheCluster(rebootCacheClusterRequest, null, null, true); return EndRebootCacheCluster(asyncResult); }
/// <summary> /// <para>The <i>RebootCacheCluster</i> operation reboots some, or all, of the cache cluster nodes within a provisioned cache cluster. This API /// will apply any modified cache parameter groups to the cache cluster. The reboot action takes place as soon as possible, and results in a /// momentary outage to the cache cluster. During the reboot, the cache cluster status is set to REBOOTING.</para> <para>The reboot causes the /// contents of the cache (for each cache cluster node being rebooted) to be lost.</para> <para>When the reboot is complete, a cache cluster /// event is created.</para> /// </summary> /// /// <param name="rebootCacheClusterRequest">Container for the necessary parameters to execute the RebootCacheCluster service method on /// AmazonElastiCache.</param> /// /// <returns>The response from the RebootCacheCluster service method, as returned by AmazonElastiCache.</returns> /// /// <exception cref="T:Amazon.ElastiCache.Model.CacheClusterNotFoundException" /> /// <exception cref="T:Amazon.ElastiCache.Model.InvalidCacheClusterStateException" /> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> public async Task<RebootCacheClusterResponse> RebootCacheClusterAsync(RebootCacheClusterRequest rebootCacheClusterRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new RebootCacheClusterRequestMarshaller(); var unmarshaller = RebootCacheClusterResponseUnmarshaller.GetInstance(); var response = await Invoke<IRequest, RebootCacheClusterRequest, RebootCacheClusterResponse>(rebootCacheClusterRequest, marshaller, unmarshaller, signer, cancellationToken) .ConfigureAwait(continueOnCapturedContext: false); return response; }
internal RebootCacheClusterResponse RebootCacheCluster(RebootCacheClusterRequest request) { var task = RebootCacheClusterAsync(request); try { return task.Result; } catch(AggregateException e) { throw e.InnerException; } }
private Amazon.ElastiCache.Model.RebootCacheClusterResponse CallAWSServiceOperation(IAmazonElastiCache client, Amazon.ElastiCache.Model.RebootCacheClusterRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon ElastiCache", "RebootCacheCluster"); try { #if DESKTOP return(client.RebootCacheCluster(request)); #elif CORECLR return(client.RebootCacheClusterAsync(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; } }
/// <summary> /// <para> Reboots some (or all) of the cache cluster nodes within a previously provisioned ElastiCache cluster. This API results in the /// application of modified CacheParameterGroup parameters to the cache cluster. This action is taken as soon as possible, and results in a /// momentary outage to the cache cluster during which the cache cluster status is set to rebooting. During that momentary outage, the contents /// of the cache (for each cache cluster node being rebooted) are lost. A CacheCluster event is created when the reboot is completed. </para> /// </summary> /// /// <param name="rebootCacheClusterRequest">Container for the necessary parameters to execute the RebootCacheCluster service method on /// AmazonElastiCache.</param> /// /// <returns>The response from the RebootCacheCluster service method, as returned by AmazonElastiCache.</returns> /// /// <exception cref="CacheClusterNotFoundException"/> /// <exception cref="InvalidCacheClusterStateException"/> public RebootCacheClusterResponse RebootCacheCluster(RebootCacheClusterRequest rebootCacheClusterRequest) { IRequest<RebootCacheClusterRequest> request = new RebootCacheClusterRequestMarshaller().Marshall(rebootCacheClusterRequest); RebootCacheClusterResponse response = Invoke<RebootCacheClusterRequest, RebootCacheClusterResponse> (request, this.signer, RebootCacheClusterResponseUnmarshaller.GetInstance()); return response; }