/// <summary> /// Describes the status of the specified volumes. Volume status provides the result of /// the checks performed on your volumes to determine events that can impair the performance /// of your volumes. The performance of a volume can be affected if an issue occurs on /// the volume's underlying host. If the volume's underlying host experiences a power /// outage or system issue, after the system is restored, there could be data inconsistencies /// on the volume. Volume events notify you if this occurs. Volume actions notify you /// if any action needs to be taken in response to the event. /// /// /// <para> /// The <code>DescribeVolumeStatus</code> operation provides the following information /// about the specified volumes: /// </para> /// /// <para> /// <i>Status</i>: Reflects the current status of the volume. The possible values are /// <code>ok</code>, <code>impaired</code> , <code>warning</code>, or <code>insufficient-data</code>. /// If all checks pass, the overall status of the volume is <code>ok</code>. If the check /// fails, the overall status is <code>impaired</code>. If the status is <code>insufficient-data</code>, /// then the checks may still be taking place on your volume at the time. We recommend /// that you retry the request. For more information on volume status, see <a href="http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/monitoring-volume-status.html">Monitoring /// the Status of Your Volumes</a>. /// </para> /// /// <para> /// <i>Events</i>: Reflect the cause of a volume status and may require you to take action. /// For example, if your volume returns an <code>impaired</code> status, then the volume /// event might be <code>potential-data-inconsistency</code>. This means that your volume /// has been affected by an issue with the underlying host, has all I/O operations disabled, /// and may have inconsistent data. /// </para> /// /// <para> /// <i>Actions</i>: Reflect the actions you may have to take in response to an event. /// For example, if the status of the volume is <code>impaired</code> and the volume event /// shows <code>potential-data-inconsistency</code>, then the action shows <code>enable-volume-io</code>. /// This means that you may want to enable the I/O operations for the volume by calling /// the <a>EnableVolumeIO</a> action and then check the volume for data consistency. /// </para> /// <note> /// <para> /// Volume status is based on the volume status checks, and does not reflect the volume /// state. Therefore, volume status does not indicate volumes in the <code>error</code> /// state (for example, when a volume is incapable of accepting I/O.) /// </para> /// </note> /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeVolumeStatus service method.</param> /// /// <returns>The response from the DescribeVolumeStatus service method, as returned by EC2.</returns> public DescribeVolumeStatusResponse DescribeVolumeStatus(DescribeVolumeStatusRequest request) { var marshaller = new DescribeVolumeStatusRequestMarshaller(); var unmarshaller = DescribeVolumeStatusResponseUnmarshaller.Instance; return Invoke<DescribeVolumeStatusRequest,DescribeVolumeStatusResponse>(request, marshaller, unmarshaller); }
/// <summary> /// Initiates the asynchronous execution of the DescribeVolumeStatus operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DescribeVolumeStatus 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<DescribeVolumeStatusResponse> DescribeVolumeStatusAsync(DescribeVolumeStatusRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DescribeVolumeStatusRequestMarshaller(); var unmarshaller = DescribeVolumeStatusResponseUnmarshaller.Instance; return InvokeAsync<DescribeVolumeStatusRequest,DescribeVolumeStatusResponse>(request, marshaller, unmarshaller, cancellationToken); }
private Amazon.EC2.Model.DescribeVolumeStatusResponse CallAWSServiceOperation(IAmazonEC2 client, Amazon.EC2.Model.DescribeVolumeStatusRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Elastic Compute Cloud (EC2)", "DescribeVolumeStatus"); try { #if DESKTOP return(client.DescribeVolumeStatus(request)); #elif CORECLR return(client.DescribeVolumeStatusAsync(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> /// Initiates the asynchronous execution of the DescribeVolumeStatus operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DescribeVolumeStatus 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 EndDescribeVolumeStatus /// operation.</returns> public IAsyncResult BeginDescribeVolumeStatus(DescribeVolumeStatusRequest request, AsyncCallback callback, object state) { var marshaller = new DescribeVolumeStatusRequestMarshaller(); var unmarshaller = DescribeVolumeStatusResponseUnmarshaller.Instance; return BeginInvoke<DescribeVolumeStatusRequest>(request, marshaller, unmarshaller, callback, state); }
public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; #pragma warning disable CS0618, CS0612 //A class member was marked with the Obsolete attribute var useParameterSelect = this.Select.StartsWith("^") || this.PassThru.IsPresent; #pragma warning restore CS0618, CS0612 //A class member was marked with the Obsolete attribute // create request and set iteration invariants var request = new Amazon.EC2.Model.DescribeVolumeStatusRequest(); if (cmdletContext.Filter != null) { request.Filters = cmdletContext.Filter; } if (cmdletContext.MaxResult != null) { request.MaxResults = AutoIterationHelpers.ConvertEmitLimitToServiceTypeInt32(cmdletContext.MaxResult.Value); } if (cmdletContext.VolumeId != null) { request.VolumeIds = cmdletContext.VolumeId; } // Initialize loop variant and commence piping var _nextToken = cmdletContext.NextToken; var _userControllingPaging = this.NoAutoIteration.IsPresent || ParameterWasBound(nameof(this.NextToken)); var client = Client ?? CreateClient(_CurrentCredentials, _RegionEndpoint); do { request.NextToken = _nextToken; CmdletOutput output; try { var response = CallAWSServiceOperation(client, request); object pipelineOutput = null; if (!useParameterSelect) { pipelineOutput = cmdletContext.Select(response, this); } output = new CmdletOutput { PipelineOutput = pipelineOutput, ServiceResponse = response }; _nextToken = response.NextToken; } catch (Exception e) { output = new CmdletOutput { ErrorResponse = e }; } ProcessOutput(output); } while (!_userControllingPaging && AutoIterationHelpers.HasValue(_nextToken)); if (useParameterSelect) { WriteObject(cmdletContext.Select(null, this)); } return(null); }
public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; var useParameterSelect = this.Select.StartsWith("^") || this.PassThru.IsPresent; // create request and set iteration invariants var request = new Amazon.EC2.Model.DescribeVolumeStatusRequest(); if (cmdletContext.Filter != null) { request.Filters = cmdletContext.Filter; } if (cmdletContext.VolumeId != null) { request.VolumeIds = cmdletContext.VolumeId; } // Initialize loop variants and commence piping System.String _nextToken = null; int? _emitLimit = null; int _retrievedSoFar = 0; if (AutoIterationHelpers.HasValue(cmdletContext.NextToken)) { _nextToken = cmdletContext.NextToken; } if (cmdletContext.MaxResult.HasValue) { _emitLimit = cmdletContext.MaxResult; } var _userControllingPaging = this.NoAutoIteration.IsPresent || ParameterWasBound(nameof(this.NextToken)); var client = Client ?? CreateClient(_CurrentCredentials, _RegionEndpoint); do { request.NextToken = _nextToken; if (_emitLimit.HasValue) { request.MaxResults = AutoIterationHelpers.ConvertEmitLimitToInt32(_emitLimit.Value); } CmdletOutput output; try { var response = CallAWSServiceOperation(client, request); object pipelineOutput = null; if (!useParameterSelect) { pipelineOutput = cmdletContext.Select(response, this); } output = new CmdletOutput { PipelineOutput = pipelineOutput, ServiceResponse = response }; int _receivedThisCall = response.VolumeStatuses.Count; _nextToken = response.NextToken; _retrievedSoFar += _receivedThisCall; if (_emitLimit.HasValue) { _emitLimit -= _receivedThisCall; } } catch (Exception e) { if (_retrievedSoFar == 0 || !_emitLimit.HasValue) { output = new CmdletOutput { ErrorResponse = e }; } else { break; } } ProcessOutput(output); } while (!_userControllingPaging && AutoIterationHelpers.HasValue(_nextToken) && (!_emitLimit.HasValue || _emitLimit.Value >= 1)); if (useParameterSelect) { WriteObject(cmdletContext.Select(null, this)); } return(null); }
IAsyncResult invokeDescribeVolumeStatus(DescribeVolumeStatusRequest describeVolumeStatusRequest, AsyncCallback callback, object state, bool synchronized) { IRequest irequest = new DescribeVolumeStatusRequestMarshaller().Marshall(describeVolumeStatusRequest); var unmarshaller = DescribeVolumeStatusResponseUnmarshaller.GetInstance(); AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller); Invoke(result); return result; }
/// <summary> /// Paginator for DescribeVolumeStatus operation ///</summary> public IDescribeVolumeStatusPaginator DescribeVolumeStatus(DescribeVolumeStatusRequest request) { return(new DescribeVolumeStatusPaginator(this.client, request)); }
/// <summary> /// <para>Describes the status of the specified volumes. Volume status provides the result of the checks performed on your volumes to determine /// events that can impair the performance of your volumes. The performance of a volume can be affected if an issue occurs on the volume's /// underlying host. If the volume's underlying host experiences a power outage or system issue, after the system is restored, there could be /// data inconsistencies on the volume. Volume events notify you if this occurs. Volume actions notify you if any action needs to be taken in /// response to the event.</para> <para>The <c>DescribeVolumeStatus</c> operation provides the following information about the specified /// volumes:</para> <para> <i>Status</i> : Reflects the current status of the volume. The possible values are <c>ok</c> , /// <c>impaired</c> , /// <c>warning</c> , or <c>insufficient-data</c> . If all checks pass, the overall status of the volume is <c>ok</c> . If /// the check fails, the overall status is <c>impaired</c> . If the status is <c>insufficient-data</c> , then the checks may still be taking /// place on your volume at the time. We recommend that you retry the request. For more information on volume status, see <a /// href="http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/monitoring-volume-status.html" >Monitoring the Status of Your Volumes</a> .</para> /// <para> <i>Events</i> : Reflect the cause of a volume status and may require you to take action. For example, if your volume returns an /// <c>impaired</c> status, then the volume event might be <c>potential-data-inconsistency</c> . This means that your volume has been affected /// by an issue with the underlying host, has all I/O operations disabled, and may have inconsistent data.</para> <para> <i>Actions</i> : /// Reflect the actions you may have to take in response to an event. For example, if the status of the volume is <c>impaired</c> and the volume /// event shows <c>potential-data-inconsistency</c> , then the action shows <c>enable-volume-io</c> . This means that you may want to enable the /// I/O operations for the volume by calling the EnableVolumeIO action and then check the volume for data consistency.</para> <para><b>NOTE:</b> /// Volume status is based on the volume status checks, and does not reflect the volume state. Therefore, volume status does not indicate /// volumes in the error state (for example, when a volume is incapable of accepting I/O.) </para> /// </summary> /// /// <param name="describeVolumeStatusRequest">Container for the necessary parameters to execute the DescribeVolumeStatus service method on /// AmazonEC2.</param> /// /// <returns>The response from the DescribeVolumeStatus service method, as returned by AmazonEC2.</returns> /// public DescribeVolumeStatusResponse DescribeVolumeStatus(DescribeVolumeStatusRequest describeVolumeStatusRequest) { IAsyncResult asyncResult = invokeDescribeVolumeStatus(describeVolumeStatusRequest, null, null, true); return EndDescribeVolumeStatus(asyncResult); }
/// <summary> /// Initiates the asynchronous execution of the DescribeVolumeStatus operation. /// <seealso cref="Amazon.EC2.IAmazonEC2.DescribeVolumeStatus"/> /// </summary> /// /// <param name="describeVolumeStatusRequest">Container for the necessary parameters to execute the DescribeVolumeStatus 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> /// /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking /// EndDescribeVolumeStatus operation.</returns> public IAsyncResult BeginDescribeVolumeStatus(DescribeVolumeStatusRequest describeVolumeStatusRequest, AsyncCallback callback, object state) { return invokeDescribeVolumeStatus(describeVolumeStatusRequest, callback, state, false); }
/// <summary> /// <para>Describes the status of the specified volumes. Volume status provides the result of the checks performed on your volumes to determine /// events that can impair the performance of your volumes. The performance of a volume can be affected if an issue occurs on the volume's /// underlying host. If the volume's underlying host experiences a power outage or system issue, after the system is restored, there could be /// data inconsistencies on the volume. Volume events notify you if this occurs. Volume actions notify you if any action needs to be taken in /// response to the event.</para> <para>The <c>DescribeVolumeStatus</c> operation provides the following information about the specified /// volumes:</para> <para> <i>Status</i> : Reflects the current status of the volume. The possible values are <c>ok</c> , /// <c>impaired</c> , /// <c>warning</c> , or <c>insufficient-data</c> . If all checks pass, the overall status of the volume is <c>ok</c> . If /// the check fails, the overall status is <c>impaired</c> . If the status is <c>insufficient-data</c> , then the checks may still be taking /// place on your volume at the time. We recommend that you retry the request. For more information on volume status, see <a href="http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/monitoring-volume-status.html">Monitoring the Status of Your Volumes</a> .</para> /// <para> <i>Events</i> : Reflect the cause of a volume status and may require you to take action. For example, if your volume returns an /// <c>impaired</c> status, then the volume event might be <c>potential-data-inconsistency</c> . This means that your volume has been affected /// by an issue with the underlying host, has all I/O operations disabled, and may have inconsistent data.</para> <para> <i>Actions</i> : /// Reflect the actions you may have to take in response to an event. For example, if the status of the volume is <c>impaired</c> and the volume /// event shows <c>potential-data-inconsistency</c> , then the action shows <c>enable-volume-io</c> . This means that you may want to enable the /// I/O operations for the volume by calling the EnableVolumeIO action and then check the volume for data consistency.</para> <para><b>NOTE:</b> /// Volume status is based on the volume status checks, and does not reflect the volume state. Therefore, volume status does not indicate /// volumes in the error state (for example, when a volume is incapable of accepting I/O.) </para> /// </summary> /// /// <param name="describeVolumeStatusRequest">Container for the necessary parameters to execute the DescribeVolumeStatus service method on /// AmazonEC2.</param> /// /// <returns>The response from the DescribeVolumeStatus service method, as returned by AmazonEC2.</returns> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> public Task<DescribeVolumeStatusResponse> DescribeVolumeStatusAsync(DescribeVolumeStatusRequest describeVolumeStatusRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DescribeVolumeStatusRequestMarshaller(); var unmarshaller = DescribeVolumeStatusResponseUnmarshaller.GetInstance(); return Invoke<IRequest, DescribeVolumeStatusRequest, DescribeVolumeStatusResponse>(describeVolumeStatusRequest, marshaller, unmarshaller, signer, cancellationToken); }
internal DescribeVolumeStatusResponse DescribeVolumeStatus(DescribeVolumeStatusRequest request) { var task = DescribeVolumeStatusAsync(request); try { return task.Result; } catch(AggregateException e) { ExceptionDispatchInfo.Capture(e.InnerException).Throw(); return null; } }
/// <summary> /// Initiates the asynchronous execution of the DescribeVolumeStatus operation. /// <seealso cref="Amazon.EC2.IAmazonEC2.DescribeVolumeStatus"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DescribeVolumeStatus 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<DescribeVolumeStatusResponse> DescribeVolumeStatusAsync(DescribeVolumeStatusRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DescribeVolumeStatusRequestMarshaller(); var unmarshaller = DescribeVolumeStatusResponseUnmarshaller.GetInstance(); var response = await Invoke<IRequest, DescribeVolumeStatusRequest, DescribeVolumeStatusResponse>(request, marshaller, unmarshaller, signer, cancellationToken) .ConfigureAwait(continueOnCapturedContext: false); return response; }
/// <summary> /// <para> Describes the status of a volume. </para> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DescribeVolumeStatus service method on /// AmazonEC2.</param> /// /// <returns>The response from the DescribeVolumeStatus service method, as returned by AmazonEC2.</returns> public DescribeVolumeStatusResponse DescribeVolumeStatus(DescribeVolumeStatusRequest request) { var task = DescribeVolumeStatusAsync(request); try { return task.Result; } catch(AggregateException e) { throw e.InnerException; } }
internal DescribeVolumeStatusPaginator(IAmazonEC2 client, DescribeVolumeStatusRequest request) { this._client = client; this._request = request; }