public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.ElastiCache.Model.DeleteCacheClusterRequest(); if (cmdletContext.CacheClusterId != null) { request.CacheClusterId = cmdletContext.CacheClusterId; } if (cmdletContext.FinalSnapshotIdentifier != null) { request.FinalSnapshotIdentifier = cmdletContext.FinalSnapshotIdentifier; } 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); }
private Amazon.ElastiCache.Model.DeleteCacheClusterResponse CallAWSServiceOperation(IAmazonElastiCache client, Amazon.ElastiCache.Model.DeleteCacheClusterRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon ElastiCache", "DeleteCacheCluster"); try { #if DESKTOP return(client.DeleteCacheCluster(request)); #elif CORECLR return(client.DeleteCacheClusterAsync(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> /// The <i>DeleteCacheCluster</i> operation deletes a previously provisioned cache cluster. /// <i>DeleteCacheCluster</i> deletes all associated cache nodes, node endpoints and the /// cache cluster itself. When you receive a successful response from this operation, /// Amazon ElastiCache immediately begins deleting the cache cluster; you cannot cancel /// or revert this operation. /// /// /// <para> /// This API cannot be used to delete a cache cluster that is the last read replica of /// a replication group that has automatic failover mode enabled. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteCacheCluster service method.</param> /// /// <returns>The response from the DeleteCacheCluster 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> /// <exception cref="Amazon.ElastiCache.Model.InvalidParameterCombinationException"> /// Two or more incompatible parameters were specified. /// </exception> /// <exception cref="Amazon.ElastiCache.Model.InvalidParameterValueException"> /// The value for a parameter is invalid. /// </exception> /// <exception cref="Amazon.ElastiCache.Model.SnapshotAlreadyExistsException"> /// You already have a snapshot with the given name. /// </exception> /// <exception cref="Amazon.ElastiCache.Model.SnapshotFeatureNotSupportedException"> /// You attempted one of the following actions: /// /// <ul> <li> /// <para> /// Creating a snapshot of a Redis cache cluster running on a <i>t1.micro</i> cache node. /// </para> /// </li> <li> /// <para> /// Creating a snapshot of a cache cluster that is running Memcached rather than Redis. /// </para> /// </li> </ul> /// <para> /// Neither of these are supported by ElastiCache. /// </para> /// </exception> /// <exception cref="Amazon.ElastiCache.Model.SnapshotQuotaExceededException"> /// The request cannot be processed because it would exceed the maximum number of snapshots. /// </exception> public DeleteCacheClusterResponse DeleteCacheCluster(DeleteCacheClusterRequest request) { var marshaller = new DeleteCacheClusterRequestMarshaller(); var unmarshaller = DeleteCacheClusterResponseUnmarshaller.Instance; return Invoke<DeleteCacheClusterRequest,DeleteCacheClusterResponse>(request, marshaller, unmarshaller); }
/// <summary> /// Initiates the asynchronous execution of the DeleteCacheCluster operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteCacheCluster 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<DeleteCacheClusterResponse> DeleteCacheClusterAsync(DeleteCacheClusterRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DeleteCacheClusterRequestMarshaller(); var unmarshaller = DeleteCacheClusterResponseUnmarshaller.Instance; return InvokeAsync<DeleteCacheClusterRequest,DeleteCacheClusterResponse>(request, marshaller, unmarshaller, cancellationToken); }
/// <summary> /// Initiates the asynchronous execution of the DeleteCacheCluster operation. /// <seealso cref="Amazon.ElastiCache.IAmazonElastiCache.DeleteCacheCluster"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteCacheCluster 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<DeleteCacheClusterResponse> DeleteCacheClusterAsync(DeleteCacheClusterRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DeleteCacheClusterRequestMarshaller(); var unmarshaller = DeleteCacheClusterResponseUnmarshaller.GetInstance(); return Invoke<IRequest, DeleteCacheClusterRequest, DeleteCacheClusterResponse>(request, marshaller, unmarshaller, signer, cancellationToken); }
/// <summary> /// Initiates the asynchronous execution of the DeleteCacheCluster operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteCacheCluster 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 EndDeleteCacheCluster /// operation.</returns> public IAsyncResult BeginDeleteCacheCluster(DeleteCacheClusterRequest request, AsyncCallback callback, object state) { var marshaller = new DeleteCacheClusterRequestMarshaller(); var unmarshaller = DeleteCacheClusterResponseUnmarshaller.Instance; return BeginInvoke<DeleteCacheClusterRequest>(request, marshaller, unmarshaller, callback, state); }
IAsyncResult invokeDeleteCacheCluster(DeleteCacheClusterRequest deleteCacheClusterRequest, AsyncCallback callback, object state, bool synchronized) { IRequest irequest = new DeleteCacheClusterRequestMarshaller().Marshall(deleteCacheClusterRequest); var unmarshaller = DeleteCacheClusterResponseUnmarshaller.GetInstance(); AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller); Invoke(result); return result; }
/// <summary> /// <para>The <i>DeleteCacheCluster</i> operation deletes a previously provisioned cache cluster. <i>DeleteCacheCluster</i> deletes all /// associated cache nodes, node endpoints and the cache cluster itself. When you receive a successful response from this operation, Amazon /// ElastiCache immediately begins deleting the cache cluster; you cannot cancel or revert this operation.</para> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteCacheCluster service method on /// AmazonElastiCache.</param> /// /// <returns>The response from the DeleteCacheCluster service method, as returned by AmazonElastiCache.</returns> /// /// <exception cref="T:Amazon.ElastiCache.Model.InvalidParameterValueException" /> /// <exception cref="T:Amazon.ElastiCache.Model.SnapshotFeatureNotSupportedException" /> /// <exception cref="T:Amazon.ElastiCache.Model.CacheClusterNotFoundException" /> /// <exception cref="T:Amazon.ElastiCache.Model.InvalidParameterCombinationException" /> /// <exception cref="T:Amazon.ElastiCache.Model.InvalidCacheClusterStateException" /> /// <exception cref="T:Amazon.ElastiCache.Model.SnapshotAlreadyExistsException" /> /// <exception cref="T:Amazon.ElastiCache.Model.SnapshotQuotaExceededException" /> public DeleteCacheClusterResponse DeleteCacheCluster(DeleteCacheClusterRequest request) { var task = DeleteCacheClusterAsync(request); try { return task.Result; } catch(AggregateException e) { ExceptionDispatchInfo.Capture(e.InnerException).Throw(); return null; } }
/// <summary> /// Initiates the asynchronous execution of the DeleteCacheCluster operation. /// <seealso cref="Amazon.ElastiCache.IAmazonElastiCache.DeleteCacheCluster"/> /// </summary> /// /// <param name="deleteCacheClusterRequest">Container for the necessary parameters to execute the DeleteCacheCluster 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 /// EndDeleteCacheCluster operation.</returns> public IAsyncResult BeginDeleteCacheCluster(DeleteCacheClusterRequest deleteCacheClusterRequest, AsyncCallback callback, object state) { return invokeDeleteCacheCluster(deleteCacheClusterRequest, callback, state, false); }
/// <summary> /// <para>The <i>DeleteCacheCluster</i> operation deletes a previously provisioned cache cluster. <i>DeleteCacheCluster</i> deletes all /// associated cache nodes, node endpoints and the cache cluster itself. When you receive a successful response from this operation, Amazon /// ElastiCache immediately begins deleting the cache cluster; you cannot cancel or revert this operation.</para> /// </summary> /// /// <param name="deleteCacheClusterRequest">Container for the necessary parameters to execute the DeleteCacheCluster service method on /// AmazonElastiCache.</param> /// /// <returns>The response from the DeleteCacheCluster service method, as returned by AmazonElastiCache.</returns> /// /// <exception cref="InvalidParameterValueException"/> /// <exception cref="CacheClusterNotFoundException"/> /// <exception cref="InvalidParameterCombinationException"/> /// <exception cref="InvalidCacheClusterStateException"/> public DeleteCacheClusterResponse DeleteCacheCluster(DeleteCacheClusterRequest deleteCacheClusterRequest) { IAsyncResult asyncResult = invokeDeleteCacheCluster(deleteCacheClusterRequest, null, null, true); return EndDeleteCacheCluster(asyncResult); }
/// <summary> /// <para>The <i>DeleteCacheCluster</i> operation deletes a previously provisioned cache cluster. <i>DeleteCacheCluster</i> deletes all /// associated cache nodes, node endpoints and the cache cluster itself. When you receive a successful response from this operation, Amazon /// ElastiCache immediately begins deleting the cache cluster; you cannot cancel or revert this operation.</para> /// </summary> /// /// <param name="deleteCacheClusterRequest">Container for the necessary parameters to execute the DeleteCacheCluster service method on /// AmazonElastiCache.</param> /// /// <returns>The response from the DeleteCacheCluster service method, as returned by AmazonElastiCache.</returns> /// /// <exception cref="T:Amazon.ElastiCache.Model.InvalidParameterValueException" /> /// <exception cref="T:Amazon.ElastiCache.Model.CacheClusterNotFoundException" /> /// <exception cref="T:Amazon.ElastiCache.Model.InvalidParameterCombinationException" /> /// <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<DeleteCacheClusterResponse> DeleteCacheClusterAsync(DeleteCacheClusterRequest deleteCacheClusterRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DeleteCacheClusterRequestMarshaller(); var unmarshaller = DeleteCacheClusterResponseUnmarshaller.GetInstance(); var response = await Invoke<IRequest, DeleteCacheClusterRequest, DeleteCacheClusterResponse>(deleteCacheClusterRequest, marshaller, unmarshaller, signer, cancellationToken) .ConfigureAwait(continueOnCapturedContext: false); return response; }
internal DeleteCacheClusterResponse DeleteCacheCluster(DeleteCacheClusterRequest request) { var task = DeleteCacheClusterAsync(request); try { return task.Result; } catch(AggregateException e) { throw e.InnerException; } }
/// <summary> /// <para> Deletes a previously provisioned Cache Cluster. A successful response from the web service indicates the request was received /// correctly. This action cannot be canceled or reverted. DeleteCacheCluster deletes all associated Cache Nodes, node endpoints and the Cache /// Cluster itself. </para> /// </summary> /// /// <param name="deleteCacheClusterRequest">Container for the necessary parameters to execute the DeleteCacheCluster service method on /// AmazonElastiCache.</param> /// /// <returns>The response from the DeleteCacheCluster service method, as returned by AmazonElastiCache.</returns> /// /// <exception cref="InvalidParameterValueException"/> /// <exception cref="CacheClusterNotFoundException"/> /// <exception cref="InvalidParameterCombinationException"/> /// <exception cref="InvalidCacheClusterStateException"/> public DeleteCacheClusterResponse DeleteCacheCluster(DeleteCacheClusterRequest deleteCacheClusterRequest) { IRequest<DeleteCacheClusterRequest> request = new DeleteCacheClusterRequestMarshaller().Marshall(deleteCacheClusterRequest); DeleteCacheClusterResponse response = Invoke<DeleteCacheClusterRequest, DeleteCacheClusterResponse> (request, this.signer, DeleteCacheClusterResponseUnmarshaller.GetInstance()); return response; }