Merge pull request #65 from ZertoPublic/checkpoint-refactor
Checkpoint refactor
This commit is contained in:
+2
-1
@@ -3,5 +3,6 @@
|
|||||||
### Zerto Virtual Manager
|
### Zerto Virtual Manager
|
||||||
|
|
||||||
* Addressed a reported [issue](https://github.com/ZertoPublic/ZertoApiWrapper/issues/60) in the `Get-ZertoRecoveryReport` function where the `-VpgIdentifier` parameter was not working. This parameter is not accepted by the API as a valid filter and is ignored. This parameter has been removed from the function.
|
* Addressed a reported [issue](https://github.com/ZertoPublic/ZertoApiWrapper/issues/60) in the `Get-ZertoRecoveryReport` function where the `-VpgIdentifier` parameter was not working. This parameter is not accepted by the API as a valid filter and is ignored. This parameter has been removed from the function.
|
||||||
* Addressed a reported [issue](https://github.com/ZertoPublic/ZertoApiWrapper/issues/60) where the `Export-ZertoVpgNicSetting` function would not properly execute when run against a VM with no NICs attached.
|
* Addressed a reported [issue](https://github.com/ZertoPublic/ZertoApiWrapper/issues/61) where the `Export-ZertoVpgNicSetting` function would not properly execute when run against a VM with no NICs attached.
|
||||||
* In reviewing the `Export-ZertoVpgNicSetting`, a review of the `Import-ZertoVpgNicSetting` was completed and it was determined to update the import logic based on various test cases. Along with this, it is now possible to reset the NIC settings to the default state with the `Import-ZertoVpgNicSetting` command. Please review the [Import-ZertoVpgNicSetting help](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Import-ZertoVmNicSetting.md) to review the updated options and import logic.
|
* In reviewing the `Export-ZertoVpgNicSetting`, a review of the `Import-ZertoVpgNicSetting` was completed and it was determined to update the import logic based on various test cases. Along with this, it is now possible to reset the NIC settings to the default state with the `Import-ZertoVpgNicSetting` command. Please review the [Import-ZertoVpgNicSetting help](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Import-ZertoVmNicSetting.md) to review the updated options and import logic.
|
||||||
|
* Refactored the `Checkpoint-ZertoVpg` command to allow pipeline input (ByValue and ByProperty) for the VpgName parameter.
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' {
|
|||||||
|
|
||||||
Context "$($global:function)::Parameter Unit Tests" {
|
Context "$($global:function)::Parameter Unit Tests" {
|
||||||
It "Has a parameter for the VpgName that is Mandatory" {
|
It "Has a parameter for the VpgName that is Mandatory" {
|
||||||
Get-Command $global:function | Should -HaveParameter vpgName -Mandatory -Type String
|
Get-Command $global:function | Should -HaveParameter vpgName -Mandatory -Type 'String[]'
|
||||||
}
|
}
|
||||||
|
|
||||||
It "Has a parameter for the CheckpointName that is Mandatory" {
|
It "Has a parameter for the CheckpointName that is Mandatory" {
|
||||||
|
|||||||
@@ -4,10 +4,12 @@ function Checkpoint-ZertoVpg {
|
|||||||
param(
|
param(
|
||||||
[Parameter(
|
[Parameter(
|
||||||
Mandatory = $true,
|
Mandatory = $true,
|
||||||
HelpMessage = "Name of the VPG to tag."
|
HelpMessage = "Name of the VPG to tag.",
|
||||||
|
ValueFromPipeline = $true,
|
||||||
|
ValueFromPipelineByPropertyName = $true
|
||||||
)]
|
)]
|
||||||
[ValidateNotNullOrEmpty()]
|
[ValidateNotNullOrEmpty()]
|
||||||
[string]$vpgName,
|
[string[]]$vpgName,
|
||||||
[Parameter(
|
[Parameter(
|
||||||
Mandatory = $true,
|
Mandatory = $true,
|
||||||
HelpMessage = "Text to tag the checkpoint with."
|
HelpMessage = "Text to tag the checkpoint with."
|
||||||
@@ -18,16 +20,18 @@ function Checkpoint-ZertoVpg {
|
|||||||
|
|
||||||
begin {
|
begin {
|
||||||
$baseUri = "vpgs"
|
$baseUri = "vpgs"
|
||||||
$vpgIdentifier = $(get-zertovpg -name $vpgName).vpgIdentifier
|
|
||||||
$body = @{"checkpointName" = $checkpointName}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
process {
|
process {
|
||||||
|
foreach ($name in $vpgName) {
|
||||||
|
$vpgIdentifier = $(get-zertovpg -name $name).vpgIdentifier
|
||||||
if ($vpgIdentifier) {
|
if ($vpgIdentifier) {
|
||||||
$uri = "{0}/{1}/Checkpoints" -f $baseUri, $vpgIdentifier
|
$uri = "{0}/{1}/Checkpoints" -f $baseUri, $vpgIdentifier
|
||||||
|
$body = @{"checkpointName" = $checkpointName}
|
||||||
Invoke-ZertoRestRequest -uri $uri -body $($body | ConvertTo-Json) -method "POST"
|
Invoke-ZertoRestRequest -uri $uri -body $($body | ConvertTo-Json) -method "POST"
|
||||||
} else {
|
} else {
|
||||||
Write-Output "Cannot find VPG named $vpgName. Please check the name and try again."
|
Write-Output "Cannot find VPG named $name. Please check the name and try again."
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ Add a tagged checkpoint to a specified VPG
|
|||||||
## SYNTAX
|
## SYNTAX
|
||||||
|
|
||||||
```
|
```
|
||||||
Checkpoint-ZertoVpg [-vpgName] <String> [-checkpointName] <String> [<CommonParameters>]
|
Checkpoint-ZertoVpg [-vpgName] <String[]> [-checkpointName] <String> [<CommonParameters>]
|
||||||
```
|
```
|
||||||
|
|
||||||
## DESCRIPTION
|
## DESCRIPTION
|
||||||
@@ -49,14 +49,14 @@ Accept wildcard characters: False
|
|||||||
Name of the VPG to tag.
|
Name of the VPG to tag.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
Type: String
|
Type: String[]
|
||||||
Parameter Sets: (All)
|
Parameter Sets: (All)
|
||||||
Aliases:
|
Aliases:
|
||||||
|
|
||||||
Required: True
|
Required: True
|
||||||
Position: 0
|
Position: 0
|
||||||
Default value: None
|
Default value: None
|
||||||
Accept pipeline input: False
|
Accept pipeline input: True (ByPropertyName, ByValue)
|
||||||
Accept wildcard characters: False
|
Accept wildcard characters: False
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ Get-ZertoRecoveryReport [<CommonParameters>]
|
|||||||
### filter
|
### filter
|
||||||
```
|
```
|
||||||
Get-ZertoRecoveryReport [-startTime <String>] [-endTime <String>] [-pageNumber <String>] [-pageSize <String>]
|
Get-ZertoRecoveryReport [-startTime <String>] [-endTime <String>] [-pageNumber <String>] [-pageSize <String>]
|
||||||
[-vpgIdentifier <String>] [-vpgName <String>] [-recoveryType <String>] [-state <String>] [<CommonParameters>]
|
[-vpgName <String>] [-recoveryType <String>] [-state <String>] [<CommonParameters>]
|
||||||
```
|
```
|
||||||
|
|
||||||
## DESCRIPTION
|
## DESCRIPTION
|
||||||
|
|||||||
@@ -26,7 +26,6 @@ Each entry in the CSV will be for one VM and a single NIC attached to that VM. E
|
|||||||
|
|
||||||
This logic is applied to both the Live and Test settings individually. It is recommended to use the `Export-ZertoVpgNicSetting` to dump all current settings and then modify a copy of the exported file with only the settings you wish to update. Import the copied file and if you need to revert, Import the original.
|
This logic is applied to both the Live and Test settings individually. It is recommended to use the `Export-ZertoVpgNicSetting` to dump all current settings and then modify a copy of the exported file with only the settings you wish to update. Import the copied file and if you need to revert, Import the original.
|
||||||
|
|
||||||
|
|
||||||
## EXAMPLES
|
## EXAMPLES
|
||||||
|
|
||||||
### Example 1
|
### Example 1
|
||||||
|
|||||||
Reference in New Issue
Block a user