#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.ComponentModel; using System.Management.Automation; using SolidFire.Core.Objects; using SolidFire.Core.Validation; using SolidFire.Core; using SolidFire.Element.Api; #endregion namespace SolidFire.Volume.Get { /// /// GetVolumeEfficiency is used to retrieve information about a volume. Only the volume given as a parameter in this API method /// is used to compute the capacity. /// [Cmdlet(VerbsCommon.Get, "SFVolumeEfficiency", DefaultParameterSetName = "VolumeId")] public class GetSFVolumeEfficiency : SFCmdlet { #region Private Data /// /// /// private Int64 volumeId; #endregion #region Parameters [Parameter(Position = 0, Mandatory = true, ValueFromPipeline = true, ValueFromPipelineByPropertyName = true, ValueFromRemainingArguments = false, HelpMessage = "Please enter a volume ID or list of volume IDs")] [ValidateNotNullOrEmpty] [ValidatePattern(SolidFireValidations.Numeric)] public Int64 VolumeID { get { return volumeId; } set { volumeId = value; } } #endregion #region Cmdlet Overrides protected override void BeginProcessing() { base.BeginProcessing(); CheckConnection(); } /// /// /// protected override void ProcessRecord() { base.ProcessRecord(); var request = new GetVolumeEfficiencyRequest(); request.VolumeID = volumeId; var objsFromAPI = SendRequest("GetVolumeEfficiency", request, false); foreach (var obj in objsFromAPI) { ProcessByVolumeId(obj); } } private void ProcessByVolumeId(SFWrapper objFromApi) { WriteObject(objFromApi.Result, true); } #endregion } }