public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.Redshift.Model.DisableLoggingRequest(); 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 invokeDisableLogging(DisableLoggingRequest disableLoggingRequest, AsyncCallback callback, object state, bool synchronized) { IRequest irequest = new DisableLoggingRequestMarshaller().Marshall(disableLoggingRequest); var unmarshaller = DisableLoggingResponseUnmarshaller.GetInstance(); AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller); Invoke(result); return result; }
/// <summary> /// Initiates the asynchronous execution of the DisableLogging operation. /// <seealso cref="Amazon.Redshift.IAmazonRedshift.DisableLogging"/> /// </summary> /// /// <param name="disableLoggingRequest">Container for the necessary parameters to execute the DisableLogging 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 EndDisableLogging /// operation.</returns> public IAsyncResult BeginDisableLogging(DisableLoggingRequest disableLoggingRequest, AsyncCallback callback, object state) { return invokeDisableLogging(disableLoggingRequest, callback, state, false); }
/// <summary> /// <para>Stops logging information, such as queries and connection attempts, for the specified Amazon Redshift cluster.</para> /// </summary> /// /// <param name="disableLoggingRequest">Container for the necessary parameters to execute the DisableLogging service method on /// AmazonRedshift.</param> /// /// <returns>The response from the DisableLogging service method, as returned by AmazonRedshift.</returns> /// /// <exception cref="ClusterNotFoundException"/> public DisableLoggingResponse DisableLogging(DisableLoggingRequest disableLoggingRequest) { IAsyncResult asyncResult = invokeDisableLogging(disableLoggingRequest, null, null, true); return EndDisableLogging(asyncResult); }
/// <summary> /// Initiates the asynchronous execution of the DisableLogging operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DisableLogging 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 EndDisableLogging /// operation.</returns> public IAsyncResult BeginDisableLogging(DisableLoggingRequest request, AsyncCallback callback, object state) { var marshaller = new DisableLoggingRequestMarshaller(); var unmarshaller = DisableLoggingResponseUnmarshaller.Instance; return BeginInvoke<DisableLoggingRequest>(request, marshaller, unmarshaller, callback, state); }
/// <summary> /// Stops logging information, such as queries and connection attempts, for the specified /// Amazon Redshift cluster. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DisableLogging service method.</param> /// /// <returns>The response from the DisableLogging 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> public DisableLoggingResponse DisableLogging(DisableLoggingRequest request) { var marshaller = new DisableLoggingRequestMarshaller(); var unmarshaller = DisableLoggingResponseUnmarshaller.Instance; return Invoke<DisableLoggingRequest,DisableLoggingResponse>(request, marshaller, unmarshaller); }
/// <summary> /// <para>Stops logging information, such as queries and connection attempts, for the specified Amazon Redshift cluster.</para> /// </summary> /// /// <param name="disableLoggingRequest">Container for the necessary parameters to execute the DisableLogging service method on /// AmazonRedshift.</param> /// /// <returns>The response from the DisableLogging service method, as returned by AmazonRedshift.</returns> /// /// <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<DisableLoggingResponse> DisableLoggingAsync(DisableLoggingRequest disableLoggingRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DisableLoggingRequestMarshaller(); var unmarshaller = DisableLoggingResponseUnmarshaller.GetInstance(); return Invoke<IRequest, DisableLoggingRequest, DisableLoggingResponse>(disableLoggingRequest, marshaller, unmarshaller, signer, cancellationToken); }
internal DisableLoggingResponse DisableLogging(DisableLoggingRequest request) { var task = DisableLoggingAsync(request); try { return task.Result; } catch(AggregateException e) { ExceptionDispatchInfo.Capture(e.InnerException).Throw(); return null; } }
/// <summary> /// <para>Stops logging information, such as queries and connection attempts, for the specified Amazon Redshift cluster.</para> /// </summary> /// /// <param name="disableLoggingRequest">Container for the necessary parameters to execute the DisableLogging service method on /// AmazonRedshift.</param> /// /// <returns>The response from the DisableLogging service method, as returned by AmazonRedshift.</returns> /// /// <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<DisableLoggingResponse> DisableLoggingAsync(DisableLoggingRequest disableLoggingRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DisableLoggingRequestMarshaller(); var unmarshaller = DisableLoggingResponseUnmarshaller.GetInstance(); var response = await Invoke<IRequest, DisableLoggingRequest, DisableLoggingResponse>(disableLoggingRequest, marshaller, unmarshaller, signer, cancellationToken) .ConfigureAwait(continueOnCapturedContext: false); return response; }
internal DisableLoggingResponse DisableLogging(DisableLoggingRequest request) { var task = DisableLoggingAsync(request); try { return task.Result; } catch(AggregateException e) { throw e.InnerException; } }
/// <summary> /// Initiates the asynchronous execution of the DisableLogging operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DisableLogging 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<DisableLoggingResponse> DisableLoggingAsync(DisableLoggingRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DisableLoggingRequestMarshaller(); var unmarshaller = DisableLoggingResponseUnmarshaller.Instance; return InvokeAsync<DisableLoggingRequest,DisableLoggingResponse>(request, marshaller, unmarshaller, cancellationToken); }
IAsyncResult invokeDisableLogging(DisableLoggingRequest request, AsyncCallback callback, object state, bool synchronized) { var marshaller = new DisableLoggingRequestMarshaller(); var unmarshaller = DisableLoggingResponseUnmarshaller.Instance; return Invoke(request, callback, state, synchronized, marshaller, unmarshaller, signer); }
private Amazon.Redshift.Model.DisableLoggingResponse CallAWSServiceOperation(IAmazonRedshift client, Amazon.Redshift.Model.DisableLoggingRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Redshift", "DisableLogging"); try { #if DESKTOP return(client.DisableLogging(request)); #elif CORECLR return(client.DisableLoggingAsync(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; } }