diff --git a/Tests/Public/Get-ZANetworkVpgStat.Tests.ps1 b/Tests/Public/Get-ZANetworkVpgStat.Tests.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZANetworkVpgStat.Tests.ps1 @@ -0,0 +1,19 @@ +#Requires -Modules Pester +$moduleFileName = "ZertoApiWrapper.psd1" +$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") +$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") +$file = Get-ChildItem "$here\$sut" +$modulePath = $here -replace "Public", "" +$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" +Get-Module -Name ZertoApiWrapper | Remove-Module -Force +Import-Module $moduleFile -Force + +Describe $file.BaseName -Tag 'Unit' { + + It "is valid Powershell (Has no script errors)" { + $contents = Get-Content -Path $file -ErrorAction Stop + $errors = $null + $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) + $errors | Should -HaveCount 0 + } +} diff --git a/ZertoApiWrapper/Public/Get-ZANetworkVpgStat.ps1 b/ZertoApiWrapper/Public/Get-ZANetworkVpgStat.ps1 new file mode 100644 index 0000000..55a6089 --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZANetworkVpgStat.ps1 @@ -0,0 +1,23 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZANetworkVpgStat { + [CmdletBinding()] + param ( + [Parameter( + HelpMessage = "The VPG identifier.", + Mandatory + )] + [string]$vpgIdentifier, + [Parameter( + HelpMessage = "Start date in RFC 3339 standard ('1970-01-01T00:00:00Z'). If the start date is omitted, the default start date is 7 days before the end date." + )] + [string]$startDate, + [Parameter( + HelpMessage = "End date in RFC 3339 standard ('1970-01-01T00:00:00Z'). If the end date is omitted, the default end date is the current time." + )] + [string]$endDate + ) + + $filter = Get-ZertoAPIFilter -filtertable $PSBoundParameters + $uri = "reports/vpg-network-stats{0}" -f $filter + Invoke-ZARestRequest -uri $uri +} diff --git a/docs/Get-ZANetworkVpgStat.md b/docs/Get-ZANetworkVpgStat.md new file mode 100644 index 0000000..4a66c98 --- /dev/null +++ b/docs/Get-ZANetworkVpgStat.md @@ -0,0 +1,94 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZANetworkVpgStat.md +schema: 2.0.0 +--- + +# Get-ZANetworkVpgStat + +## SYNOPSIS + +Get Max, Avg. and Min network statistics for Throughput, Wan and IOPS traffic for a given VPG, filtered by start date and end date. + +## SYNTAX + +``` +Get-ZANetworkVpgStat [-vpgIdentifier] [[-startDate] ] [[-endDate] ] + [] +``` + +## DESCRIPTION + +Get Max, Avg. and Min network statistics for Throughput, Wan and IOPS traffic for a given VPG, filtered by start date and end date. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZANetworkVpgStat -vpgIdentifier "3456-7890-1234" +``` + +Get Network VPG Stats for VPG with Identifier "3456-7890-1234" for the last 7 days. + +## PARAMETERS + +### -endDate +End date in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If the end date is omitted, the default end date is the current time. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 3 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -startDate +Start date in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If the start date is omitted, the default start date is 7 days before the end date. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -vpgIdentifier +The VPG identifier. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +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 + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Analytics REST API Endpoint for Network VPG Summary](https://docs.api.zerto.com/#/Network_Reports/get_v2_reports_vpg_network_summary)