public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.EC2.Model.ModifyVolumeAttributeRequest(); if (cmdletContext.AutoEnableIO != null) { request.AutoEnableIO = cmdletContext.AutoEnableIO.Value; } if (cmdletContext.VolumeId != null) { request.VolumeId = cmdletContext.VolumeId; } 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 ModifyVolumeAttribute operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ModifyVolumeAttribute 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<ModifyVolumeAttributeResponse> ModifyVolumeAttributeAsync(ModifyVolumeAttributeRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new ModifyVolumeAttributeRequestMarshaller(); var unmarshaller = ModifyVolumeAttributeResponseUnmarshaller.Instance; return InvokeAsync<ModifyVolumeAttributeRequest,ModifyVolumeAttributeResponse>(request, marshaller, unmarshaller, cancellationToken); }
/// <summary> /// Modifies a volume attribute. /// /// /// <para> /// By default, all I/O operations for the volume are suspended when the data on the volume /// is determined to be potentially inconsistent, to prevent undetectable, latent data /// corruption. The I/O access to the volume can be resumed by first enabling I/O access /// and then checking the data consistency on your volume. /// </para> /// /// <para> /// You can change the default behavior to resume I/O operations. We recommend that you /// change this only for boot volumes or for volumes that are stateless or disposable. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the ModifyVolumeAttribute service method.</param> /// /// <returns>The response from the ModifyVolumeAttribute service method, as returned by EC2.</returns> public ModifyVolumeAttributeResponse ModifyVolumeAttribute(ModifyVolumeAttributeRequest request) { var marshaller = new ModifyVolumeAttributeRequestMarshaller(); var unmarshaller = ModifyVolumeAttributeResponseUnmarshaller.Instance; return Invoke<ModifyVolumeAttributeRequest,ModifyVolumeAttributeResponse>(request, marshaller, unmarshaller); }
/// <summary> /// Initiates the asynchronous execution of the ModifyVolumeAttribute operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ModifyVolumeAttribute operation on AmazonEC2Client.</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 EndModifyVolumeAttribute /// operation.</returns> public IAsyncResult BeginModifyVolumeAttribute(ModifyVolumeAttributeRequest request, AsyncCallback callback, object state) { var marshaller = new ModifyVolumeAttributeRequestMarshaller(); var unmarshaller = ModifyVolumeAttributeResponseUnmarshaller.Instance; return BeginInvoke<ModifyVolumeAttributeRequest>(request, marshaller, unmarshaller, callback, state); }
IAsyncResult invokeModifyVolumeAttribute(ModifyVolumeAttributeRequest modifyVolumeAttributeRequest, AsyncCallback callback, object state, bool synchronized) { IRequest irequest = new ModifyVolumeAttributeRequestMarshaller().Marshall(modifyVolumeAttributeRequest); var unmarshaller = ModifyVolumeAttributeResponseUnmarshaller.GetInstance(); AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller); Invoke(result); return result; }
/// <summary> /// Initiates the asynchronous execution of the ModifyVolumeAttribute operation. /// <seealso cref="Amazon.EC2.IAmazonEC2.ModifyVolumeAttribute"/> /// </summary> /// /// <param name="modifyVolumeAttributeRequest">Container for the necessary parameters to execute the ModifyVolumeAttribute operation on /// AmazonEC2.</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> public IAsyncResult BeginModifyVolumeAttribute(ModifyVolumeAttributeRequest modifyVolumeAttributeRequest, AsyncCallback callback, object state) { return invokeModifyVolumeAttribute(modifyVolumeAttributeRequest, callback, state, false); }
/// <summary> /// <para>Modifies a volume attribute.</para> <para>By default, all I/O operations for the volume are suspended when the data on the volume is /// determined to be potentially inconsistent, to prevent undetectable, latent data corruption. The I/O access to the volume can be resumed by /// first enabling I/O access and then checking the data consistency on your volume.</para> <para>You can change the default behavior to resume /// I/O operations. We recommend that you change this only for boot volumes or for volumes that are stateless or disposable.</para> /// </summary> /// /// <param name="modifyVolumeAttributeRequest">Container for the necessary parameters to execute the ModifyVolumeAttribute service method on /// AmazonEC2.</param> /// public ModifyVolumeAttributeResponse ModifyVolumeAttribute(ModifyVolumeAttributeRequest modifyVolumeAttributeRequest) { IAsyncResult asyncResult = invokeModifyVolumeAttribute(modifyVolumeAttributeRequest, null, null, true); return EndModifyVolumeAttribute(asyncResult); }
/// <summary> /// <para>Modifies a volume attribute.</para> <para>By default, all I/O operations for the volume are suspended when the data on the volume is /// determined to be potentially inconsistent, to prevent undetectable, latent data corruption. The I/O access to the volume can be resumed by /// first enabling I/O access and then checking the data consistency on your volume.</para> <para>You can change the default behavior to resume /// I/O operations. We recommend that you change this only for boot volumes or for volumes that are stateless or disposable.</para> /// </summary> /// /// <param name="modifyVolumeAttributeRequest">Container for the necessary parameters to execute the ModifyVolumeAttribute service method on /// AmazonEC2.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> public Task<ModifyVolumeAttributeResponse> ModifyVolumeAttributeAsync(ModifyVolumeAttributeRequest modifyVolumeAttributeRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new ModifyVolumeAttributeRequestMarshaller(); var unmarshaller = ModifyVolumeAttributeResponseUnmarshaller.GetInstance(); return Invoke<IRequest, ModifyVolumeAttributeRequest, ModifyVolumeAttributeResponse>(modifyVolumeAttributeRequest, marshaller, unmarshaller, signer, cancellationToken); }
internal ModifyVolumeAttributeResponse ModifyVolumeAttribute(ModifyVolumeAttributeRequest request) { var task = ModifyVolumeAttributeAsync(request); try { return task.Result; } catch(AggregateException e) { ExceptionDispatchInfo.Capture(e.InnerException).Throw(); return null; } }
/// <summary> /// Initiates the asynchronous execution of the ModifyVolumeAttribute operation. /// <seealso cref="Amazon.EC2.IAmazonEC2.ModifyVolumeAttribute"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ModifyVolumeAttribute 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 async Task<ModifyVolumeAttributeResponse> ModifyVolumeAttributeAsync(ModifyVolumeAttributeRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new ModifyVolumeAttributeRequestMarshaller(); var unmarshaller = ModifyVolumeAttributeResponseUnmarshaller.GetInstance(); var response = await Invoke<IRequest, ModifyVolumeAttributeRequest, ModifyVolumeAttributeResponse>(request, marshaller, unmarshaller, signer, cancellationToken) .ConfigureAwait(continueOnCapturedContext: false); return response; }
/// <summary> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ModifyVolumeAttribute service method on /// AmazonEC2.</param> public ModifyVolumeAttributeResponse ModifyVolumeAttribute(ModifyVolumeAttributeRequest request) { var task = ModifyVolumeAttributeAsync(request); try { return task.Result; } catch(AggregateException e) { throw e.InnerException; } }
private Amazon.EC2.Model.ModifyVolumeAttributeResponse CallAWSServiceOperation(IAmazonEC2 client, Amazon.EC2.Model.ModifyVolumeAttributeRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Elastic Compute Cloud (EC2)", "ModifyVolumeAttribute"); try { #if DESKTOP return(client.ModifyVolumeAttribute(request)); #elif CORECLR return(client.ModifyVolumeAttributeAsync(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; } }