/// <summary> /// Stops a query execution. /// /// /// <para> /// For code samples using the AWS SDK for Java, see <a href="http://docs.aws.amazon.com/athena/latest/ug/code-samples.html">Examples /// and Code Samples</a> in the <i>Amazon Athena User Guide</i>. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the StopQueryExecution service method.</param> /// /// <returns>The response from the StopQueryExecution service method, as returned by Athena.</returns> /// <exception cref="Amazon.Athena.Model.InternalServerException"> /// Indicates a platform issue, which may be due to a transient condition or outage. /// </exception> /// <exception cref="Amazon.Athena.Model.InvalidRequestException"> /// Indicates that something is wrong with the input to the request. For example, a required /// parameter may be missing or out of range. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/athena-2017-05-18/StopQueryExecution">REST API Reference for StopQueryExecution Operation</seealso> public StopQueryExecutionResponse StopQueryExecution(StopQueryExecutionRequest request) { var marshaller = new StopQueryExecutionRequestMarshaller(); var unmarshaller = StopQueryExecutionResponseUnmarshaller.Instance; return(Invoke <StopQueryExecutionRequest, StopQueryExecutionResponse>(request, marshaller, unmarshaller)); }
internal virtual StopQueryExecutionResponse StopQueryExecution(StopQueryExecutionRequest request) { var marshaller = StopQueryExecutionRequestMarshaller.Instance; var unmarshaller = StopQueryExecutionResponseUnmarshaller.Instance; return(Invoke <StopQueryExecutionRequest, StopQueryExecutionResponse>(request, marshaller, unmarshaller)); }
public static void Example() { // Create an Amazon Athena client var athenaConfig = new AmazonAthenaConfig { RegionEndpoint = RegionEndpoint.USEast1, Timeout = TimeSpan.FromMilliseconds(ExampleConstants.CLIENT_EXECUTION_TIMEOUT) }; var athenaClient = new AmazonAthenaClient(config: athenaConfig); String sampleQueryExecutionId = submitAthenaQuery(athenaClient); // Submit the stop query Request var stopQueryExecutionRequest = new StopQueryExecutionRequest() { QueryExecutionId = sampleQueryExecutionId }; var stopQueryExecutionResponse = athenaClient.StopQueryExecution(stopQueryExecutionRequest); // Ensure that the query was stopped var getQueryExecutionRequest = new GetQueryExecutionRequest() { QueryExecutionId = sampleQueryExecutionId }; var getQueryExecutionResponse = athenaClient.GetQueryExecution(getQueryExecutionRequest); if (getQueryExecutionResponse.QueryExecution.Status.State == QueryExecutionState.CANCELLED) { Console.WriteLine("Query has been cancelled"); } }
/// <summary> /// Initiates the asynchronous execution of the StopQueryExecution operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the StopQueryExecution 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> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/athena-2017-05-18/StopQueryExecution">REST API Reference for StopQueryExecution Operation</seealso> public virtual Task <StopQueryExecutionResponse> StopQueryExecutionAsync(StopQueryExecutionRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = StopQueryExecutionRequestMarshaller.Instance; var unmarshaller = StopQueryExecutionResponseUnmarshaller.Instance; return(InvokeAsync <StopQueryExecutionRequest, StopQueryExecutionResponse>(request, marshaller, unmarshaller, cancellationToken)); }
internal virtual StopQueryExecutionResponse StopQueryExecution(StopQueryExecutionRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = StopQueryExecutionRequestMarshaller.Instance; options.ResponseUnmarshaller = StopQueryExecutionResponseUnmarshaller.Instance; return(Invoke <StopQueryExecutionResponse>(request, options)); }