Fix Body Creation Method
This commit is contained in:
@@ -62,32 +62,20 @@ function Start-ZertoCloneVpg {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
$body['VmIdentifiers'] = $vmIdentifiers
|
$body['VmIdentifiers'] = $vmIdentifiers
|
||||||
if ($checkpointIdentifier) {
|
|
||||||
$body['CheckpointIdentifier'] = $checkpointIdentifier
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
process {
|
|
||||||
$uri = "{0}/{1}/CloneStart" -f $baseUri, $vpgIdentifier
|
|
||||||
$body = [ordered]@{ }
|
|
||||||
if ( $PSBoundParameters.ContainsKey('checkpointIdentifier') ) {
|
if ( $PSBoundParameters.ContainsKey('checkpointIdentifier') ) {
|
||||||
$body['checkpointId'] = $checkpointIdentifier
|
$body['checkpointId'] = $checkpointIdentifier
|
||||||
}
|
}
|
||||||
if ( $datastoreIdentifier ) {
|
|
||||||
$body['DatastoreIdentifier'] = $datastoreIdentifier
|
|
||||||
}
|
|
||||||
if ( $vmIdentifiers ) {
|
|
||||||
$body['VmIdentifiers'] = $vmIdentifiers
|
|
||||||
}
|
|
||||||
Write-Verbose $body
|
Write-Verbose $body
|
||||||
|
$uri = "{0}/{1}/CloneStart" -f $baseUri, $vpgIdentifier
|
||||||
if ($PSCmdlet.ShouldProcess("Clone Vpg")) {
|
if ($PSCmdlet.ShouldProcess("Clone Vpg")) {
|
||||||
Invoke-ZertoRestRequest -uri $uri -body $($body | ConvertTo-Json) -method "POST"
|
Invoke-ZertoRestRequest -uri $uri -body $($body | ConvertTo-Json) -method "POST"
|
||||||
|
Write-Verbose "Call Submitted to $uri"
|
||||||
|
Write-Verbose "With the following information: $($body | ConvertTo-Json)"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
end {
|
end {
|
||||||
Write-Verbose "Call Submitted to $uri"
|
|
||||||
Write-Verbose "With the following information: $($body | ConvertTo-Json)"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user