#region Copyright /* * Copyright 2014-2016 NetApp, Inc. All Rights Reserved. * * CONFIDENTIALITY NOTICE: THIS SOFTWARE CONTAINS CONFIDENTIAL INFORMATION OF * NETAPP, INC. USE, DISCLOSURE OR REPRODUCTION IS PROHIBITED WITHOUT THE PRIOR * EXPRESS WRITTEN PERMISSION OF NETAPP, INC. */ #endregion #region Using Directives using System; using System.Linq; using System.ComponentModel; using System.Management.Automation; using SolidFire.Core; using SolidFire.Element.Api; #endregion namespace SolidFire.Volume.Get { /// /// You can use ListAsyncResults to list the results of all currently running and completed asynchronous methods on the system. Querying asynchronous results with ListAsyncResults does not cause completed asyncHandles to expire; you can use GetAsyncResult to query any of the asyncHandles returned by ListAsyncResults. /// [Cmdlet(VerbsCommon.Get, "SFAsyncStatus")] public class GetSFAsyncStatus : SFCmdlet { #region Private Data /// /// An optional list of types of results. You can use this list to restrict the results to only these types of operations. Possible values:BulkVolume: Copy operations between volumes, such as backups or restores.Clone: Volume cloning operations.DriveRemoval: Operations involving the system copying data from a drive in preparation to remove it from the cluster.RtfiPendingNode: Operations involving the system installing compatible software on a node before adding it to the cluster. /// private string[] _asyncResultTypes; #endregion #region Parameters [Parameter(Mandatory = false, HelpMessage = "An optional list of types of results. You can use this list to restrict the results to only these types of operations. Possible values:BulkVolume: Copy operations between volumes, such as backups or restores.Clone: Volume cloning operations.DriveRemoval: Operations involving the system copying data from a drive in preparation to remove it from the cluster.RtfiPendingNode: Operations involving the system installing compatible software on a node before adding it to the cluster.")] public string[] AsyncResultTypes { get { return _asyncResultTypes; } set { _asyncResultTypes = value; } } #endregion #region Cmdlet Overrides protected override void BeginProcessing() { base.BeginProcessing(); CheckConnection(9); } protected override void ProcessRecord() { base.ProcessRecord(); var request = new ListAsyncResultsRequest(); request.AsyncResultTypes = _asyncResultTypes; var objsFromAPI = SendRequest("ListAsyncResults", request); WriteObject(objsFromAPI.Select(obj => obj.Result.AsyncHandles), true); } #endregion } }