Update FailoverTestStop with additional options.
This commit is contained in:
@@ -2,21 +2,30 @@ function Invoke-ZertoFailoverTestStop {
|
|||||||
[cmdletbinding()]
|
[cmdletbinding()]
|
||||||
param(
|
param(
|
||||||
[Parameter(
|
[Parameter(
|
||||||
HelpMessage = "Name(s) of VPG(s) to roll back from failing over",
|
HelpMessage = "Name(s) of VPG(s) to stop testing.",
|
||||||
Mandatory = $true
|
Mandatory = $true
|
||||||
)]
|
)]
|
||||||
[string[]]$vpgName
|
[string[]]$vpgName,
|
||||||
|
[Parameter(
|
||||||
|
HelpMessage = "Was the test successful? True or False. True is Default."
|
||||||
|
)]
|
||||||
|
[bool]$failoverTestSuccess = $true,
|
||||||
|
[Parameter(
|
||||||
|
HelpMessage = "Free text field for any notes to add to the test report."
|
||||||
|
)]
|
||||||
|
[string]$failoverTestSummary = "Stop Failover Test for $vpgName"
|
||||||
)
|
)
|
||||||
|
|
||||||
begin {
|
begin {
|
||||||
$baseUri = "vpgs"
|
$baseUri = "vpgs"
|
||||||
|
$body = @{"FailoverTestSuccess" = $failoverTestSuccess; "FailoverTestSummary" = $failoverTestSummary}
|
||||||
}
|
}
|
||||||
|
|
||||||
process {
|
process {
|
||||||
foreach ($name in $vpgName) {
|
foreach ($name in $vpgName) {
|
||||||
$id = $(Get-ZertoVpg -name $name).vpgIdentifier
|
$vpgId = $(Get-ZertoVpg -name $name).vpgIdentifier
|
||||||
$uri = "{0}/{1}/FailoverTestStop" -f $baseUri, $id
|
$uri = "{0}/{1}/FailoverTestStop" -f $baseUri, $vpgId
|
||||||
Invoke-ZertoRestRequest -uri $uri -method "POST"
|
Invoke-ZertoRestRequest -uri $uri -method "POST" -body $($body | ConvertTo-Json)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user