Create function and associated docs.

Get-ZANetworkVpgSummary
This commit is contained in:
Wes Carroll
2019-06-10 09:40:00 -04:00
parent b0763e965e
commit 2ed0169a00
3 changed files with 136 additions and 0 deletions
@@ -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
}
}
@@ -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
}
+94
View File
@@ -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] <String> [[-startDate] <String>] [[-endDate] <String>]
[<CommonParameters>]
```
## 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)