Create Pause and Resume operations
This commit is contained in:
@@ -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
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user