#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.ComponentModel;
using System.Management.Automation;
using SolidFire.Core;
using SolidFire.Element.Api;
using SolidFire.Core.Validation;
#endregion
namespace SolidFire.Volume.Complete
{
///
/// CompleteVolumePairing is used to complete the pairing of two volumes.
///
[Cmdlet(VerbsLifecycle.Complete, "SFVolumePairing", SupportsShouldProcess = true, ConfirmImpact = ConfirmImpact.Medium)]
public class CompleteSFVolumePairing : SFCmdlet
{
#region Private Data
#endregion
#region Parameters
///
/// A string of characters that is returned from the StartVolumePairing API method.
///
[Parameter(Position = 0, Mandatory = true, ValueFromPipeline = true, ValueFromPipelineByPropertyName = true, HelpMessage = "A string of characters that is returned from the StartVolumePairing API method.")]
public string VolumePairingKey { get; set; }
///
/// The ID of volume on which to complete the pairing process.
///
[Parameter(Position = 1, Mandatory = true, ValueFromPipeline = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The ID of the volume on which to complete the pairing process.")]
[ValidatePattern(SolidFireValidations.Numeric)]
public long VolumeID { get; set; }
#endregion
#region Cmdlet Overrides
protected override void BeginProcessing()
{
base.BeginProcessing();
CheckConnection();
}
protected override void ProcessRecord()
{
base.ProcessRecord();
var request = new CompleteVolumePairingRequest();
request.VolumePairingKey = VolumePairingKey;
request.VolumeID = VolumeID;
var objsFromAPI = SendRequest("CompleteVolumePairing", request);
foreach (var obj in objsFromAPI)
{
WriteObject(obj.Result);
}
}
#endregion
}
}