Create Pause and Resume operations

This commit is contained in:
Wes Carroll
2019-02-26 13:05:30 -05:00
parent 074950b32e
commit 65d89031f3
2 changed files with 52 additions and 0 deletions
@@ -0,0 +1,26 @@
function Resume-ZertoVpg {
[cmdletbinding()]
param(
[Parameter(
HelpMessage = "Name(s) of VPG(s) to resume replication",
Mandatory = $true
)]
[string[]]$vpgName
)
begin {
$baseUri = "vpgs"
}
process {
foreach ($name in $vpgName) {
$id = $(Get-ZertoVpg -name $name).vpgIdentifier
$uri = "{0}/{1}/resume" -f $baseUri, $id
Invoke-ZertoRestRequest -uri $uri -method "POST"
}
}
end {
#Nothing to do
}
}
@@ -0,0 +1,26 @@
function Suspend-ZertoVpg {
[cmdletbinding()]
param(
[Parameter(
HelpMessage = "Name(s) of VPG(s) to pause replication",
Mandatory = $true
)]
[string[]]$vpgName
)
begin {
$baseUri = "vpgs"
}
process {
foreach ($name in $vpgName) {
$id = $(Get-ZertoVpg -name $name).vpgIdentifier
$uri = "{0}/{1}/pause" -f $baseUri, $id
Invoke-ZertoRestRequest -uri $uri -method "POST"
}
}
end {
#Nothing to do
}
}