diff --git a/ZertoApiWrapper/Public/Resume-ZertoVpg.ps1 b/ZertoApiWrapper/Public/Resume-ZertoVpg.ps1 new file mode 100644 index 0000000..16db296 --- /dev/null +++ b/ZertoApiWrapper/Public/Resume-ZertoVpg.ps1 @@ -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 + } +} diff --git a/ZertoApiWrapper/Public/Suspend-ZertoVpg.ps1 b/ZertoApiWrapper/Public/Suspend-ZertoVpg.ps1 new file mode 100644 index 0000000..9627ede --- /dev/null +++ b/ZertoApiWrapper/Public/Suspend-ZertoVpg.ps1 @@ -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 + } +}