Merge pull request #80 from ZertoPublic:Get-ZertoEvent-Fix
Get zerto event fix
This commit is contained in:
@@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project is transitioning to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
### Zerto Virtual Manager
|
||||
|
||||
#### Fixed
|
||||
|
||||
* Updated `Get-ZertoEvent` to translate a vpg name parameter to a vpgIdentifier per the API documentation
|
||||
|
||||
## [1.4.1]
|
||||
|
||||
### General
|
||||
|
||||
@@ -12,7 +12,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' {
|
||||
$ParameterTestCases = @(
|
||||
@{ParameterName = 'startDate'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' }
|
||||
@{ParameterName = 'endDate'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' }
|
||||
@{ParameterName = 'vpgName'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' }
|
||||
@{ParameterName = 'vpg'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' }
|
||||
@{ParameterName = 'vpgIdentifier'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' }
|
||||
@{ParameterName = 'eventType'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' }
|
||||
@{ParameterName = 'siteName'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' }
|
||||
|
||||
@@ -19,8 +19,8 @@ function Get-ZertoEvent {
|
||||
HelpMessage = "The name of the VPG for which you want to return events."
|
||||
)]
|
||||
[ValidateNotNullOrEmpty()]
|
||||
[Alias("vpg")]
|
||||
[string]$vpgName,
|
||||
[Alias("vpgName")]
|
||||
[string]$vpg,
|
||||
[Parameter(
|
||||
ParameterSetName = "filter",
|
||||
HelpMessage = "The identifier of the VPG for which you want to return events."
|
||||
@@ -137,6 +137,10 @@ function Get-ZertoEvent {
|
||||
# If a filter is applied, create the filter and return the events that fall in that filter
|
||||
"filter" {
|
||||
$filter = Get-ZertoApiFilter -filterTable $PSBoundParameters
|
||||
if ($PSBoundParameters.Keys -contains 'vpg') {
|
||||
$vpgIdentifier = (Get-ZertoVpg -name $vpg).vpgIdentifier
|
||||
$filter = $filter.replace("vpg=$vpg", "vpg=$vpgIdentifier")
|
||||
}
|
||||
$uri = "{0}{1}" -f $baseUri, $filter
|
||||
$returnObject = Invoke-ZertoRestRequest -uri $uri
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user