#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.Management.Automation;
using SolidFire.Core;
using SolidFire.Element.Api;
using System.Linq;
using SolidFire.Core.Helpers;
#endregion
namespace SolidFire.Test
{
///
/// Used to validate the connection to all nodes in the cluster on both 1G and 10G interfaces using ICMP packets. The test uses the appropriate MTU sizes for each packet based on the MTU settings in the network configuration.
///
[Cmdlet(VerbsDiagnostic.Test, "SFDrives", SupportsShouldProcess = true,
ConfirmImpact = ConfirmImpact.Medium)]
public class TestSFDrives : SFCmdlet
{
#region Private Fields
#endregion
#region CmdLet Parameters
[Parameter(HelpMessage = "Specifies the number of minutes to run the test.")]
public int Minutes { get;set; }
#endregion
#region Cmdlet Overrides
protected override void BeginProcessing()
{
base.BeginProcessing();
CheckConnection(endPoint: SolidFireUtilities.SFEndPoint.Node);
}
protected override void ProcessRecord()
{
base.ProcessRecord();
var request = new TestDrivesRequest()
{
Minutes = Minutes,
Force = true
};
WriteWarning("You can only use Test-SFDrives on nodes that are not \"Active\" in a cluster.");
WriteObject(SendRequest("TestDrives", request).Select(o => o.Result), true);
}
#endregion
}
}