public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.Redshift.Model.RotateEncryptionKeyRequest(); if (cmdletContext.ClusterIdentifier != null) { request.ClusterIdentifier = cmdletContext.ClusterIdentifier; } 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); }
IAsyncResult invokeRotateEncryptionKey(RotateEncryptionKeyRequest rotateEncryptionKeyRequest, AsyncCallback callback, object state, bool synchronized) { IRequest irequest = new RotateEncryptionKeyRequestMarshaller().Marshall(rotateEncryptionKeyRequest); var unmarshaller = RotateEncryptionKeyResponseUnmarshaller.GetInstance(); AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller); Invoke(result); return result; }
/// <summary> /// Initiates the asynchronous execution of the RotateEncryptionKey operation. /// <seealso cref="Amazon.Redshift.IAmazonRedshift.RotateEncryptionKey"/> /// </summary> /// /// <param name="rotateEncryptionKeyRequest">Container for the necessary parameters to execute the RotateEncryptionKey operation on /// AmazonRedshift.</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 /// EndRotateEncryptionKey operation.</returns> public IAsyncResult BeginRotateEncryptionKey(RotateEncryptionKeyRequest rotateEncryptionKeyRequest, AsyncCallback callback, object state) { return invokeRotateEncryptionKey(rotateEncryptionKeyRequest, callback, state, false); }
/// <summary> /// <para> Rotates the encryption keys for a cluster. </para> /// </summary> /// /// <param name="rotateEncryptionKeyRequest">Container for the necessary parameters to execute the RotateEncryptionKey service method on /// AmazonRedshift.</param> /// /// <returns>The response from the RotateEncryptionKey service method, as returned by AmazonRedshift.</returns> /// /// <exception cref="InvalidClusterStateException"/> /// <exception cref="ClusterNotFoundException"/> public RotateEncryptionKeyResponse RotateEncryptionKey(RotateEncryptionKeyRequest rotateEncryptionKeyRequest) { IAsyncResult asyncResult = invokeRotateEncryptionKey(rotateEncryptionKeyRequest, null, null, true); return EndRotateEncryptionKey(asyncResult); }
/// <summary> /// Initiates the asynchronous execution of the RotateEncryptionKey operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the RotateEncryptionKey operation on AmazonRedshiftClient.</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 EndRotateEncryptionKey /// operation.</returns> public IAsyncResult BeginRotateEncryptionKey(RotateEncryptionKeyRequest request, AsyncCallback callback, object state) { var marshaller = new RotateEncryptionKeyRequestMarshaller(); var unmarshaller = RotateEncryptionKeyResponseUnmarshaller.Instance; return BeginInvoke<RotateEncryptionKeyRequest>(request, marshaller, unmarshaller, callback, state); }
/// <summary> /// Rotates the encryption keys for a cluster. /// </summary> /// <param name="request">Container for the necessary parameters to execute the RotateEncryptionKey service method.</param> /// /// <returns>The response from the RotateEncryptionKey service method, as returned by Redshift.</returns> /// <exception cref="Amazon.Redshift.Model.ClusterNotFoundException"> /// The <i>ClusterIdentifier</i> parameter does not refer to an existing cluster. /// </exception> /// <exception cref="Amazon.Redshift.Model.InvalidClusterStateException"> /// The specified cluster is not in the <code>available</code> state. /// </exception> public RotateEncryptionKeyResponse RotateEncryptionKey(RotateEncryptionKeyRequest request) { var marshaller = new RotateEncryptionKeyRequestMarshaller(); var unmarshaller = RotateEncryptionKeyResponseUnmarshaller.Instance; return Invoke<RotateEncryptionKeyRequest,RotateEncryptionKeyResponse>(request, marshaller, unmarshaller); }
/// <summary> /// <para> Rotates the encryption keys for a cluster. </para> /// </summary> /// /// <param name="rotateEncryptionKeyRequest">Container for the necessary parameters to execute the RotateEncryptionKey service method on /// AmazonRedshift.</param> /// /// <returns>The response from the RotateEncryptionKey service method, as returned by AmazonRedshift.</returns> /// /// <exception cref="T:Amazon.Redshift.Model.InvalidClusterStateException" /> /// <exception cref="T:Amazon.Redshift.Model.ClusterNotFoundException" /> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> public Task<RotateEncryptionKeyResponse> RotateEncryptionKeyAsync(RotateEncryptionKeyRequest rotateEncryptionKeyRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new RotateEncryptionKeyRequestMarshaller(); var unmarshaller = RotateEncryptionKeyResponseUnmarshaller.GetInstance(); return Invoke<IRequest, RotateEncryptionKeyRequest, RotateEncryptionKeyResponse>(rotateEncryptionKeyRequest, marshaller, unmarshaller, signer, cancellationToken); }
internal RotateEncryptionKeyResponse RotateEncryptionKey(RotateEncryptionKeyRequest request) { var task = RotateEncryptionKeyAsync(request); try { return task.Result; } catch(AggregateException e) { ExceptionDispatchInfo.Capture(e.InnerException).Throw(); return null; } }
/// <summary> /// <para> Rotates the encryption keys for a cluster. </para> /// </summary> /// /// <param name="rotateEncryptionKeyRequest">Container for the necessary parameters to execute the RotateEncryptionKey service method on /// AmazonRedshift.</param> /// /// <returns>The response from the RotateEncryptionKey service method, as returned by AmazonRedshift.</returns> /// /// <exception cref="T:Amazon.Redshift.Model.InvalidClusterStateException" /> /// <exception cref="T:Amazon.Redshift.Model.ClusterNotFoundException" /> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> public async Task<RotateEncryptionKeyResponse> RotateEncryptionKeyAsync(RotateEncryptionKeyRequest rotateEncryptionKeyRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new RotateEncryptionKeyRequestMarshaller(); var unmarshaller = RotateEncryptionKeyResponseUnmarshaller.GetInstance(); var response = await Invoke<IRequest, RotateEncryptionKeyRequest, RotateEncryptionKeyResponse>(rotateEncryptionKeyRequest, marshaller, unmarshaller, signer, cancellationToken) .ConfigureAwait(continueOnCapturedContext: false); return response; }
internal RotateEncryptionKeyResponse RotateEncryptionKey(RotateEncryptionKeyRequest request) { var task = RotateEncryptionKeyAsync(request); try { return task.Result; } catch(AggregateException e) { throw e.InnerException; } }
/// <summary> /// Initiates the asynchronous execution of the RotateEncryptionKey operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the RotateEncryptionKey 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<RotateEncryptionKeyResponse> RotateEncryptionKeyAsync(RotateEncryptionKeyRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new RotateEncryptionKeyRequestMarshaller(); var unmarshaller = RotateEncryptionKeyResponseUnmarshaller.Instance; return InvokeAsync<RotateEncryptionKeyRequest,RotateEncryptionKeyResponse>(request, marshaller, unmarshaller, cancellationToken); }
IAsyncResult invokeRotateEncryptionKey(RotateEncryptionKeyRequest request, AsyncCallback callback, object state, bool synchronized) { var marshaller = new RotateEncryptionKeyRequestMarshaller(); var unmarshaller = RotateEncryptionKeyResponseUnmarshaller.Instance; return Invoke(request, callback, state, synchronized, marshaller, unmarshaller, signer); }
private Amazon.Redshift.Model.RotateEncryptionKeyResponse CallAWSServiceOperation(IAmazonRedshift client, Amazon.Redshift.Model.RotateEncryptionKeyRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Redshift", "RotateEncryptionKey"); try { #if DESKTOP return(client.RotateEncryptionKey(request)); #elif CORECLR return(client.RotateEncryptionKeyAsync(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; } }