From 2ed0169a0087df646ee6db580e6684654f9f68bb Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 10 Jun 2019 09:40:00 -0400 Subject: [PATCH] Create function and associated docs. Get-ZANetworkVpgSummary --- .../Public/Get-ZANetworkVpgSummary.Tests.ps1 | 19 ++++ .../Public/Get-ZANetworkVpgSummary.ps1 | 23 +++++ docs/Get-ZANetworkVpgSummary.md | 94 +++++++++++++++++++ 3 files changed, 136 insertions(+) create mode 100644 Tests/Public/Get-ZANetworkVpgSummary.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZANetworkVpgSummary.ps1 create mode 100644 docs/Get-ZANetworkVpgSummary.md diff --git a/Tests/Public/Get-ZANetworkVpgSummary.Tests.ps1 b/Tests/Public/Get-ZANetworkVpgSummary.Tests.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZANetworkVpgSummary.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-ZANetworkVpgSummary.ps1 b/ZertoApiWrapper/Public/Get-ZANetworkVpgSummary.ps1 new file mode 100644 index 0000000..5aeaed0 --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZANetworkVpgSummary.ps1 @@ -0,0 +1,23 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZANetworkVpgSummary { + [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-summary{0}" -f $filter + Invoke-ZARestRequest -uri $uri +} diff --git a/docs/Get-ZANetworkVpgSummary.md b/docs/Get-ZANetworkVpgSummary.md new file mode 100644 index 0000000..429c5d5 --- /dev/null +++ b/docs/Get-ZANetworkVpgSummary.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-ZANetworkVpgSummary.md +schema: 2.0.0 +--- + +# Get-ZANetworkVpgSummary + +## SYNOPSIS + +Get a network executive summary for a given VPG, filtered by start date and end date. + +## SYNTAX + +``` +Get-ZANetworkVpgSummary [-vpgIdentifier] [[-startDate] ] [[-endDate] ] + [] +``` + +## DESCRIPTION + +Get a network executive summary for a given VPG, filtered by start date and end date. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZANetworkVpgSummary -vpgIdentifier "3456-7890-1234" +``` + +Get Network VPG Summary 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)