From ae2de975ca9e590dabd6873516ece20bba78cc55 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 13 Mar 2019 14:15:44 -0400 Subject: [PATCH 01/11] Create Export-ZertoVpg --- ZertoApiWrapper/Public/Export-ZertoVpg.ps1 | 24 +++++++++++++++++ ZertoApiWrapper/Public/New-ZertoVpg.ps1 | 2 +- .../Public/New-ZertoVpgSettingsIdentifier.ps1 | 26 +++++++++++++++++++ 3 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 ZertoApiWrapper/Public/Export-ZertoVpg.ps1 create mode 100644 ZertoApiWrapper/Public/New-ZertoVpgSettingsIdentifier.ps1 diff --git a/ZertoApiWrapper/Public/Export-ZertoVpg.ps1 b/ZertoApiWrapper/Public/Export-ZertoVpg.ps1 new file mode 100644 index 0000000..ebb5dec --- /dev/null +++ b/ZertoApiWrapper/Public/Export-ZertoVpg.ps1 @@ -0,0 +1,24 @@ +function Export-ZertoVpg { + [cmdletbinding()] + param( + [string]$outputPath, + [string[]]$vpgName + ) + + begin { + + } + + process { + foreach ($name in $vpgName) { + $vpgSettingsIdentifier = New-ZertoVpgSettingsIdentifier -vpgIdentifier $(Get-ZertoVpg -name $name).vpgIdentifier + $vpgSettings = Get-ZertoVpgSetting -vpgSettingsIdentifier $vpgSettingsIdentifier + $filePath = "{0}\{1}.json" -f $outputPath, $name + $vpgSettings | Convertto-Json -depth 10 | Out-File -FilePath $filePath + } + } + + end { + + } +} \ No newline at end of file diff --git a/ZertoApiWrapper/Public/New-ZertoVpg.ps1 b/ZertoApiWrapper/Public/New-ZertoVpg.ps1 index 7b34854..a944121 100644 --- a/ZertoApiWrapper/Public/New-ZertoVpg.ps1 +++ b/ZertoApiWrapper/Public/New-ZertoVpg.ps1 @@ -228,7 +228,7 @@ function New-ZertoVpg { process { $baseUri = "vpgsettings" # Create a VPG Settings Identifier - $vpgSettingsIdentifier = Invoke-ZertoRestRequest -uri $baseUri -body "{}" -method "POST" + $vpgSettingsIdentifier = New-ZertoVpgSettingsIdentifier # Put base settings into an object easy to manipulate $baseSettings = Get-ZertoVpgSetting -vpgSettingsIdentifier $vpgSettingsIdentifier # Set settings equal to passed and default parameters diff --git a/ZertoApiWrapper/Public/New-ZertoVpgSettingsIdentifier.ps1 b/ZertoApiWrapper/Public/New-ZertoVpgSettingsIdentifier.ps1 new file mode 100644 index 0000000..5fe72bf --- /dev/null +++ b/ZertoApiWrapper/Public/New-ZertoVpgSettingsIdentifier.ps1 @@ -0,0 +1,26 @@ +function New-ZertoVpgSettingsIdentifier { + [cmdletbinding()] + param( + [Parameter( + HelpMessage = "Identifier of the VPG to create a VPG settings identifier. If a vpgIdentifier is not provided, a new VPG settings object is created without any configured settings. This would be used for creating a new VPG from scratch." + )] + [string]$vpgIdentifier = $null + ) + + begin { + $baseUri = "vpgSettings" + if ($null -eq $vpgIdentifier) { + $body = "{}" + } else { + $body = "{""VpgIdentifier"":""$vpgIdentifier""}" + } + } + + process { + Invoke-ZertoRestRequest -uri $baseUri -body $body -Method "POST" + } + + end { + + } +} \ No newline at end of file From a91e2a034b2d081871b37d14c77e6d75f6281932 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 13 Mar 2019 14:19:38 -0400 Subject: [PATCH 02/11] Update Invoke-ZertoFailoverRollback.md --- docs/Invoke-ZertoFailoverRollback.md | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/docs/Invoke-ZertoFailoverRollback.md b/docs/Invoke-ZertoFailoverRollback.md index 4f4f451..a19a10a 100644 --- a/docs/Invoke-ZertoFailoverRollback.md +++ b/docs/Invoke-ZertoFailoverRollback.md @@ -8,29 +8,33 @@ schema: 2.0.0 # Invoke-ZertoFailoverRollback ## SYNOPSIS -Rollsback a VPG in a Before Commit Failover State + +Rolls back a VPG in a Before Commit Failover State ## SYNTAX -``` +```PowerShell Invoke-ZertoFailoverRollback [-vpgName] [] ``` ## DESCRIPTION -Rollsback a VPG in a Before Commit Failover State + +Rolls back a VPG in a Before Commit Failover State ## EXAMPLES ### Example 1 + ```powershell PS C:\> Invoke-ZertoFailoverRollback -vpgName "MyVpg" ``` -Rollsback VPG "MyVPG" from a Before Commit State +Rolls back VPG "MyVPG" from a Before Commit State ## PARAMETERS ### -vpgName + Name(s) of VPG(s) to roll back from failing over ```yaml @@ -46,14 +50,17 @@ Accept wildcard characters: False ``` ### CommonParameters + This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS ### None + ## OUTPUTS ### System.Object + ## NOTES ## RELATED LINKS From 59f83cbb8a10cff0b4e8cacffc6e52cc0e9c8027 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 14 Mar 2019 20:29:13 -0400 Subject: [PATCH 03/11] Create switch when creating new VPG Settings --- .../Public/New-ZertoVpgSettingsIdentifier.ps1 | 28 ++++++++++++++----- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/ZertoApiWrapper/Public/New-ZertoVpgSettingsIdentifier.ps1 b/ZertoApiWrapper/Public/New-ZertoVpgSettingsIdentifier.ps1 index 5fe72bf..1ae97dc 100644 --- a/ZertoApiWrapper/Public/New-ZertoVpgSettingsIdentifier.ps1 +++ b/ZertoApiWrapper/Public/New-ZertoVpgSettingsIdentifier.ps1 @@ -2,17 +2,31 @@ function New-ZertoVpgSettingsIdentifier { [cmdletbinding()] param( [Parameter( - HelpMessage = "Identifier of the VPG to create a VPG settings identifier. If a vpgIdentifier is not provided, a new VPG settings object is created without any configured settings. This would be used for creating a new VPG from scratch." + HelpMessage = "Identifier of the VPG to create a VPG settings identifier. If a vpgIdentifier is not provided, a new VPG settings object is created without any configured settings. This would be used for creating a new VPG from scratch.", + ParameterSetName = "existingVpg", + Mandatory = $true, + ValueFromPipeline = $true, + ValueFromPipelineByPropertyName = $true )] - [string]$vpgIdentifier = $null + [string]$vpgIdentifier, + [Parameter( + HelpMessage = "Use this switch when creating a vpgSettingsIdentifier for a new VPG", + ParameterSetName = "newVpg", + Mandatory = $true + )] + [switch]$newVpg ) begin { $baseUri = "vpgSettings" - if ($null -eq $vpgIdentifier) { - $body = "{}" - } else { - $body = "{""VpgIdentifier"":""$vpgIdentifier""}" + switch ($PSCmdlet.ParameterSetName) { + "newVpg" { + $body = "{}" + } + + "existingVpg" { + $body = "{""VpgIdentifier"":""$vpgIdentifier""}" + } } } @@ -23,4 +37,4 @@ function New-ZertoVpgSettingsIdentifier { end { } -} \ No newline at end of file +} From 28b36d3983598e5c4b1ffaeaeaf1b48c8868bddf Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 14 Mar 2019 20:30:12 -0400 Subject: [PATCH 04/11] Update to use the new create new vpg switch --- ZertoApiWrapper/Public/New-ZertoVpg.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ZertoApiWrapper/Public/New-ZertoVpg.ps1 b/ZertoApiWrapper/Public/New-ZertoVpg.ps1 index a944121..3ec1ff8 100644 --- a/ZertoApiWrapper/Public/New-ZertoVpg.ps1 +++ b/ZertoApiWrapper/Public/New-ZertoVpg.ps1 @@ -228,7 +228,7 @@ function New-ZertoVpg { process { $baseUri = "vpgsettings" # Create a VPG Settings Identifier - $vpgSettingsIdentifier = New-ZertoVpgSettingsIdentifier + $vpgSettingsIdentifier = New-ZertoVpgSettingsIdentifier -newVpg # Put base settings into an object easy to manipulate $baseSettings = Get-ZertoVpgSetting -vpgSettingsIdentifier $vpgSettingsIdentifier # Set settings equal to passed and default parameters From 42b45e53140c0fbc2ab3120acfd4074555c97355 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 14 Mar 2019 20:30:52 -0400 Subject: [PATCH 05/11] Update ExportVpg with help and export all option --- ZertoApiWrapper/Public/Export-ZertoVpg.ps1 | 25 ++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/ZertoApiWrapper/Public/Export-ZertoVpg.ps1 b/ZertoApiWrapper/Public/Export-ZertoVpg.ps1 index ebb5dec..b51dffa 100644 --- a/ZertoApiWrapper/Public/Export-ZertoVpg.ps1 +++ b/ZertoApiWrapper/Public/Export-ZertoVpg.ps1 @@ -1,12 +1,29 @@ function Export-ZertoVpg { [cmdletbinding()] param( - [string]$outputPath, - [string[]]$vpgName + [Parameter( + HelpMessage = "Location where to dump the resulting JSON files containing the VPG Settings", + Mandatory = $true + )] + [string]$outputFolder, + [parameter( + HelpMessage = "Name(s) of the VPG(s) to be exported", + ParameterSetName = "namedVpgs" + )] + [string[]]$vpgName, + [parameter( + HelpMessage = "Export all VPGs at this site", + ParameterSetName = "allVpgs", + valuefrompipeline = $true, + ValueFromPipelineByPropertyName = $true + )] + [switch]$allVpgs ) begin { - + if ($allVpgs) { + $vpgName = $(Get-ZertoVpg).vpgName + } } process { @@ -21,4 +38,4 @@ function Export-ZertoVpg { end { } -} \ No newline at end of file +} From 80d0d922be0d6c4def5ff4c403840b83f5d74ca3 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 14 Mar 2019 20:31:01 -0400 Subject: [PATCH 06/11] Create Import-ZertoVpg.ps1 --- ZertoApiWrapper/Public/Import-ZertoVpg.ps1 | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 ZertoApiWrapper/Public/Import-ZertoVpg.ps1 diff --git a/ZertoApiWrapper/Public/Import-ZertoVpg.ps1 b/ZertoApiWrapper/Public/Import-ZertoVpg.ps1 new file mode 100644 index 0000000..f3e54ec --- /dev/null +++ b/ZertoApiWrapper/Public/Import-ZertoVpg.ps1 @@ -0,0 +1,36 @@ +function Import-ZertoVpg { + [cmdletbinding()] + param( + [Parameter( + HelpMessage = "VPG settings JSON file(s) to import.", + Mandatory = $true, + ValueFromPipeline = $true, + ValueFromPipelineByPropertyName = $true + )] + [Alias("FullName")] + [string[]]$settingsFile + ) + + begin { + $baseUri = "vpgSettings" + } + + process { + foreach ($file in $settingsFile) { + $importedSettings = Get-Content -Path $file -Raw | ConvertFrom-Json + $vpgSettingsIdentifier = New-ZertoVpgSettingsIdentifier -newVpg + $importedSettings.VpgIdentifier = $null + $importedSettings.VpgSettingsIdentifier = $vpgSettingsIdentifier + $uri = "{0}/{1}" -f $baseUri, $vpgSettingsIdentifier + Invoke-ZertoRestRequest -uri $uri -method "PUT" -body $($importedSettings | convertto-json -Depth 10) + $vpgSettingsIdentifier | Save-ZertoVpgSettings + if ($settingsFile.Count -gt 1) { + Start-Sleep 5 + } + } + } + + end { + + } +} From 941d25a5889023e3f5063c9f6cdf924ab0c3924b Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 14 Mar 2019 20:41:37 -0400 Subject: [PATCH 07/11] Update formatting to standard --- docs/Get-ZertoVpg.md | 40 ++++++++++------------------ docs/Invoke-ZertoFailoverRollback.md | 3 +-- docs/Remove-ZertoVpg.md | 7 ++--- 3 files changed, 17 insertions(+), 33 deletions(-) diff --git a/docs/Get-ZertoVpg.md b/docs/Get-ZertoVpg.md index 299b221..737456a 100644 --- a/docs/Get-ZertoVpg.md +++ b/docs/Get-ZertoVpg.md @@ -14,74 +14,63 @@ Returns information about VPGs ## SYNTAX ### main (Default) - -```PowerShell +``` Get-ZertoVpg [] ``` ### stats - -```PowerShell +``` Get-ZertoVpg -protectionGroupIdentifier [-checkpointsStats] [] ``` ### checkpoints - -```PowerShell -Get-ZertoVpg -protectionGroupIdentifier [-checkpoints] [-startDate ] [-endDate ] [] +``` +Get-ZertoVpg -protectionGroupIdentifier [-checkpoints] [-startDate ] [-endDate ] + [] ``` ### protectionGroupIdentifier - -```PowerShell +``` Get-ZertoVpg -protectionGroupIdentifier [] ``` ### entityTypes - -```PowerShell +``` Get-ZertoVpg [-entityTypes] [] ``` ### failoverCommitPolicies - -```PowerShell +``` Get-ZertoVpg [-failoverCommitPolicies] [] ``` ### failoverShutdownPolicies - -```PowerShell +``` Get-ZertoVpg [-failoverShutdownPolicies] [] ``` ### priorities - -```PowerShell +``` Get-ZertoVpg [-priorities] [] ``` ### retentionPolicies - -```PowerShell +``` Get-ZertoVpg [-retentionPolicies] [] ``` ### statuses - -```PowerShell +``` Get-ZertoVpg [-statuses] [] ``` ### subStatuses - -```PowerShell +``` Get-ZertoVpg [-subStatuses] [] ``` ### filter - -```PowerShell +``` Get-ZertoVpg [-name ] [-status ] [-subStatus ] [-protectedSiteType ] [-recoverySiteType ] [-protectedSiteIdentifier ] [-recoverySiteIdentifier ] [-organizationName ] [-zorgIdentifier ] [-priority ] @@ -508,7 +497,6 @@ Accept wildcard characters: False ``` ### CommonParameters - This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Invoke-ZertoFailoverRollback.md b/docs/Invoke-ZertoFailoverRollback.md index a19a10a..6f11cf3 100644 --- a/docs/Invoke-ZertoFailoverRollback.md +++ b/docs/Invoke-ZertoFailoverRollback.md @@ -13,7 +13,7 @@ Rolls back a VPG in a Before Commit Failover State ## SYNTAX -```PowerShell +``` Invoke-ZertoFailoverRollback [-vpgName] [] ``` @@ -50,7 +50,6 @@ Accept wildcard characters: False ``` ### CommonParameters - This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Remove-ZertoVpg.md b/docs/Remove-ZertoVpg.md index 9fba18b..ec2bac7 100644 --- a/docs/Remove-ZertoVpg.md +++ b/docs/Remove-ZertoVpg.md @@ -14,15 +14,13 @@ Deletes a Zerto Virtual Protection Group ## SYNTAX ### vpgIdentifier (Default) - -```PowerShell +``` Remove-ZertoVpg -vpgidentifier [-keepRecoveryVolumes] [-force] [-WhatIf] [-Confirm] [] ``` ### vpgName - -```PowerShell +``` Remove-ZertoVpg [-vpgName] [-keepRecoveryVolumes] [-force] [-WhatIf] [-Confirm] [] ``` @@ -164,7 +162,6 @@ Accept wildcard characters: False ``` ### CommonParameters - This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS From 185cb8a3604ce90f6115493dff2201c2ed12e405 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 14 Mar 2019 20:42:24 -0400 Subject: [PATCH 08/11] Create new function help files Export-ZertoVpg, Import-ZertoVpg, New-ZertoVpgSettingsIdentifier --- docs/Export-ZertoVpg.md | 96 ++++++++++++++++++++++++++ docs/Import-ZertoVpg.md | 60 ++++++++++++++++ docs/New-ZertoVpgSettingsIdentifier.md | 83 ++++++++++++++++++++++ 3 files changed, 239 insertions(+) create mode 100644 docs/Export-ZertoVpg.md create mode 100644 docs/Import-ZertoVpg.md create mode 100644 docs/New-ZertoVpgSettingsIdentifier.md diff --git a/docs/Export-ZertoVpg.md b/docs/Export-ZertoVpg.md new file mode 100644 index 0000000..55ead29 --- /dev/null +++ b/docs/Export-ZertoVpg.md @@ -0,0 +1,96 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: +schema: 2.0.0 +--- + +# Export-ZertoVpg + +## SYNOPSIS +{{ Fill in the Synopsis }} + +## SYNTAX + +### namedVpgs +``` +Export-ZertoVpg -outputFolder [-vpgName ] [] +``` + +### allVpgs +``` +Export-ZertoVpg -outputFolder [-allVpgs] [] +``` + +## DESCRIPTION +{{ Fill in the Description }} + +## EXAMPLES + +### Example 1 +```powershell +PS C:> {{ Add example code here }} +``` + +{{ Add example description here }} + +## PARAMETERS + +### -allVpgs +Export all VPGs at this site + +```yaml +Type: SwitchParameter +Parameter Sets: allVpgs +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName, ByValue) +Accept wildcard characters: False +``` + +### -outputFolder +Location where to dump the resulting JSON files containing the VPG Settings + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -vpgName +Name(s) of the VPG(s) to be exported + +```yaml +Type: String[] +Parameter Sets: namedVpgs +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### System.Management.Automation.SwitchParameter + +## OUTPUTS + +### System.Object +## NOTES + +## RELATED LINKS diff --git a/docs/Import-ZertoVpg.md b/docs/Import-ZertoVpg.md new file mode 100644 index 0000000..478181b --- /dev/null +++ b/docs/Import-ZertoVpg.md @@ -0,0 +1,60 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: +schema: 2.0.0 +--- + +# Import-ZertoVpg + +## SYNOPSIS +{{ Fill in the Synopsis }} + +## SYNTAX + +``` +Import-ZertoVpg [-settingsFile] [] +``` + +## DESCRIPTION +{{ Fill in the Description }} + +## EXAMPLES + +### Example 1 +```powershell +PS C:> {{ Add example code here }} +``` + +{{ Add example description here }} + +## PARAMETERS + +### -settingsFile +VPG settings JSON file(s) to import. + +```yaml +Type: String[] +Parameter Sets: (All) +Aliases: FullName + +Required: True +Position: 0 +Default value: None +Accept pipeline input: True (ByPropertyName, ByValue) +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### System.String[] + +## OUTPUTS + +### System.Object +## NOTES + +## RELATED LINKS diff --git a/docs/New-ZertoVpgSettingsIdentifier.md b/docs/New-ZertoVpgSettingsIdentifier.md new file mode 100644 index 0000000..0d42d33 --- /dev/null +++ b/docs/New-ZertoVpgSettingsIdentifier.md @@ -0,0 +1,83 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: +schema: 2.0.0 +--- + +# New-ZertoVpgSettingsIdentifier + +## SYNOPSIS +{{ Fill in the Synopsis }} + +## SYNTAX + +### existingVpg +``` +New-ZertoVpgSettingsIdentifier -vpgIdentifier [] +``` + +### newVpg +``` +New-ZertoVpgSettingsIdentifier [-newVpg] [] +``` + +## DESCRIPTION +{{ Fill in the Description }} + +## EXAMPLES + +### Example 1 +```powershell +PS C:> {{ Add example code here }} +``` + +{{ Add example description here }} + +## PARAMETERS + +### -newVpg +Use this switch when creating a vpgSettingsIdentifier for a new VPG + +```yaml +Type: SwitchParameter +Parameter Sets: newVpg +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -vpgIdentifier +Identifier of the VPG to create a VPG settings identifier. +If a vpgIdentifier is not provided, a new VPG settings object is created without any configured settings. +This would be used for creating a new VPG from scratch. + +```yaml +Type: String +Parameter Sets: existingVpg +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName, ByValue) +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### System.String + +## OUTPUTS + +### System.Object +## NOTES + +## RELATED LINKS From 48ec5188eb59e12c604844cfbdcb6602d62a1e7e Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Fri, 15 Mar 2019 12:24:33 -0400 Subject: [PATCH 09/11] Update Help for import \ export functions. --- .../Public/en-us/ZertoApiWrapper-help.xml | 372 +++++++++++++++++- docs/Export-ZertoVpg.md | 19 +- docs/Import-ZertoVpg.md | 12 +- docs/New-ZertoVpgSettingsIdentifier.md | 19 +- 4 files changed, 404 insertions(+), 18 deletions(-) diff --git a/ZertoApiWrapper/Public/en-us/ZertoApiWrapper-help.xml b/ZertoApiWrapper/Public/en-us/ZertoApiWrapper-help.xml index 1ae92cc..39806eb 100644 --- a/ZertoApiWrapper/Public/en-us/ZertoApiWrapper-help.xml +++ b/ZertoApiWrapper/Public/en-us/ZertoApiWrapper-help.xml @@ -754,6 +754,163 @@ + + + Export-ZertoVpg + Export + ZertoVpg + + Exports a VPG Settings Object to a JSON file. This file can be used to re-import the VPG at a later time. + + + + Exports a VPG Settings Object to a JSON file. This file can be used to re-import the VPG at a later time. + + + + Export-ZertoVpg + + allVpgs + + Export all VPGs at this site + + + SwitchParameter + + + False + + + outputFolder + + Location where to dump the resulting JSON files containing the VPG Settings + + String + + String + + + None + + + + Export-ZertoVpg + + outputFolder + + Location where to dump the resulting JSON files containing the VPG Settings + + String + + String + + + None + + + vpgName + + Name(s) of the VPG(s) to be exported + + String[] + + String[] + + + None + + + + + + allVpgs + + Export all VPGs at this site + + SwitchParameter + + SwitchParameter + + + False + + + outputFolder + + Location where to dump the resulting JSON files containing the VPG Settings + + String + + String + + + None + + + vpgName + + Name(s) of the VPG(s) to be exported + + String[] + + String[] + + + None + + + + + + System.Management.Automation.SwitchParameter + + + + + + + + + + System.Object + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + PS C:> Export-ZertoVpg -outputFolder "C:\ZertoVPGs" -vpgName "My Vpg", "My Other Vpg" + + Exports VPG settings for VPGs "My Vpg" and "My Other Vpg". Each settings object will be placed inside a JSON file at C:\ZertoVPGs\ with the name of the file being the name of the VPG. + + + + -------------------------- Example 2 -------------------------- + PS C:> Export-ZertoVpg -outputFolder "C:\ZertoVPGs" -allVpgs + + Exports VPG settings for all Vpgs replicated to or from this site. Each settings object will be placed inside a JSON file at C:\ZertoVPGs\ with the name of the file being the name of the VPG. If a VPG is in an un-editable state, it cannot be exported. + + + + + + Online Version: + https://github.com/wcarroll/ZertoApiWrapper/blob/Master/docs/Export-ZertoVpg.md + + + Zerto REST API VPG Settings End Point Documentation + http://s3.amazonaws.com/zertodownload_docs/Latest/Zerto%20Virtual%20Replication%20Zerto%20Virtual%20Manager%20%28ZVM%29%20-%20vSphere%20Online%20Help/RestfulAPIs/StatusAPIs.5.108.html# + + + Get-ZertoAlert @@ -6414,6 +6571,94 @@ + + + Import-ZertoVpg + Import + ZertoVpg + + Reads in one or more JSON files and imports each one into a VPG. + + + + Reads in one or several JSON files and imports each one into a VPG. Currently this method does not support using pre-seed volumes. We are working through a method to get this working, but it may be a while until this happens. + + + + Import-ZertoVpg + + settingsFile + + VPG settings JSON file(s) to import. + + String[] + + String[] + + + None + + + + + + settingsFile + + VPG settings JSON file(s) to import. + + String[] + + String[] + + + None + + + + + + System.String[] + + + + + + + + + + System.Object + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + PS C:> Import-ZertoVpg -settingsFile "C:\ZertoVpgs\My Vpg.json" + + Reads in "My Vpg.json", creates a new VPG object, applies all the settings and saves the VPG. + + + + + + Online Version: + https://github.com/wcarroll/ZertoApiWrapper/blob/Master/docs/Import-ZertoVpg.md + + + Zerto REST API VPG Settings End Point Documentation + http://s3.amazonaws.com/zertodownload_docs/Latest/Zerto%20Virtual%20Replication%20Zerto%20Virtual%20Manager%20%28ZVM%29%20-%20vSphere%20Online%20Help/RestfulAPIs/StatusAPIs.5.108.html# + + + Install-ZertoVra @@ -7223,11 +7468,11 @@ Invoke ZertoFailoverRollback - Rollsback a VPG in a Before Commit Failover State + Rolls back a VPG in a Before Commit Failover State - Rollsback a VPG in a Before Commit Failover State + Rolls back a VPG in a Before Commit Failover State @@ -7290,7 +7535,7 @@ -------------------------- Example 1 -------------------------- PS C:\> Invoke-ZertoFailoverRollback -vpgName "MyVpg" - Rollsback VPG "MyVPG" from a Before Commit State + Rolls back VPG "MyVPG" from a Before Commit State @@ -9649,6 +9894,127 @@ + + + New-ZertoVpgSettingsIdentifier + New + ZertoVpgSettingsIdentifier + + Creates and returns a VPG Settings Identifier either for an existing VPG or a new VPG. + + + + Creates and returns a VPG Settings Identifier either for an existing VPG or a new VPG. + + + + New-ZertoVpgSettingsIdentifier + + newVpg + + Use this switch when creating a vpgSettingsIdentifier for a new VPG + + + SwitchParameter + + + False + + + + New-ZertoVpgSettingsIdentifier + + vpgIdentifier + + Identifier of the VPG to create a VPG settings identifier. If a vpgIdentifier is not provided, a new VPG settings object is created without any configured settings. This would be used for creating a new VPG from scratch. + + String + + String + + + None + + + + + + newVpg + + Use this switch when creating a vpgSettingsIdentifier for a new VPG + + SwitchParameter + + SwitchParameter + + + False + + + vpgIdentifier + + Identifier of the VPG to create a VPG settings identifier. If a vpgIdentifier is not provided, a new VPG settings object is created without any configured settings. This would be used for creating a new VPG from scratch. + + String + + String + + + None + + + + + + System.String + + + + + + + + + + System.Object + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + PS C:> New-ZertoVpgSettingsIdentifier -newVpg + + Creates a Vpg Settings Identifier for a new, blank VPG. + + + + -------------------------- Example 2 -------------------------- + PS C:> New-ZertoVpgSettingsIdentifier -vpgIdentifier "MyVpgIdentifier" + + Creates a Vpg Settings Identifier for an existing VPG. This settings identifier points to a settings object that contains the current settings of the VPG. + + + + + + Online Version: + https://github.com/wcarroll/ZertoApiWrapper/blob/Master/docs/New-ZertoVpgSettingsIdentifier.md + + + Zerto REST API VPG Settings End Point Documentation + http://s3.amazonaws.com/zertodownload_docs/Latest/Zerto%20Virtual%20Replication%20Zerto%20Virtual%20Manager%20%28ZVM%29%20-%20vSphere%20Online%20Help/RestfulAPIs/StatusAPIs.5.108.html# + + + Remove-ZertoVpg diff --git a/docs/Export-ZertoVpg.md b/docs/Export-ZertoVpg.md index 55ead29..9bd5be3 100644 --- a/docs/Export-ZertoVpg.md +++ b/docs/Export-ZertoVpg.md @@ -1,14 +1,14 @@ --- external help file: ZertoApiWrapper-help.xml Module Name: ZertoApiWrapper -online version: +online version: https://github.com/wcarroll/ZertoApiWrapper/blob/Master/docs/Export-ZertoVpg.md schema: 2.0.0 --- # Export-ZertoVpg ## SYNOPSIS -{{ Fill in the Synopsis }} +Exports a VPG Settings Object to a JSON file. This file can be used to re-import the VPG at a later time. ## SYNTAX @@ -23,16 +23,23 @@ Export-ZertoVpg -outputFolder [-allVpgs] [] ``` ## DESCRIPTION -{{ Fill in the Description }} +Exports a VPG Settings Object to a JSON file. This file can be used to re-import the VPG at a later time. ## EXAMPLES ### Example 1 ```powershell -PS C:> {{ Add example code here }} +PS C:> Export-ZertoVpg -outputFolder "C:\ZertoVPGs" -vpgName "My Vpg", "My Other Vpg" ``` -{{ Add example description here }} +Exports VPG settings for VPGs "My Vpg" and "My Other Vpg". Each settings object will be placed inside a JSON file at C:\ZertoVPGs\ with the name of the file being the name of the VPG. + +### Example 2 +```powershell +PS C:> Export-ZertoVpg -outputFolder "C:\ZertoVPGs" -allVpgs +``` + +Exports VPG settings for all Vpgs replicated to or from this site. Each settings object will be placed inside a JSON file at C:\ZertoVPGs\ with the name of the file being the name of the VPG. If a VPG is in an un-editable state, it cannot be exported. ## PARAMETERS @@ -94,3 +101,5 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## NOTES ## RELATED LINKS + +[Zerto REST API VPG Settings End Point Documentation](http://s3.amazonaws.com/zertodownload_docs/Latest/Zerto%20Virtual%20Replication%20Zerto%20Virtual%20Manager%20%28ZVM%29%20-%20vSphere%20Online%20Help/RestfulAPIs/StatusAPIs.5.108.html#) diff --git a/docs/Import-ZertoVpg.md b/docs/Import-ZertoVpg.md index 478181b..2649e3d 100644 --- a/docs/Import-ZertoVpg.md +++ b/docs/Import-ZertoVpg.md @@ -1,14 +1,14 @@ --- external help file: ZertoApiWrapper-help.xml Module Name: ZertoApiWrapper -online version: +online version: https://github.com/wcarroll/ZertoApiWrapper/blob/Master/docs/Import-ZertoVpg.md schema: 2.0.0 --- # Import-ZertoVpg ## SYNOPSIS -{{ Fill in the Synopsis }} +Reads in one or more JSON files and imports each one into a VPG. ## SYNTAX @@ -17,16 +17,16 @@ Import-ZertoVpg [-settingsFile] [] ``` ## DESCRIPTION -{{ Fill in the Description }} +Reads in one or several JSON files and imports each one into a VPG. Currently this method does not support using pre-seed volumes. We are working through a method to get this working, but it may be a while until this happens. ## EXAMPLES ### Example 1 ```powershell -PS C:> {{ Add example code here }} +PS C:> Import-ZertoVpg -settingsFile "C:\ZertoVpgs\My Vpg.json" ``` -{{ Add example description here }} +Reads in "My Vpg.json", creates a new VPG object, applies all the settings and saves the VPG. ## PARAMETERS @@ -58,3 +58,5 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## NOTES ## RELATED LINKS + +[Zerto REST API VPG Settings End Point Documentation](http://s3.amazonaws.com/zertodownload_docs/Latest/Zerto%20Virtual%20Replication%20Zerto%20Virtual%20Manager%20%28ZVM%29%20-%20vSphere%20Online%20Help/RestfulAPIs/StatusAPIs.5.108.html#) diff --git a/docs/New-ZertoVpgSettingsIdentifier.md b/docs/New-ZertoVpgSettingsIdentifier.md index 0d42d33..abae8dd 100644 --- a/docs/New-ZertoVpgSettingsIdentifier.md +++ b/docs/New-ZertoVpgSettingsIdentifier.md @@ -1,14 +1,14 @@ --- external help file: ZertoApiWrapper-help.xml Module Name: ZertoApiWrapper -online version: +online version: https://github.com/wcarroll/ZertoApiWrapper/blob/Master/docs/New-ZertoVpgSettingsIdentifier.md schema: 2.0.0 --- # New-ZertoVpgSettingsIdentifier ## SYNOPSIS -{{ Fill in the Synopsis }} +Creates and returns a VPG Settings Identifier either for an existing VPG or a new VPG. ## SYNTAX @@ -23,16 +23,23 @@ New-ZertoVpgSettingsIdentifier [-newVpg] [] ``` ## DESCRIPTION -{{ Fill in the Description }} +Creates and returns a VPG Settings Identifier either for an existing VPG or a new VPG. ## EXAMPLES ### Example 1 ```powershell -PS C:> {{ Add example code here }} +PS C:> New-ZertoVpgSettingsIdentifier -newVpg ``` -{{ Add example description here }} +Creates a Vpg Settings Identifier for a new, blank VPG. + +### Example 2 +```powershell +PS C:> New-ZertoVpgSettingsIdentifier -vpgIdentifier "MyVpgIdentifier" +``` + +Creates a Vpg Settings Identifier for an existing VPG. This settings identifier points to a settings object that contains the current settings of the VPG. ## PARAMETERS @@ -81,3 +88,5 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## NOTES ## RELATED LINKS + +[Zerto REST API VPG Settings End Point Documentation](http://s3.amazonaws.com/zertodownload_docs/Latest/Zerto%20Virtual%20Replication%20Zerto%20Virtual%20Manager%20%28ZVM%29%20-%20vSphere%20Online%20Help/RestfulAPIs/StatusAPIs.5.108.html#) From b9fe2ccbf41cb0912d0b69129573efc7643ea51c Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Fri, 15 Mar 2019 12:29:03 -0400 Subject: [PATCH 10/11] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index ded53b9..f815e73 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,7 @@ If you are using this as part of a larger script, I highly suggest explicitly en ## Recent Updates +- March 15th, 2019: Implement Export and Import Functionality. Please See [Export-ZertoVpg Help](https://github.com/wcarroll/ZertoApiWrapper/blob/Master/docs/Export-ZertoVpg.md) and [Import-ZertoVpg Help](https://github.com/wcarroll/ZertoApiWrapper/blob/ExportImportFunctionality/docs/Import-ZertoVpg.md) for assistance. No current pre-seed support. - March 11th, 2019: Create basic VPG completed. Please see [New-ZertoVpg Help](https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/New-ZertoVpg.md) ## TODO From bf50d4c0c14abf66482a3a6b259b85befda3a0b5 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Fri, 15 Mar 2019 12:32:25 -0400 Subject: [PATCH 11/11] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f815e73..6508ec2 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ If you are using this as part of a larger script, I highly suggest explicitly en ## Recent Updates -- March 15th, 2019: Implement Export and Import Functionality. Please See [Export-ZertoVpg Help](https://github.com/wcarroll/ZertoApiWrapper/blob/Master/docs/Export-ZertoVpg.md) and [Import-ZertoVpg Help](https://github.com/wcarroll/ZertoApiWrapper/blob/ExportImportFunctionality/docs/Import-ZertoVpg.md) for assistance. No current pre-seed support. +- March 15th, 2019: Implement Export and Import Functionality. Please See [Export-ZertoVpg Help](https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Export-ZertoVpg.md) and [Import-ZertoVpg Help](https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Import-ZertoVpg.md) for assistance. No current pre-seed support. - March 11th, 2019: Create basic VPG completed. Please see [New-ZertoVpg Help](https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/New-ZertoVpg.md) ## TODO