#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;
#endregion
namespace SolidFire.Cluster.Complete
{
///
/// Complete-SFClusterPairing is the second step in the cluster pairing process. It uses the encoded key received from the
/// StartClusterPairing API method to complete the cluster pairing process.
///
[Cmdlet(VerbsLifecycle.Complete, "SFClusterPairing", SupportsShouldProcess = true, ConfirmImpact = ConfirmImpact.Medium)]
public class CompleteSFClusterPairing : SFCmdlet
{
#region Private Data
#endregion
#region Parameters
///
/// A string of characters that is returned from the StartClusterPairing API method.
///
[Parameter(Position = 0, Mandatory = true, ValueFromPipeline = true, ValueFromPipelineByPropertyName = true, HelpMessage = "A string of characters that is returned from the StartClusterPairing API method.")]
public string ClusterPairingKey { get; set; }
#endregion
#region Cmdlet Overrides
protected override void BeginProcessing()
{
base.BeginProcessing();
CheckConnection();
}
protected override void ProcessRecord()
{
base.ProcessRecord();
var request = new CompleteClusterPairingRequest();
request.ClusterPairingKey = ClusterPairingKey;
var objsFromAPI = SendRequest("CompleteClusterPairing", request);
foreach (var obj in objsFromAPI)
{
WriteObject(obj.Result);
}
}
#endregion
}
}