From ca5d357d2f1238066d4d4f0a8068c15aae820fc6 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 3 Jun 2019 07:11:15 -0400 Subject: [PATCH 001/108] Create Invoke-ZARestRequest.ps1 --- .../Private/Invoke-ZARestRequest.ps1 | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 ZertoApiWrapper/Private/Invoke-ZARestRequest.ps1 diff --git a/ZertoApiWrapper/Private/Invoke-ZARestRequest.ps1 b/ZertoApiWrapper/Private/Invoke-ZARestRequest.ps1 new file mode 100644 index 0000000..599bad8 --- /dev/null +++ b/ZertoApiWrapper/Private/Invoke-ZARestRequest.ps1 @@ -0,0 +1,20 @@ +function Invoke-ZARestRequest { + [cmdletbinding()] + param( + [string]$uri, + [string]$method = "GET", + [string]$body, + [string]$contentType = "application/json" + ) + + $submittedUri = "https://analytics.api.zerto.com/v2/{0}" -f $uri + if ($PSVersionTable.PSVersion.Major -ge 6) { + Invoke-RestMethod -Uri $submittedUri -Method $method -Body $body -Headers $Script:zaHeaders -ContentType $contentType -TimeoutSec 100 + } else { + if ([String]::IsNullOrEmpty($body)) { + Invoke-RestMethod -Uri $submittedUri -Method $method -Headers $Script:zaHeaders -ContentType $contentType -TimeoutSec 100 + } else { + Invoke-RestMethod -Uri $submittedUri -Method $method -Headers $Script:zaHeaders -ContentType $contentType -TimeoutSec 100 -Body $body + } + } +} \ No newline at end of file From a1a4a7882060ac41fe5c262d9ae1ada3c576e18b Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 3 Jun 2019 07:11:20 -0400 Subject: [PATCH 002/108] Create Connect-ZertoAnalytics.ps1 --- .../Public/Connect-ZertoAnalytics.ps1 | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 ZertoApiWrapper/Public/Connect-ZertoAnalytics.ps1 diff --git a/ZertoApiWrapper/Public/Connect-ZertoAnalytics.ps1 b/ZertoApiWrapper/Public/Connect-ZertoAnalytics.ps1 new file mode 100644 index 0000000..698d957 --- /dev/null +++ b/ZertoApiWrapper/Public/Connect-ZertoAnalytics.ps1 @@ -0,0 +1,19 @@ +function Connect-ZertoAnalytics { + [cmdletbinding()] + param( + [Parameter( + Mandatory = $true, + HelpMessage = "PSCredential Object containing username and password authorized for the Zerto Analytics site", + Position = 0 + )] + [System.Management.Automation.PSCredential]$credential + ) + + $uri = "auth/token" + Set-Variable -Name zaHeaders -Scope Script -Value @{"Accept" = "application/json" } + Set-Variable -Name zaLastActionTime -Scope Script -Value $(Get-date).Ticks + $body = @{"username" = $credential.UserName; "password" = $credential.GetNetworkCredential().password } + $result = Invoke-ZARestRequest -Uri $uri -body $($body | ConvertTo-Json) -Method POST + $Script:zaHeaders["Authorization"] = "Bearer $($result.Token)" + $Script:zaHeaders +} \ No newline at end of file From b22481e3b0f1ee285e2e6772778e7ab844cc05ef Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 3 Jun 2019 07:11:33 -0400 Subject: [PATCH 003/108] Create Get-ZALicense.ps1 --- ZertoApiWrapper/Public/Get-ZALicense.ps1 | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 ZertoApiWrapper/Public/Get-ZALicense.ps1 diff --git a/ZertoApiWrapper/Public/Get-ZALicense.ps1 b/ZertoApiWrapper/Public/Get-ZALicense.ps1 new file mode 100644 index 0000000..02c8fd1 --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZALicense.ps1 @@ -0,0 +1,4 @@ +function Get-ZALicense { + $uri = "licenses" + Invoke-ZARestRequest -uri $uri +} \ No newline at end of file From 14424c6b51db5de1af77004036d2c51e8af98f30 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 5 Jun 2019 14:07:37 -0400 Subject: [PATCH 004/108] Add External Help File --- ZertoApiWrapper/Public/Connect-ZertoAnalytics.ps1 | 1 + 1 file changed, 1 insertion(+) diff --git a/ZertoApiWrapper/Public/Connect-ZertoAnalytics.ps1 b/ZertoApiWrapper/Public/Connect-ZertoAnalytics.ps1 index 698d957..2c8e95f 100644 --- a/ZertoApiWrapper/Public/Connect-ZertoAnalytics.ps1 +++ b/ZertoApiWrapper/Public/Connect-ZertoAnalytics.ps1 @@ -1,3 +1,4 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> function Connect-ZertoAnalytics { [cmdletbinding()] param( From 1ef5d63cf7adeff2086d5ec29aeb86dd13573bcf Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 5 Jun 2019 14:07:58 -0400 Subject: [PATCH 005/108] Create Invoke-ZARestRequest.Tests.ps1 --- Tests/Private/Invoke-ZARestRequest.Tests.ps1 | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 Tests/Private/Invoke-ZARestRequest.Tests.ps1 diff --git a/Tests/Private/Invoke-ZARestRequest.Tests.ps1 b/Tests/Private/Invoke-ZARestRequest.Tests.ps1 new file mode 100644 index 0000000..984d682 --- /dev/null +++ b/Tests/Private/Invoke-ZARestRequest.Tests.ps1 @@ -0,0 +1,17 @@ +$filePath = (Split-Path -Parent $MyInvocation.MyCommand.Path) -replace 'Tests', 'ZertoApiWrapper' +$fileName = (Split-Path -Leaf $MyInvocation.MyCommand.Path ) -replace '.Tests.', '.' +$file = Get-ChildItem "$filePath\$fileName" +. $file.FullName + +Describe $file.BaseName -Tag Unit { + it "file should exist" { + $file.FullName | should exist + } + + It "is valid Powershell (Has no script errors)" { + $contents = Get-Content -Path $file.FullName -ErrorAction Stop + $errors = $null + $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) + $errors | Should -HaveCount 0 + } +} \ No newline at end of file From 947fbe64681fb0b283931fb990b94474ae4a0dda Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 5 Jun 2019 14:08:06 -0400 Subject: [PATCH 006/108] Create Connect-ZertoAnalytics.Tests.ps1 --- Tests/Public/Connect-ZertoAnalytics.Tests.ps1 | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 Tests/Public/Connect-ZertoAnalytics.Tests.ps1 diff --git a/Tests/Public/Connect-ZertoAnalytics.Tests.ps1 b/Tests/Public/Connect-ZertoAnalytics.Tests.ps1 new file mode 100644 index 0000000..50d2f9d --- /dev/null +++ b/Tests/Public/Connect-ZertoAnalytics.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 + } +} \ No newline at end of file From ce5a37ceb62a5da601fbaef570943e11d0660089 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 5 Jun 2019 14:08:45 -0400 Subject: [PATCH 007/108] Make into an advanced function. --- ZertoApiWrapper/Public/Get-ZALicense.ps1 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ZertoApiWrapper/Public/Get-ZALicense.ps1 b/ZertoApiWrapper/Public/Get-ZALicense.ps1 index 02c8fd1..bd1bd94 100644 --- a/ZertoApiWrapper/Public/Get-ZALicense.ps1 +++ b/ZertoApiWrapper/Public/Get-ZALicense.ps1 @@ -1,4 +1,7 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> function Get-ZALicense { + [cmdletbinding()] + param() $uri = "licenses" Invoke-ZARestRequest -uri $uri } \ No newline at end of file From 04b8b9837b442772d46b9c5852bd3cc5e59c412b Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 5 Jun 2019 14:12:36 -0400 Subject: [PATCH 008/108] Create Get-ZALicense.Tests.ps1 --- Tests/Public/Get-ZALicense.Tests.ps1 | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 Tests/Public/Get-ZALicense.Tests.ps1 diff --git a/Tests/Public/Get-ZALicense.Tests.ps1 b/Tests/Public/Get-ZALicense.Tests.ps1 new file mode 100644 index 0000000..50d2f9d --- /dev/null +++ b/Tests/Public/Get-ZALicense.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 + } +} \ No newline at end of file From 50354f10cf02fce296edcbfd629f6951d2f76b5a Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 5 Jun 2019 14:13:31 -0400 Subject: [PATCH 009/108] Create ZAMonitoring Function and Tests --- Tests/Public/Get-ZAMonitoring.Tests.ps1 | 19 +++++++++++++++++++ ZertoApiWrapper/Public/Get-ZAMonitoring.ps1 | 18 ++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 Tests/Public/Get-ZAMonitoring.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZAMonitoring.ps1 diff --git a/Tests/Public/Get-ZAMonitoring.Tests.ps1 b/Tests/Public/Get-ZAMonitoring.Tests.ps1 new file mode 100644 index 0000000..50d2f9d --- /dev/null +++ b/Tests/Public/Get-ZAMonitoring.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 + } +} \ No newline at end of file diff --git a/ZertoApiWrapper/Public/Get-ZAMonitoring.ps1 b/ZertoApiWrapper/Public/Get-ZAMonitoring.ps1 new file mode 100644 index 0000000..a196baa --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZAMonitoring.ps1 @@ -0,0 +1,18 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZAMonitoring { + [cmdletbinding()] + param( + [Parameter( + HelpMessage = "The ZORG identifier by which to filter the user's statistics for a single account. If the ZORG identifier is omitted, statistics related to all sites, for a single account, is retrieved." + )] + [ValidateNotNullOrEmpty()] + [string]$zOrgIdentifier + ) + $uri = "monitoring/" + if ( -not [String]::IsNullorEmpty($zOrgIdentifier) ){ + $filterTable = @{"zOrgIdentifier" = $zOrgIdentifier} + $filterString = Get-ZertoApiFilter -filterTable $filterTable + $uri = "{0}{1}" -f $uri, $filterString + } + Invoke-ZARestRequest -uri $uri +} \ No newline at end of file From 58a3500dddc14a4e4171fbbfb2c42e6247e5dc88 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 5 Jun 2019 14:16:43 -0400 Subject: [PATCH 010/108] Create Get-ZAAlert Function and Tests --- Tests/Public/Get-ZAAlert.Tests.ps1 | 19 +++++++++++++ ZertoApiWrapper/Public/Get-ZAAlert.ps1 | 38 ++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 Tests/Public/Get-ZAAlert.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZAAlert.ps1 diff --git a/Tests/Public/Get-ZAAlert.Tests.ps1 b/Tests/Public/Get-ZAAlert.Tests.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZAAlert.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-ZAAlert.ps1 b/ZertoApiWrapper/Public/Get-ZAAlert.ps1 new file mode 100644 index 0000000..f47ca3f --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZAAlert.ps1 @@ -0,0 +1,38 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZAAlert { + [cmdletbinding( DefaultParameterSetName = "zOrg")] + param( + [Parameter( + HelpMessage = "The ZORG identifier by which to filter the alert list. If the ZORG identifier is omitted, a list of all the alerts is retrieved.", + ParameterSetName = "zOrg" + )] + [ValidateNotNullOrEmpty()] + [string]$zOrgIdentifier, + [Parameter( + HelpMessage = "The maximum number of alerts to return.", + ParameterSetName = "zOrg" + )] + [ValidateRange(1, 1000000)] + [int]$limitTo, + [Parameter( + HelpMessage = "The VPG Idnetifier", + ParameterSetName = "vpgId" + )] + [ValidateNotNullOrEmpty()] + [string]$vpgIdentifier + ) + $uri = "monitoring/alerts" + switch ($PSCmdlet.ParameterSetName) { + zOrg { + if ( $PSBoundParameters.Keys.Count -gt 0 ) { + $filterString = Get-ZertoApiFilter -filterTable $PSBoundParameters + $uri = "{0}{1}" -f $uri, $filterString + } + } + + vpgId { + $uri = "{0}/{1}" -f $uri, $vpgIdentifier + } + } + Invoke-ZARestRequest -uri $uri +} From ee7770e1e96d3f360ff1004ef2cc9eede7724fc5 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 5 Jun 2019 14:17:41 -0400 Subject: [PATCH 011/108] Create Get-ZAAlertAggregation Function and Tests --- Tests/Public/Get-ZAAlertAggregation.Tests.ps1 | 19 ++++++++++++++++++ .../Public/Get-ZAAlertAggregation.ps1 | 20 +++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 Tests/Public/Get-ZAAlertAggregation.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZAAlertAggregation.ps1 diff --git a/Tests/Public/Get-ZAAlertAggregation.Tests.ps1 b/Tests/Public/Get-ZAAlertAggregation.Tests.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZAAlertAggregation.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-ZAAlertAggregation.ps1 b/ZertoApiWrapper/Public/Get-ZAAlertAggregation.ps1 new file mode 100644 index 0000000..7b82559 --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZAAlertAggregation.ps1 @@ -0,0 +1,20 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZAAlertAggeration { + [cmdletbinding()] + param( + [Parameter( + HelpMessage = "The ZORG identifier by which to filter the alert count. If the ZORG identifier is omitted, retrieves all alerts sorted by entity and by type." + )] + [ValidateNotNullOrEmpty()] + [string]$zOrgIdentifier + ) + $uri = "monitoring/alerts" + if ( -not [String]::IsNullorEmpty($zOrgIdentifier) ) { + $filterTable = @{"zOrgIdentifier" = $zOrgIdentifier } + $filterString = Get-ZertoApiFilter -filterTable $filterTable + $uri = "{0}{1}&format=aggregations" -f $uri, $filterString + } else { + $uri = "{0}?format=aggregations" -f $uri + } + Invoke-ZARestRequest -uri $uri +} From bcc5c49b711c6e4cc8bb1443298c0695591dfb5f Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 5 Jun 2019 14:18:16 -0400 Subject: [PATCH 012/108] Create Get-ZASite Function and Tests --- Tests/Public/Get-ZASite.Tests.ps1 | 19 +++++++++++++++++++ ZertoApiWrapper/Public/Get-ZASite.ps1 | 18 ++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 Tests/Public/Get-ZASite.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZASite.ps1 diff --git a/Tests/Public/Get-ZASite.Tests.ps1 b/Tests/Public/Get-ZASite.Tests.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZASite.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-ZASite.ps1 b/ZertoApiWrapper/Public/Get-ZASite.ps1 new file mode 100644 index 0000000..dc2b66d --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZASite.ps1 @@ -0,0 +1,18 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZASite { + [cmdletbinding()] + param( + [Parameter( + HelpMessage = "The ZORG identifier by which to filter site list. If the ZORG identifier is omitted, a list of all sites is retrieved." + )] + [ValidateNotNullOrEmpty()] + [string]$zOrgIdentifier + ) + $uri = "monitoring/sites" + if ( -not [String]::IsNullorEmpty($zOrgIdentifier) ) { + $filterTable = @{"zOrgIdentifier" = $zOrgIdentifier } + $filterString = Get-ZertoApiFilter -filterTable $filterTable + $uri = "{0}{1}" -f $uri, $filterString + } + Invoke-ZARestRequest -uri $uri +} From 0f35782f66699bfb4f62dee84875a23a7d4005e6 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 5 Jun 2019 14:18:57 -0400 Subject: [PATCH 013/108] Create Get-ZASiteTopology Function and Tests --- Tests/Public/Get-ZASiteTopology.Tests.ps1 | 19 ++++++++++++++++++ ZertoApiWrapper/Public/Get-ZASiteTopology.ps1 | 20 +++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 Tests/Public/Get-ZASiteTopology.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZASiteTopology.ps1 diff --git a/Tests/Public/Get-ZASiteTopology.Tests.ps1 b/Tests/Public/Get-ZASiteTopology.Tests.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZASiteTopology.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-ZASiteTopology.ps1 b/ZertoApiWrapper/Public/Get-ZASiteTopology.ps1 new file mode 100644 index 0000000..82795c3 --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZASiteTopology.ps1 @@ -0,0 +1,20 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZASiteTopology { + [cmdletbinding()] + param( + [Parameter( + HelpMessage = "The ZORG identifier by which to filter sites topology list. If the ZORG identifier is omitted, information related to all sites topology is retrieved." + )] + [ValidateNotNullOrEmpty()] + [string]$zOrgIdentifier + ) + $uri = "monitoring/sites" + if ( -not [String]::IsNullorEmpty($zOrgIdentifier) ) { + $filterTable = @{"zOrgIdentifier" = $zOrgIdentifier } + $filterString = Get-ZertoApiFilter -filterTable $filterTable + $uri = "{0}{1}&format=topology" -f $uri, $filterString + } else { + $uri = "{0}?format=topology" -f $uri + } + Invoke-ZARestRequest -uri $uri +} From 1b331105b90105bb8e27c545f94f45fb2487647c Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 5 Jun 2019 14:19:34 -0400 Subject: [PATCH 014/108] Create Get-ZAVpg Function and Tests --- Tests/Public/Get-ZAVpg.Tests.ps1 | 19 +++++++++++++++ ZertoApiWrapper/Public/Get-ZAVpg.ps1 | 36 ++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 Tests/Public/Get-ZAVpg.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZAVpg.ps1 diff --git a/Tests/Public/Get-ZAVpg.Tests.ps1 b/Tests/Public/Get-ZAVpg.Tests.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZAVpg.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-ZAVpg.ps1 b/ZertoApiWrapper/Public/Get-ZAVpg.ps1 new file mode 100644 index 0000000..3b31e20 --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZAVpg.ps1 @@ -0,0 +1,36 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZAVpg { + [cmdletbinding(DefaultParameterSetName = 'zOrg')] + param( + [Parameter( + HelpMessage = "The ZORG identifier by which to filter the VPG list. If the ZORG identifier is omitted, a list of all VPGs is retrieved.", + ParameterSetName = 'zOrg' + )] + [ValidateNotNullOrEmpty()] + [string]$zOrgIdentifier, + [Parameter( + HelpMessage = "The VPG Identifier", + ParameterSetName = "vpg", + Mandatory = $true + )] + [ValidateNotNullOrEmpty()] + [string]$vpgIdentifier + ) + $uri = "monitoring/vpgs" + + switch ($PSCmdlet.ParameterSetName) { + zOrg { + if ( -not [String]::IsNullorEmpty($zOrgIdentifier) ) { + $filterTable = @{"zOrgIdentifier" = $zOrgIdentifier } + $filterString = Get-ZertoApiFilter -filterTable $filterTable + $uri = "{0}{1}" -f $uri, $filterString + } + } + + vpg { + $uri = "{0}/$vpgIdentifier" + } + } + + Invoke-ZARestRequest -uri $uri +} From fd2d175def0a5e60dc53fe07971e59a9913d12c9 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 5 Jun 2019 14:20:13 -0400 Subject: [PATCH 015/108] Create Get-ZAzOrg Function and Tests --- Tests/Public/Get-ZAzOrg.Tests.ps1 | 19 +++++++++++++++++++ ZertoApiWrapper/Public/Get-ZAzOrg.ps1 | 7 +++++++ 2 files changed, 26 insertions(+) create mode 100644 Tests/Public/Get-ZAzOrg.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZAzOrg.ps1 diff --git a/Tests/Public/Get-ZAzOrg.Tests.ps1 b/Tests/Public/Get-ZAzOrg.Tests.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZAzOrg.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-ZAzOrg.ps1 b/ZertoApiWrapper/Public/Get-ZAzOrg.ps1 new file mode 100644 index 0000000..7a69bc1 --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZAzOrg.ps1 @@ -0,0 +1,7 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZAzOrg { + [cmdletbinding()] + param() + $uri = "monitoring/zorgs" + Invoke-ZARestRequest -uri $uri +} \ No newline at end of file From 1008c2c67047b608b4fa87f30071340ba9a169bc Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 5 Jun 2019 15:41:31 -0400 Subject: [PATCH 016/108] Update Invoke-ZertoFailoverCommit.md Add SupportShouldProcess --- docs/Invoke-ZertoFailoverCommit.md | 34 ++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/docs/Invoke-ZertoFailoverCommit.md b/docs/Invoke-ZertoFailoverCommit.md index 627ece1..b9d302f 100644 --- a/docs/Invoke-ZertoFailoverCommit.md +++ b/docs/Invoke-ZertoFailoverCommit.md @@ -13,7 +13,7 @@ Commit a running VPG failover ## SYNTAX ``` -Invoke-ZertoFailoverCommit [-vpgName] [-reverseProtection] [] +Invoke-ZertoFailoverCommit [-vpgName] [-reverseProtection] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -67,8 +67,38 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +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). +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 From 79fe7de886fcbe7f0d76d75661a4b89962b3c246 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 3 Jun 2019 07:11:15 -0400 Subject: [PATCH 017/108] Create Invoke-ZARestRequest.ps1 --- .../Private/Invoke-ZARestRequest.ps1 | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 ZertoApiWrapper/Private/Invoke-ZARestRequest.ps1 diff --git a/ZertoApiWrapper/Private/Invoke-ZARestRequest.ps1 b/ZertoApiWrapper/Private/Invoke-ZARestRequest.ps1 new file mode 100644 index 0000000..599bad8 --- /dev/null +++ b/ZertoApiWrapper/Private/Invoke-ZARestRequest.ps1 @@ -0,0 +1,20 @@ +function Invoke-ZARestRequest { + [cmdletbinding()] + param( + [string]$uri, + [string]$method = "GET", + [string]$body, + [string]$contentType = "application/json" + ) + + $submittedUri = "https://analytics.api.zerto.com/v2/{0}" -f $uri + if ($PSVersionTable.PSVersion.Major -ge 6) { + Invoke-RestMethod -Uri $submittedUri -Method $method -Body $body -Headers $Script:zaHeaders -ContentType $contentType -TimeoutSec 100 + } else { + if ([String]::IsNullOrEmpty($body)) { + Invoke-RestMethod -Uri $submittedUri -Method $method -Headers $Script:zaHeaders -ContentType $contentType -TimeoutSec 100 + } else { + Invoke-RestMethod -Uri $submittedUri -Method $method -Headers $Script:zaHeaders -ContentType $contentType -TimeoutSec 100 -Body $body + } + } +} \ No newline at end of file From 6a32ed6e14d7a35c48c7df85f115230449d6303c Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 3 Jun 2019 07:11:20 -0400 Subject: [PATCH 018/108] Create Connect-ZertoAnalytics.ps1 --- .../Public/Connect-ZertoAnalytics.ps1 | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 ZertoApiWrapper/Public/Connect-ZertoAnalytics.ps1 diff --git a/ZertoApiWrapper/Public/Connect-ZertoAnalytics.ps1 b/ZertoApiWrapper/Public/Connect-ZertoAnalytics.ps1 new file mode 100644 index 0000000..698d957 --- /dev/null +++ b/ZertoApiWrapper/Public/Connect-ZertoAnalytics.ps1 @@ -0,0 +1,19 @@ +function Connect-ZertoAnalytics { + [cmdletbinding()] + param( + [Parameter( + Mandatory = $true, + HelpMessage = "PSCredential Object containing username and password authorized for the Zerto Analytics site", + Position = 0 + )] + [System.Management.Automation.PSCredential]$credential + ) + + $uri = "auth/token" + Set-Variable -Name zaHeaders -Scope Script -Value @{"Accept" = "application/json" } + Set-Variable -Name zaLastActionTime -Scope Script -Value $(Get-date).Ticks + $body = @{"username" = $credential.UserName; "password" = $credential.GetNetworkCredential().password } + $result = Invoke-ZARestRequest -Uri $uri -body $($body | ConvertTo-Json) -Method POST + $Script:zaHeaders["Authorization"] = "Bearer $($result.Token)" + $Script:zaHeaders +} \ No newline at end of file From 183bbc7d1314ac6a7398139430f93eceb75fe43e Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 3 Jun 2019 07:11:33 -0400 Subject: [PATCH 019/108] Create Get-ZALicense.ps1 --- ZertoApiWrapper/Public/Get-ZALicense.ps1 | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 ZertoApiWrapper/Public/Get-ZALicense.ps1 diff --git a/ZertoApiWrapper/Public/Get-ZALicense.ps1 b/ZertoApiWrapper/Public/Get-ZALicense.ps1 new file mode 100644 index 0000000..02c8fd1 --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZALicense.ps1 @@ -0,0 +1,4 @@ +function Get-ZALicense { + $uri = "licenses" + Invoke-ZARestRequest -uri $uri +} \ No newline at end of file From 934f02664489bff524d3361c3d6d82996ccf6eea Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 5 Jun 2019 14:07:37 -0400 Subject: [PATCH 020/108] Add External Help File --- ZertoApiWrapper/Public/Connect-ZertoAnalytics.ps1 | 1 + 1 file changed, 1 insertion(+) diff --git a/ZertoApiWrapper/Public/Connect-ZertoAnalytics.ps1 b/ZertoApiWrapper/Public/Connect-ZertoAnalytics.ps1 index 698d957..2c8e95f 100644 --- a/ZertoApiWrapper/Public/Connect-ZertoAnalytics.ps1 +++ b/ZertoApiWrapper/Public/Connect-ZertoAnalytics.ps1 @@ -1,3 +1,4 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> function Connect-ZertoAnalytics { [cmdletbinding()] param( From ab39ba70a2144186a159a1412149726d7729f68a Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 5 Jun 2019 14:07:58 -0400 Subject: [PATCH 021/108] Create Invoke-ZARestRequest.Tests.ps1 --- Tests/Private/Invoke-ZARestRequest.Tests.ps1 | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 Tests/Private/Invoke-ZARestRequest.Tests.ps1 diff --git a/Tests/Private/Invoke-ZARestRequest.Tests.ps1 b/Tests/Private/Invoke-ZARestRequest.Tests.ps1 new file mode 100644 index 0000000..984d682 --- /dev/null +++ b/Tests/Private/Invoke-ZARestRequest.Tests.ps1 @@ -0,0 +1,17 @@ +$filePath = (Split-Path -Parent $MyInvocation.MyCommand.Path) -replace 'Tests', 'ZertoApiWrapper' +$fileName = (Split-Path -Leaf $MyInvocation.MyCommand.Path ) -replace '.Tests.', '.' +$file = Get-ChildItem "$filePath\$fileName" +. $file.FullName + +Describe $file.BaseName -Tag Unit { + it "file should exist" { + $file.FullName | should exist + } + + It "is valid Powershell (Has no script errors)" { + $contents = Get-Content -Path $file.FullName -ErrorAction Stop + $errors = $null + $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) + $errors | Should -HaveCount 0 + } +} \ No newline at end of file From c78ad3e696c93c0f5c30d54b6d37e2104a94185b Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 5 Jun 2019 14:08:06 -0400 Subject: [PATCH 022/108] Create Connect-ZertoAnalytics.Tests.ps1 --- Tests/Public/Connect-ZertoAnalytics.Tests.ps1 | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 Tests/Public/Connect-ZertoAnalytics.Tests.ps1 diff --git a/Tests/Public/Connect-ZertoAnalytics.Tests.ps1 b/Tests/Public/Connect-ZertoAnalytics.Tests.ps1 new file mode 100644 index 0000000..50d2f9d --- /dev/null +++ b/Tests/Public/Connect-ZertoAnalytics.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 + } +} \ No newline at end of file From 5f24cc8c73c7508197e17d675e943943604d7515 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 5 Jun 2019 14:08:45 -0400 Subject: [PATCH 023/108] Make into an advanced function. --- ZertoApiWrapper/Public/Get-ZALicense.ps1 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ZertoApiWrapper/Public/Get-ZALicense.ps1 b/ZertoApiWrapper/Public/Get-ZALicense.ps1 index 02c8fd1..bd1bd94 100644 --- a/ZertoApiWrapper/Public/Get-ZALicense.ps1 +++ b/ZertoApiWrapper/Public/Get-ZALicense.ps1 @@ -1,4 +1,7 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> function Get-ZALicense { + [cmdletbinding()] + param() $uri = "licenses" Invoke-ZARestRequest -uri $uri } \ No newline at end of file From b4246057350b53270a3ffac0b751cbf5da5faaa1 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 5 Jun 2019 14:12:36 -0400 Subject: [PATCH 024/108] Create Get-ZALicense.Tests.ps1 --- Tests/Public/Get-ZALicense.Tests.ps1 | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 Tests/Public/Get-ZALicense.Tests.ps1 diff --git a/Tests/Public/Get-ZALicense.Tests.ps1 b/Tests/Public/Get-ZALicense.Tests.ps1 new file mode 100644 index 0000000..50d2f9d --- /dev/null +++ b/Tests/Public/Get-ZALicense.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 + } +} \ No newline at end of file From 848daf3c49f02a8192198501c480aab0a352e311 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 5 Jun 2019 14:13:31 -0400 Subject: [PATCH 025/108] Create ZAMonitoring Function and Tests --- Tests/Public/Get-ZAMonitoring.Tests.ps1 | 19 +++++++++++++++++++ ZertoApiWrapper/Public/Get-ZAMonitoring.ps1 | 18 ++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 Tests/Public/Get-ZAMonitoring.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZAMonitoring.ps1 diff --git a/Tests/Public/Get-ZAMonitoring.Tests.ps1 b/Tests/Public/Get-ZAMonitoring.Tests.ps1 new file mode 100644 index 0000000..50d2f9d --- /dev/null +++ b/Tests/Public/Get-ZAMonitoring.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 + } +} \ No newline at end of file diff --git a/ZertoApiWrapper/Public/Get-ZAMonitoring.ps1 b/ZertoApiWrapper/Public/Get-ZAMonitoring.ps1 new file mode 100644 index 0000000..a196baa --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZAMonitoring.ps1 @@ -0,0 +1,18 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZAMonitoring { + [cmdletbinding()] + param( + [Parameter( + HelpMessage = "The ZORG identifier by which to filter the user's statistics for a single account. If the ZORG identifier is omitted, statistics related to all sites, for a single account, is retrieved." + )] + [ValidateNotNullOrEmpty()] + [string]$zOrgIdentifier + ) + $uri = "monitoring/" + if ( -not [String]::IsNullorEmpty($zOrgIdentifier) ){ + $filterTable = @{"zOrgIdentifier" = $zOrgIdentifier} + $filterString = Get-ZertoApiFilter -filterTable $filterTable + $uri = "{0}{1}" -f $uri, $filterString + } + Invoke-ZARestRequest -uri $uri +} \ No newline at end of file From 15435c9261c4386d819ac6a7f7d83a424387957e Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 5 Jun 2019 14:16:43 -0400 Subject: [PATCH 026/108] Create Get-ZAAlert Function and Tests --- Tests/Public/Get-ZAAlert.Tests.ps1 | 19 +++++++++++++ ZertoApiWrapper/Public/Get-ZAAlert.ps1 | 38 ++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 Tests/Public/Get-ZAAlert.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZAAlert.ps1 diff --git a/Tests/Public/Get-ZAAlert.Tests.ps1 b/Tests/Public/Get-ZAAlert.Tests.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZAAlert.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-ZAAlert.ps1 b/ZertoApiWrapper/Public/Get-ZAAlert.ps1 new file mode 100644 index 0000000..f47ca3f --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZAAlert.ps1 @@ -0,0 +1,38 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZAAlert { + [cmdletbinding( DefaultParameterSetName = "zOrg")] + param( + [Parameter( + HelpMessage = "The ZORG identifier by which to filter the alert list. If the ZORG identifier is omitted, a list of all the alerts is retrieved.", + ParameterSetName = "zOrg" + )] + [ValidateNotNullOrEmpty()] + [string]$zOrgIdentifier, + [Parameter( + HelpMessage = "The maximum number of alerts to return.", + ParameterSetName = "zOrg" + )] + [ValidateRange(1, 1000000)] + [int]$limitTo, + [Parameter( + HelpMessage = "The VPG Idnetifier", + ParameterSetName = "vpgId" + )] + [ValidateNotNullOrEmpty()] + [string]$vpgIdentifier + ) + $uri = "monitoring/alerts" + switch ($PSCmdlet.ParameterSetName) { + zOrg { + if ( $PSBoundParameters.Keys.Count -gt 0 ) { + $filterString = Get-ZertoApiFilter -filterTable $PSBoundParameters + $uri = "{0}{1}" -f $uri, $filterString + } + } + + vpgId { + $uri = "{0}/{1}" -f $uri, $vpgIdentifier + } + } + Invoke-ZARestRequest -uri $uri +} From e43e911c7b177fcc4f7302bcb661ea41429ac291 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 5 Jun 2019 14:17:41 -0400 Subject: [PATCH 027/108] Create Get-ZAAlertAggregation Function and Tests --- Tests/Public/Get-ZAAlertAggregation.Tests.ps1 | 19 ++++++++++++++++++ .../Public/Get-ZAAlertAggregation.ps1 | 20 +++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 Tests/Public/Get-ZAAlertAggregation.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZAAlertAggregation.ps1 diff --git a/Tests/Public/Get-ZAAlertAggregation.Tests.ps1 b/Tests/Public/Get-ZAAlertAggregation.Tests.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZAAlertAggregation.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-ZAAlertAggregation.ps1 b/ZertoApiWrapper/Public/Get-ZAAlertAggregation.ps1 new file mode 100644 index 0000000..7b82559 --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZAAlertAggregation.ps1 @@ -0,0 +1,20 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZAAlertAggeration { + [cmdletbinding()] + param( + [Parameter( + HelpMessage = "The ZORG identifier by which to filter the alert count. If the ZORG identifier is omitted, retrieves all alerts sorted by entity and by type." + )] + [ValidateNotNullOrEmpty()] + [string]$zOrgIdentifier + ) + $uri = "monitoring/alerts" + if ( -not [String]::IsNullorEmpty($zOrgIdentifier) ) { + $filterTable = @{"zOrgIdentifier" = $zOrgIdentifier } + $filterString = Get-ZertoApiFilter -filterTable $filterTable + $uri = "{0}{1}&format=aggregations" -f $uri, $filterString + } else { + $uri = "{0}?format=aggregations" -f $uri + } + Invoke-ZARestRequest -uri $uri +} From 5018404641d22cec04c216b205251d9ccbcd64f7 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 5 Jun 2019 14:18:16 -0400 Subject: [PATCH 028/108] Create Get-ZASite Function and Tests --- Tests/Public/Get-ZASite.Tests.ps1 | 19 +++++++++++++++++++ ZertoApiWrapper/Public/Get-ZASite.ps1 | 18 ++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 Tests/Public/Get-ZASite.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZASite.ps1 diff --git a/Tests/Public/Get-ZASite.Tests.ps1 b/Tests/Public/Get-ZASite.Tests.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZASite.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-ZASite.ps1 b/ZertoApiWrapper/Public/Get-ZASite.ps1 new file mode 100644 index 0000000..dc2b66d --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZASite.ps1 @@ -0,0 +1,18 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZASite { + [cmdletbinding()] + param( + [Parameter( + HelpMessage = "The ZORG identifier by which to filter site list. If the ZORG identifier is omitted, a list of all sites is retrieved." + )] + [ValidateNotNullOrEmpty()] + [string]$zOrgIdentifier + ) + $uri = "monitoring/sites" + if ( -not [String]::IsNullorEmpty($zOrgIdentifier) ) { + $filterTable = @{"zOrgIdentifier" = $zOrgIdentifier } + $filterString = Get-ZertoApiFilter -filterTable $filterTable + $uri = "{0}{1}" -f $uri, $filterString + } + Invoke-ZARestRequest -uri $uri +} From 97aa9f1ba80abd035c542df264d0365309345482 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 5 Jun 2019 14:18:57 -0400 Subject: [PATCH 029/108] Create Get-ZASiteTopology Function and Tests --- Tests/Public/Get-ZASiteTopology.Tests.ps1 | 19 ++++++++++++++++++ ZertoApiWrapper/Public/Get-ZASiteTopology.ps1 | 20 +++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 Tests/Public/Get-ZASiteTopology.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZASiteTopology.ps1 diff --git a/Tests/Public/Get-ZASiteTopology.Tests.ps1 b/Tests/Public/Get-ZASiteTopology.Tests.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZASiteTopology.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-ZASiteTopology.ps1 b/ZertoApiWrapper/Public/Get-ZASiteTopology.ps1 new file mode 100644 index 0000000..82795c3 --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZASiteTopology.ps1 @@ -0,0 +1,20 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZASiteTopology { + [cmdletbinding()] + param( + [Parameter( + HelpMessage = "The ZORG identifier by which to filter sites topology list. If the ZORG identifier is omitted, information related to all sites topology is retrieved." + )] + [ValidateNotNullOrEmpty()] + [string]$zOrgIdentifier + ) + $uri = "monitoring/sites" + if ( -not [String]::IsNullorEmpty($zOrgIdentifier) ) { + $filterTable = @{"zOrgIdentifier" = $zOrgIdentifier } + $filterString = Get-ZertoApiFilter -filterTable $filterTable + $uri = "{0}{1}&format=topology" -f $uri, $filterString + } else { + $uri = "{0}?format=topology" -f $uri + } + Invoke-ZARestRequest -uri $uri +} From 87857303a03adac5e3ae64fee3a3e1ef5ca5c334 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 5 Jun 2019 14:19:34 -0400 Subject: [PATCH 030/108] Create Get-ZAVpg Function and Tests --- Tests/Public/Get-ZAVpg.Tests.ps1 | 19 +++++++++++++++ ZertoApiWrapper/Public/Get-ZAVpg.ps1 | 36 ++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 Tests/Public/Get-ZAVpg.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZAVpg.ps1 diff --git a/Tests/Public/Get-ZAVpg.Tests.ps1 b/Tests/Public/Get-ZAVpg.Tests.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZAVpg.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-ZAVpg.ps1 b/ZertoApiWrapper/Public/Get-ZAVpg.ps1 new file mode 100644 index 0000000..3b31e20 --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZAVpg.ps1 @@ -0,0 +1,36 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZAVpg { + [cmdletbinding(DefaultParameterSetName = 'zOrg')] + param( + [Parameter( + HelpMessage = "The ZORG identifier by which to filter the VPG list. If the ZORG identifier is omitted, a list of all VPGs is retrieved.", + ParameterSetName = 'zOrg' + )] + [ValidateNotNullOrEmpty()] + [string]$zOrgIdentifier, + [Parameter( + HelpMessage = "The VPG Identifier", + ParameterSetName = "vpg", + Mandatory = $true + )] + [ValidateNotNullOrEmpty()] + [string]$vpgIdentifier + ) + $uri = "monitoring/vpgs" + + switch ($PSCmdlet.ParameterSetName) { + zOrg { + if ( -not [String]::IsNullorEmpty($zOrgIdentifier) ) { + $filterTable = @{"zOrgIdentifier" = $zOrgIdentifier } + $filterString = Get-ZertoApiFilter -filterTable $filterTable + $uri = "{0}{1}" -f $uri, $filterString + } + } + + vpg { + $uri = "{0}/$vpgIdentifier" + } + } + + Invoke-ZARestRequest -uri $uri +} From 8d5111a24a0e506cf4389370ef2ba0a6c4ae8746 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 5 Jun 2019 14:20:13 -0400 Subject: [PATCH 031/108] Create Get-ZAzOrg Function and Tests --- Tests/Public/Get-ZAzOrg.Tests.ps1 | 19 +++++++++++++++++++ ZertoApiWrapper/Public/Get-ZAzOrg.ps1 | 7 +++++++ 2 files changed, 26 insertions(+) create mode 100644 Tests/Public/Get-ZAzOrg.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZAzOrg.ps1 diff --git a/Tests/Public/Get-ZAzOrg.Tests.ps1 b/Tests/Public/Get-ZAzOrg.Tests.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZAzOrg.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-ZAzOrg.ps1 b/ZertoApiWrapper/Public/Get-ZAzOrg.ps1 new file mode 100644 index 0000000..7a69bc1 --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZAzOrg.ps1 @@ -0,0 +1,7 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZAzOrg { + [cmdletbinding()] + param() + $uri = "monitoring/zorgs" + Invoke-ZARestRequest -uri $uri +} \ No newline at end of file From bc9e485346d2352cac1631c06c16a33df0cb7641 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 5 Jun 2019 15:41:31 -0400 Subject: [PATCH 032/108] Update Invoke-ZertoFailoverCommit.md Add SupportShouldProcess --- docs/Invoke-ZertoFailoverCommit.md | 34 ++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/docs/Invoke-ZertoFailoverCommit.md b/docs/Invoke-ZertoFailoverCommit.md index 627ece1..b9d302f 100644 --- a/docs/Invoke-ZertoFailoverCommit.md +++ b/docs/Invoke-ZertoFailoverCommit.md @@ -13,7 +13,7 @@ Commit a running VPG failover ## SYNTAX ``` -Invoke-ZertoFailoverCommit [-vpgName] [-reverseProtection] [] +Invoke-ZertoFailoverCommit [-vpgName] [-reverseProtection] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -67,8 +67,38 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +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). +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 From 70261242db7497a6a37079f3dc8f2be9957df3b5 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 5 Jun 2019 15:55:28 -0400 Subject: [PATCH 033/108] Update Invoke-ZertoFailoverCommit.md --- docs/Invoke-ZertoFailoverCommit.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Invoke-ZertoFailoverCommit.md b/docs/Invoke-ZertoFailoverCommit.md index b9d302f..f7876b3 100644 --- a/docs/Invoke-ZertoFailoverCommit.md +++ b/docs/Invoke-ZertoFailoverCommit.md @@ -98,7 +98,7 @@ 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). +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 From ba4f0fc82a399b4dd2615dc583803f2c9a14cd8c Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 6 Jun 2019 11:20:01 -0400 Subject: [PATCH 034/108] Create Connect-ZertoAnalytics.md --- docs/Connect-ZertoAnalytics.md | 60 ++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 docs/Connect-ZertoAnalytics.md diff --git a/docs/Connect-ZertoAnalytics.md b/docs/Connect-ZertoAnalytics.md new file mode 100644 index 0000000..86a10c7 --- /dev/null +++ b/docs/Connect-ZertoAnalytics.md @@ -0,0 +1,60 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: +schema: 2.0.0 +--- + +# Connect-ZertoAnalytics + +## SYNOPSIS +All requests to the server, apart from the request to authenticate, must contain a security token which is provided on successful authentication. +In order to authenticate, the user sends myZerto credentials (user/password). + +## SYNTAX + +``` +Connect-ZertoAnalytics [-credential] [] +``` + +## DESCRIPTION +All requests to the server, apart from the request to authenticate, must contain a security token which is provided on successful authentication. +In order to authenticate, the user sends myZerto credentials (user/password). Once this call has been completed successfully, the header authentication token will be stored as a variable and automatically passed during future calls to the Zerto Analytics platform. This token will automatically expire after 60 minutes of inactivity and need to be reauthorized by calling this function again. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Connect-ZertoAnalytics -credential $myCredential +``` + +Connects to the Zerto Analytics site and gets a Bearer Authorization token that is automatically stored as a variable for future calls to the Zerto Analytics REST API. This token will automatically expire after 60 minutes of inactivity and need to be reauthorized by calling this function again. + +## PARAMETERS + +### -credential +PSCredential Object containing username and password authorized for the Zerto Analytics site + +```yaml +Type: PSCredential +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 Authentication](https://docs.api.zerto.com/#/Authentication/post_v2_auth_token) From 8581c037d719812f9d6d47679765c9a49ac7de74 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 6 Jun 2019 11:20:29 -0400 Subject: [PATCH 035/108] Add task to update the Markdown help files with new commands. --- ZertoApiWrapper.build.ps1 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ZertoApiWrapper.build.ps1 b/ZertoApiWrapper.build.ps1 index 448cab0..69d0b3e 100644 --- a/ZertoApiWrapper.build.ps1 +++ b/ZertoApiWrapper.build.ps1 @@ -89,6 +89,12 @@ task UpdateMarkdownHelp CheckPlatyPSInstalled, { Update-MarkDownHelp -Path docs -AlphabeticParamsOrder } +task UpdateMarkdownHelpModule CheckPlatyPSInstalled, { + remove-module ZertoApiWrapper -force -ErrorAction SilentlyContinue + Import-Module .\ZertoApiWrapper\ZertoApiWrapper.psm1 -Force + Update-MarkDownHelpModule -Path docs -AlphabeticParamsOrder +} + task CreatePsd1ForRelease CleanTemp, { $functionsToExport = Get-ChildItem -Path 'ZertoApiWrapper\Public\*.ps1' | ForEach-Object { $_.BaseName } $releaseNotes = "# {0}{1}" -f $version, $(Get-Content .\RELEASENOTES.md -Raw) From 5990d57285bd69dd87b33bf2916d20960efb8667 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 6 Jun 2019 11:31:44 -0400 Subject: [PATCH 036/108] Fix variable Typo --- ZertoApiWrapper/Public/Get-ZAAlert.ps1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ZertoApiWrapper/Public/Get-ZAAlert.ps1 b/ZertoApiWrapper/Public/Get-ZAAlert.ps1 index f47ca3f..f2e4a2d 100644 --- a/ZertoApiWrapper/Public/Get-ZAAlert.ps1 +++ b/ZertoApiWrapper/Public/Get-ZAAlert.ps1 @@ -16,10 +16,10 @@ function Get-ZAAlert { [int]$limitTo, [Parameter( HelpMessage = "The VPG Idnetifier", - ParameterSetName = "vpgId" + ParameterSetName = "alertId" )] [ValidateNotNullOrEmpty()] - [string]$vpgIdentifier + [string]$alertIdentifier ) $uri = "monitoring/alerts" switch ($PSCmdlet.ParameterSetName) { @@ -30,8 +30,8 @@ function Get-ZAAlert { } } - vpgId { - $uri = "{0}/{1}" -f $uri, $vpgIdentifier + alertId { + $uri = "{0}/{1}" -f $uri, $alertIdentifier } } Invoke-ZARestRequest -uri $uri From d8084b2fb3a01e5c748e954b2797b53a46900d95 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 6 Jun 2019 11:31:55 -0400 Subject: [PATCH 037/108] Formatting Update --- docs/Connect-ZertoAnalytics.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/Connect-ZertoAnalytics.md b/docs/Connect-ZertoAnalytics.md index 86a10c7..3d50e87 100644 --- a/docs/Connect-ZertoAnalytics.md +++ b/docs/Connect-ZertoAnalytics.md @@ -57,4 +57,5 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## NOTES ## RELATED LINKS + [Zerto Analytics REST API Endpoint for Authentication](https://docs.api.zerto.com/#/Authentication/post_v2_auth_token) From f0f45a383f40ff9efc2c88d0264d221013462a4d Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 6 Jun 2019 11:34:27 -0400 Subject: [PATCH 038/108] Create Get-ZAAlert Markdown Help File --- docs/Get-ZAAlert.md | 125 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 125 insertions(+) create mode 100644 docs/Get-ZAAlert.md diff --git a/docs/Get-ZAAlert.md b/docs/Get-ZAAlert.md new file mode 100644 index 0000000..abced20 --- /dev/null +++ b/docs/Get-ZAAlert.md @@ -0,0 +1,125 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: +schema: 2.0.0 +--- + +# Get-ZAAlert + +## SYNOPSIS +Retrieve information about all existing alerts. + +## SYNTAX + +### zOrg (Default) +``` +Get-ZAAlert [-zOrgIdentifier ] [-limitTo ] [] +``` + +### alertId +``` +Get-ZAAlert [-alertIdentifier ] [] +``` + +## DESCRIPTION +Retrieve information about all existing alerts. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZAAlert +``` + +Returns all alerts. + +### Example 2 +```powershell +PS C:\> Get-ZAAlert -limitTo 10 +``` + +Returns 10 alerts. + +### Example 3 +```powershell +PS C:\> Get-ZAAlert -zOrgIdentifier "1234-5678-9012" +``` + +Returns all alerts for the zOrg with Identifier "1234-5678-9012". + +### Example 4 +```powershell +PS C:\> Get-ZAAlert -zOrgIdentifier "1234-5678-9012" -limitTo 10 +``` + +Returns 10 alerts for the zOrg with Identifier "1234-5678-9012". + +### Example 3 +```powershell +PS C:\> Get-ZAAlert -alertId "1234-5678-9012" +``` + +Returns one alert with identifier "1234-5678-9012". + +## PARAMETERS + +### -alertIdentifier +The VPG Idnetifier + +```yaml +Type: String +Parameter Sets: alertId +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -limitTo +The maximum number of alerts to return. + +```yaml +Type: Int32 +Parameter Sets: zOrg +Aliases: + +Required: False +Position: Named +Default value: 0 +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -zOrgIdentifier +The ZORG identifier by which to filter the alert list. +If the ZORG identifier is omitted, a list of all the alerts is retrieved. + +```yaml +Type: String +Parameter Sets: zOrg +Aliases: + +Required: False +Position: Named +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 Alerts](https://docs.api.zerto.com/#/Monitoring/get_v2_monitoring_alerts) +[Zerto Analytics REST API Endpoint for Alerts by Identifier](https://docs.api.zerto.com/#/Monitoring/get_v2_monitoring_alerts__alertIdentifier_) From 0fbc6d2242f2ea72fab38b78b653903e5362dbdb Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 6 Jun 2019 11:35:41 -0400 Subject: [PATCH 039/108] Create Get-ZALicense Markdown Help File --- docs/Get-ZALicense.md | 45 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 docs/Get-ZALicense.md diff --git a/docs/Get-ZALicense.md b/docs/Get-ZALicense.md new file mode 100644 index 0000000..27a9e9c --- /dev/null +++ b/docs/Get-ZALicense.md @@ -0,0 +1,45 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: +schema: 2.0.0 +--- + +# Get-ZALicense + +## SYNOPSIS + +Retrieve a list of all licenses. + +## SYNTAX + +``` +Get-ZALicense [] +``` + +## DESCRIPTION +Retrieve a list of all licenses. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZALicense +``` + +Returns all licenses and associated information + +## PARAMETERS + +### 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 License End Point Documentation](https://docs.api.zerto.com/#/Licenses/get_v2_licenses) From 8b09b702d61781cdb64b0ab2ccbd5cda6045582b Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 6 Jun 2019 11:42:01 -0400 Subject: [PATCH 040/108] Create Get-ZAMonitoring Markdown Help file --- docs/Get-ZAMonitoring.md | 69 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 docs/Get-ZAMonitoring.md diff --git a/docs/Get-ZAMonitoring.md b/docs/Get-ZAMonitoring.md new file mode 100644 index 0000000..131adca --- /dev/null +++ b/docs/Get-ZAMonitoring.md @@ -0,0 +1,69 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: +schema: 2.0.0 +--- + +# Get-ZAMonitoring + +## SYNOPSIS + +Retrieve statistics related to all the user’s sites - belonging to a single account. + +## SYNTAX + +``` +Get-ZAMonitoring [[-zOrgIdentifier] ] [] +``` + +## DESCRIPTION + +Retrieve statistics related to all the user’s sites - belonging to a single account. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZAMonitoring +``` + +Retrieve statistics related to all the user’s sites - belonging to a single account. + +### Example 1 +```powershell +PS C:\> Get-ZAMonitoring -zOrgIdentifier "1234-5678-9012" +``` + +Retrieve statistics related to the zOrgIdentifier provided + +## PARAMETERS + +### -zOrgIdentifier +The ZORG identifier by which to filter the user's statistics for a single account. +If the ZORG identifier is omitted, statistics related to all sites, for a single account, is retrieved. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +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 Monitoring](https://docs.api.zerto.com/#/Monitoring/get_v2_monitoring_) From 6d66a1c35b139910ee21fce225114adb402aaeaf Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 6 Jun 2019 11:44:04 -0400 Subject: [PATCH 041/108] Create Get-ZASite Markdown help file --- docs/Get-ZASite.md | 69 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 docs/Get-ZASite.md diff --git a/docs/Get-ZASite.md b/docs/Get-ZASite.md new file mode 100644 index 0000000..5bb6dbe --- /dev/null +++ b/docs/Get-ZASite.md @@ -0,0 +1,69 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: +schema: 2.0.0 +--- + +# Get-ZASite + +## SYNOPSIS + +Retrieve a list of all sites. + +## SYNTAX + +``` +Get-ZASite [[-zOrgIdentifier] ] [] +``` + +## DESCRIPTION + +Retrieve a list of all sites. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZASite +``` + +Retrieve a list of all sites. + +### Example 2 +```powershell +PS C:\> Get-ZASite -zOrgIdentifier "1234-5678-9012" +``` + +Retrieve a list of all sites managed under zOrgIdentifier "1234-5678-9012". + +## PARAMETERS + +### -zOrgIdentifier +The ZORG identifier by which to filter site list. +If the ZORG identifier is omitted, a list of all sites is retrieved. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +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 Sites](https://docs.api.zerto.com/#/Monitoring/get_v2_monitoring_sites) From a3fd87f933fecf7c573811212acada3691a2d97f Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 6 Jun 2019 11:46:49 -0400 Subject: [PATCH 042/108] Create Get-ZASiteTopology Markdown Help File --- docs/Get-ZASiteTopology.md | 70 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 docs/Get-ZASiteTopology.md diff --git a/docs/Get-ZASiteTopology.md b/docs/Get-ZASiteTopology.md new file mode 100644 index 0000000..c6b5686 --- /dev/null +++ b/docs/Get-ZASiteTopology.md @@ -0,0 +1,70 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: +schema: 2.0.0 +--- + +# Get-ZASiteTopology + +## SYNOPSIS + +Retrieves a collection of Sites topology information structures for all the available user’s sites, including disabled and non-transmitting due to lack of a transmitter (older ZVR versions). + +## SYNTAX + +``` +Get-ZASiteTopology [[-zOrgIdentifier] ] [] +``` + +## DESCRIPTION + +Retrieves a collection of Sites topology information structures for all the available user’s sites, including disabled and non-transmitting due to lack of a transmitter (older ZVR versions). | The following note should be taken into consideration: +The information might not be complete, since there are sites that do not transmit (disabled), yet this API concludes their presence and VPG count from the VPGs they share with transmitting sites. Such a disabled site might have relations with other disabled sites, which this API does not reveal. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZASiteTopology +``` + +Retrieves a collection of Sites topology information structures for all the available user’s sites. + +### Example 2 +```powershell +PS C:\> Get-ZASiteTopology -zOrgIdentifier "1234-5678-9012" +``` + +Retrieves a collection of Sites topology information structures for all the available user’s sites within zOrgIdentifier "1234-5678-9012". + +## PARAMETERS + +### -zOrgIdentifier +The ZORG identifier by which to filter sites topology list. +If the ZORG identifier is omitted, information related to all sites topology is retrieved. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +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 Site Topology](https://docs.api.zerto.com/#/Monitoring/get_v2_monitoring_sites_format_topology) From ebc86c5e7164376521efaaad679f61aa5f607689 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 6 Jun 2019 11:48:49 -0400 Subject: [PATCH 043/108] Update Function to set variable to mandatory --- ZertoApiWrapper/Public/Get-ZAAlert.ps1 | 3 ++- docs/Get-ZAAlert.md | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ZertoApiWrapper/Public/Get-ZAAlert.ps1 b/ZertoApiWrapper/Public/Get-ZAAlert.ps1 index f2e4a2d..af0c80e 100644 --- a/ZertoApiWrapper/Public/Get-ZAAlert.ps1 +++ b/ZertoApiWrapper/Public/Get-ZAAlert.ps1 @@ -16,7 +16,8 @@ function Get-ZAAlert { [int]$limitTo, [Parameter( HelpMessage = "The VPG Idnetifier", - ParameterSetName = "alertId" + ParameterSetName = "alertId", + Mandatory = $true )] [ValidateNotNullOrEmpty()] [string]$alertIdentifier diff --git a/docs/Get-ZAAlert.md b/docs/Get-ZAAlert.md index abced20..2e98eaa 100644 --- a/docs/Get-ZAAlert.md +++ b/docs/Get-ZAAlert.md @@ -19,7 +19,7 @@ Get-ZAAlert [-zOrgIdentifier ] [-limitTo ] [] ### alertId ``` -Get-ZAAlert [-alertIdentifier ] [] +Get-ZAAlert -alertIdentifier [] ``` ## DESCRIPTION @@ -72,7 +72,7 @@ Type: String Parameter Sets: alertId Aliases: -Required: False +Required: True Position: Named Default value: None Accept pipeline input: False From cddd25ded1b5204b341319a985cdfa55e28fd858 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 6 Jun 2019 11:49:49 -0400 Subject: [PATCH 044/108] Formatting Update --- docs/Get-ZAMonitoring.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/Get-ZAMonitoring.md b/docs/Get-ZAMonitoring.md index 131adca..7489568 100644 --- a/docs/Get-ZAMonitoring.md +++ b/docs/Get-ZAMonitoring.md @@ -9,7 +9,7 @@ schema: 2.0.0 ## SYNOPSIS -Retrieve statistics related to all the user’s sites - belonging to a single account. +Retrieve statistics related to all the user's sites - belonging to a single account. ## SYNTAX @@ -19,7 +19,7 @@ Get-ZAMonitoring [[-zOrgIdentifier] ] [] ## DESCRIPTION -Retrieve statistics related to all the user’s sites - belonging to a single account. +Retrieve statistics related to all the user's sites - belonging to a single account. ## EXAMPLES @@ -28,7 +28,7 @@ Retrieve statistics related to all the user’s sites - belonging to a single ac PS C:\> Get-ZAMonitoring ``` -Retrieve statistics related to all the user’s sites - belonging to a single account. +Retrieve statistics related to all the user's sites - belonging to a single account. ### Example 1 ```powershell From 9799feaeea545f2568cac8eeef69771020103ffe Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 6 Jun 2019 11:50:09 -0400 Subject: [PATCH 045/108] Formatting Update --- docs/Get-ZASiteTopology.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/Get-ZASiteTopology.md b/docs/Get-ZASiteTopology.md index c6b5686..cb42853 100644 --- a/docs/Get-ZASiteTopology.md +++ b/docs/Get-ZASiteTopology.md @@ -9,7 +9,7 @@ schema: 2.0.0 ## SYNOPSIS -Retrieves a collection of Sites topology information structures for all the available user’s sites, including disabled and non-transmitting due to lack of a transmitter (older ZVR versions). +Retrieves a collection of Sites topology information structures for all the available user's sites, including disabled and non-transmitting due to lack of a transmitter (older ZVR versions). ## SYNTAX @@ -19,7 +19,7 @@ Get-ZASiteTopology [[-zOrgIdentifier] ] [] ## DESCRIPTION -Retrieves a collection of Sites topology information structures for all the available user’s sites, including disabled and non-transmitting due to lack of a transmitter (older ZVR versions). | The following note should be taken into consideration: +Retrieves a collection of Sites topology information structures for all the available user's sites, including disabled and non-transmitting due to lack of a transmitter (older ZVR versions). | The following note should be taken into consideration: The information might not be complete, since there are sites that do not transmit (disabled), yet this API concludes their presence and VPG count from the VPGs they share with transmitting sites. Such a disabled site might have relations with other disabled sites, which this API does not reveal. ## EXAMPLES @@ -29,14 +29,14 @@ The information might not be complete, since there are sites that do not transmi PS C:\> Get-ZASiteTopology ``` -Retrieves a collection of Sites topology information structures for all the available user’s sites. +Retrieves a collection of Sites topology information structures for all the available user's sites. ### Example 2 ```powershell PS C:\> Get-ZASiteTopology -zOrgIdentifier "1234-5678-9012" ``` -Retrieves a collection of Sites topology information structures for all the available user’s sites within zOrgIdentifier "1234-5678-9012". +Retrieves a collection of Sites topology information structures for all the available user's sites within zOrgIdentifier "1234-5678-9012". ## PARAMETERS From 2c891795b2fcb664fac60bee7c9dcc011bcee0ec Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 6 Jun 2019 11:57:05 -0400 Subject: [PATCH 046/108] Add Online Parameter URL --- docs/Connect-ZertoAnalytics.md | 2 +- docs/Get-ZAAlert.md | 2 +- docs/Get-ZALicense.md | 2 +- docs/Get-ZAMonitoring.md | 2 +- docs/Get-ZASite.md | 2 +- docs/Get-ZASiteTopology.md | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/Connect-ZertoAnalytics.md b/docs/Connect-ZertoAnalytics.md index 3d50e87..4b789bf 100644 --- a/docs/Connect-ZertoAnalytics.md +++ b/docs/Connect-ZertoAnalytics.md @@ -1,7 +1,7 @@ --- external help file: ZertoApiWrapper-help.xml Module Name: ZertoApiWrapper -online version: +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Connect-ZertoAnalytics.md schema: 2.0.0 --- diff --git a/docs/Get-ZAAlert.md b/docs/Get-ZAAlert.md index 2e98eaa..3ef258f 100644 --- a/docs/Get-ZAAlert.md +++ b/docs/Get-ZAAlert.md @@ -1,7 +1,7 @@ --- external help file: ZertoApiWrapper-help.xml Module Name: ZertoApiWrapper -online version: +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAAlert.md schema: 2.0.0 --- diff --git a/docs/Get-ZALicense.md b/docs/Get-ZALicense.md index 27a9e9c..cc9b992 100644 --- a/docs/Get-ZALicense.md +++ b/docs/Get-ZALicense.md @@ -1,7 +1,7 @@ --- external help file: ZertoApiWrapper-help.xml Module Name: ZertoApiWrapper -online version: +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZALicense.md schema: 2.0.0 --- diff --git a/docs/Get-ZAMonitoring.md b/docs/Get-ZAMonitoring.md index 7489568..da04a32 100644 --- a/docs/Get-ZAMonitoring.md +++ b/docs/Get-ZAMonitoring.md @@ -1,7 +1,7 @@ --- external help file: ZertoApiWrapper-help.xml Module Name: ZertoApiWrapper -online version: +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAMonitoring.md schema: 2.0.0 --- diff --git a/docs/Get-ZASite.md b/docs/Get-ZASite.md index 5bb6dbe..4af04a2 100644 --- a/docs/Get-ZASite.md +++ b/docs/Get-ZASite.md @@ -1,7 +1,7 @@ --- external help file: ZertoApiWrapper-help.xml Module Name: ZertoApiWrapper -online version: +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZASite.md schema: 2.0.0 --- diff --git a/docs/Get-ZASiteTopology.md b/docs/Get-ZASiteTopology.md index cb42853..cd75b6d 100644 --- a/docs/Get-ZASiteTopology.md +++ b/docs/Get-ZASiteTopology.md @@ -1,7 +1,7 @@ --- external help file: ZertoApiWrapper-help.xml Module Name: ZertoApiWrapper -online version: +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZASiteTopology.md schema: 2.0.0 --- From f2d2e00f12db2f6595bdbdf90fb31dbe09bace28 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 6 Jun 2019 12:28:07 -0400 Subject: [PATCH 047/108] Create Get-ZAVpg External Help File --- docs/Get-ZAVpg.md | 98 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 docs/Get-ZAVpg.md diff --git a/docs/Get-ZAVpg.md b/docs/Get-ZAVpg.md new file mode 100644 index 0000000..07ff413 --- /dev/null +++ b/docs/Get-ZAVpg.md @@ -0,0 +1,98 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAVpg.md +schema: 2.0.0 +--- + +# Get-ZAVpg + +## SYNOPSIS + +Retrieve a list of all VPGs. + +## SYNTAX + +### zOrg (Default) +``` +Get-ZAVpg [-zOrgIdentifier ] [] +``` + +### vpg +``` +Get-ZAVpg -vpgIdentifier [] +``` + +## DESCRIPTION + +Retrieve a list of all VPGs. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZAVpg +``` + +Retrieve a list of all VPGs. + +### Example 2 +```powershell +PS C:\> Get-ZAVpg -zOrgIdentifier "1234-5678-9012" +``` + +Retrieve a list of all VPGs associated with zOrg "1234-5678-9012" + +### Example 3 +```powershell +PS C:\> Get-ZAVpg -vpgIdentifier "2109-8765-4321" +``` + +Retrieve information for VPG with identifier "2109-8765-4321" + +## PARAMETERS + +### -vpgIdentifier +The VPG Identifier + +```yaml +Type: String +Parameter Sets: vpg +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -zOrgIdentifier +The ZORG identifier by which to filter the VPG list. +If the ZORG identifier is omitted, a list of all VPGs is retrieved. + +```yaml +Type: String +Parameter Sets: zOrg +Aliases: + +Required: False +Position: Named +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 VPGs](https://docs.api.zerto.com/#/Monitoring/get_v2_monitoring_vpgs) +[Zerto Analytics REST API Endpoint for VPG Identifier](https://docs.api.zerto.com/#/Monitoring/get_v2_monitoring_vpgs__vpgIdentifier_) From 7ec6d846c0ba2e896ceb236a186f700cf0ff7f84 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 6 Jun 2019 12:30:01 -0400 Subject: [PATCH 048/108] Create External Help File for Get-ZAzOrg Function --- docs/Get-ZAzOrg.md | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 docs/Get-ZAzOrg.md diff --git a/docs/Get-ZAzOrg.md b/docs/Get-ZAzOrg.md new file mode 100644 index 0000000..4fe4457 --- /dev/null +++ b/docs/Get-ZAzOrg.md @@ -0,0 +1,46 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAzOrg.md +schema: 2.0.0 +--- + +# Get-ZAzOrg + +## SYNOPSIS + +Retrieve a list of all ZORGs. + +## SYNTAX + +``` +Get-ZAzOrg [] +``` + +## DESCRIPTION + +Retrieve a list of all ZORGs. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZAzOrg +``` + +Retrieve a list of all ZORGs. + +## PARAMETERS + +### 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 ZOrgs](https://docs.api.zerto.com/#/Monitoring/get_v2_monitoring_zorgs) From 4fc6c9ebcd7c2007a17ca9108a89e732bd1605c2 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 6 Jun 2019 13:36:04 -0400 Subject: [PATCH 049/108] Create Get-ZAEvent Files --- Tests/Public/Get-ZAEvent.Tests.ps1 | 19 ++++ ZertoApiWrapper/Public/Get-ZAEvent.ps1 | 39 +++++++ docs/Get-ZAEvent.md | 140 +++++++++++++++++++++++++ 3 files changed, 198 insertions(+) create mode 100644 Tests/Public/Get-ZAEvent.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZAEvent.ps1 create mode 100644 docs/Get-ZAEvent.md diff --git a/Tests/Public/Get-ZAEvent.Tests.ps1 b/Tests/Public/Get-ZAEvent.Tests.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZAEvent.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-ZAEvent.ps1 b/ZertoApiWrapper/Public/Get-ZAEvent.ps1 new file mode 100644 index 0000000..beb9ca9 --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZAEvent.ps1 @@ -0,0 +1,39 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZAEvent { + [cmdletbinding()] + param( + [Parameter( + HelpMessage = "The ZORG identifier by which to filter the user's events. If the ZORG identifier is omitted, events is retrieved." + )] + [ValidateNotNullOrEmpty()] + [string]$zOrgIdentifier, + [Parameter( + HelpMessage = "The event category (events/alertsHistory). Default displays the list of all." + )] + [ValidateSet("events", "alertsHistory")] + [string]$category, + [Parameter( + HelpMessage = "The maximum number of events to return." + )] + [ValidateRange(1, 1000000)] + [int]$limitTo, + [Parameter( + HelpMessage = "The earliest timestamp of an event to return, in RFC 3339 standard ('1970-01-01T00:00:00Z'). Default is one year ago." + )] + [ValidateNotNullOrEmpty()] + [string]$startDate, + [Parameter( + HelpMessage = "The latest timestamp of an event to return, in RFC 3339 standard ('1970-01-01T00:00:00Z'). Default is the present time." + )] + [ValidateNotNullOrEmpty()] + [string]$endDate + ) + $uri = "monitoring/events" + + if ( $PSBoundParameters.Keys.Count -gt 0 ) { + $filterString = Get-ZertoApiFilter -filterTable $PSBoundParameters + $uri = "{0}{1}" -f $uri, $filterString + } + + Invoke-ZARestRequest -uri $uri +} diff --git a/docs/Get-ZAEvent.md b/docs/Get-ZAEvent.md new file mode 100644 index 0000000..dbfa390 --- /dev/null +++ b/docs/Get-ZAEvent.md @@ -0,0 +1,140 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAEvent.md +schema: 2.0.0 +--- + +# Get-ZAEvent + +## SYNOPSIS + +Retrieve details of all existing events. + +## SYNTAX + +``` +Get-ZAEvent [[-zOrgIdentifier] ] [[-category] ] [[-limitTo] ] [[-startDate] ] + [[-endDate] ] [] +``` + +## DESCRIPTION + +Retrieve details of all existing events. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZAEvent +``` + +Retrieve details of all existing events. + +### Example 2 +```powershell +PS C:\> Get-ZAEvent -zOrgIdentifier "1234-5678-9012" +``` + +Retrieve details of all existing events for zOrg with Identifier "1234-5678-9012" + +### Example 3 +```powershell +PS C:\> Get-ZAEvent -category events -startDate "2019-03-01" -endDate "2019-04-01" -limitTo 400 +``` + +Retrieve details of all events between March 1st and April 1st and limit results to 400. + +## PARAMETERS + +### -category +The event category (events/alertsHistory). +Default displays the list of all. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -endDate +The latest timestamp of an event to return, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +Default is the present time. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 5 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -limitTo +The maximum number of events to return. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: 3 +Default value: 0 +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -startDate +The earliest timestamp of an event to return, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +Default is one year ago. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 4 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -zOrgIdentifier +The ZORG identifier by which to filter the user's events. +If the ZORG identifier is omitted, events is retrieved. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +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 Events](https://docs.api.zerto.com/#/Monitoring/get_v2_monitoring_events) From 0e148bdb1b2314d1bd64ce6b4f6a503d94f97411 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 6 Jun 2019 13:59:13 -0400 Subject: [PATCH 050/108] Create Get-ZATask files and content --- Tests/Public/Get-ZATask.Tests.ps1 | 19 +++++ ZertoApiWrapper/Public/Get-ZATask.ps1 | 39 +++++++++ docs/Get-ZATask.md | 112 ++++++++++++++++++++++++++ 3 files changed, 170 insertions(+) create mode 100644 Tests/Public/Get-ZATask.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZATask.ps1 create mode 100644 docs/Get-ZATask.md diff --git a/Tests/Public/Get-ZATask.Tests.ps1 b/Tests/Public/Get-ZATask.Tests.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZATask.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-ZATask.ps1 b/ZertoApiWrapper/Public/Get-ZATask.ps1 new file mode 100644 index 0000000..2f1bce5 --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZATask.ps1 @@ -0,0 +1,39 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZATask { + [cmdletbinding( DefaultParameterSetName = "zOrg")] + param( + [Parameter( + HelpMessage = "The ZORG identifier by which to filter the task list. If the ZORG identifier is omitted, a list of all the tasks is retrieved.", + ParameterSetName = "zOrg" + )] + [ValidateNotNullOrEmpty()] + [string]$zOrgIdentifier, + [Parameter( + HelpMessage = "The maximum number of tasks to return.", + ParameterSetName = "zOrg" + )] + [ValidateRange(1, 1000000)] + [int]$limitTo, + [Parameter( + HelpMessage = "The task Idnetifier", + ParameterSetName = "taskId", + Mandatory = $true + )] + [ValidateNotNullOrEmpty()] + [string]$taskIdentifier + ) + $uri = "monitoring/tasks" + switch ($PSCmdlet.ParameterSetName) { + zOrg { + if ( $PSBoundParameters.Keys.Count -gt 0 ) { + $filterString = Get-ZertoApiFilter -filterTable $PSBoundParameters + $uri = "{0}{1}" -f $uri, $filterString + } + } + + taskId { + $uri = "{0}/{1}" -f $uri, $taskIdentifier + } + } + Invoke-ZARestRequest -uri $uri +} diff --git a/docs/Get-ZATask.md b/docs/Get-ZATask.md new file mode 100644 index 0000000..bb5f3bf --- /dev/null +++ b/docs/Get-ZATask.md @@ -0,0 +1,112 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZATask.md +schema: 2.0.0 +--- + +# Get-ZATask + +## SYNOPSIS + +Retrieve details of all existing tasks. + +## SYNTAX + +### zOrg (Default) +``` +Get-ZATask [-zOrgIdentifier ] [-limitTo ] [] +``` + +### taskId +``` +Get-ZATask -taskIdentifier [] +``` + +## DESCRIPTION + +Retrieve details of all existing tasks. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZATask +``` + +Retrieve details of all existing tasks. + +### Example 2 +```powershell +PS C:\> Get-ZATask -zOrgIdentifier "1234-5678-9012" +``` + +Retrieve details of all existing tasks for zOrg with Identifier "1234-5678-9012". + +### Example 1 +```powershell +PS C:\> Get-ZATask -taskIdentifier "9012-3456-7890" +``` + +Retrieve details of a specific task with identifier "9012-3456-7890". + +## PARAMETERS + +### -limitTo +The maximum number of tasks to return. + +```yaml +Type: Int32 +Parameter Sets: zOrg +Aliases: + +Required: False +Position: Named +Default value: 0 +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -taskIdentifier +The task Idnetifier + +```yaml +Type: String +Parameter Sets: taskId +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -zOrgIdentifier +The ZORG identifier by which to filter the task list. +If the ZORG identifier is omitted, a list of all the tasks is retrieved. + +```yaml +Type: String +Parameter Sets: zOrg +Aliases: + +Required: False +Position: Named +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 Tasks](https://docs.api.zerto.com/#/Monitoring/get_v2_monitoring_tasks) From c88d175fd0da6e359c2ecdab22fd9f01d5b78021 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 6 Jun 2019 13:59:41 -0400 Subject: [PATCH 051/108] Correct Help Message Typo --- ZertoApiWrapper/Public/Get-ZAAlert.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ZertoApiWrapper/Public/Get-ZAAlert.ps1 b/ZertoApiWrapper/Public/Get-ZAAlert.ps1 index af0c80e..1026895 100644 --- a/ZertoApiWrapper/Public/Get-ZAAlert.ps1 +++ b/ZertoApiWrapper/Public/Get-ZAAlert.ps1 @@ -15,7 +15,7 @@ function Get-ZAAlert { [ValidateRange(1, 1000000)] [int]$limitTo, [Parameter( - HelpMessage = "The VPG Idnetifier", + HelpMessage = "The alert Idnetifier", ParameterSetName = "alertId", Mandatory = $true )] From 1f03feb1c68b909269b3b3b5e584dee6d86c27b8 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 6 Jun 2019 14:29:22 -0400 Subject: [PATCH 052/108] Create Get-ZADatastore function & supporting docs --- Tests/Public/Get-ZADatastore.Tests.ps1 | 19 ++++ ZertoApiWrapper/Public/Get-ZADatastore.ps1 | 37 +++++++ docs/Get-ZADatastore.md | 123 +++++++++++++++++++++ 3 files changed, 179 insertions(+) create mode 100644 Tests/Public/Get-ZADatastore.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZADatastore.ps1 create mode 100644 docs/Get-ZADatastore.md diff --git a/Tests/Public/Get-ZADatastore.Tests.ps1 b/Tests/Public/Get-ZADatastore.Tests.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZADatastore.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-ZADatastore.ps1 b/ZertoApiWrapper/Public/Get-ZADatastore.ps1 new file mode 100644 index 0000000..64bb34f --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZADatastore.ps1 @@ -0,0 +1,37 @@ +function Get-ZADatastore { + [CmdletBinding(DefaultParameterSetName = "AllInfo")] + param ( + [Parameter( + HelpMessage = "The site identifier. The site identifier is mandatory. Omit the datastore and datastore cluster identifiers to view site level storage information.", + Mandatory = $true, + ParameterSetName = "AllInfo" + )] + [Parameter( + Mandatory = $true, + ParameterSetName = "cluster" + )] + [Parameter( + Mandatory = $true, + ParameterSetName = "datastore" + )] + [ValidateNotNullOrEmpty()] + [string]$siteIdentifier, + [Parameter( + HelpMessage = "The datastore cluster identifier. Gets a list of datastores in the cluster.", + ParameterSetName = "cluster", + Mandatory = "true" + )] + [ValidateNotNullOrEmpty()] + [string]$clusterIdentifier, + [Parameter( + HelpMessage = "The datastore identifer. Gets the datastore info.", + ParameterSetName = "datastore", + Mandatory = $true + )] + [string]$datastoreIdentifier + + ) + $filter = Get-ZertoApiFilter -filterTable $PSBoundParameters + $uri = "monitoring/datastores{0}" -f $filter + Invoke-ZARestRequest -uri $uri +} diff --git a/docs/Get-ZADatastore.md b/docs/Get-ZADatastore.md new file mode 100644 index 0000000..b44e4f4 --- /dev/null +++ b/docs/Get-ZADatastore.md @@ -0,0 +1,123 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZATask.md +schema: 2.0.0 +--- + +# Get-ZADatastore + +## SYNOPSIS + +Get a list of datastore/s, filtered by site. Enter a site identifier only to get the list of all datastores. Enter a site identifier and cluster identifier to get a list of datastores in the cluster. Enter a site identifier and datastore identifier to get specific datastore info. + +## SYNTAX + +### AllInfo (Default) +``` +Get-ZADatastore -siteIdentifier [] +``` + +### datastore +``` +Get-ZADatastore -siteIdentifier -datastoreIdentifier [] +``` + +### cluster +``` +Get-ZADatastore -siteIdentifier -clusterIdentifier [] +``` + +## DESCRIPTION + +Get a list of datastore/s, filtered by site. Enter a site identifier only to get the list of all datastores. Enter a site identifier and cluster identifier to get a list of datastores in the cluster. Enter a site identifier and datastore identifier to get specific datastore info. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZADatastore -siteIdentifier "7890-1234-5678" +``` + +Returns all datastore clusters and datastores associated with site identifier "7890-1234-5678" + +### Example 2 +```powershell +PS C:\> Get-ZADatastore -siteIdentifier "7890-1234-5678" -clusterIdentifier "3456-7890-1234" +``` + +Returns datastore cluster information with identifier "3456-7890-1234" associated with site identifier "7890-1234-5678" + +### Example 3 +```powershell +PS C:\> Get-ZADatastore -siteIdentifier "7890-1234-5678" -datastoreIdentifier "5678-9012-3456" +``` + +Returns all datastore information with identifier "5678-9012-3456" associated with site identifier "7890-1234-5678" + +## PARAMETERS + +### -clusterIdentifier +The datastore cluster identifier. +Gets a list of datastores in the cluster. + +```yaml +Type: String +Parameter Sets: cluster +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -datastoreIdentifier +The datastore identifer. +Gets the datastore info. + +```yaml +Type: String +Parameter Sets: datastore +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -siteIdentifier +The site identifier. +The site identifier is mandatory. +Omit the datastore and datastore cluster identifiers to view site level storage information. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +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 + +### None + +## OUTPUTS + +### System.Object +## NOTES + +## RELATED LINKS + +[Zerto Analytics REST API Endpoint for Datastores](https://docs.api.zerto.com/#/Monitoring/get_v2_monitoring_datastores) From c83eb2d8a71557c85e5d26c807e5f446c391e145 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sat, 8 Jun 2019 16:08:25 -0400 Subject: [PATCH 053/108] Create Get-ZAVolume and required files --- Tests/Public/Get-ZAVolume.Tests.ps1 | 19 ++++ ZertoApiWrapper/Public/Get-ZAVolume.ps1 | 43 ++++++++ docs/Get-ZAVolume.md | 137 ++++++++++++++++++++++++ 3 files changed, 199 insertions(+) create mode 100644 Tests/Public/Get-ZAVolume.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZAVolume.ps1 create mode 100644 docs/Get-ZAVolume.md diff --git a/Tests/Public/Get-ZAVolume.Tests.ps1 b/Tests/Public/Get-ZAVolume.Tests.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZAVolume.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-ZAVolume.ps1 b/ZertoApiWrapper/Public/Get-ZAVolume.ps1 new file mode 100644 index 0000000..554f2ad --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZAVolume.ps1 @@ -0,0 +1,43 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZAVolume { + [CmdletBinding(DefaultParameterSetName = "VpgIdentifier")] + param ( + [Parameter( + HelpMessage = "The site identifier. The site identifier is mandatory if vpgIdentifier is not entered.", + Mandatory, + ParameterSetName = "SiteAndClusterIdentifier" + )] + [Parameter( + HelpMessage = "The site identifier. The site identifier is mandatory if vpgIdentifier is not entered.", + Mandatory, + ParameterSetName = "SiteAndDatastoreIdentifier" + )] + [ValidateNotNullOrEmpty()] + [string]$siteIdentifier, + [Parameter( + HelpMessage = "The cluster identifier. If a cluster identifier is not entered, you must enter a datastore identifier.", + Mandatory, + ParameterSetName = "SiteAndClusterIdentifier" + )] + [ValidateNotNullOrEmpty()] + [string]$clusterIdentifier, + [Parameter( + HelpMessage = "The datastore identifer. If a datastore identifier is not entered, you must enter a cluster identifier.", + Mandatory, + ParameterSetName = "SiteAndDatastoreIdentifier" + )] + [ValidateNotNullOrEmpty()] + [string]$datastoreIdentifier, + [Parameter( + HelpMessage = "The vpg identifer.", + Mandatory, + ParameterSetName = "VpgIdentifier" + )] + [string]$vpgIdentifier + + ) + + $filter = Get-ZertoApiFilter -FilterTable $PSBoundParameters + $uri = "monitoring/volumes{0}" -f $filter + Invoke-ZARestRequest -uri $uri +} diff --git a/docs/Get-ZAVolume.md b/docs/Get-ZAVolume.md new file mode 100644 index 0000000..0b56f41 --- /dev/null +++ b/docs/Get-ZAVolume.md @@ -0,0 +1,137 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAVolume.md +schema: 2.0.0 +--- + +# Get-ZAVolume + +## SYNOPSIS + +Retrieves account volumes by datastore. Enter a site identifier and cluster identifier to get the list of volumes that exist in the datastore cluster. Or, enter a site identifier and datastore identifier to get the list of volumes that exist in the datastore. To retrieve all volumes for a specific VPG, enter a VPG identifier only. + +## SYNTAX + +### VpgIdentifier (Default) +``` +Get-ZAVolume -vpgIdentifier [] +``` + +### SiteAndDatastoreIdentifier +``` +Get-ZAVolume -siteIdentifier -datastoreIdentifier [] +``` + +### SiteAndClusterIdentifier +``` +Get-ZAVolume -siteIdentifier -clusterIdentifier [] +``` + +## DESCRIPTION + +Retrieves account volumes by datastore. Enter a site identifier and cluster identifier to get the list of volumes that exist in the datastore cluster. Or, enter a site identifier and datastore identifier to get the list of volumes that exist in the datastore. To retrieve all volumes for a specific VPG, enter a VPG identifier only. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZAVolume -vpgIdentifier "2345-6789-0123" +``` + +Returns all volume information for all VMs in VPG with Identifier "2345-6789-0123" + +### Example 2 +```powershell +PS C:\> Get-ZAVolume -siteIdentifier "3456-7890-1234" -clusterIdentifier "0123-4567-8901" +``` + +Returns all volume information for all volumes in Site with Identifier "3456-7890-1234" on Datastore Cluster with Identifier "0123-4567-8901" + +### Example 3 +```powershell +PS C:\> Get-ZAVolume -siteIdentifier "3456-7890-1234" -datastoreIdentifier "5678-9012-3456" +``` + +Returns all volume information for all volumes in Site with Identifier "3456-7890-1234" on Datastore with Identifier "5678-9012-3456" + +## PARAMETERS + +### -clusterIdentifier +The cluster identifier. +If a cluster identifier is not entered, you must enter a datastore identifier. + +```yaml +Type: String +Parameter Sets: SiteAndClusterIdentifier +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -datastoreIdentifier +The datastore identifer. +If a datastore identifier is not entered, you must enter a cluster identifier. + +```yaml +Type: String +Parameter Sets: SiteAndDatastoreIdentifier +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -siteIdentifier +The site identifier. +The site identifier is mandatory if vpgIdentifier is not entered. + +```yaml +Type: String +Parameter Sets: SiteAndDatastoreIdentifier, SiteAndClusterIdentifier +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -vpgIdentifier +The vpg identifer. + +```yaml +Type: String +Parameter Sets: VpgIdentifier +Aliases: + +Required: True +Position: Named +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 + +### None + +## OUTPUTS + +### System.Object +## NOTES + +## RELATED LINKS + +[Zerto Analytics REST API Endpoint for Volumes](https://docs.api.zerto.com/#/Monitoring/get_v2_monitoring_volumes) From 35b03a963f0daf2b619ca637afb1fa96ff52a15d Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sat, 8 Jun 2019 16:08:57 -0400 Subject: [PATCH 054/108] Update Help File --- docs/Invoke-ZertoFailoverCommit.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Invoke-ZertoFailoverCommit.md b/docs/Invoke-ZertoFailoverCommit.md index b9d302f..f7876b3 100644 --- a/docs/Invoke-ZertoFailoverCommit.md +++ b/docs/Invoke-ZertoFailoverCommit.md @@ -98,7 +98,7 @@ 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). +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 From f0fb1d4fc6bf38703785660d142065c9b52dcdf7 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sat, 8 Jun 2019 16:09:10 -0400 Subject: [PATCH 055/108] Add required External Help Line --- ZertoApiWrapper/Public/Get-ZADatastore.ps1 | 1 + 1 file changed, 1 insertion(+) diff --git a/ZertoApiWrapper/Public/Get-ZADatastore.ps1 b/ZertoApiWrapper/Public/Get-ZADatastore.ps1 index 64bb34f..8f12ddb 100644 --- a/ZertoApiWrapper/Public/Get-ZADatastore.ps1 +++ b/ZertoApiWrapper/Public/Get-ZADatastore.ps1 @@ -1,3 +1,4 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> function Get-ZADatastore { [CmdletBinding(DefaultParameterSetName = "AllInfo")] param ( From 358d680c72d935d839ecf2e4f43708eb5d130c87 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sat, 8 Jun 2019 16:11:04 -0400 Subject: [PATCH 056/108] Remove AlertAggregation Remove AlertAggregation, Will add aggregation into Alert down the road. --- Tests/Public/Get-ZAAlertAggregation.Tests.ps1 | 19 ------------------ .../Public/Get-ZAAlertAggregation.ps1 | 20 ------------------- 2 files changed, 39 deletions(-) delete mode 100644 Tests/Public/Get-ZAAlertAggregation.Tests.ps1 delete mode 100644 ZertoApiWrapper/Public/Get-ZAAlertAggregation.ps1 diff --git a/Tests/Public/Get-ZAAlertAggregation.Tests.ps1 b/Tests/Public/Get-ZAAlertAggregation.Tests.ps1 deleted file mode 100644 index f5816b6..0000000 --- a/Tests/Public/Get-ZAAlertAggregation.Tests.ps1 +++ /dev/null @@ -1,19 +0,0 @@ -#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-ZAAlertAggregation.ps1 b/ZertoApiWrapper/Public/Get-ZAAlertAggregation.ps1 deleted file mode 100644 index 7b82559..0000000 --- a/ZertoApiWrapper/Public/Get-ZAAlertAggregation.ps1 +++ /dev/null @@ -1,20 +0,0 @@ -<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> -function Get-ZAAlertAggeration { - [cmdletbinding()] - param( - [Parameter( - HelpMessage = "The ZORG identifier by which to filter the alert count. If the ZORG identifier is omitted, retrieves all alerts sorted by entity and by type." - )] - [ValidateNotNullOrEmpty()] - [string]$zOrgIdentifier - ) - $uri = "monitoring/alerts" - if ( -not [String]::IsNullorEmpty($zOrgIdentifier) ) { - $filterTable = @{"zOrgIdentifier" = $zOrgIdentifier } - $filterString = Get-ZertoApiFilter -filterTable $filterTable - $uri = "{0}{1}&format=aggregations" -f $uri, $filterString - } else { - $uri = "{0}?format=aggregations" -f $uri - } - Invoke-ZARestRequest -uri $uri -} From f7fff2248e22b9ce3849712f78518cd0f4cbf7b5 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 9 Jun 2019 08:56:04 -0400 Subject: [PATCH 057/108] Create Get-ZARPOSummary and Docs --- Tests/Public/Get-ZARPOSummary.Tests.ps1 | 19 ++++ ZertoApiWrapper/Public/Get-ZARPOSummary.ps1 | 26 +++++ docs/Get-ZARPOSummary.md | 107 ++++++++++++++++++++ 3 files changed, 152 insertions(+) create mode 100644 Tests/Public/Get-ZARPOSummary.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZARPOSummary.ps1 create mode 100644 docs/Get-ZARPOSummary.md diff --git a/Tests/Public/Get-ZARPOSummary.Tests.ps1 b/Tests/Public/Get-ZARPOSummary.Tests.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZARPOSummary.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-ZARPOSummary.ps1 b/ZertoApiWrapper/Public/Get-ZARPOSummary.ps1 new file mode 100644 index 0000000..58f3a61 --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZARPOSummary.ps1 @@ -0,0 +1,26 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZARPOSummary { + [CmdletBinding()] + param ( + [Parameter( + HelpMessage = "The identifier of the VPG.", + Mandatory + )] + [ValidateNotNullOrEmpty()] + [string]$vpgIdentifier, + [Parameter( + HelpMessage = "The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). If only the end date is added, the start date by default will be the end date minus 7 days." + )] + [ValidateNotNullOrEmpty()] + [string]$startDate, + [Parameter( + HelpMessage = "The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). The default is the current time." + )] + [ValidateNotNullOrEmpty()] + [string]$endDate + ) + + $filter = Get-ZertoApiFilter -FilterTable $PSBoundParameters + $uri = "reports/rpo-summary{0}" -f $filter + Invoke-ZARestRequest -uri $uri +} diff --git a/docs/Get-ZARPOSummary.md b/docs/Get-ZARPOSummary.md new file mode 100644 index 0000000..bfeeb10 --- /dev/null +++ b/docs/Get-ZARPOSummary.md @@ -0,0 +1,107 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAMonitoring.md +schema: 2.0.0 +--- + +# Get-ZARPOSummary + +## SYNOPSIS + +Retrieves RPO historical statistics for a given VPG. + +## SYNTAX + +``` +Get-ZARPOSummary [-vpgIdentifier] [[-startDate] ] [[-endDate] ] [] +``` + +## DESCRIPTION + +Retrieves RPO historical statistics for a given VPG. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZARPOSummary -vpgIdentifier "3456-7890-1234" +``` + +Gets the RPO Summary for the VPG with identifier "3456-7890-1234" for the past 7 days. + +### Example 2 +```powershell +PS C:\> Get-ZARPOSummary -vpgIdentifier "3456-7890-1234" -startDate "2019-01-01T00:00:00" +``` + +Gets the RPO Summary for the VPG with identifier "3456-7890-1234" starting January 1st, 2019 till the date this command is run. + +### Example 3 +```powershell +PS C:\> Get-ZARPOSummary -vpgIdentifier "3456-7890-1234" -startDate "2019-01-01T00:00:00" -endDate "2019-02-01T00:00:00" +``` + +Gets the RPO Summary for the VPG with identifier "3456-7890-1234" for the Month of January. + +## PARAMETERS + +### -endDate +The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +The default 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 +The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If only the end date is added, the start date by default will be the end date minus 7 days. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -vpgIdentifier +The identifier of the VPG. + +```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 RPO Summary](https://docs.api.zerto.com/#/RPO_Reports/get_v2_reports_rpo_summary) From 9262f1b42de7defea421d6d3631699804075a82b Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 9 Jun 2019 09:50:35 -0400 Subject: [PATCH 058/108] Create Get-ZARPOStat and required docs --- Tests/Public/Get-ZARPOStat.ps1 | 19 +++++ ZertoApiWrapper/Public/Get-ZARPOStat.ps1 | 26 ++++++ docs/Get-ZARPOStat.md | 104 +++++++++++++++++++++++ 3 files changed, 149 insertions(+) create mode 100644 Tests/Public/Get-ZARPOStat.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZARPOStat.ps1 create mode 100644 docs/Get-ZARPOStat.md diff --git a/Tests/Public/Get-ZARPOStat.ps1 b/Tests/Public/Get-ZARPOStat.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZARPOStat.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-ZARPOStat.ps1 b/ZertoApiWrapper/Public/Get-ZARPOStat.ps1 new file mode 100644 index 0000000..14f9a29 --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZARPOStat.ps1 @@ -0,0 +1,26 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZARPOStat { + [CmdletBinding()] + param ( + [Parameter( + HelpMessage = "The identifier of the VPG.", + Mandatory + )] + [ValidateNotNullOrEmpty()] + [string]$vpgIdentifier, + [Parameter( + HelpMessage = "The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). If only the end date is added, the start date by default will be the end date minus 7 days." + )] + [ValidateNotNullOrEmpty()] + [string]$startDate, + [Parameter( + HelpMessage = "The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). The default is the current time." + )] + [ValidateNotNullOrEmpty()] + [string]$endDate + ) + + $filter = Get-ZertoApiFilter -FilterTable $PSBoundParameters + $uri = "reports/stats-rpo{0}" -f $filter + Invoke-ZARestRequest -uri $uri +} diff --git a/docs/Get-ZARPOStat.md b/docs/Get-ZARPOStat.md new file mode 100644 index 0000000..e3f9a91 --- /dev/null +++ b/docs/Get-ZARPOStat.md @@ -0,0 +1,104 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZARPOStat.md +schema: 2.0.0 +--- + +# Get-ZARPOStat + +## SYNOPSIS + +## SYNTAX + +``` +Get-ZARPOStat [-vpgIdentifier] [[-startDate] ] [[-endDate] ] [] +``` + +## DESCRIPTION +{{ Fill in the Description }} + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZARPOStat -vpgIdentifier "3456-7890-1234" +``` + +Gets the RPO Stats for the VPG with identifier "3456-7890-1234" for the past 7 days. + +### Example 2 +```powershell +PS C:\> Get-ZARPOStat -vpgIdentifier "3456-7890-1234" -startDate "2019-01-01T00:00:00" +``` + +Gets the RPO Stats for the VPG with identifier "3456-7890-1234" starting January 1st, 2019 till the date this command is run. + +### Example 3 +```powershell +PS C:\> Get-ZARPOStat -vpgIdentifier "3456-7890-1234" -startDate "2019-01-01T00:00:00" -endDate "2019-02-01T00:00:00" +``` + +Gets the RPO Stats for the VPG with identifier "3456-7890-1234" for the Month of January. + +## PARAMETERS + +### -endDate +The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +The default 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 +The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If only the end date is added, the start date by default will be the end date minus 7 days. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -vpgIdentifier +The identifier of the VPG. + +```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 RPO Stats](https://docs.api.zerto.com/#/RPO_Reports/get_v2_reports_stats_rpo) From 1c9a5bb6cb993b853b16d653ec186d0022177a16 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 9 Jun 2019 09:59:05 -0400 Subject: [PATCH 059/108] Fix Get-ZARPOStat issues with tests and docs --- Tests/Public/{Get-ZARPOStat.ps1 => Get-ZARPOStat.Tests.ps1} | 0 docs/Get-ZARPOStat.md | 5 ++++- 2 files changed, 4 insertions(+), 1 deletion(-) rename Tests/Public/{Get-ZARPOStat.ps1 => Get-ZARPOStat.Tests.ps1} (100%) diff --git a/Tests/Public/Get-ZARPOStat.ps1 b/Tests/Public/Get-ZARPOStat.Tests.ps1 similarity index 100% rename from Tests/Public/Get-ZARPOStat.ps1 rename to Tests/Public/Get-ZARPOStat.Tests.ps1 diff --git a/docs/Get-ZARPOStat.md b/docs/Get-ZARPOStat.md index e3f9a91..414c814 100644 --- a/docs/Get-ZARPOStat.md +++ b/docs/Get-ZARPOStat.md @@ -9,6 +9,8 @@ schema: 2.0.0 ## SYNOPSIS +Retrieves Rpo min, max and avg. Stats. + ## SYNTAX ``` @@ -16,7 +18,8 @@ Get-ZARPOStat [-vpgIdentifier] [[-startDate] ] [[-endDate] Date: Sun, 9 Jun 2019 10:02:50 -0400 Subject: [PATCH 060/108] Create Get-ZARPOBreach and required docs. --- Tests/Public/Get-ZARPOBreach.Tests.ps1 | 19 ++++ ZertoApiWrapper/Public/Get-ZARPOBreach.ps1 | 26 +++++ docs/Get-ZARPOBreach.md | 107 +++++++++++++++++++++ 3 files changed, 152 insertions(+) create mode 100644 Tests/Public/Get-ZARPOBreach.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZARPOBreach.ps1 create mode 100644 docs/Get-ZARPOBreach.md diff --git a/Tests/Public/Get-ZARPOBreach.Tests.ps1 b/Tests/Public/Get-ZARPOBreach.Tests.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZARPOBreach.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-ZARPOBreach.ps1 b/ZertoApiWrapper/Public/Get-ZARPOBreach.ps1 new file mode 100644 index 0000000..3030cca --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZARPOBreach.ps1 @@ -0,0 +1,26 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZARPOBreach { + [CmdletBinding()] + param ( + [Parameter( + HelpMessage = "The identifier of the VPG.", + Mandatory + )] + [ValidateNotNullOrEmpty()] + [string]$vpgIdentifier, + [Parameter( + HelpMessage = "The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). If only the end date is added, the start date by default will be the end date minus 7 days." + )] + [ValidateNotNullOrEmpty()] + [string]$startDate, + [Parameter( + HelpMessage = "The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). The default is the current time." + )] + [ValidateNotNullOrEmpty()] + [string]$endDate + ) + + $filter = Get-ZertoApiFilter -FilterTable $PSBoundParameters + $uri = "reports/rpo-breach{0}" -f $filter + Invoke-ZARestRequest -uri $uri +} diff --git a/docs/Get-ZARPOBreach.md b/docs/Get-ZARPOBreach.md new file mode 100644 index 0000000..5e4ceb7 --- /dev/null +++ b/docs/Get-ZARPOBreach.md @@ -0,0 +1,107 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZARPOBreach.md +schema: 2.0.0 +--- + +# Get-ZARPOBreach + +## SYNOPSIS + +Retrieves RPO breaches over the selected timeframe. + +## SYNTAX + +``` +Get-ZARPOBreach [-vpgIdentifier] [[-startDate] ] [[-endDate] ] [] +``` + +## DESCRIPTION + +Retrieves RPO breaches over the selected timeframe. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZARPOBreach -vpgIdentifier "3456-7890-1234" +``` + +Gets the RPO Breaches for the VPG with identifier "3456-7890-1234" for the past 7 days. + +### Example 2 +```powershell +PS C:\> Get-ZARPOBreach -vpgIdentifier "3456-7890-1234" -startDate "2019-01-01T00:00:00" +``` + +Gets the RPO Breaches for the VPG with identifier "3456-7890-1234" starting January 1st, 2019 till the date this command is run. + +### Example 3 +```powershell +PS C:\> Get-ZARPOBreach -vpgIdentifier "3456-7890-1234" -startDate "2019-01-01T00:00:00" -endDate "2019-02-01T00:00:00" +``` + +Gets the RPO Breaches for the VPG with identifier "3456-7890-1234" for the Month of January. + +## PARAMETERS + +### -endDate +The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +The default 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 +The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If only the end date is added, the start date by default will be the end date minus 7 days. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -vpgIdentifier +The identifier of the VPG. + +```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 RPO Breach](https://docs.api.zerto.com/#/RPO_Reports/get_v2_reports_rpo_breach) From 675c43b35e1e001836eabb66405bda05e74c2d6d Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 9 Jun 2019 10:12:00 -0400 Subject: [PATCH 061/108] Create Get-ZARPOStatusProportion and Docs --- .../Get-ZARPOStatusProportion.Tests.ps1 | 19 +++ .../Public/Get-ZARPOStatusProportion.ps1 | 26 +++++ docs/Get-ZARPOStatusProportion.md | 108 ++++++++++++++++++ 3 files changed, 153 insertions(+) create mode 100644 Tests/Public/Get-ZARPOStatusProportion.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZARPOStatusProportion.ps1 create mode 100644 docs/Get-ZARPOStatusProportion.md diff --git a/Tests/Public/Get-ZARPOStatusProportion.Tests.ps1 b/Tests/Public/Get-ZARPOStatusProportion.Tests.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZARPOStatusProportion.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-ZARPOStatusProportion.ps1 b/ZertoApiWrapper/Public/Get-ZARPOStatusProportion.ps1 new file mode 100644 index 0000000..493d7f7 --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZARPOStatusProportion.ps1 @@ -0,0 +1,26 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZARPOStatusProportion { + [CmdletBinding()] + param ( + [Parameter( + HelpMessage = "The identifier of the VPG.", + Mandatory + )] + [ValidateNotNullOrEmpty()] + [string]$vpgIdentifier, + [Parameter( + HelpMessage = "The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). If only the end date is added, the start date by default will be the end date minus 7 days." + )] + [ValidateNotNullOrEmpty()] + [string]$startDate, + [Parameter( + HelpMessage = "The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). The default is the current time." + )] + [ValidateNotNullOrEmpty()] + [string]$endDate + ) + + $filter = Get-ZertoApiFilter -FilterTable $PSBoundParameters + $uri = "reports/rpo-statuses-proportions{0}" -f $filter + Invoke-ZARestRequest -uri $uri +} diff --git a/docs/Get-ZARPOStatusProportion.md b/docs/Get-ZARPOStatusProportion.md new file mode 100644 index 0000000..3ad8d16 --- /dev/null +++ b/docs/Get-ZARPOStatusProportion.md @@ -0,0 +1,108 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZARPOStatusProportion.md +schema: 2.0.0 +--- + +# Get-ZARPOStatusProportion + +## SYNOPSIS + +Retrieves RPO SLA status distribution over the selected timeframe. + +## SYNTAX + +``` +Get-ZARPOStatusProportion [-vpgIdentifier] [[-startDate] ] [[-endDate] ] + [] +``` + +## DESCRIPTION + +Retrieves RPO SLA status distribution over the selected timeframe. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZARPOStatusProportion -vpgIdentifier "3456-7890-1234" +``` + +Gets the RPO Breaches for the VPG with identifier "3456-7890-1234" for the past 7 days. + +### Example 2 +```powershell +PS C:\> Get-ZARPOStatusProportion -vpgIdentifier "3456-7890-1234" -startDate "2019-01-01T00:00:00" +``` + +Gets the RPO Breaches for the VPG with identifier "3456-7890-1234" starting January 1st, 2019 till the date this command is run. + +### Example 3 +```powershell +PS C:\> Get-ZARPOStatusProportion -vpgIdentifier "3456-7890-1234" -startDate "2019-01-01T00:00:00" -endDate "2019-02-01T00:00:00" +``` + +Gets the RPO Breaches for the VPG with identifier "3456-7890-1234" for the Month of January. + +## PARAMETERS + +### -endDate +The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +The default 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 +The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If only the end date is added, the start date by default will be the end date minus 7 days. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -vpgIdentifier +The identifier of the VPG. + +```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 RPO Statuses Proportions](https://docs.api.zerto.com/#/RPO_Reports/get_v2_reports_rpo_statuses_proportions) From f3d07003b4afb3a924d69ee977126e24ae1763c6 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 9 Jun 2019 11:17:07 -0400 Subject: [PATCH 062/108] Create Get-ZARPOAccountAverage and Docs --- .../Public/Get-ZARPOAccountAverage.Tests.ps1 | 19 +++ .../Public/Get-ZARPOAccountAverage.ps1 | 25 ++++ docs/Get-ZARPOAccountAverage.md | 109 ++++++++++++++++++ 3 files changed, 153 insertions(+) create mode 100644 Tests/Public/Get-ZARPOAccountAverage.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZARPOAccountAverage.ps1 create mode 100644 docs/Get-ZARPOAccountAverage.md diff --git a/Tests/Public/Get-ZARPOAccountAverage.Tests.ps1 b/Tests/Public/Get-ZARPOAccountAverage.Tests.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZARPOAccountAverage.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-ZARPOAccountAverage.ps1 b/ZertoApiWrapper/Public/Get-ZARPOAccountAverage.ps1 new file mode 100644 index 0000000..d9149fc --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZARPOAccountAverage.ps1 @@ -0,0 +1,25 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZARPOAccountAverage { + [CmdletBinding()] + param ( + [Parameter( + Helpmessage = "The ZORG identifier by which to filter the user's average RPO for a single account. If the ZORG identifier is omitted, statistics related to all sites, for a single account, is retrieved." + )] + [ValidateNotNullOrEmpty()] + [string]$zOrgIdentifier, + [Parameter( + HelpMessage = "The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). If only the end date is added, the start date by default will be the end date minus 7 days." + )] + [ValidateNotNullOrEmpty()] + [string]$startDate, + [Parameter( + HelpMessage = "The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). The default is the current time." + )] + [ValidateNotNullOrEmpty()] + [string]$endDate + ) + + $filter = Get-ZertoApiFilter -FilterTable $PSBoundParameters + $uri = "reports/account-rpo-average{0}" -f $filter + Invoke-ZARestRequest -uri $uri +} diff --git a/docs/Get-ZARPOAccountAverage.md b/docs/Get-ZARPOAccountAverage.md new file mode 100644 index 0000000..d5eded0 --- /dev/null +++ b/docs/Get-ZARPOAccountAverage.md @@ -0,0 +1,109 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/Master/docs/Get-ZARPOAccountAverage.md +schema: 2.0.0 +--- + +# Get-ZARPOAccountAverage + +## SYNOPSIS + +Get average RPO for all VPGs in a single account, filtered by last 30 days. + +## SYNTAX + +``` +Get-RPOAccountAverage [[-zOrgIdentifier] ] [[-startDate] ] [[-endDate] ] + [] +``` + +## DESCRIPTION + +Get average RPO for all VPGs in a single account, filtered by last 30 days. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZARPOAccountAverage +``` + +Get average RPO for all VPGs in a single account. + +### Example 2 +```powershell +PS C:\> Get-ZARPOAccountAverage -zOrgIdentifier "1234-5678-9012" +``` + +Get average RPO for all VPGs in zOrg with identifier "1234-5678-9012". + +### Example 3 +```powershell +PS C:\> Get-ZARPOAccountAverage -startDate "2019-06-01T00:00:00Z" -endDate "2019-06-02T00:00:00Z" +``` + +Get average RPO for all VPGs in a single account for June 6th, 2019 + +## PARAMETERS + +### -endDate +The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +The default 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 +The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If only the end date is added, the start date by default will be the end date minus 7 days. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -zOrgIdentifier +The ZORG identifier by which to filter the user's average RPO for a single account. +If the ZORG identifier is omitted, statistics related to all sites, for a single account, is retrieved. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +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 RPO Average](https://docs.api.zerto.com/#/RPO_Reports/get_v2_reports_account_rpo_average) From e80fab4eac1aedbd1a263d50c6753acba9241931 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 9 Jun 2019 11:52:21 -0400 Subject: [PATCH 063/108] Fix Function Name Typo --- docs/Get-ZARPOAccountAverage.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Get-ZARPOAccountAverage.md b/docs/Get-ZARPOAccountAverage.md index d5eded0..509bb0a 100644 --- a/docs/Get-ZARPOAccountAverage.md +++ b/docs/Get-ZARPOAccountAverage.md @@ -14,7 +14,7 @@ Get average RPO for all VPGs in a single account, filtered by last 30 days. ## SYNTAX ``` -Get-RPOAccountAverage [[-zOrgIdentifier] ] [[-startDate] ] [[-endDate] ] +Get-ZARPOAccountAverage [[-zOrgIdentifier] ] [[-startDate] ] [[-endDate] ] [] ``` From 80bad682389a400b76f87829a7ee7e40b43586a8 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 9 Jun 2019 12:02:06 -0400 Subject: [PATCH 064/108] Update Related Links description --- docs/Get-ZARPOAccountAverage.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Get-ZARPOAccountAverage.md b/docs/Get-ZARPOAccountAverage.md index 509bb0a..8461d13 100644 --- a/docs/Get-ZARPOAccountAverage.md +++ b/docs/Get-ZARPOAccountAverage.md @@ -106,4 +106,4 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## RELATED LINKS -[Zerto Analytics REST API Endpoint for RPO Average](https://docs.api.zerto.com/#/RPO_Reports/get_v2_reports_account_rpo_average) +[Zerto Analytics REST API Endpoint for Account RPO Average](https://docs.api.zerto.com/#/RPO_Reports/get_v2_reports_account_rpo_average) From 72cbe0eb29d406dd5e1ef9d767ca5634cd9b678a Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 9 Jun 2019 12:02:25 -0400 Subject: [PATCH 065/108] Create Get-ZARPOAverage and Required Docs --- Tests/Public/Get-ZARPOAverage.Tests.ps1 | 19 ++++ ZertoApiWrapper/Public/Get-ZARPOAverage.ps1 | 31 +++++ docs/Get-ZARPOAverage.md | 118 ++++++++++++++++++++ 3 files changed, 168 insertions(+) create mode 100644 Tests/Public/Get-ZARPOAverage.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZARPOAverage.ps1 create mode 100644 docs/Get-ZARPOAverage.md diff --git a/Tests/Public/Get-ZARPOAverage.Tests.ps1 b/Tests/Public/Get-ZARPOAverage.Tests.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZARPOAverage.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-ZARPOAverage.ps1 b/ZertoApiWrapper/Public/Get-ZARPOAverage.ps1 new file mode 100644 index 0000000..2114c85 --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZARPOAverage.ps1 @@ -0,0 +1,31 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZARPOAverage { + [CmdletBinding()] + param ( + [Parameter( + Helpmessage = "The identifier of the VPG.", + Mandatory + )] + [ValidateNotNullOrEmpty()] + [string]$vpgIdentifier, + [Parameter( + HelpMessage = "The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). If only the end date is added, the start date by default will be the end date minus 7 days." + )] + [ValidateNotNullOrEmpty()] + [string]$startDate, + [Parameter( + HelpMessage = "The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). The default is the current time." + )] + [ValidateNotNullOrEmpty()] + [string]$endDate, + [Parameter( + HelpMessage = "The interval selected within the duration of the report. The interval can be 1-minute data granularity for up to 6 hours’ time frame, 1-hour data granularity for 6 hours to 15 days’ time frame or 1-day data granularity for 15 days up to 30 days’ time frame. Value should be submitted in Seconds" + )] + [ValidateRange(60, 2678400)] + [Int32]$interval + ) + + $filter = Get-ZertoApiFilter -FilterTable $PSBoundParameters + $uri = "reports/rpo-average{0}" -f $filter + Invoke-ZARestRequest -uri $uri +} diff --git a/docs/Get-ZARPOAverage.md b/docs/Get-ZARPOAverage.md new file mode 100644 index 0000000..cb16613 --- /dev/null +++ b/docs/Get-ZARPOAverage.md @@ -0,0 +1,118 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/Master/docs/Get-ZARPOAverage.md +schema: 2.0.0 +--- + +# Get-ZARPOAverage + +## SYNOPSIS + +Retrieves list of average RPO values for a specific VPG, filtered by start date, end date, and optional interval. The interval defines the RPO samples interval. by default a 1 minutes interval. + +## SYNTAX + +``` +Get-ZARPOAverage [-vpgIdentifier] [[-startDate] ] [[-endDate] ] [[-interval] ] + [] +``` + +## DESCRIPTION + +Retrieves list of average RPO values for a specific VPG, filtered by start date, end date, and optional interval. The interval defines the RPO samples interval. by default a 1 minutes interval. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZARPOAverage -vpgIdentifier "5678-9012-3456" +``` + +Returns RPO Average over the past 7 days for VPG with Identifier "5678-9012-3456" + +### Example 2 +```powershell +PS C:\> Get-ZARPOAverage -vpgIdentifier "5678-9012-3456" -startDate "2019-06-01T12:00:00Z" -endDate "2019-06-01T14:00:00Z" -interval 60 +``` + +Returns RPO Average in one minute intervals for the time period between June 1st, 2019 at Noon to June 1st, 2019 at 14:00 for VPG with Identifier "5678-9012-3456" + +## PARAMETERS + +### -endDate +The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +The default 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 +``` + +### -interval +The interval selected within the duration of the report. +The interval can be 1-minute data granularity for up to 6 hours' time frame, 1-hour data granularity for 6 hours to 15 days' time frame or 1-day data granularity for 15 days up to 30 days' time frame. +Value should be submitted in Seconds + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: 4 +Default value: 0 +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -startDate +The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If only the end date is added, the start date by default will be the end date minus 7 days. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -vpgIdentifier +The identifier of the VPG. + +```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 RPO Average](https://docs.api.zerto.com/#/RPO_Reports/get_v2_reports_rpo_average) From 89bfe61a1b35688399e8e5323ffc52c7718cd0d7 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 9 Jun 2019 12:18:11 -0400 Subject: [PATCH 066/108] Add Parameter Validation --- ZertoApiWrapper/Public/Get-ZADatastore.ps1 | 1 + ZertoApiWrapper/Public/Get-ZAVolume.ps1 | 1 + 2 files changed, 2 insertions(+) diff --git a/ZertoApiWrapper/Public/Get-ZADatastore.ps1 b/ZertoApiWrapper/Public/Get-ZADatastore.ps1 index 8f12ddb..60bdc9e 100644 --- a/ZertoApiWrapper/Public/Get-ZADatastore.ps1 +++ b/ZertoApiWrapper/Public/Get-ZADatastore.ps1 @@ -29,6 +29,7 @@ function Get-ZADatastore { ParameterSetName = "datastore", Mandatory = $true )] + [ValidateNotNullOrEmpty()] [string]$datastoreIdentifier ) diff --git a/ZertoApiWrapper/Public/Get-ZAVolume.ps1 b/ZertoApiWrapper/Public/Get-ZAVolume.ps1 index 554f2ad..662448e 100644 --- a/ZertoApiWrapper/Public/Get-ZAVolume.ps1 +++ b/ZertoApiWrapper/Public/Get-ZAVolume.ps1 @@ -33,6 +33,7 @@ function Get-ZAVolume { Mandatory, ParameterSetName = "VpgIdentifier" )] + [ValidateNotNullOrEmpty()] [string]$vpgIdentifier ) From bb6de17e7cca21023da9e2ef82d9a57252c0ead7 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 9 Jun 2019 12:25:07 -0400 Subject: [PATCH 067/108] Create Get-ZAJournalSummary and Docs --- Tests/Public/Get-ZAJournalSummary.Tests.ps1 | 19 ++++ .../Public/Get-ZAJournalSummary.ps1 | 26 +++++ docs/Get-ZAJournalSummary.md | 101 ++++++++++++++++++ 3 files changed, 146 insertions(+) create mode 100644 Tests/Public/Get-ZAJournalSummary.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZAJournalSummary.ps1 create mode 100644 docs/Get-ZAJournalSummary.md diff --git a/Tests/Public/Get-ZAJournalSummary.Tests.ps1 b/Tests/Public/Get-ZAJournalSummary.Tests.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZAJournalSummary.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-ZAJournalSummary.ps1 b/ZertoApiWrapper/Public/Get-ZAJournalSummary.ps1 new file mode 100644 index 0000000..cdcdb9a --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZAJournalSummary.ps1 @@ -0,0 +1,26 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZAJournalSummary { + [CmdletBinding()] + param ( + [Parameter( + HelpMessage = "The identifier of the VPG.", + Mandatory + )] + [ValidateNotNullOrEmpty()] + [string]$vpgIdentifier, + [Parameter( + HelpMessage = "The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). If only the end date is added, the start date by default will be the end date minus 7 days." + )] + [ValidateNotNullOrEmpty()] + [string]$startDate, + [Parameter( + HelpMessage = "The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). The default is the current time." + )] + [ValidateNotNullOrEmpty()] + [string]$endDate + ) + + $filter = Get-ZertoApiFilter -filtertable $PSBoundParameters + $uri = "reports/journal-summary{0}" -f $filter + Invoke-ZARestRequest -uri $uri +} diff --git a/docs/Get-ZAJournalSummary.md b/docs/Get-ZAJournalSummary.md new file mode 100644 index 0000000..e8cad08 --- /dev/null +++ b/docs/Get-ZAJournalSummary.md @@ -0,0 +1,101 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAJournalSummary.md +schema: 2.0.0 +--- + +# Get-ZAJournalSummary + +## SYNOPSIS + +Retrieves journal historical statistics for a given VPG. + +## SYNTAX + +``` +Get-ZAJournalSummary [-vpgIdentifier] [[-startDate] ] [[-endDate] ] + [] +``` + +## DESCRIPTION + +Retrieves journal historical statistics for a given VPG. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZAJournalSummary -vpgIdentifier "9876-5432-1098" +``` + +Returns Journal Summary information for VPG with identifier "9876-5432-1098" + +### Example 2 +```powershell +PS C:\> Get-ZAJournalSummary -vpgIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" +``` + +Returns Journal Summary information for VPG with identifier "9876-5432-1098" between the dates specified. + +## PARAMETERS + +### -endDate +The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +The default 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 +The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If only the end date is added, the start date by default will be the end date minus 7 days. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -vpgIdentifier +The identifier of the VPG. + +```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 Journal Summary](https://docs.api.zerto.com/#/Journal_Reports/get_v2_reports_journal_summary) From 6ab9a2dae66b351fa9b511515e8efde18726ab71 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 9 Jun 2019 12:32:50 -0400 Subject: [PATCH 068/108] Create Get-ZAJournalStorage Stat and Docs --- .../Public/Get-ZAJournalStorageStat.Tests.ps1 | 19 ++++ .../Public/Get-ZAJournalStorageStat.ps1 | 26 +++++ docs/Get-ZAJournalStorageStat.md | 101 ++++++++++++++++++ 3 files changed, 146 insertions(+) create mode 100644 Tests/Public/Get-ZAJournalStorageStat.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZAJournalStorageStat.ps1 create mode 100644 docs/Get-ZAJournalStorageStat.md diff --git a/Tests/Public/Get-ZAJournalStorageStat.Tests.ps1 b/Tests/Public/Get-ZAJournalStorageStat.Tests.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZAJournalStorageStat.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-ZAJournalStorageStat.ps1 b/ZertoApiWrapper/Public/Get-ZAJournalStorageStat.ps1 new file mode 100644 index 0000000..cf2f520 --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZAJournalStorageStat.ps1 @@ -0,0 +1,26 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZAJournalStorageStat { + [CmdletBinding()] + param ( + [Parameter( + HelpMessage = "The identifier of the VPG.", + Mandatory + )] + [ValidateNotNullOrEmpty()] + [string]$vpgIdentifier, + [Parameter( + HelpMessage = "The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). If only the end date is added, the start date by default will be the end date minus 7 days." + )] + [ValidateNotNullOrEmpty()] + [string]$startDate, + [Parameter( + HelpMessage = "The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). The default is the current time." + )] + [ValidateNotNullOrEmpty()] + [string]$endDate + ) + + $filter = Get-ZertoApiFilter -filtertable $PSBoundParameters + $uri = "reports/stats-journal-storage{0}" -f $filter + Invoke-ZARestRequest -uri $uri +} diff --git a/docs/Get-ZAJournalStorageStat.md b/docs/Get-ZAJournalStorageStat.md new file mode 100644 index 0000000..6b806c8 --- /dev/null +++ b/docs/Get-ZAJournalStorageStat.md @@ -0,0 +1,101 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAJournalStorageStat.md +schema: 2.0.0 +--- + +# Get-ZAJournalSummary + +## SYNOPSIS + +Retrieves Journal Storage minimum, maximum and average. Statistics over the selected timeframe. + +## SYNTAX + +``` +Get-ZAJournalSummary [-vpgIdentifier] [[-startDate] ] [[-endDate] ] + [] +``` + +## DESCRIPTION + +Retrieves Journal Storage minimum, maximum and average. Statistics over the selected timeframe. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZAJournalStorageStat -vpgIdentifier "9876-5432-1098" +``` + +Returns Journal Storage Stats for VPG with identifier "9876-5432-1098" + +### Example 2 +```powershell +PS C:\> Get-ZAJournalStorageStat -vpgIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" +``` + +Returns Journal Storage Stats for VPG with identifier "9876-5432-1098" between the dates specified. + +## PARAMETERS + +### -endDate +The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +The default 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 +The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If only the end date is added, the start date by default will be the end date minus 7 days. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -vpgIdentifier +The identifier of the VPG. + +```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 Journal Storage Stats](https://docs.api.zerto.com/#/Journal_Reports/get_v2_reports_stats_journal_storage) From ced00662441c55361a098f85c1d1b2e6e961c3b6 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 9 Jun 2019 12:41:42 -0400 Subject: [PATCH 069/108] Create Get-ZAJournalBreach and Docs --- Tests/Public/Get-ZAJournalBreach.Tests.ps1 | 19 ++++ .../Public/Get-ZAJournalBreach.ps1 | 26 +++++ docs/Get-ZAJournalBreach.md | 101 ++++++++++++++++++ 3 files changed, 146 insertions(+) create mode 100644 Tests/Public/Get-ZAJournalBreach.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZAJournalBreach.ps1 create mode 100644 docs/Get-ZAJournalBreach.md diff --git a/Tests/Public/Get-ZAJournalBreach.Tests.ps1 b/Tests/Public/Get-ZAJournalBreach.Tests.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZAJournalBreach.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-ZAJournalBreach.ps1 b/ZertoApiWrapper/Public/Get-ZAJournalBreach.ps1 new file mode 100644 index 0000000..d4afbf6 --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZAJournalBreach.ps1 @@ -0,0 +1,26 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZAJournalBreach { + [CmdletBinding()] + param ( + [Parameter( + HelpMessage = "The identifier of the VPG.", + Mandatory + )] + [ValidateNotNullOrEmpty()] + [string]$vpgIdentifier, + [Parameter( + HelpMessage = "The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). If only the end date is added, the start date by default will be the end date minus 7 days." + )] + [ValidateNotNullOrEmpty()] + [string]$startDate, + [Parameter( + HelpMessage = "The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). The default is the current time." + )] + [ValidateNotNullOrEmpty()] + [string]$endDate + ) + + $filter = Get-ZertoApiFilter -filtertable $PSBoundParameters + $uri = "reports/journal-breach{0}" -f $filter + Invoke-ZARestRequest -uri $uri +} diff --git a/docs/Get-ZAJournalBreach.md b/docs/Get-ZAJournalBreach.md new file mode 100644 index 0000000..c1e6253 --- /dev/null +++ b/docs/Get-ZAJournalBreach.md @@ -0,0 +1,101 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAJournalBreach.md +schema: 2.0.0 +--- + +# Get-ZAJournalSummary + +## SYNOPSIS + +Retrieves the journal history breaches over the selected timeframe. + +## SYNTAX + +``` +Get-ZAJournalSummary [-vpgIdentifier] [[-startDate] ] [[-endDate] ] + [] +``` + +## DESCRIPTION + +Retrieves the journal history breaches over the selected timeframe. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZAJournalSummary -vpgIdentifier "9876-5432-1098" +``` + +Returns Journal Breach information for VPG with identifier "9876-5432-1098" + +### Example 2 +```powershell +PS C:\> Get-ZAJournalSummary -vpgIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" +``` + +Returns Journal Breach information for VPG with identifier "9876-5432-1098" between the dates specified. + +## PARAMETERS + +### -endDate +The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +The default 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 +The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If only the end date is added, the start date by default will be the end date minus 7 days. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -vpgIdentifier +The identifier of the VPG. + +```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 Journal Breach](https://docs.api.zerto.com/#/Journal_Reports/get_v2_reports_journal_breach) From b934e28657a50901b43869e0228c368fcea00425 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 9 Jun 2019 12:41:55 -0400 Subject: [PATCH 070/108] Create Get-ZAJournalHistoryStat and Docs --- .../Public/Get-ZAJournalHistoryStat.Tests.ps1 | 19 ++++ .../Public/Get-ZAJournalHistoryStat.ps1 | 26 +++++ docs/Get-ZAJournalHistoryStat.md | 101 ++++++++++++++++++ 3 files changed, 146 insertions(+) create mode 100644 Tests/Public/Get-ZAJournalHistoryStat.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZAJournalHistoryStat.ps1 create mode 100644 docs/Get-ZAJournalHistoryStat.md diff --git a/Tests/Public/Get-ZAJournalHistoryStat.Tests.ps1 b/Tests/Public/Get-ZAJournalHistoryStat.Tests.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZAJournalHistoryStat.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-ZAJournalHistoryStat.ps1 b/ZertoApiWrapper/Public/Get-ZAJournalHistoryStat.ps1 new file mode 100644 index 0000000..d973aea --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZAJournalHistoryStat.ps1 @@ -0,0 +1,26 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZAJournalHistoryStat { + [CmdletBinding()] + param ( + [Parameter( + HelpMessage = "The identifier of the VPG.", + Mandatory + )] + [ValidateNotNullOrEmpty()] + [string]$vpgIdentifier, + [Parameter( + HelpMessage = "The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). If only the end date is added, the start date by default will be the end date minus 7 days." + )] + [ValidateNotNullOrEmpty()] + [string]$startDate, + [Parameter( + HelpMessage = "The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). The default is the current time." + )] + [ValidateNotNullOrEmpty()] + [string]$endDate + ) + + $filter = Get-ZertoApiFilter -filtertable $PSBoundParameters + $uri = "reports/stats-journal-history{0}" -f $filter + Invoke-ZARestRequest -uri $uri +} diff --git a/docs/Get-ZAJournalHistoryStat.md b/docs/Get-ZAJournalHistoryStat.md new file mode 100644 index 0000000..63b56e4 --- /dev/null +++ b/docs/Get-ZAJournalHistoryStat.md @@ -0,0 +1,101 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAJournalHistoryStat.md +schema: 2.0.0 +--- + +# Get-ZAJournalSummary + +## SYNOPSIS + +Retrieves Journal history min, max and avg Statistics over the selected timeframe. + +## SYNTAX + +``` +Get-ZAJournalSummary [-vpgIdentifier] [[-startDate] ] [[-endDate] ] + [] +``` + +## DESCRIPTION + +Retrieves Journal history min, max and avg Statistics over the selected timeframe. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZAJournalStorageStat -vpgIdentifier "9876-5432-1098" +``` + +Returns Journal History Stats for VPG with identifier "9876-5432-1098" + +### Example 2 +```powershell +PS C:\> Get-ZAJournalStorageStat -vpgIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" +``` + +Returns Journal History Stats for VPG with identifier "9876-5432-1098" between the dates specified. + +## PARAMETERS + +### -endDate +The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +The default 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 +The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If only the end date is added, the start date by default will be the end date minus 7 days. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -vpgIdentifier +The identifier of the VPG. + +```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 Journal History Stats](https://docs.api.zerto.com/#/Journal_Reports/get_v2_reports_stats_journal_history) From 0226fdd432f99111c5f102579824319831a09bd3 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 9 Jun 2019 12:49:09 -0400 Subject: [PATCH 071/108] Fix Function Name Typos in Docs --- docs/Get-ZAJournalBreach.md | 8 ++++---- docs/Get-ZAJournalHistoryStat.md | 8 ++++---- docs/Get-ZAJournalStorageStat.md | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/Get-ZAJournalBreach.md b/docs/Get-ZAJournalBreach.md index c1e6253..03e25ba 100644 --- a/docs/Get-ZAJournalBreach.md +++ b/docs/Get-ZAJournalBreach.md @@ -5,7 +5,7 @@ online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/ schema: 2.0.0 --- -# Get-ZAJournalSummary +# Get-ZAJournalBreach ## SYNOPSIS @@ -14,7 +14,7 @@ Retrieves the journal history breaches over the selected timeframe. ## SYNTAX ``` -Get-ZAJournalSummary [-vpgIdentifier] [[-startDate] ] [[-endDate] ] +Get-ZAJournalBreach [-vpgIdentifier] [[-startDate] ] [[-endDate] ] [] ``` @@ -26,14 +26,14 @@ Retrieves the journal history breaches over the selected timeframe. ### Example 1 ```powershell -PS C:\> Get-ZAJournalSummary -vpgIdentifier "9876-5432-1098" +PS C:\> Get-ZAJournalBreach -vpgIdentifier "9876-5432-1098" ``` Returns Journal Breach information for VPG with identifier "9876-5432-1098" ### Example 2 ```powershell -PS C:\> Get-ZAJournalSummary -vpgIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" +PS C:\> Get-ZAJournalBreach -vpgIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" ``` Returns Journal Breach information for VPG with identifier "9876-5432-1098" between the dates specified. diff --git a/docs/Get-ZAJournalHistoryStat.md b/docs/Get-ZAJournalHistoryStat.md index 63b56e4..957ffc4 100644 --- a/docs/Get-ZAJournalHistoryStat.md +++ b/docs/Get-ZAJournalHistoryStat.md @@ -5,7 +5,7 @@ online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/ schema: 2.0.0 --- -# Get-ZAJournalSummary +# Get-ZAJournalHistoryStat ## SYNOPSIS @@ -14,7 +14,7 @@ Retrieves Journal history min, max and avg Statistics over the selected timefram ## SYNTAX ``` -Get-ZAJournalSummary [-vpgIdentifier] [[-startDate] ] [[-endDate] ] +Get-ZAJournalHistoryStat [-vpgIdentifier] [[-startDate] ] [[-endDate] ] [] ``` @@ -26,14 +26,14 @@ Retrieves Journal history min, max and avg Statistics over the selected timefram ### Example 1 ```powershell -PS C:\> Get-ZAJournalStorageStat -vpgIdentifier "9876-5432-1098" +PS C:\> Get-ZAJournalHistoryStat -vpgIdentifier "9876-5432-1098" ``` Returns Journal History Stats for VPG with identifier "9876-5432-1098" ### Example 2 ```powershell -PS C:\> Get-ZAJournalStorageStat -vpgIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" +PS C:\> Get-ZAJournalHistoryStat -vpgIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" ``` Returns Journal History Stats for VPG with identifier "9876-5432-1098" between the dates specified. diff --git a/docs/Get-ZAJournalStorageStat.md b/docs/Get-ZAJournalStorageStat.md index 6b806c8..625f650 100644 --- a/docs/Get-ZAJournalStorageStat.md +++ b/docs/Get-ZAJournalStorageStat.md @@ -5,7 +5,7 @@ online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/ schema: 2.0.0 --- -# Get-ZAJournalSummary +# Get-ZAJournalStorageStat ## SYNOPSIS @@ -14,7 +14,7 @@ Retrieves Journal Storage minimum, maximum and average. Statistics over the sele ## SYNTAX ``` -Get-ZAJournalSummary [-vpgIdentifier] [[-startDate] ] [[-endDate] ] +Get-ZAJournalStorageStat [-vpgIdentifier] [[-startDate] ] [[-endDate] ] [] ``` From 0fda0c1e78fbe0ca164bdea6fe5f0aa4ad4e85b2 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 9 Jun 2019 12:49:45 -0400 Subject: [PATCH 072/108] Create Function and Docs Get-ZAJournalStatusProportion --- .../Get-ZAJournalStatusProportion.Tests.ps1 | 19 ++++ .../Public/Get-ZAJournalStatusProportion.ps1 | 26 +++++ docs/Get-ZAJournalStatusProportion.md | 101 ++++++++++++++++++ 3 files changed, 146 insertions(+) create mode 100644 Tests/Public/Get-ZAJournalStatusProportion.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZAJournalStatusProportion.ps1 create mode 100644 docs/Get-ZAJournalStatusProportion.md diff --git a/Tests/Public/Get-ZAJournalStatusProportion.Tests.ps1 b/Tests/Public/Get-ZAJournalStatusProportion.Tests.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZAJournalStatusProportion.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-ZAJournalStatusProportion.ps1 b/ZertoApiWrapper/Public/Get-ZAJournalStatusProportion.ps1 new file mode 100644 index 0000000..9595675 --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZAJournalStatusProportion.ps1 @@ -0,0 +1,26 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZAJournalStatusProportion { + [CmdletBinding()] + param ( + [Parameter( + HelpMessage = "The identifier of the VPG.", + Mandatory + )] + [ValidateNotNullOrEmpty()] + [string]$vpgIdentifier, + [Parameter( + HelpMessage = "The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). If only the end date is added, the start date by default will be the end date minus 7 days." + )] + [ValidateNotNullOrEmpty()] + [string]$startDate, + [Parameter( + HelpMessage = "The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). The default is the current time." + )] + [ValidateNotNullOrEmpty()] + [string]$endDate + ) + + $filter = Get-ZertoApiFilter -filtertable $PSBoundParameters + $uri = "reports/journal-statuses-proportions{0}" -f $filter + Invoke-ZARestRequest -uri $uri +} diff --git a/docs/Get-ZAJournalStatusProportion.md b/docs/Get-ZAJournalStatusProportion.md new file mode 100644 index 0000000..0e6ae7d --- /dev/null +++ b/docs/Get-ZAJournalStatusProportion.md @@ -0,0 +1,101 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAJournalStatusProportion.md +schema: 2.0.0 +--- + +# Get-ZAJournalStatusProportion + +## SYNOPSIS + +Retrieves journal history SLA status distribution over selected timeframe. + +## SYNTAX + +``` +Get-ZAJournalStatusProportion [-vpgIdentifier] [[-startDate] ] [[-endDate] ] + [] +``` + +## DESCRIPTION + +Retrieves journal history SLA status distribution over selected timeframe. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZAJournalStatusProportion -vpgIdentifier "9876-5432-1098" +``` + +Returns Journal history SLA status distribution for VPG with identifier "9876-5432-1098" + +### Example 2 +```powershell +PS C:\> Get-ZAJournalStatusProportion -vpgIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" +``` + +Returns Journalhistory SLA status distribution for VPG with identifier "9876-5432-1098" between the dates specified. + +## PARAMETERS + +### -endDate +The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +The default 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 +The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If only the end date is added, the start date by default will be the end date minus 7 days. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -vpgIdentifier +The identifier of the VPG. + +```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 Journal Statuses Proportions](https://docs.api.zerto.com/#/Journal_Reports/get_v2_reports_journal_statuses_proportions) From d46869353b57eace7d06da6ee92da49a364b64da Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 9 Jun 2019 14:50:54 -0400 Subject: [PATCH 073/108] Create Function and Required Docs Get-ZAJournalAverageHistory --- .../Get-ZAJournalAverageHistory.Tests.ps1 | 19 +++ .../Public/Get-ZAJournalAverageHistory.ps1 | 31 +++++ docs/Get-ZAJournalAverageHistory.md | 123 ++++++++++++++++++ 3 files changed, 173 insertions(+) create mode 100644 Tests/Public/Get-ZAJournalAverageHistory.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZAJournalAverageHistory.ps1 create mode 100644 docs/Get-ZAJournalAverageHistory.md diff --git a/Tests/Public/Get-ZAJournalAverageHistory.Tests.ps1 b/Tests/Public/Get-ZAJournalAverageHistory.Tests.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZAJournalAverageHistory.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-ZAJournalAverageHistory.ps1 b/ZertoApiWrapper/Public/Get-ZAJournalAverageHistory.ps1 new file mode 100644 index 0000000..4dc0ca2 --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZAJournalAverageHistory.ps1 @@ -0,0 +1,31 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZAJournalAverageHistory { + [CmdletBinding()] + param ( + [Parameter( + HelpMessage = "The identifier of the VPG.", + Mandatory + )] + [ValidateNotNullOrEmpty()] + [string]$vpgIdentifier, + [Parameter( + HelpMessage = "The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). If only the end date is added, the start date by default will be the end date minus 7 days." + )] + [ValidateNotNullOrEmpty()] + [string]$startDate, + [Parameter( + HelpMessage = "The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). The default is the current time." + )] + [ValidateNotNullOrEmpty()] + [string]$endDate, + [Parameter( + HelpMessage = "The interval selected within the duration of the report. The interval can be per hour, for up to 15 days’ time frame or per day, for between 15 to 30 days' time frame. Submit value in Seconds" + )] + [ValidateRange(60, 2678400)] + [Int32]$interval + ) + + $filter = Get-ZertoApiFilter -filtertable $PSBoundParameters + $uri = "reports/journal-history-average{0}" -f $filter + Invoke-ZARestRequest -uri $uri +} diff --git a/docs/Get-ZAJournalAverageHistory.md b/docs/Get-ZAJournalAverageHistory.md new file mode 100644 index 0000000..de1aafe --- /dev/null +++ b/docs/Get-ZAJournalAverageHistory.md @@ -0,0 +1,123 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAJournalAverageHistory.md +schema: 2.0.0 +--- + +# Get-ZAJournalAverageHistory + +## SYNOPSIS + +Retrieves the list of historical average journal history values for a specific VPG, filtered by start date, end date, and optional interval. The interval defines the journal history samples interval. + +## SYNTAX + +``` +Get-ZAJournalAverageHistory [-vpgIdentifier] [[-startDate] ] [[-endDate] ] + [[-interval] ] [] +``` + +## DESCRIPTION + +Retrieves the list of historical average journal history values for a specific VPG, filtered by start date, end date, and optional interval. The interval defines the journal history samples interval. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZAJournalAverageHistory -vpgIdentifier "9876-5432-1098" +``` + +Returns Journal Average History information for VPG with identifier "9876-5432-1098" + +### Example 2 +```powershell +PS C:\> Get-ZAJournalAverageHistory -vpgIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" +``` + +Returns Journal Average History for VPG with identifier "9876-5432-1098" between the dates specified. + +### Example 3 +```powershell +PS C:\> Get-ZAJournalAverageHistory -vpgIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" -interval 7200 +``` + +Returns Journal Average History for VPG with identifier "9876-5432-1098" between the dates specified with a 2 hour interval. + +## PARAMETERS + +### -endDate +The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +The default 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 +``` + +### -interval +The interval selected within the duration of the report. The interval can be per hour, for up to 15 days' time frame or per day, for between 15 to 30 days' time frame. Submit value in Seconds + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: 4 +Default value: 0 +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -startDate +The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If only the end date is added, the start date by default will be the end date minus 7 days. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -vpgIdentifier +The identifier of the VPG. + +```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 Journal Average History](https://docs.api.zerto.com/#/Journal_Reports/get_v2_reports_journal_history_average) From ca2620d9b588e047e7ac8083fec473a4abc5012e Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 9 Jun 2019 14:51:16 -0400 Subject: [PATCH 074/108] Create function and required docs Get-ZAJournalAverageSiteHistory --- .../Get-ZAJournalAverageSiteHistory.Tests.ps1 | 19 +++ .../Get-ZAJournalAverageSiteHistory.ps1 | 31 +++++ docs/Get-ZAJournalAverageSiteHistory.md | 123 ++++++++++++++++++ 3 files changed, 173 insertions(+) create mode 100644 Tests/Public/Get-ZAJournalAverageSiteHistory.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZAJournalAverageSiteHistory.ps1 create mode 100644 docs/Get-ZAJournalAverageSiteHistory.md diff --git a/Tests/Public/Get-ZAJournalAverageSiteHistory.Tests.ps1 b/Tests/Public/Get-ZAJournalAverageSiteHistory.Tests.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZAJournalAverageSiteHistory.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-ZAJournalAverageSiteHistory.ps1 b/ZertoApiWrapper/Public/Get-ZAJournalAverageSiteHistory.ps1 new file mode 100644 index 0000000..b5942a3 --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZAJournalAverageSiteHistory.ps1 @@ -0,0 +1,31 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZAJournalAverageSiteHistory { + [CmdletBinding()] + param ( + [Parameter( + HelpMessage = "The identifier of the recovery site. A site identification is required for at least one site.", + Mandatory + )] + [ValidateNotNullOrEmpty()] + [string]$recoverySiteIdentifier, + [Parameter( + HelpMessage = "The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). If only the end date is added, the start date by default will be the end date minus 7 days." + )] + [ValidateNotNullOrEmpty()] + [string]$startDate, + [Parameter( + HelpMessage = "The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). The default is the current time." + )] + [ValidateNotNullOrEmpty()] + [string]$endDate, + [Parameter( + HelpMessage = "The interval selected within the duration of the report. The interval can be per hour, for up to 15 days’ time frame or per day, for between 15 to 30 days' time frame. Submit value in Seconds" + )] + [ValidateRange(60, 2678400)] + [Int32]$interval + ) + + $filter = Get-ZertoApiFilter -filtertable $PSBoundParameters + $uri = "reports/site-journal-history-average{0}" -f $filter + Invoke-ZARestRequest -uri $uri +} diff --git a/docs/Get-ZAJournalAverageSiteHistory.md b/docs/Get-ZAJournalAverageSiteHistory.md new file mode 100644 index 0000000..aed6665 --- /dev/null +++ b/docs/Get-ZAJournalAverageSiteHistory.md @@ -0,0 +1,123 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAJournalAverageSiteHistory.md +schema: 2.0.0 +--- + +# Get-ZAJournalAverageSiteHistory + +## SYNOPSIS + +Get list of samples of average Journal History values for all VPGs replicating to a specified recovery site, filtered by start date, end date, and optional interval. The interval defines the Journal History samples interval. + +## SYNTAX + +``` +Get-ZAJournalAverageSiteHistory [-vpgIdentifier] [[-startDate] ] [[-endDate] ] + [[-interval] ] [] +``` + +## DESCRIPTION + +Get list of samples of average Journal History values for all VPGs replicating to a specified recovery site, filtered by start date, end date, and optional interval. The interval defines the Journal History samples interval. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZAJournalAverageSiteHistory -recoverySiteIdentifier "9876-5432-1098" +``` + +Returns Journal Average History information for the recovery site with identifier "9876-5432-1098" + +### Example 2 +```powershell +PS C:\> Get-ZAJournalAverageSiteHistory -recoverySiteIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" +``` + +Returns Journal Average History information for the recovery site with identifier "9876-5432-1098" between the dates specified. + +### Example 3 +```powershell +PS C:\> Get-ZAJournalAverageSiteHistory -recoverySiteIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" -interval 7200 +``` + +Returns Journal Average History information for the recovery site with identifier "9876-5432-1098" between the dates specified with a 2 hour interval. + +## PARAMETERS + +### -endDate +The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +The default 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 +``` + +### -interval +The interval selected within the duration of the report. The interval can be per hour, for up to 15 days' time frame or per day, for between 15 to 30 days' time frame. Submit value in Seconds + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: 4 +Default value: 0 +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -startDate +The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If only the end date is added, the start date by default will be the end date minus 7 days. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -recoverySiteIdentifier +The identifier of the VPG. + +```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 Journal Average Site History](https://docs.api.zerto.com/#/Journal_Reports/get_v2_reports_site_journal_history_average) From 1110fcc56aed6ea4705f2273beb98ca013f4b2c8 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 9 Jun 2019 14:51:38 -0400 Subject: [PATCH 075/108] Create Function and required docs Get-JournalAverageSize --- .../Public/Get-ZAJournalAverageSize.Tests.ps1 | 19 +++ .../Public/Get-ZAJournalAverageSize.ps1 | 31 +++++ docs/Get-ZAJournalAverageSize.md | 123 ++++++++++++++++++ 3 files changed, 173 insertions(+) create mode 100644 Tests/Public/Get-ZAJournalAverageSize.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZAJournalAverageSize.ps1 create mode 100644 docs/Get-ZAJournalAverageSize.md diff --git a/Tests/Public/Get-ZAJournalAverageSize.Tests.ps1 b/Tests/Public/Get-ZAJournalAverageSize.Tests.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZAJournalAverageSize.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-ZAJournalAverageSize.ps1 b/ZertoApiWrapper/Public/Get-ZAJournalAverageSize.ps1 new file mode 100644 index 0000000..26f7955 --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZAJournalAverageSize.ps1 @@ -0,0 +1,31 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZAJournalAverageSize { + [CmdletBinding()] + param ( + [Parameter( + HelpMessage = "The identifier of the VPG.", + Mandatory + )] + [ValidateNotNullOrEmpty()] + [string]$vpgIdentifier, + [Parameter( + HelpMessage = "The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). If only the end date is added, the start date by default will be the end date minus 7 days." + )] + [ValidateNotNullOrEmpty()] + [string]$startDate, + [Parameter( + HelpMessage = "The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). The default is the current time." + )] + [ValidateNotNullOrEmpty()] + [string]$endDate, + [Parameter( + HelpMessage = "The interval selected within the duration of the report. The interval can be per hour, for up to 15 days’ time frame or per day, for between 15 to 30 days' time frame. Submit value in Seconds" + )] + [ValidateRange(60, 2678400)] + [Int32]$interval + ) + + $filter = Get-ZertoApiFilter -filtertable $PSBoundParameters + $uri = "reports/journal-size-average{0}" -f $filter + Invoke-ZARestRequest -uri $uri +} diff --git a/docs/Get-ZAJournalAverageSize.md b/docs/Get-ZAJournalAverageSize.md new file mode 100644 index 0000000..8517622 --- /dev/null +++ b/docs/Get-ZAJournalAverageSize.md @@ -0,0 +1,123 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAJournalAverageSize.md +schema: 2.0.0 +--- + +# Get-ZAJournalAverageSize + +## SYNOPSIS + +Retrieves the list of historical average journal storage values for a specific VPG, filtered by start date, end date, and optional interval. The interval defines the journal storage samples interval. + +## SYNTAX + +``` +Get-ZAJournalAverageSize [-vpgIdentifier] [[-startDate] ] [[-endDate] ] + [[-interval] ] [] +``` + +## DESCRIPTION + +Retrieves the list of historical average journal storage values for a specific VPG, filtered by start date, end date, and optional interval. The interval defines the journal storage samples interval. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZAJournalAverageSize -vpgIdentifier "9876-5432-1098" +``` + +Returns Journal Average Size information for VPG with identifier "9876-5432-1098" + +### Example 2 +```powershell +PS C:\> Get-ZAJournalAverageSize -vpgIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" +``` + +Returns Journal Average Size for VPG with identifier "9876-5432-1098" between the dates specified. + +### Example 3 +```powershell +PS C:\> Get-ZAJournalAverageSize -vpgIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" -interval 7200 +``` + +Returns Journal Average Size for VPG with identifier "9876-5432-1098" between the dates specified with a 2 hour interval. + +## PARAMETERS + +### -endDate +The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +The default 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 +``` + +### -interval +The interval selected within the duration of the report. The interval can be per hour, for up to 15 days' time frame or per day, for between 15 to 30 days' time frame. Submit value in Seconds + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: 4 +Default value: 0 +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -startDate +The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If only the end date is added, the start date by default will be the end date minus 7 days. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -vpgIdentifier +The identifier of the VPG. + +```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 Journal Average Size](https://docs.api.zerto.com/#/Journal_Reports/get_v2_reports_journal_size_average) From aeeaf73da0f29e72b9df0bfa4bf10bbda0a7f6e8 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 9 Jun 2019 14:57:38 -0400 Subject: [PATCH 076/108] Correct Parameter Error --- docs/Get-ZAJournalAverageSiteHistory.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Get-ZAJournalAverageSiteHistory.md b/docs/Get-ZAJournalAverageSiteHistory.md index aed6665..38b7133 100644 --- a/docs/Get-ZAJournalAverageSiteHistory.md +++ b/docs/Get-ZAJournalAverageSiteHistory.md @@ -14,7 +14,7 @@ Get list of samples of average Journal History values for all VPGs replicating t ## SYNTAX ``` -Get-ZAJournalAverageSiteHistory [-vpgIdentifier] [[-startDate] ] [[-endDate] ] +Get-ZAJournalAverageSiteHistory [-recoverySiteIdentifier] [[-startDate] ] [[-endDate] ] [[-interval] ] [] ``` From eb528e3432a446c437061f2f87c2b209a9c478a9 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 9 Jun 2019 14:58:04 -0400 Subject: [PATCH 077/108] Create Function and Required Docs Get-ZAJournalAverageSize --- .../Get-ZAJournalAverageSiteSize.Tests.ps1 | 19 +++ .../Public/Get-ZAJournalAverageSiteSize.ps1 | 31 +++++ docs/Get-ZAJournalAverageSiteSize.md | 123 ++++++++++++++++++ 3 files changed, 173 insertions(+) create mode 100644 Tests/Public/Get-ZAJournalAverageSiteSize.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZAJournalAverageSiteSize.ps1 create mode 100644 docs/Get-ZAJournalAverageSiteSize.md diff --git a/Tests/Public/Get-ZAJournalAverageSiteSize.Tests.ps1 b/Tests/Public/Get-ZAJournalAverageSiteSize.Tests.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZAJournalAverageSiteSize.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-ZAJournalAverageSiteSize.ps1 b/ZertoApiWrapper/Public/Get-ZAJournalAverageSiteSize.ps1 new file mode 100644 index 0000000..d1c31f6 --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZAJournalAverageSiteSize.ps1 @@ -0,0 +1,31 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZAJournalAverageSiteSize { + [CmdletBinding()] + param ( + [Parameter( + HelpMessage = "The identifier of the recovery site. A site identification is required for at least one site.", + Mandatory + )] + [ValidateNotNullOrEmpty()] + [string]$recoverySiteIdentifier, + [Parameter( + HelpMessage = "The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). If only the end date is added, the start date by default will be the end date minus 7 days." + )] + [ValidateNotNullOrEmpty()] + [string]$startDate, + [Parameter( + HelpMessage = "The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). The default is the current time." + )] + [ValidateNotNullOrEmpty()] + [string]$endDate, + [Parameter( + HelpMessage = "The interval selected within the duration of the report. The interval can be per hour, for up to 15 days’ time frame or per day, for between 15 to 30 days' time frame. Submit value in Seconds" + )] + [ValidateRange(60, 2678400)] + [Int32]$interval + ) + + $filter = Get-ZertoApiFilter -filtertable $PSBoundParameters + $uri = "reports/site-journal-size-average{0}" -f $filter + Invoke-ZARestRequest -uri $uri +} diff --git a/docs/Get-ZAJournalAverageSiteSize.md b/docs/Get-ZAJournalAverageSiteSize.md new file mode 100644 index 0000000..a8935a7 --- /dev/null +++ b/docs/Get-ZAJournalAverageSiteSize.md @@ -0,0 +1,123 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAJournalAverageSiteSize.md +schema: 2.0.0 +--- + +# Get-ZAJournalAverageSiteSize + +## SYNOPSIS + +Get list of samples of total Journal Size of all VPGs replicating to a specified recovery site, filtered by start date, end date, and optional interval. The interval defines the Journal Size samples interval. + +## SYNTAX + +``` +Get-ZAJournalAverageSiteSize [-recoverySiteIdentifier] [[-startDate] ] [[-endDate] ] + [[-interval] ] [] +``` + +## DESCRIPTION + +Get list of samples of total Journal Size of all VPGs replicating to a specified recovery site, filtered by start date, end date, and optional interval. The interval defines the Journal Size samples interval. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZAJournalAverageSiteSize -recoverySiteIdentifier "9876-5432-1098" +``` + +Returns Journal Average Size information for the recovery site with identifier "9876-5432-1098" + +### Example 2 +```powershell +PS C:\> Get-ZAJournalAverageSiteSize -recoverySiteIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" +``` + +Returns Journal Average Size information for the recovery site with identifier "9876-5432-1098" between the dates specified. + +### Example 3 +```powershell +PS C:\> Get-ZAJournalAverageSiteSize -recoverySiteIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" -interval 7200 +``` + +Returns Journal Average Size information for the recovery site with identifier "9876-5432-1098" between the dates specified with a 2 hour interval. + +## PARAMETERS + +### -endDate +The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +The default 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 +``` + +### -interval +The interval selected within the duration of the report. The interval can be per hour, for up to 15 days' time frame or per day, for between 15 to 30 days' time frame. Submit value in Seconds + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: 4 +Default value: 0 +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -startDate +The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If only the end date is added, the start date by default will be the end date minus 7 days. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -recoverySiteIdentifier +The identifier of the VPG. + +```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 Journal Average Site Size](https://docs.api.zerto.com/#/Journal_Reports/get_v2_reports_site_journal_size_average) From 5bd2d83cc898e1ab2c576f899ec8ada2300b21d1 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 9 Jun 2019 15:07:40 -0400 Subject: [PATCH 078/108] Create function and associated docs Get-ZAJournalHistorySiteStat --- .../Get-ZAJournalHistorySiteStat.Tests.ps1 | 19 +++ .../Public/Get-ZAJournalHistorySiteStat.ps1 | 31 +++++ docs/Get-ZAJournalHistorySiteStat.md | 123 ++++++++++++++++++ 3 files changed, 173 insertions(+) create mode 100644 Tests/Public/Get-ZAJournalHistorySiteStat.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZAJournalHistorySiteStat.ps1 create mode 100644 docs/Get-ZAJournalHistorySiteStat.md diff --git a/Tests/Public/Get-ZAJournalHistorySiteStat.Tests.ps1 b/Tests/Public/Get-ZAJournalHistorySiteStat.Tests.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZAJournalHistorySiteStat.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-ZAJournalHistorySiteStat.ps1 b/ZertoApiWrapper/Public/Get-ZAJournalHistorySiteStat.ps1 new file mode 100644 index 0000000..43e3993 --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZAJournalHistorySiteStat.ps1 @@ -0,0 +1,31 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZAJournalHistorySiteStat { + [CmdletBinding()] + param ( + [Parameter( + HelpMessage = "The identifier of the VPG.", + Mandatory + )] + [ValidateNotNullOrEmpty()] + [string]$vpgIdentifier, + [Parameter( + HelpMessage = "The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). If only the end date is added, the start date by default will be the end date minus 7 days." + )] + [ValidateNotNullOrEmpty()] + [string]$startDate, + [Parameter( + HelpMessage = "The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). The default is the current time." + )] + [ValidateNotNullOrEmpty()] + [string]$endDate, + [Parameter( + HelpMessage = "The interval selected within the duration of the report. The interval can be per hour, for up to 15 days’ time frame or per day, for between 15 to 30 days' time frame. Submit value in Seconds" + )] + [ValidateRange(60, 2678400)] + [Int32]$interval + ) + + $filter = Get-ZertoApiFilter -filtertable $PSBoundParameters + $uri = "reports/site-journal-history-stats{0}" -f $filter + Invoke-ZARestRequest -uri $uri +} diff --git a/docs/Get-ZAJournalHistorySiteStat.md b/docs/Get-ZAJournalHistorySiteStat.md new file mode 100644 index 0000000..ffdb292 --- /dev/null +++ b/docs/Get-ZAJournalHistorySiteStat.md @@ -0,0 +1,123 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAJournalHistorySiteStat.md +schema: 2.0.0 +--- + +# Get-ZAJournalHistorySiteStat + +## SYNOPSIS + +Get Max, Avg. and Min Journal History statistics for all VPGs replicating to a specified recovery site, filtered by start date, end date, and optional interval. The interval defines the journal history samples interval. + +## SYNTAX + +``` +Get-ZAJournalHistorySiteStat [-recoverySiteIdentifier] [[-startDate] ] [[-endDate] ] + [[-interval] ] [] +``` + +## DESCRIPTION + +Get Max, Avg. and Min Journal History statistics for all VPGs replicating to a specified recovery site, filtered by start date, end date, and optional interval. The interval defines the journal history samples interval. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZAJournalHistorySiteStat -recoverySiteIdentifier "9876-5432-1098" +``` + +Returns Journal Average History information for the recovery site with identifier "9876-5432-1098" + +### Example 2 +```powershell +PS C:\> Get-ZAJournalHistorySiteStat -recoverySiteIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" +``` + +Returns Journal Average History information for the recovery site with identifier "9876-5432-1098" between the dates specified. + +### Example 3 +```powershell +PS C:\> Get-ZAJournalHistorySiteStat -recoverySiteIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" -interval 7200 +``` + +Returns Journal Average History information for the recovery site with identifier "9876-5432-1098" between the dates specified with a 2 hour interval. + +## PARAMETERS + +### -endDate +The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +The default 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 +``` + +### -interval +The interval selected within the duration of the report. The interval can be per hour, for up to 15 days' time frame or per day, for between 15 to 30 days' time frame. Submit value in Seconds + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: 4 +Default value: 0 +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -startDate +The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If only the end date is added, the start date by default will be the end date minus 7 days. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -recoverySiteIdentifier +The identifier of the VPG. + +```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 Journal Site History Stats](https://docs.api.zerto.com/#/Journal_Reports/get_v2_reports_site_journal_history_stats) From d2b559ec83d9110f90c19065014bd44a85aa67e5 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 9 Jun 2019 15:25:36 -0400 Subject: [PATCH 079/108] Function Rename --- ...ps1 => Get-ZAJournalSiteAverageHistory.Tests.ps1} | 0 ...story.ps1 => Get-ZAJournalSiteAverageHistory.ps1} | 2 +- ...History.md => Get-ZAJournalSiteAverageHistory.md} | 12 ++++++------ 3 files changed, 7 insertions(+), 7 deletions(-) rename Tests/Public/{Get-ZAJournalAverageSiteHistory.Tests.ps1 => Get-ZAJournalSiteAverageHistory.Tests.ps1} (100%) rename ZertoApiWrapper/Public/{Get-ZAJournalAverageSiteHistory.ps1 => Get-ZAJournalSiteAverageHistory.ps1} (96%) rename docs/{Get-ZAJournalAverageSiteHistory.md => Get-ZAJournalSiteAverageHistory.md} (90%) diff --git a/Tests/Public/Get-ZAJournalAverageSiteHistory.Tests.ps1 b/Tests/Public/Get-ZAJournalSiteAverageHistory.Tests.ps1 similarity index 100% rename from Tests/Public/Get-ZAJournalAverageSiteHistory.Tests.ps1 rename to Tests/Public/Get-ZAJournalSiteAverageHistory.Tests.ps1 diff --git a/ZertoApiWrapper/Public/Get-ZAJournalAverageSiteHistory.ps1 b/ZertoApiWrapper/Public/Get-ZAJournalSiteAverageHistory.ps1 similarity index 96% rename from ZertoApiWrapper/Public/Get-ZAJournalAverageSiteHistory.ps1 rename to ZertoApiWrapper/Public/Get-ZAJournalSiteAverageHistory.ps1 index b5942a3..a9a06f0 100644 --- a/ZertoApiWrapper/Public/Get-ZAJournalAverageSiteHistory.ps1 +++ b/ZertoApiWrapper/Public/Get-ZAJournalSiteAverageHistory.ps1 @@ -1,5 +1,5 @@ <# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> -function Get-ZAJournalAverageSiteHistory { +function Get-ZAJournalSiteAverageHistory { [CmdletBinding()] param ( [Parameter( diff --git a/docs/Get-ZAJournalAverageSiteHistory.md b/docs/Get-ZAJournalSiteAverageHistory.md similarity index 90% rename from docs/Get-ZAJournalAverageSiteHistory.md rename to docs/Get-ZAJournalSiteAverageHistory.md index 38b7133..13a0bb6 100644 --- a/docs/Get-ZAJournalAverageSiteHistory.md +++ b/docs/Get-ZAJournalSiteAverageHistory.md @@ -1,11 +1,11 @@ --- external help file: ZertoApiWrapper-help.xml Module Name: ZertoApiWrapper -online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAJournalAverageSiteHistory.md +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAJournalSiteAverageHistory.md schema: 2.0.0 --- -# Get-ZAJournalAverageSiteHistory +# Get-ZAJournalSiteAverageHistory ## SYNOPSIS @@ -14,7 +14,7 @@ Get list of samples of average Journal History values for all VPGs replicating t ## SYNTAX ``` -Get-ZAJournalAverageSiteHistory [-recoverySiteIdentifier] [[-startDate] ] [[-endDate] ] +Get-ZAJournalSiteAverageHistory [-recoverySiteIdentifier] [[-startDate] ] [[-endDate] ] [[-interval] ] [] ``` @@ -26,21 +26,21 @@ Get list of samples of average Journal History values for all VPGs replicating t ### Example 1 ```powershell -PS C:\> Get-ZAJournalAverageSiteHistory -recoverySiteIdentifier "9876-5432-1098" +PS C:\> Get-ZAJournalSiteAverageHistory -recoverySiteIdentifier "9876-5432-1098" ``` Returns Journal Average History information for the recovery site with identifier "9876-5432-1098" ### Example 2 ```powershell -PS C:\> Get-ZAJournalAverageSiteHistory -recoverySiteIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" +PS C:\> Get-ZAJournalSiteAverageHistory -recoverySiteIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" ``` Returns Journal Average History information for the recovery site with identifier "9876-5432-1098" between the dates specified. ### Example 3 ```powershell -PS C:\> Get-ZAJournalAverageSiteHistory -recoverySiteIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" -interval 7200 +PS C:\> Get-ZAJournalSiteAverageHistory -recoverySiteIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" -interval 7200 ``` Returns Journal Average History information for the recovery site with identifier "9876-5432-1098" between the dates specified with a 2 hour interval. From 108cb12439ae2f304f14b87f1b8ac9b92e81ef77 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 9 Jun 2019 15:26:14 -0400 Subject: [PATCH 080/108] Function Rename --- ...ts.ps1 => Get-ZAJournalSiteAverageSize.Tests.ps1} | 0 ...SiteSize.ps1 => Get-ZAJournalSiteAverageSize.ps1} | 2 +- ...geSiteSize.md => Get-ZAJournalSiteAverageSize.md} | 12 ++++++------ 3 files changed, 7 insertions(+), 7 deletions(-) rename Tests/Public/{Get-ZAJournalAverageSiteSize.Tests.ps1 => Get-ZAJournalSiteAverageSize.Tests.ps1} (100%) rename ZertoApiWrapper/Public/{Get-ZAJournalAverageSiteSize.ps1 => Get-ZAJournalSiteAverageSize.ps1} (97%) rename docs/{Get-ZAJournalAverageSiteSize.md => Get-ZAJournalSiteAverageSize.md} (90%) diff --git a/Tests/Public/Get-ZAJournalAverageSiteSize.Tests.ps1 b/Tests/Public/Get-ZAJournalSiteAverageSize.Tests.ps1 similarity index 100% rename from Tests/Public/Get-ZAJournalAverageSiteSize.Tests.ps1 rename to Tests/Public/Get-ZAJournalSiteAverageSize.Tests.ps1 diff --git a/ZertoApiWrapper/Public/Get-ZAJournalAverageSiteSize.ps1 b/ZertoApiWrapper/Public/Get-ZAJournalSiteAverageSize.ps1 similarity index 97% rename from ZertoApiWrapper/Public/Get-ZAJournalAverageSiteSize.ps1 rename to ZertoApiWrapper/Public/Get-ZAJournalSiteAverageSize.ps1 index d1c31f6..822f46f 100644 --- a/ZertoApiWrapper/Public/Get-ZAJournalAverageSiteSize.ps1 +++ b/ZertoApiWrapper/Public/Get-ZAJournalSiteAverageSize.ps1 @@ -1,5 +1,5 @@ <# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> -function Get-ZAJournalAverageSiteSize { +function Get-ZAJournalSiteAverageSize { [CmdletBinding()] param ( [Parameter( diff --git a/docs/Get-ZAJournalAverageSiteSize.md b/docs/Get-ZAJournalSiteAverageSize.md similarity index 90% rename from docs/Get-ZAJournalAverageSiteSize.md rename to docs/Get-ZAJournalSiteAverageSize.md index a8935a7..dc1510c 100644 --- a/docs/Get-ZAJournalAverageSiteSize.md +++ b/docs/Get-ZAJournalSiteAverageSize.md @@ -1,11 +1,11 @@ --- external help file: ZertoApiWrapper-help.xml Module Name: ZertoApiWrapper -online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAJournalAverageSiteSize.md +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAJournalSiteAverageSize.md schema: 2.0.0 --- -# Get-ZAJournalAverageSiteSize +# Get-ZAJournalSiteAverageSize ## SYNOPSIS @@ -14,7 +14,7 @@ Get list of samples of total Journal Size of all VPGs replicating to a specified ## SYNTAX ``` -Get-ZAJournalAverageSiteSize [-recoverySiteIdentifier] [[-startDate] ] [[-endDate] ] +Get-ZAJournalSiteAverageSize [-recoverySiteIdentifier] [[-startDate] ] [[-endDate] ] [[-interval] ] [] ``` @@ -26,21 +26,21 @@ Get list of samples of total Journal Size of all VPGs replicating to a specified ### Example 1 ```powershell -PS C:\> Get-ZAJournalAverageSiteSize -recoverySiteIdentifier "9876-5432-1098" +PS C:\> Get-ZAJournalSiteAverageSize -recoverySiteIdentifier "9876-5432-1098" ``` Returns Journal Average Size information for the recovery site with identifier "9876-5432-1098" ### Example 2 ```powershell -PS C:\> Get-ZAJournalAverageSiteSize -recoverySiteIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" +PS C:\> Get-ZAJournalSiteAverageSize -recoverySiteIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" ``` Returns Journal Average Size information for the recovery site with identifier "9876-5432-1098" between the dates specified. ### Example 3 ```powershell -PS C:\> Get-ZAJournalAverageSiteSize -recoverySiteIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" -interval 7200 +PS C:\> Get-ZAJournalSiteAverageSize -recoverySiteIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" -interval 7200 ``` Returns Journal Average Size information for the recovery site with identifier "9876-5432-1098" between the dates specified with a 2 hour interval. From a74bc14e306b0dd60c74fd5d2e187cbfe41a2ca7 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 9 Jun 2019 15:26:28 -0400 Subject: [PATCH 081/108] Function Rename --- ...ts.ps1 => Get-ZAJournalSiteHistoryStat.Tests.ps1} | 0 ...SiteStat.ps1 => Get-ZAJournalSiteHistoryStat.ps1} | 2 +- ...rySiteStat.md => Get-ZAJournalSiteHistoryStat.md} | 12 ++++++------ 3 files changed, 7 insertions(+), 7 deletions(-) rename Tests/Public/{Get-ZAJournalHistorySiteStat.Tests.ps1 => Get-ZAJournalSiteHistoryStat.Tests.ps1} (100%) rename ZertoApiWrapper/Public/{Get-ZAJournalHistorySiteStat.ps1 => Get-ZAJournalSiteHistoryStat.ps1} (96%) rename docs/{Get-ZAJournalHistorySiteStat.md => Get-ZAJournalSiteHistoryStat.md} (90%) diff --git a/Tests/Public/Get-ZAJournalHistorySiteStat.Tests.ps1 b/Tests/Public/Get-ZAJournalSiteHistoryStat.Tests.ps1 similarity index 100% rename from Tests/Public/Get-ZAJournalHistorySiteStat.Tests.ps1 rename to Tests/Public/Get-ZAJournalSiteHistoryStat.Tests.ps1 diff --git a/ZertoApiWrapper/Public/Get-ZAJournalHistorySiteStat.ps1 b/ZertoApiWrapper/Public/Get-ZAJournalSiteHistoryStat.ps1 similarity index 96% rename from ZertoApiWrapper/Public/Get-ZAJournalHistorySiteStat.ps1 rename to ZertoApiWrapper/Public/Get-ZAJournalSiteHistoryStat.ps1 index 43e3993..98b5823 100644 --- a/ZertoApiWrapper/Public/Get-ZAJournalHistorySiteStat.ps1 +++ b/ZertoApiWrapper/Public/Get-ZAJournalSiteHistoryStat.ps1 @@ -1,5 +1,5 @@ <# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> -function Get-ZAJournalHistorySiteStat { +function Get-ZAJournalSiteHistoryStat { [CmdletBinding()] param ( [Parameter( diff --git a/docs/Get-ZAJournalHistorySiteStat.md b/docs/Get-ZAJournalSiteHistoryStat.md similarity index 90% rename from docs/Get-ZAJournalHistorySiteStat.md rename to docs/Get-ZAJournalSiteHistoryStat.md index ffdb292..437cde4 100644 --- a/docs/Get-ZAJournalHistorySiteStat.md +++ b/docs/Get-ZAJournalSiteHistoryStat.md @@ -1,11 +1,11 @@ --- external help file: ZertoApiWrapper-help.xml Module Name: ZertoApiWrapper -online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAJournalHistorySiteStat.md +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAJournalSiteHistoryStat.md schema: 2.0.0 --- -# Get-ZAJournalHistorySiteStat +# Get-ZAJournalSiteHistoryStat ## SYNOPSIS @@ -14,7 +14,7 @@ Get Max, Avg. and Min Journal History statistics for all VPGs replicating to a s ## SYNTAX ``` -Get-ZAJournalHistorySiteStat [-recoverySiteIdentifier] [[-startDate] ] [[-endDate] ] +Get-ZAJournalSiteHistoryStat [-recoverySiteIdentifier] [[-startDate] ] [[-endDate] ] [[-interval] ] [] ``` @@ -26,21 +26,21 @@ Get Max, Avg. and Min Journal History statistics for all VPGs replicating to a s ### Example 1 ```powershell -PS C:\> Get-ZAJournalHistorySiteStat -recoverySiteIdentifier "9876-5432-1098" +PS C:\> Get-ZAJournalSiteHistoryStat -recoverySiteIdentifier "9876-5432-1098" ``` Returns Journal Average History information for the recovery site with identifier "9876-5432-1098" ### Example 2 ```powershell -PS C:\> Get-ZAJournalHistorySiteStat -recoverySiteIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" +PS C:\> Get-ZAJournalSiteHistoryStat -recoverySiteIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" ``` Returns Journal Average History information for the recovery site with identifier "9876-5432-1098" between the dates specified. ### Example 3 ```powershell -PS C:\> Get-ZAJournalHistorySiteStat -recoverySiteIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" -interval 7200 +PS C:\> Get-ZAJournalSiteHistoryStat -recoverySiteIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" -interval 7200 ``` Returns Journal Average History information for the recovery site with identifier "9876-5432-1098" between the dates specified with a 2 hour interval. From 8b6f4999b2ffcb1a522386254f8603e237761de7 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 9 Jun 2019 15:27:02 -0400 Subject: [PATCH 082/108] Create Function and Required Docs Get-ZAJournalSiteSizeStat --- .../Get-ZAJournalSiteSizeStat.Tests.ps1 | 19 +++ .../Public/Get-ZAJournalSiteSizeStat.ps1 | 31 +++++ docs/Get-ZAJournalSiteSizeStat.md | 123 ++++++++++++++++++ 3 files changed, 173 insertions(+) create mode 100644 Tests/Public/Get-ZAJournalSiteSizeStat.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZAJournalSiteSizeStat.ps1 create mode 100644 docs/Get-ZAJournalSiteSizeStat.md diff --git a/Tests/Public/Get-ZAJournalSiteSizeStat.Tests.ps1 b/Tests/Public/Get-ZAJournalSiteSizeStat.Tests.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZAJournalSiteSizeStat.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-ZAJournalSiteSizeStat.ps1 b/ZertoApiWrapper/Public/Get-ZAJournalSiteSizeStat.ps1 new file mode 100644 index 0000000..4461d57 --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZAJournalSiteSizeStat.ps1 @@ -0,0 +1,31 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZAJournalSiteSizeStat { + [CmdletBinding()] + param ( + [Parameter( + HelpMessage = "The identifier of the VPG.", + Mandatory + )] + [ValidateNotNullOrEmpty()] + [string]$vpgIdentifier, + [Parameter( + HelpMessage = "The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). If only the end date is added, the start date by default will be the end date minus 7 days." + )] + [ValidateNotNullOrEmpty()] + [string]$startDate, + [Parameter( + HelpMessage = "The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). The default is the current time." + )] + [ValidateNotNullOrEmpty()] + [string]$endDate, + [Parameter( + HelpMessage = "The interval selected within the duration of the report. The interval can be per hour, for up to 15 days’ time frame or per day, for between 15 to 30 days' time frame. Submit value in Seconds" + )] + [ValidateRange(60, 2678400)] + [Int32]$interval + ) + + $filter = Get-ZertoApiFilter -filtertable $PSBoundParameters + $uri = "reports/site-journal-size-stats{0}" -f $filter + Invoke-ZARestRequest -uri $uri +} diff --git a/docs/Get-ZAJournalSiteSizeStat.md b/docs/Get-ZAJournalSiteSizeStat.md new file mode 100644 index 0000000..35069c1 --- /dev/null +++ b/docs/Get-ZAJournalSiteSizeStat.md @@ -0,0 +1,123 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAJournalSiteSizeStat.md +schema: 2.0.0 +--- + +# Get-ZAJournalSiteSizeStat + +## SYNOPSIS + +Get Max, Avg. and Min of total Journal Size statistics for all VPGs replicating to a specified recovery site, filtered by start date, end date, and optional interval. The interval defines the journal history samples interval. + +## SYNTAX + +``` +Get-ZAJournalSiteSizeStat [-recoverySiteIdentifier] [[-startDate] ] [[-endDate] ] + [[-interval] ] [] +``` + +## DESCRIPTION + +Get Max, Avg. and Min of total Journal Size statistics for all VPGs replicating to a specified recovery site, filtered by start date, end date, and optional interval. The interval defines the journal history samples interval. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZAJournalSiteSizeStat -recoverySiteIdentifier "9876-5432-1098" +``` + +Returns Journal Size Statistics information for the recovery site with identifier "9876-5432-1098" + +### Example 2 +```powershell +PS C:\> Get-ZAJournalSiteSizeStat -recoverySiteIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" +``` + +Returns Journal Size Statistics information for the recovery site with identifier "9876-5432-1098" between the dates specified. + +### Example 3 +```powershell +PS C:\> Get-ZAJournalSiteSizeStat -recoverySiteIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" -interval 7200 +``` + +Returns Journal Size Statistics information for the recovery site with identifier "9876-5432-1098" between the dates specified with a 2 hour interval. + +## PARAMETERS + +### -endDate +The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +The default 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 +``` + +### -interval +The interval selected within the duration of the report. The interval can be per hour, for up to 15 days' time frame or per day, for between 15 to 30 days' time frame. Submit value in Seconds + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: 4 +Default value: 0 +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -startDate +The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If only the end date is added, the start date by default will be the end date minus 7 days. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -recoverySiteIdentifier +The identifier of the VPG. + +```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 Journal Site size Stats](https://docs.api.zerto.com/#/Journal_Reports/get_v2_reports_site_journal_size_stats) From 7a80131e950674cb5980eb105e8f54553bfd700c Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 9 Jun 2019 15:31:09 -0400 Subject: [PATCH 083/108] Create Function and required docs Get-ZAJournalSiteHistorySummary --- .../Get-ZAJournalSiteHistorySummary.Tests.ps1 | 19 +++ .../Get-ZAJournalSiteHistorySummary.ps1 | 31 +++++ docs/Get-ZAJournalSiteHistorySummary.md | 123 ++++++++++++++++++ 3 files changed, 173 insertions(+) create mode 100644 Tests/Public/Get-ZAJournalSiteHistorySummary.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZAJournalSiteHistorySummary.ps1 create mode 100644 docs/Get-ZAJournalSiteHistorySummary.md diff --git a/Tests/Public/Get-ZAJournalSiteHistorySummary.Tests.ps1 b/Tests/Public/Get-ZAJournalSiteHistorySummary.Tests.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZAJournalSiteHistorySummary.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-ZAJournalSiteHistorySummary.ps1 b/ZertoApiWrapper/Public/Get-ZAJournalSiteHistorySummary.ps1 new file mode 100644 index 0000000..c749572 --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZAJournalSiteHistorySummary.ps1 @@ -0,0 +1,31 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZAJournalSiteHistorySummary { + [CmdletBinding()] + param ( + [Parameter( + HelpMessage = "The identifier of the VPG.", + Mandatory + )] + [ValidateNotNullOrEmpty()] + [string]$vpgIdentifier, + [Parameter( + HelpMessage = "The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). If only the end date is added, the start date by default will be the end date minus 7 days." + )] + [ValidateNotNullOrEmpty()] + [string]$startDate, + [Parameter( + HelpMessage = "The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). The default is the current time." + )] + [ValidateNotNullOrEmpty()] + [string]$endDate, + [Parameter( + HelpMessage = "The interval selected within the duration of the report. The interval can be per hour, for up to 15 days’ time frame or per day, for between 15 to 30 days' time frame. Submit value in Seconds" + )] + [ValidateRange(60, 2678400)] + [Int32]$interval + ) + + $filter = Get-ZertoApiFilter -filtertable $PSBoundParameters + $uri = "reports/site-journal-history-summary{0}" -f $filter + Invoke-ZARestRequest -uri $uri +} diff --git a/docs/Get-ZAJournalSiteHistorySummary.md b/docs/Get-ZAJournalSiteHistorySummary.md new file mode 100644 index 0000000..e986549 --- /dev/null +++ b/docs/Get-ZAJournalSiteHistorySummary.md @@ -0,0 +1,123 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAJournalSiteHistorySummary.md +schema: 2.0.0 +--- + +# Get-ZAJournalSiteHistorySummary + +## SYNOPSIS + +Get a Journal History executive summary for all VPGs replicating to a specified recovery site. + +## SYNTAX + +``` +Get-ZAJournalSiteHistorySummary [-recoverySiteIdentifier] [[-startDate] ] [[-endDate] ] + [[-interval] ] [] +``` + +## DESCRIPTION + +Get a Journal History executive summary for all VPGs replicating to a specified recovery site. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZAJournalSiteHistorySummary -recoverySiteIdentifier "9876-5432-1098" +``` + +Returns Journal History Executive Summary information for the recovery site with identifier "9876-5432-1098" + +### Example 2 +```powershell +PS C:\> Get-ZAJournalSiteHistorySummary -recoverySiteIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" +``` + +Returns Journal History Executive Summary information for the recovery site with identifier "9876-5432-1098" between the dates specified. + +### Example 3 +```powershell +PS C:\> Get-ZAJournalSiteHistorySummary -recoverySiteIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" -interval 7200 +``` + +Returns Journal History Executive Summary information for the recovery site with identifier "9876-5432-1098" between the dates specified with a 2 hour interval. + +## PARAMETERS + +### -endDate +The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +The default 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 +``` + +### -interval +The interval selected within the duration of the report. The interval can be per hour, for up to 15 days' time frame or per day, for between 15 to 30 days' time frame. Submit value in Seconds + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: 4 +Default value: 0 +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -startDate +The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If only the end date is added, the start date by default will be the end date minus 7 days. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -recoverySiteIdentifier +The identifier of the VPG. + +```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 Journal Site History Summary](https://docs.api.zerto.com/#/Journal_Reports/get_v2_reports_site_journal_history_summary) From 27c44056a52f64b8a10d6354fa1d1a10dfcbb2c0 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 9 Jun 2019 16:02:16 -0400 Subject: [PATCH 084/108] Create Function and Associated Docs Get-ZASitePair --- Tests/Public/Get-ZASitePair.Tests.ps1 | 19 ++++ ZertoApiWrapper/Public/Get-ZASitePair.ps1 | 24 +++++ docs/Get-ZASitePair.md | 104 ++++++++++++++++++++++ 3 files changed, 147 insertions(+) create mode 100644 Tests/Public/Get-ZASitePair.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZASitePair.ps1 create mode 100644 docs/Get-ZASitePair.md diff --git a/Tests/Public/Get-ZASitePair.Tests.ps1 b/Tests/Public/Get-ZASitePair.Tests.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZASitePair.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-ZASitePair.ps1 b/ZertoApiWrapper/Public/Get-ZASitePair.ps1 new file mode 100644 index 0000000..1c3d724 --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZASitePair.ps1 @@ -0,0 +1,24 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZASitePair { + [cmdletbinding()] + param( + [Parameter( + HelpMessage = "The ZORG identifier by which to filter the site list. If the ZORG identifier is omitted, a list of all sites is retrieved." + )] + [ValidateNotNullOrEmpty()] + [string]$zOrgIdentifier, + [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." + )] + [ValidateNotNullOrEmpty()] + [string]$startDate, + [Parameter( + HelpMessage = "End date in RFC 3339 standard ('1970-01-01T00:00:00Z'). If the end date is omitted, the default endDate is the current date." + )] + [ValidateNotNullOrEmpty()] + [string]$endDate + ) + $filter = Get-ZertoApiFilter -filterTable $PSBoundParameters + $uri = "reports/sites-list{0}" -f $filter + Invoke-ZARestRequest -uri $uri +} diff --git a/docs/Get-ZASitePair.md b/docs/Get-ZASitePair.md new file mode 100644 index 0000000..f616f8b --- /dev/null +++ b/docs/Get-ZASitePair.md @@ -0,0 +1,104 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZASitePair.md +schema: 2.0.0 +--- + +# Get-ZASitePair + +## SYNOPSIS + +Get all the sites, protected and recovery, filtered by start date and end date. + +## SYNTAX + +``` +Get-ZASitePair [[-zOrgIdentifier] ] [[-startDate] ] [[-endDate] ] [] +``` + +## DESCRIPTION + +Get all the sites, protected and recovery, filtered by start date and end date. +* When startDate is omitted, the default startDate is 7 days before the endDate. +* When endDate is ommited, the default endDate is the current date. +* When both startDate and endDate are omitted, the default date range is the last 7 days. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZASitePair +``` + +Returns all site pairings. + +### Example 1 +```powershell +PS C:\> Get-ZASitePair -zOrgIdentifier "9876-5432-1098" +``` + +Returns all site pairings belonging to zOrg with Identifier "9876-5432-1098". + +## PARAMETERS + +### -endDate +End date in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If the end date is omitted, the default endDate is the current date. + +```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 +``` + +### -zOrgIdentifier +The ZORG identifier by which to filter the site list. +If the ZORG identifier is omitted, a list of all sites is retrieved. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +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 Site Pairs](https://docs.api.zerto.com/#/Network_Reports/get_v2_reports_sites_list) From 58e948dfbce1dac03d6d6dccfe12072c1e48d7ae Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 9 Jun 2019 16:03:02 -0400 Subject: [PATCH 085/108] Update Help Parameters --- docs/Get-ZAJournalSiteAverageHistory.md | 34 ++++++++++++------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/docs/Get-ZAJournalSiteAverageHistory.md b/docs/Get-ZAJournalSiteAverageHistory.md index 13a0bb6..e514e06 100644 --- a/docs/Get-ZAJournalSiteAverageHistory.md +++ b/docs/Get-ZAJournalSiteAverageHistory.md @@ -14,8 +14,8 @@ Get list of samples of average Journal History values for all VPGs replicating t ## SYNTAX ``` -Get-ZAJournalSiteAverageHistory [-recoverySiteIdentifier] [[-startDate] ] [[-endDate] ] - [[-interval] ] [] +Get-ZAJournalSiteAverageHistory [-recoverySiteIdentifier] [[-startDate] ] + [[-endDate] ] [[-interval] ] [] ``` ## DESCRIPTION @@ -78,6 +78,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -recoverySiteIdentifier +The identifier of the recovery site. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -startDate The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). If only the end date is added, the start date by default will be the end date minus 7 days. @@ -94,21 +109,6 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -recoverySiteIdentifier -The identifier of the VPG. - -```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). From 1da569fa6acf0e9f4df948e9a905c1669cf0ca83 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 9 Jun 2019 16:03:31 -0400 Subject: [PATCH 086/108] Correct Parameter in Help File --- docs/Get-ZAJournalSiteAverageSize.md | 30 ++++++++++++++-------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/docs/Get-ZAJournalSiteAverageSize.md b/docs/Get-ZAJournalSiteAverageSize.md index dc1510c..7699b8c 100644 --- a/docs/Get-ZAJournalSiteAverageSize.md +++ b/docs/Get-ZAJournalSiteAverageSize.md @@ -78,6 +78,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -recoverySiteIdentifier +The identifier of the recovery Site. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -startDate The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). If only the end date is added, the start date by default will be the end date minus 7 days. @@ -94,21 +109,6 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -recoverySiteIdentifier -The identifier of the VPG. - -```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). From c6a53688ec7706f4b856c175680df9d55a69e908 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 9 Jun 2019 16:04:57 -0400 Subject: [PATCH 087/108] Correct Parameter Variable Name --- ZertoApiWrapper/Public/Get-ZAJournalSiteHistoryStat.ps1 | 4 ++-- docs/Get-ZAJournalSiteHistoryStat.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ZertoApiWrapper/Public/Get-ZAJournalSiteHistoryStat.ps1 b/ZertoApiWrapper/Public/Get-ZAJournalSiteHistoryStat.ps1 index 98b5823..c911cd1 100644 --- a/ZertoApiWrapper/Public/Get-ZAJournalSiteHistoryStat.ps1 +++ b/ZertoApiWrapper/Public/Get-ZAJournalSiteHistoryStat.ps1 @@ -3,11 +3,11 @@ function Get-ZAJournalSiteHistoryStat { [CmdletBinding()] param ( [Parameter( - HelpMessage = "The identifier of the VPG.", + HelpMessage = "The identifier of the recovery site.", Mandatory )] [ValidateNotNullOrEmpty()] - [string]$vpgIdentifier, + [string]$recoverySiteIdentifier, [Parameter( HelpMessage = "The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). If only the end date is added, the start date by default will be the end date minus 7 days." )] diff --git a/docs/Get-ZAJournalSiteHistoryStat.md b/docs/Get-ZAJournalSiteHistoryStat.md index 437cde4..1b247a6 100644 --- a/docs/Get-ZAJournalSiteHistoryStat.md +++ b/docs/Get-ZAJournalSiteHistoryStat.md @@ -95,7 +95,7 @@ Accept wildcard characters: False ``` ### -recoverySiteIdentifier -The identifier of the VPG. +The identifier of the recovery site. ```yaml Type: String From d31b4ce995696abd1fd7d334ddc5de3fe0a39c8d Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 9 Jun 2019 16:05:47 -0400 Subject: [PATCH 088/108] Update Mis-named variable --- ZertoApiWrapper/Public/Get-ZAJournalSiteHistorySummary.ps1 | 4 ++-- docs/Get-ZAJournalSiteHistorySummary.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ZertoApiWrapper/Public/Get-ZAJournalSiteHistorySummary.ps1 b/ZertoApiWrapper/Public/Get-ZAJournalSiteHistorySummary.ps1 index c749572..b8f2688 100644 --- a/ZertoApiWrapper/Public/Get-ZAJournalSiteHistorySummary.ps1 +++ b/ZertoApiWrapper/Public/Get-ZAJournalSiteHistorySummary.ps1 @@ -3,11 +3,11 @@ function Get-ZAJournalSiteHistorySummary { [CmdletBinding()] param ( [Parameter( - HelpMessage = "The identifier of the VPG.", + HelpMessage = "The identifier of the recovery site.", Mandatory )] [ValidateNotNullOrEmpty()] - [string]$vpgIdentifier, + [string]$recoverySiteIdentifier, [Parameter( HelpMessage = "The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). If only the end date is added, the start date by default will be the end date minus 7 days." )] diff --git a/docs/Get-ZAJournalSiteHistorySummary.md b/docs/Get-ZAJournalSiteHistorySummary.md index e986549..9f18690 100644 --- a/docs/Get-ZAJournalSiteHistorySummary.md +++ b/docs/Get-ZAJournalSiteHistorySummary.md @@ -95,7 +95,7 @@ Accept wildcard characters: False ``` ### -recoverySiteIdentifier -The identifier of the VPG. +The identifier of the recovery site. ```yaml Type: String From e33b45a274825ed0a990aa5c004816f9c6201c0b Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 9 Jun 2019 16:06:24 -0400 Subject: [PATCH 089/108] Correct mis-named variable --- ZertoApiWrapper/Public/Get-ZAJournalSiteSizeStat.ps1 | 2 +- docs/Get-ZAJournalSiteSizeStat.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ZertoApiWrapper/Public/Get-ZAJournalSiteSizeStat.ps1 b/ZertoApiWrapper/Public/Get-ZAJournalSiteSizeStat.ps1 index 4461d57..0f1df3e 100644 --- a/ZertoApiWrapper/Public/Get-ZAJournalSiteSizeStat.ps1 +++ b/ZertoApiWrapper/Public/Get-ZAJournalSiteSizeStat.ps1 @@ -7,7 +7,7 @@ function Get-ZAJournalSiteSizeStat { Mandatory )] [ValidateNotNullOrEmpty()] - [string]$vpgIdentifier, + [string]$recoverySiteIdentifier, [Parameter( HelpMessage = "The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). If only the end date is added, the start date by default will be the end date minus 7 days." )] diff --git a/docs/Get-ZAJournalSiteSizeStat.md b/docs/Get-ZAJournalSiteSizeStat.md index 35069c1..2fada19 100644 --- a/docs/Get-ZAJournalSiteSizeStat.md +++ b/docs/Get-ZAJournalSiteSizeStat.md @@ -95,7 +95,7 @@ Accept wildcard characters: False ``` ### -recoverySiteIdentifier -The identifier of the VPG. +The identifier of the recovery site. ```yaml Type: String From fb7fd5abb80bae708065c9939f0ee9a88c4bc7eb Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 9 Jun 2019 16:18:09 -0400 Subject: [PATCH 090/108] Update Parameter Information --- docs/Get-ZAJournalSiteHistoryStat.md | 30 +++++++++++----------- docs/Get-ZAJournalSiteHistorySummary.md | 34 ++++++++++++------------- docs/Get-ZAJournalSiteSizeStat.md | 30 +++++++++++----------- 3 files changed, 47 insertions(+), 47 deletions(-) diff --git a/docs/Get-ZAJournalSiteHistoryStat.md b/docs/Get-ZAJournalSiteHistoryStat.md index 1b247a6..d88a655 100644 --- a/docs/Get-ZAJournalSiteHistoryStat.md +++ b/docs/Get-ZAJournalSiteHistoryStat.md @@ -78,6 +78,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -recoverySiteIdentifier +The identifier of the recovery site. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -startDate The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). If only the end date is added, the start date by default will be the end date minus 7 days. @@ -94,21 +109,6 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -recoverySiteIdentifier -The identifier of the recovery site. - -```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). diff --git a/docs/Get-ZAJournalSiteHistorySummary.md b/docs/Get-ZAJournalSiteHistorySummary.md index 9f18690..e5e6d36 100644 --- a/docs/Get-ZAJournalSiteHistorySummary.md +++ b/docs/Get-ZAJournalSiteHistorySummary.md @@ -14,8 +14,8 @@ Get a Journal History executive summary for all VPGs replicating to a specified ## SYNTAX ``` -Get-ZAJournalSiteHistorySummary [-recoverySiteIdentifier] [[-startDate] ] [[-endDate] ] - [[-interval] ] [] +Get-ZAJournalSiteHistorySummary [-recoverySiteIdentifier] [[-startDate] ] + [[-endDate] ] [[-interval] ] [] ``` ## DESCRIPTION @@ -78,6 +78,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -recoverySiteIdentifier +The identifier of the recovery site. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -startDate The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). If only the end date is added, the start date by default will be the end date minus 7 days. @@ -94,21 +109,6 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -recoverySiteIdentifier -The identifier of the recovery site. - -```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). diff --git a/docs/Get-ZAJournalSiteSizeStat.md b/docs/Get-ZAJournalSiteSizeStat.md index 2fada19..16bb3a0 100644 --- a/docs/Get-ZAJournalSiteSizeStat.md +++ b/docs/Get-ZAJournalSiteSizeStat.md @@ -78,6 +78,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -recoverySiteIdentifier +The identifier of the recovery site. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -startDate The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). If only the end date is added, the start date by default will be the end date minus 7 days. @@ -94,21 +109,6 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -recoverySiteIdentifier -The identifier of the recovery site. - -```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). From 9a2e1c63add1452f934c5a9b22a7cfe77064aadb Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 9 Jun 2019 16:18:36 -0400 Subject: [PATCH 091/108] Create Function and Required Docs Get-ZANetworkSiteSummary --- .../Public/Get-ZANetworkSiteSummary.Tests.ps1 | 19 +++ .../Public/Get-ZANetworkSiteSummary.ps1 | 47 +++++ docs/Get-ZANetworkSiteSummary.md | 160 ++++++++++++++++++ 3 files changed, 226 insertions(+) create mode 100644 Tests/Public/Get-ZANetworkSiteSummary.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZANetworkSiteSummary.ps1 create mode 100644 docs/Get-ZANetworkSiteSummary.md diff --git a/Tests/Public/Get-ZANetworkSiteSummary.Tests.ps1 b/Tests/Public/Get-ZANetworkSiteSummary.Tests.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZANetworkSiteSummary.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-ZANetworkSiteSummary.ps1 b/ZertoApiWrapper/Public/Get-ZANetworkSiteSummary.ps1 new file mode 100644 index 0000000..c797e10 --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZANetworkSiteSummary.ps1 @@ -0,0 +1,47 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZANetworkSiteSummary { + [CmdletBinding(DefaultParameterSetName = "ProtectedSite")] + param ( + [Parameter( + HelpMessage = "Protected site identifier. A site identification is required for at least one of the sites.", + ParameterSetName = "ProtectedSite", + Mandatory + )] + [Parameter( + HelpMessage = "Protected site identifier. A site identification is required for at least one of the sites.", + ParameterSetName = "RecoverySite" + )] + [ValidateNotNullOrEmpty()] + [string]$protectedSiteIdentifier, + [Parameter( + HelpMessage = "Recovery site identifier. If the recovery site identifier is omitted, the API will show all outgoing traffic from the protected site to its replicating sites.", + ParameterSetName = "RecoverySite", + Mandatory + )] + [Parameter( + HelpMessage = "Recovery site identifier. If the recovery site identifier is omitted, the API will show all outgoing traffic from the protected site to its replicating sites.", + ParameterSetName = "ProtectedSite" + )] + [ValidateNotNullOrEmpty()] + [string]$recoverySiteIdentifier, + [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." + )] + [ValidateNotNullOrEmpty()] + [string]$startDate, + [Parameter( + HelpMessage = "End date in RFC 3339 standard ('1970-01-01T00:00:00Z'). If the end date is ommitted, the default end date is the current time." + )] + [ValidateNotNullOrEmpty()] + [string]$endDate, + [Parameter( + HelpMessage = "The ZORG identifier by which to filter the excutive summary." + )] + [ValidateNotNullOrEmpty()] + [string]$zOrgIdentifier + ) + + $filter = Get-ZertoAPIFilter -filtertable $PSBoundParameters + $uri = "reports/sites-network-summary{0}" -f $filter + Invoke-ZARestRequest -uri $uri +} diff --git a/docs/Get-ZANetworkSiteSummary.md b/docs/Get-ZANetworkSiteSummary.md new file mode 100644 index 0000000..f7f40dc --- /dev/null +++ b/docs/Get-ZANetworkSiteSummary.md @@ -0,0 +1,160 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAMonitoring.md +schema: 2.0.0 +--- + +# Get-ZANetworkSiteSummary + +## SYNOPSIS + +Get a network executive summary for sites, filtered by start date and end date. + +## SYNTAX + +### ProtectedSite (Default) +``` +Get-ZANetworkSiteSummary -protectedSiteIdentifier [-recoverySiteIdentifier ] + [-startDate ] [-endDate ] [-zOrgIdentifier ] [] +``` + +### RecoverySite +``` +Get-ZANetworkSiteSummary [-protectedSiteIdentifier ] -recoverySiteIdentifier + [-startDate ] [-endDate ] [-zOrgIdentifier ] [] +``` + +## DESCRIPTION + +Get a network executive summary for sites, filtered by start date and end date.The following options are available: + +* To view the network executive summary of all outgoing traffic from a protected site to all its replicating sites, specify only the protected site identifier. +* To view the network executive summary between two sites, specifiy both the protected site identifier and the recovery site identifier. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> {{ Add example code here }} +``` + +{{ Add example description here }} + +## PARAMETERS + +### -endDate +End date in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If the end date is ommitted, the default end date is the current time. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -protectedSiteIdentifier +Protected site identifier. +A site identification is required for at least one of the sites. + +```yaml +Type: String +Parameter Sets: ProtectedSite +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +```yaml +Type: String +Parameter Sets: RecoverySite +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -recoverySiteIdentifier +Recovery site identifier. +If the recovery site identifier is omitted, the API will show all outgoing traffic from the protected site to its replicating sites. + +```yaml +Type: String +Parameter Sets: ProtectedSite +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +```yaml +Type: String +Parameter Sets: RecoverySite +Aliases: + +Required: True +Position: Named +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: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -zOrgIdentifier +The ZORG identifier by which to filter the excutive summary. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +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 Site Summary](https://docs.api.zerto.com/#/Network_Reports/get_v2_reports_sites_network_summary) From ff809b733fd7d090df8db17f3428c896816a5605 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 10 Jun 2019 07:58:33 -0400 Subject: [PATCH 092/108] Correct spelling errors and Add Examples --- .../Public/Get-ZANetworkSiteSummary.ps1 | 2 +- docs/Get-ZANetworkSiteSummary.md | 19 +++++++++++++------ 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/ZertoApiWrapper/Public/Get-ZANetworkSiteSummary.ps1 b/ZertoApiWrapper/Public/Get-ZANetworkSiteSummary.ps1 index c797e10..8257ae2 100644 --- a/ZertoApiWrapper/Public/Get-ZANetworkSiteSummary.ps1 +++ b/ZertoApiWrapper/Public/Get-ZANetworkSiteSummary.ps1 @@ -35,7 +35,7 @@ function Get-ZANetworkSiteSummary { [ValidateNotNullOrEmpty()] [string]$endDate, [Parameter( - HelpMessage = "The ZORG identifier by which to filter the excutive summary." + HelpMessage = "The ZORG identifier by which to filter the executive summary." )] [ValidateNotNullOrEmpty()] [string]$zOrgIdentifier diff --git a/docs/Get-ZANetworkSiteSummary.md b/docs/Get-ZANetworkSiteSummary.md index f7f40dc..a3050e9 100644 --- a/docs/Get-ZANetworkSiteSummary.md +++ b/docs/Get-ZANetworkSiteSummary.md @@ -1,7 +1,7 @@ --- external help file: ZertoApiWrapper-help.xml Module Name: ZertoApiWrapper -online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAMonitoring.md +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZANetworkSiteSummary.md schema: 2.0.0 --- @@ -30,22 +30,29 @@ Get-ZANetworkSiteSummary [-protectedSiteIdentifier ] -recoverySiteIdenti Get a network executive summary for sites, filtered by start date and end date.The following options are available: * To view the network executive summary of all outgoing traffic from a protected site to all its replicating sites, specify only the protected site identifier. -* To view the network executive summary between two sites, specifiy both the protected site identifier and the recovery site identifier. +* To view the network executive summary between two sites, specify both the protected site identifier and the recovery site identifier. ## EXAMPLES ### Example 1 ```powershell -PS C:\> {{ Add example code here }} +PS C:\> Get-ZANetworkSiteSummary -protectedSiteIdentifier "7890-1234-5678" ``` -{{ Add example description here }} +Returns outgoing networks summary from site with identifier "7890-1234-5678" + +### Example 2 +```powershell +PS C:\> Get-ZANetworkSiteSummary -protectedSiteIdentifier "7890-1234-5678" -recoverySiteIdentifier "9876-5432-1098" +``` + +Returns network summary between sites with identifiers "7890-1234-5678" and "9876-5432-1098" ## PARAMETERS ### -endDate End date in RFC 3339 standard ('1970-01-01T00:00:00Z'). -If the end date is ommitted, the default end date is the current time. +If the end date is omitted, the default end date is the current time. ```yaml Type: String @@ -132,7 +139,7 @@ Accept wildcard characters: False ``` ### -zOrgIdentifier -The ZORG identifier by which to filter the excutive summary. +The ZORG identifier by which to filter the executive summary. ```yaml Type: String From d3dbc71a64805b4b2ba1d2f5dcd316b537524cc8 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 10 Jun 2019 07:58:57 -0400 Subject: [PATCH 093/108] Create function and associated docs Get-ZANetworkSiteStat --- Tests/Public/Get-ZANetworkSiteStat1.ps1 | 19 ++ .../Public/Get-ZANetworkSiteStat.ps1 | 47 +++++ docs/Get-ZANetworkSiteStat.md | 167 ++++++++++++++++++ 3 files changed, 233 insertions(+) create mode 100644 Tests/Public/Get-ZANetworkSiteStat1.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZANetworkSiteStat.ps1 create mode 100644 docs/Get-ZANetworkSiteStat.md diff --git a/Tests/Public/Get-ZANetworkSiteStat1.ps1 b/Tests/Public/Get-ZANetworkSiteStat1.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZANetworkSiteStat1.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-ZANetworkSiteStat.ps1 b/ZertoApiWrapper/Public/Get-ZANetworkSiteStat.ps1 new file mode 100644 index 0000000..6762b4a --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZANetworkSiteStat.ps1 @@ -0,0 +1,47 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZANetworkSiteStat { + [CmdletBinding(DefaultParameterSetName = "ProtectedSite")] + param ( + [Parameter( + HelpMessage = "Protected site identifier. A site identification is required for at least one of the sites.", + ParameterSetName = "ProtectedSite", + Mandatory + )] + [Parameter( + HelpMessage = "Protected site identifier. A site identification is required for at least one of the sites.", + ParameterSetName = "RecoverySite" + )] + [ValidateNotNullOrEmpty()] + [string]$protectedSiteIdentifier, + [Parameter( + HelpMessage = "Recovery site identifier. If the recovery site identifier is omitted, the API will show all outgoing traffic from the protected site to its replicating sites.", + ParameterSetName = "RecoverySite", + Mandatory + )] + [Parameter( + HelpMessage = "Recovery site identifier. If the recovery site identifier is omitted, the API will show all outgoing traffic from the protected site to its replicating sites.", + ParameterSetName = "ProtectedSite" + )] + [ValidateNotNullOrEmpty()] + [string]$recoverySiteIdentifier, + [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." + )] + [ValidateNotNullOrEmpty()] + [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." + )] + [ValidateNotNullOrEmpty()] + [string]$endDate, + [Parameter( + HelpMessage = "The ZORG identifier by which to filter the executive summary." + )] + [ValidateNotNullOrEmpty()] + [string]$zOrgIdentifier + ) + + $filter = Get-ZertoAPIFilter -filtertable $PSBoundParameters + $uri = "reports/sites-network-stats{0}" -f $filter + Invoke-ZARestRequest -uri $uri +} diff --git a/docs/Get-ZANetworkSiteStat.md b/docs/Get-ZANetworkSiteStat.md new file mode 100644 index 0000000..8bb0167 --- /dev/null +++ b/docs/Get-ZANetworkSiteStat.md @@ -0,0 +1,167 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAMonitoring.md +schema: 2.0.0 +--- + +# Get-ZANetworkSiteStat + +## SYNOPSIS + +Get Max, Avg. and Min network statistics for Throughput, Wan and IOPS traffic for sites, filtered by start date and end date. + +## SYNTAX + +### ProtectedSite (Default) +``` +Get-ZANetworkSiteStat -protectedSiteIdentifier [-recoverySiteIdentifier ] + [-startDate ] [-endDate ] [-zOrgIdentifier ] [] +``` + +### RecoverySite +``` +Get-ZANetworkSiteStat [-protectedSiteIdentifier ] -recoverySiteIdentifier + [-startDate ] [-endDate ] [-zOrgIdentifier ] [] +``` + +## DESCRIPTION + +Get Max, Avg. and Min network statistics for Throughput, Wan and IOPS traffic for sites, filtered by start date and end date. The following options are available: + +* To view network stats of all outgoing traffic from a protected site to all its replicating sites, specify only the protected site identifier. +* To view network stats between two sites, specify both the protected site identifier and the recovery site identifier. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZANetworkSiteStat -protectedSiteIdentifier "7890-1234-5678" +``` + +Returns all outgoing networks stats from site with identifier "7890-1234-5678" + +### Example 2 +```powershell +PS C:\> Get-ZANetworkSiteStat -protectedSiteIdentifier "7890-1234-5678" -recoverySiteIdentifier "9876-5432-1098" +``` + +Returns all networks stats between sites with identifiers "7890-1234-5678" and "9876-5432-1098" + +## 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: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -protectedSiteIdentifier +Protected site identifier. +A site identification is required for at least one of the sites. + +```yaml +Type: String +Parameter Sets: ProtectedSite +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +```yaml +Type: String +Parameter Sets: RecoverySite +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -recoverySiteIdentifier +Recovery site identifier. +If the recovery site identifier is omitted, the API will show all outgoing traffic from the protected site to its replicating sites. + +```yaml +Type: String +Parameter Sets: ProtectedSite +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +```yaml +Type: String +Parameter Sets: RecoverySite +Aliases: + +Required: True +Position: Named +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: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -zOrgIdentifier +The ZORG identifier by which to filter the executive summary. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +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 Site Summary](https://docs.api.zerto.com/#/Network_Reports/get_v2_reports_sites_network_stats) From aaed38ee359e65cb06670fe31943b3125e81d3c8 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 10 Jun 2019 08:53:29 -0400 Subject: [PATCH 094/108] Fix filename typo --- ...Get-ZANetworkSiteStat1.ps1 => Get-ZANetworkSiteStat.Tests.ps1} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Tests/Public/{Get-ZANetworkSiteStat1.ps1 => Get-ZANetworkSiteStat.Tests.ps1} (100%) diff --git a/Tests/Public/Get-ZANetworkSiteStat1.ps1 b/Tests/Public/Get-ZANetworkSiteStat.Tests.ps1 similarity index 100% rename from Tests/Public/Get-ZANetworkSiteStat1.ps1 rename to Tests/Public/Get-ZANetworkSiteStat.Tests.ps1 From dce6d688b7e1259402c42e001ba06837e9575b4f Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 10 Jun 2019 08:53:48 -0400 Subject: [PATCH 095/108] Create function and required docs Get-ZANetworkSiteAveragePerformance --- ...-ZANetworkSiteAveragePerformance.Tests.ps1 | 19 ++ .../Get-ZANetworkSiteAveragePerformance.ps1 | 47 +++++ docs/Get-ZANetworkSiteAveragePerformance.md | 168 ++++++++++++++++++ 3 files changed, 234 insertions(+) create mode 100644 Tests/Public/Get-ZANetworkSiteAveragePerformance.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZANetworkSiteAveragePerformance.ps1 create mode 100644 docs/Get-ZANetworkSiteAveragePerformance.md diff --git a/Tests/Public/Get-ZANetworkSiteAveragePerformance.Tests.ps1 b/Tests/Public/Get-ZANetworkSiteAveragePerformance.Tests.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZANetworkSiteAveragePerformance.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-ZANetworkSiteAveragePerformance.ps1 b/ZertoApiWrapper/Public/Get-ZANetworkSiteAveragePerformance.ps1 new file mode 100644 index 0000000..e055a04 --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZANetworkSiteAveragePerformance.ps1 @@ -0,0 +1,47 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZANetworkSiteAveragePerformance { + [CmdletBinding(DefaultParameterSetName = "ProtectedSite")] + param ( + [Parameter( + HelpMessage = "Protected site identifier. A site identification is required for at least one of the sites.", + ParameterSetName = "ProtectedSite", + Mandatory + )] + [Parameter( + HelpMessage = "Protected site identifier. A site identification is required for at least one of the sites.", + ParameterSetName = "RecoverySite" + )] + [ValidateNotNullOrEmpty()] + [string]$protectedSiteIdentifier, + [Parameter( + HelpMessage = "Recovery site identifier. If the recovery site identifier is omitted, the API will show all outgoing traffic from the protected site to its replicating sites.", + ParameterSetName = "RecoverySite", + Mandatory + )] + [Parameter( + HelpMessage = "Recovery site identifier. If the recovery site identifier is omitted, the API will show all outgoing traffic from the protected site to its replicating sites.", + ParameterSetName = "ProtectedSite" + )] + [ValidateNotNullOrEmpty()] + [string]$recoverySiteIdentifier, + [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." + )] + [ValidateNotNullOrEmpty()] + [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." + )] + [ValidateNotNullOrEmpty()] + [string]$endDate, + [Parameter( + HelpMessage = "The ZORG identifier by which to filter the executive summary." + )] + [ValidateNotNullOrEmpty()] + [string]$zOrgIdentifier + ) + + $filter = Get-ZertoAPIFilter -filtertable $PSBoundParameters + $uri = "reports/sites-network-performance-average{0}" -f $filter + Invoke-ZARestRequest -uri $uri +} diff --git a/docs/Get-ZANetworkSiteAveragePerformance.md b/docs/Get-ZANetworkSiteAveragePerformance.md new file mode 100644 index 0000000..e8eff40 --- /dev/null +++ b/docs/Get-ZANetworkSiteAveragePerformance.md @@ -0,0 +1,168 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZANetworkSiteAveragePerformance.md +schema: 2.0.0 +--- + +# Get-ZANetworkSiteAveragePerformance + +## SYNOPSIS + +Get list of samples of average and maximum network performance metrics (throughput and WAN traffic) for sites, filtered by start date and end date, and optional intervals. + +## SYNTAX + +### ProtectedSite (Default) +``` +Get-ZANetworkSiteAveragePerformance -protectedSiteIdentifier [-recoverySiteIdentifier ] + [-startDate ] [-endDate ] [-zOrgIdentifier ] [] +``` + +### RecoverySite +``` +Get-ZANetworkSiteAveragePerformance [-protectedSiteIdentifier ] -recoverySiteIdentifier + [-startDate ] [-endDate ] [-zOrgIdentifier ] [] +``` + +## DESCRIPTION + +Get list of samples of average and maximum network performance metrics (throughput and WAN traffic) for sites, filtered by start date and end date, and optional intervals. +The following options are available: + +* To view average and maximum network performance of throughput vs. WAN traffic of all outgoing traffic from a protected site to all its replicating sites, specify only the protected site identifier. +* To view average and maximum network performance of throughput and WAN traffic between two sites, specifiy both the protected site identifier and the recovery site identifier. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZANetworkSiteAveragePerformance -protectedSiteIdentifier "7890-1234-5678" +``` + +Returns outgoing networks performance average from site with identifier "7890-1234-5678" + +### Example 2 +```powershell +PS C:\> Get-ZANetworkSiteAveragePerformance -protectedSiteIdentifier "7890-1234-5678" -recoverySiteIdentifier "9876-5432-1098" +``` + +Returns network performance average between sites with identifiers "7890-1234-5678" and "9876-5432-1098" + +## 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: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -protectedSiteIdentifier +Protected site identifier. +A site identification is required for at least one of the sites. + +```yaml +Type: String +Parameter Sets: ProtectedSite +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +```yaml +Type: String +Parameter Sets: RecoverySite +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -recoverySiteIdentifier +Recovery site identifier. +If the recovery site identifier is omitted, the API will show all outgoing traffic from the protected site to its replicating sites. + +```yaml +Type: String +Parameter Sets: ProtectedSite +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +```yaml +Type: String +Parameter Sets: RecoverySite +Aliases: + +Required: True +Position: Named +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: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -zOrgIdentifier +The ZORG identifier by which to filter the executive summary. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +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 Site Average Performance](https://docs.api.zerto.com/#/Network_Reports/get_v2_reports_sites_network_performance_average) From ee4419687a439357d095fbced70886c99bf84271 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 10 Jun 2019 09:06:29 -0400 Subject: [PATCH 096/108] Fix Spelling Error --- docs/Get-ZANetworkSiteAveragePerformance.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Get-ZANetworkSiteAveragePerformance.md b/docs/Get-ZANetworkSiteAveragePerformance.md index e8eff40..3c11784 100644 --- a/docs/Get-ZANetworkSiteAveragePerformance.md +++ b/docs/Get-ZANetworkSiteAveragePerformance.md @@ -31,7 +31,7 @@ Get list of samples of average and maximum network performance metrics (throughp The following options are available: * To view average and maximum network performance of throughput vs. WAN traffic of all outgoing traffic from a protected site to all its replicating sites, specify only the protected site identifier. -* To view average and maximum network performance of throughput and WAN traffic between two sites, specifiy both the protected site identifier and the recovery site identifier. +* To view average and maximum network performance of throughput and WAN traffic between two sites, specify both the protected site identifier and the recovery site identifier. ## EXAMPLES From 5447d1b4436f0340e5ad0beecb603a26b31663bb Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 10 Jun 2019 09:06:52 -0400 Subject: [PATCH 097/108] Create Function and associated docs Get-ZANetworkSiteAverageIOPS --- .../Get-ZANetworkSiteAverageIOPS.Tests.ps1 | 19 ++ .../Public/Get-ZANetworkSiteAverageIOPS.ps1 | 47 +++++ docs/Get-ZANetworkSiteAverageIOPS.md | 168 ++++++++++++++++++ 3 files changed, 234 insertions(+) create mode 100644 Tests/Public/Get-ZANetworkSiteAverageIOPS.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZANetworkSiteAverageIOPS.ps1 create mode 100644 docs/Get-ZANetworkSiteAverageIOPS.md diff --git a/Tests/Public/Get-ZANetworkSiteAverageIOPS.Tests.ps1 b/Tests/Public/Get-ZANetworkSiteAverageIOPS.Tests.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZANetworkSiteAverageIOPS.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-ZANetworkSiteAverageIOPS.ps1 b/ZertoApiWrapper/Public/Get-ZANetworkSiteAverageIOPS.ps1 new file mode 100644 index 0000000..3c0cf78 --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZANetworkSiteAverageIOPS.ps1 @@ -0,0 +1,47 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZANetworkSiteAverageIOPS { + [CmdletBinding(DefaultParameterSetName = "ProtectedSite")] + param ( + [Parameter( + HelpMessage = "Protected site identifier. A site identification is required for at least one of the sites.", + ParameterSetName = "ProtectedSite", + Mandatory + )] + [Parameter( + HelpMessage = "Protected site identifier. A site identification is required for at least one of the sites.", + ParameterSetName = "RecoverySite" + )] + [ValidateNotNullOrEmpty()] + [string]$protectedSiteIdentifier, + [Parameter( + HelpMessage = "Recovery site identifier. If the recovery site identifier is omitted, the API will show all outgoing traffic from the protected site to its replicating sites.", + ParameterSetName = "RecoverySite", + Mandatory + )] + [Parameter( + HelpMessage = "Recovery site identifier. If the recovery site identifier is omitted, the API will show all outgoing traffic from the protected site to its replicating sites.", + ParameterSetName = "ProtectedSite" + )] + [ValidateNotNullOrEmpty()] + [string]$recoverySiteIdentifier, + [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." + )] + [ValidateNotNullOrEmpty()] + [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." + )] + [ValidateNotNullOrEmpty()] + [string]$endDate, + [Parameter( + HelpMessage = "The ZORG identifier by which to filter the executive summary." + )] + [ValidateNotNullOrEmpty()] + [string]$zOrgIdentifier + ) + + $filter = Get-ZertoAPIFilter -filtertable $PSBoundParameters + $uri = "reports/sites-network-iops-average{0}" -f $filter + Invoke-ZARestRequest -uri $uri +} diff --git a/docs/Get-ZANetworkSiteAverageIOPS.md b/docs/Get-ZANetworkSiteAverageIOPS.md new file mode 100644 index 0000000..458c8e5 --- /dev/null +++ b/docs/Get-ZANetworkSiteAverageIOPS.md @@ -0,0 +1,168 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZANetworkSiteAverageIOPS.md +schema: 2.0.0 +--- + +# Get-ZANetworkSiteAverageIOPS + +## SYNOPSIS + +Get average and maximum IOPS performance for sites, filtered by start date and end date, and optional intervals. + +## SYNTAX + +### ProtectedSite (Default) +``` +Get-ZANetworkSiteAverageIOPS -protectedSiteIdentifier [-recoverySiteIdentifier ] + [-startDate ] [-endDate ] [-zOrgIdentifier ] [] +``` + +### RecoverySite +``` +Get-ZANetworkSiteAverageIOPS [-protectedSiteIdentifier ] -recoverySiteIdentifier + [-startDate ] [-endDate ] [-zOrgIdentifier ] [] +``` + +## DESCRIPTION + +Get average and maximum IOPS performance for sites, filtered by start date and end date, and optional intervals. +The following options are available: + +* To view average and maximum IOPS performance of all outgoing traffic from a protected site to all its replicating sites, specify only the protected site identifier. +* To view average and maximum IOPS performance between two sites, specify both the protected site identifier and the recovery site identifier. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZANetworkSiteAverageIOPS -protectedSiteIdentifier "7890-1234-5678" +``` + +Returns outgoing networks IOPS average from site with identifier "7890-1234-5678" + +### Example 2 +```powershell +PS C:\> Get-ZANetworkSiteAverageIOPS -protectedSiteIdentifier "7890-1234-5678" -recoverySiteIdentifier "9876-5432-1098" +``` + +Returns network IOPS average between sites with identifiers "7890-1234-5678" and "9876-5432-1098" + +## 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: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -protectedSiteIdentifier +Protected site identifier. +A site identification is required for at least one of the sites. + +```yaml +Type: String +Parameter Sets: ProtectedSite +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +```yaml +Type: String +Parameter Sets: RecoverySite +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -recoverySiteIdentifier +Recovery site identifier. +If the recovery site identifier is omitted, the API will show all outgoing traffic from the protected site to its replicating sites. + +```yaml +Type: String +Parameter Sets: ProtectedSite +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +```yaml +Type: String +Parameter Sets: RecoverySite +Aliases: + +Required: True +Position: Named +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: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -zOrgIdentifier +The ZORG identifier by which to filter the executive summary. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +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 Site Average IOPS](https://docs.api.zerto.com/#/Network_Reports/get_v2_reports_sites_network_iops_average) From b0763e965e85b4cf7c8c706c83501a8c607c8ac7 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 10 Jun 2019 09:39:36 -0400 Subject: [PATCH 098/108] Create Function and Required Docs Get-ZANetworkVpgStat --- Tests/Public/Get-ZANetworkVpgStat.Tests.ps1 | 19 ++++ .../Public/Get-ZANetworkVpgStat.ps1 | 23 +++++ docs/Get-ZANetworkVpgStat.md | 94 +++++++++++++++++++ 3 files changed, 136 insertions(+) create mode 100644 Tests/Public/Get-ZANetworkVpgStat.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZANetworkVpgStat.ps1 create mode 100644 docs/Get-ZANetworkVpgStat.md 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) From 2ed0169a0087df646ee6db580e6684654f9f68bb Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 10 Jun 2019 09:40:00 -0400 Subject: [PATCH 099/108] 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) From a0cc4214ca5ab0e090bc967f0f7d340551bb34e0 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 10 Jun 2019 09:54:07 -0400 Subject: [PATCH 100/108] Add parameter validation --- ZertoApiWrapper/Public/Get-ZANetworkVpgStat.ps1 | 3 +++ ZertoApiWrapper/Public/Get-ZANetworkVpgSummary.ps1 | 3 +++ 2 files changed, 6 insertions(+) diff --git a/ZertoApiWrapper/Public/Get-ZANetworkVpgStat.ps1 b/ZertoApiWrapper/Public/Get-ZANetworkVpgStat.ps1 index 55a6089..c135c6f 100644 --- a/ZertoApiWrapper/Public/Get-ZANetworkVpgStat.ps1 +++ b/ZertoApiWrapper/Public/Get-ZANetworkVpgStat.ps1 @@ -6,14 +6,17 @@ function Get-ZANetworkVpgStat { HelpMessage = "The VPG identifier.", Mandatory )] + [ValidateNotNullOrEmpty()] [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." )] + [ValidateNotNullOrEmpty()] [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." )] + [ValidateNotNullOrEmpty()] [string]$endDate ) diff --git a/ZertoApiWrapper/Public/Get-ZANetworkVpgSummary.ps1 b/ZertoApiWrapper/Public/Get-ZANetworkVpgSummary.ps1 index 5aeaed0..3654fcd 100644 --- a/ZertoApiWrapper/Public/Get-ZANetworkVpgSummary.ps1 +++ b/ZertoApiWrapper/Public/Get-ZANetworkVpgSummary.ps1 @@ -6,14 +6,17 @@ function Get-ZANetworkVpgSummary { HelpMessage = "The VPG identifier.", Mandatory )] + [ValidateNotNullOrEmpty()] [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." )] + [ValidateNotNullOrEmpty()] [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." )] + [ValidateNotNullOrEmpty()] [string]$endDate ) From 1ad528c11416052e08b01abe4135a6ee5ab5682f Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 10 Jun 2019 09:54:33 -0400 Subject: [PATCH 101/108] Create function and associated docs Get-ZANetwrokVpgAverageIOPS --- .../Get-ZANetworkVpgAverageIOPS.Tests.ps1 | 19 +++ .../Public/Get-ZANetworkVpgAverageIOPS.ps1 | 31 +++++ docs/Get-ZANetworkVpgAverageIOPS.md | 109 ++++++++++++++++++ 3 files changed, 159 insertions(+) create mode 100644 Tests/Public/Get-ZANetworkVpgAverageIOPS.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZANetworkVpgAverageIOPS.ps1 create mode 100644 docs/Get-ZANetworkVpgAverageIOPS.md diff --git a/Tests/Public/Get-ZANetworkVpgAverageIOPS.Tests.ps1 b/Tests/Public/Get-ZANetworkVpgAverageIOPS.Tests.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZANetworkVpgAverageIOPS.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-ZANetworkVpgAverageIOPS.ps1 b/ZertoApiWrapper/Public/Get-ZANetworkVpgAverageIOPS.ps1 new file mode 100644 index 0000000..b8eb8eb --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZANetworkVpgAverageIOPS.ps1 @@ -0,0 +1,31 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZANetworkVpgAverageIOPS { + [CmdletBinding()] + param ( + [Parameter( + HelpMessage = "The VPG identifier.", + Mandatory + )] + [ValidateNotNullOrEmpty()] + [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." + )] + [ValidateNotNullOrEmpty()] + [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." + )] + [ValidateNotNullOrEmpty()] + [string]$endDate, + [Parameter( + HelpMessage = "The interval selected within the duration of the report. The interval can be per minute - for up to 6 hours, per hour - for 6 hours to 15 days, or per day - for 15 days up to 30 days. If an interval is not specified, the default is 60 seconds. Submit value in Seconds." + )] + [ValidateRange(60, 2678400)] + [Int32]$interval + ) + + $filter = Get-ZertoAPIFilter -filtertable $PSBoundParameters + $uri = "reports/vpg-network-iops-average{0}" -f $filter + Invoke-ZARestRequest -uri $uri +} diff --git a/docs/Get-ZANetworkVpgAverageIOPS.md b/docs/Get-ZANetworkVpgAverageIOPS.md new file mode 100644 index 0000000..72dc7c5 --- /dev/null +++ b/docs/Get-ZANetworkVpgAverageIOPS.md @@ -0,0 +1,109 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZANetworkVpgAverageIOPS.md +schema: 2.0.0 +--- + +# Get-ZANetworkVpgAverageIOPS + +## SYNOPSIS + +Get average and maximum IOPS performance for a specific VPG, filtered by start date and end date, and optional intervals. + +## SYNTAX + +``` +Get-ZANetworkVpgAverageIOPS [-vpgIdentifier] [[-startDate] ] [[-endDate] ] + [[-interval] ] [] +``` + +## DESCRIPTION + +Get average and maximum IOPS performance for a specific VPG, filtered by start date and end date, and optional intervals. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZANetworkVpgAverageIOPS -vpgIdentifier "3456-7890-1234" -interval 3600 +``` + +Get Network VPG Average IOPS for VPG with Identifier "3456-7890-1234" for the last 7 days at an interval of 1 hour. + +## 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 +``` + +### -interval +The interval selected within the duration of the report. The interval can be per minute - for up to 6 hours, per hour - for 6 hours to 15 days, or per day - for 15 days up to 30 days. If an interval is not specified, the default is 60 seconds. Submit value in Seconds. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: 4 +Default value: 0 +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 Average IOPS](https://docs.api.zerto.com/#/Network_Reports/get_v2_reports_vpg_network_iops_average) From 8edfb97b1f959bb138a0dd898b6e659e4b95b73f Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 10 Jun 2019 10:07:13 -0400 Subject: [PATCH 102/108] Create function and related docs Get-ZANetworkVpgAveragePerformance --- ...t-ZANetworkVpgAveragePerformance.Tests.ps1 | 19 +++ .../Get-ZANetworkVpgAveragePerformance.ps1 | 31 +++++ docs/Get-ZANetworkVpgAveragePerformance.md | 109 ++++++++++++++++++ 3 files changed, 159 insertions(+) create mode 100644 Tests/Public/Get-ZANetworkVpgAveragePerformance.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZANetworkVpgAveragePerformance.ps1 create mode 100644 docs/Get-ZANetworkVpgAveragePerformance.md diff --git a/Tests/Public/Get-ZANetworkVpgAveragePerformance.Tests.ps1 b/Tests/Public/Get-ZANetworkVpgAveragePerformance.Tests.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZANetworkVpgAveragePerformance.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-ZANetworkVpgAveragePerformance.ps1 b/ZertoApiWrapper/Public/Get-ZANetworkVpgAveragePerformance.ps1 new file mode 100644 index 0000000..0485cdb --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZANetworkVpgAveragePerformance.ps1 @@ -0,0 +1,31 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZANetworkVpgAveragePerformance { + [CmdletBinding()] + param ( + [Parameter( + HelpMessage = "The VPG identifier.", + Mandatory + )] + [ValidateNotNullOrEmpty()] + [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." + )] + [ValidateNotNullOrEmpty()] + [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." + )] + [ValidateNotNullOrEmpty()] + [string]$endDate, + [Parameter( + HelpMessage = "The interval selected within the duration of the report. The interval can be per minute - for up to 6 hours, per hour - for 6 hours to 15 days, or per day - for 15 days up to 30 days. If an interval is not specified, the default is 60 seconds. Submit value in Seconds." + )] + [ValidateRange(60, 2678400)] + [Int32]$interval + ) + + $filter = Get-ZertoAPIFilter -filtertable $PSBoundParameters + $uri = "reports/vpg-network-performance-average{0}" -f $filter + Invoke-ZARestRequest -uri $uri +} diff --git a/docs/Get-ZANetworkVpgAveragePerformance.md b/docs/Get-ZANetworkVpgAveragePerformance.md new file mode 100644 index 0000000..b781da5 --- /dev/null +++ b/docs/Get-ZANetworkVpgAveragePerformance.md @@ -0,0 +1,109 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZANetworkVpgAveragePerformance.md +schema: 2.0.0 +--- + +# Get-ZANetworkVpgAveragePerformance + +## SYNOPSIS + +Get average and maximum network performance of throughput vs. WAN traffic for a specific VPG filtered by start date and end date, and optional intervals. + +## SYNTAX + +``` +Get-ZANetworkVpgAveragePerformance [-vpgIdentifier] [[-startDate] ] [[-endDate] ] + [[-interval] ] [] +``` + +## DESCRIPTION + +Get average and maximum network performance of throughput vs. WAN traffic for a specific VPG filtered by start date and end date, and optional intervals + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZANetworkVpgAveragePerformance -vpgIdentifier "3456-7890-1234" -interval 3600 +``` + +Get Network VPG Average Performance for VPG with Identifier "3456-7890-1234" for the last 7 days at an interval of 1 hour. + +## 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 +``` + +### -interval +The interval selected within the duration of the report. The interval can be per minute - for up to 6 hours, per hour - for 6 hours to 15 days, or per day - for 15 days up to 30 days. If an interval is not specified, the default is 60 seconds. Submit value in Seconds. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: 4 +Default value: 0 +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 Average Performance](https://docs.api.zerto.com/#/Network_Reports/get_v2_reports_vpg_network_performance_average) From 598b9027a660db623dde62f1a0d3509a2df66b71 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 10 Jun 2019 11:38:36 -0400 Subject: [PATCH 103/108] Add Interval Parameter --- .../Public/Get-ZANetworkSiteAverageIOPS.ps1 | 8 +++++++- .../Get-ZANetworkSiteAveragePerformance.ps1 | 7 ++++++- docs/Get-ZANetworkSiteAverageIOPS.md | 19 +++++++++++++++++-- docs/Get-ZANetworkSiteAveragePerformance.md | 19 +++++++++++++++++-- 4 files changed, 47 insertions(+), 6 deletions(-) diff --git a/ZertoApiWrapper/Public/Get-ZANetworkSiteAverageIOPS.ps1 b/ZertoApiWrapper/Public/Get-ZANetworkSiteAverageIOPS.ps1 index 3c0cf78..e329788 100644 --- a/ZertoApiWrapper/Public/Get-ZANetworkSiteAverageIOPS.ps1 +++ b/ZertoApiWrapper/Public/Get-ZANetworkSiteAverageIOPS.ps1 @@ -38,7 +38,13 @@ function Get-ZANetworkSiteAverageIOPS { HelpMessage = "The ZORG identifier by which to filter the executive summary." )] [ValidateNotNullOrEmpty()] - [string]$zOrgIdentifier + [string]$zOrgIdentifier, + [Parameter( + HelpMessage = "The interval selected within the duration of the report. The interval can be per hour, for up to 15 days’ time frame or per day, for between 15 to 30 days' time frame. Submit value in Seconds" + )] + [ValidateRange(60, 2678400)] + [Int32]$interval + ) $filter = Get-ZertoAPIFilter -filtertable $PSBoundParameters diff --git a/ZertoApiWrapper/Public/Get-ZANetworkSiteAveragePerformance.ps1 b/ZertoApiWrapper/Public/Get-ZANetworkSiteAveragePerformance.ps1 index e055a04..ad8addc 100644 --- a/ZertoApiWrapper/Public/Get-ZANetworkSiteAveragePerformance.ps1 +++ b/ZertoApiWrapper/Public/Get-ZANetworkSiteAveragePerformance.ps1 @@ -38,7 +38,12 @@ function Get-ZANetworkSiteAveragePerformance { HelpMessage = "The ZORG identifier by which to filter the executive summary." )] [ValidateNotNullOrEmpty()] - [string]$zOrgIdentifier + [string]$zOrgIdentifier, + [Parameter( + HelpMessage = "The interval selected within the duration of the report. The interval can be per hour, for up to 15 days’ time frame or per day, for between 15 to 30 days' time frame. Submit value in Seconds" + )] + [ValidateRange(60, 2678400)] + [Int32]$interval ) $filter = Get-ZertoAPIFilter -filtertable $PSBoundParameters diff --git a/docs/Get-ZANetworkSiteAverageIOPS.md b/docs/Get-ZANetworkSiteAverageIOPS.md index 458c8e5..5cbe8e5 100644 --- a/docs/Get-ZANetworkSiteAverageIOPS.md +++ b/docs/Get-ZANetworkSiteAverageIOPS.md @@ -16,13 +16,13 @@ Get average and maximum IOPS performance for sites, filtered by start date and e ### ProtectedSite (Default) ``` Get-ZANetworkSiteAverageIOPS -protectedSiteIdentifier [-recoverySiteIdentifier ] - [-startDate ] [-endDate ] [-zOrgIdentifier ] [] + [-startDate ] [-endDate ] [-zOrgIdentifier ] [-interval ] [] ``` ### RecoverySite ``` Get-ZANetworkSiteAverageIOPS [-protectedSiteIdentifier ] -recoverySiteIdentifier - [-startDate ] [-endDate ] [-zOrgIdentifier ] [] + [-startDate ] [-endDate ] [-zOrgIdentifier ] [-interval ] [] ``` ## DESCRIPTION @@ -67,6 +67,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -interval +The interval selected within the duration of the report. The interval can be per hour, for up to 15 days' time frame or per day, for between 15 to 30 days' time frame. Submit value in Seconds + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: 0 +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -protectedSiteIdentifier Protected site identifier. A site identification is required for at least one of the sites. diff --git a/docs/Get-ZANetworkSiteAveragePerformance.md b/docs/Get-ZANetworkSiteAveragePerformance.md index 3c11784..ff5da43 100644 --- a/docs/Get-ZANetworkSiteAveragePerformance.md +++ b/docs/Get-ZANetworkSiteAveragePerformance.md @@ -16,13 +16,13 @@ Get list of samples of average and maximum network performance metrics (throughp ### ProtectedSite (Default) ``` Get-ZANetworkSiteAveragePerformance -protectedSiteIdentifier [-recoverySiteIdentifier ] - [-startDate ] [-endDate ] [-zOrgIdentifier ] [] + [-startDate ] [-endDate ] [-zOrgIdentifier ] [-interval ] [] ``` ### RecoverySite ``` Get-ZANetworkSiteAveragePerformance [-protectedSiteIdentifier ] -recoverySiteIdentifier - [-startDate ] [-endDate ] [-zOrgIdentifier ] [] + [-startDate ] [-endDate ] [-zOrgIdentifier ] [-interval ] [] ``` ## DESCRIPTION @@ -67,6 +67,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -interval +The interval selected within the duration of the report. The interval can be per hour, for up to 15 days' time frame or per day, for between 15 to 30 days' time frame. Submit value in Seconds + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: 0 +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -protectedSiteIdentifier Protected site identifier. A site identification is required for at least one of the sites. From c70e0a6701d14132eb06e1edfdad19ab43682817 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 10 Jun 2019 17:54:32 -0400 Subject: [PATCH 104/108] Update README.md --- README.md | 55 +++++++++++++------------------------------------------ 1 file changed, 13 insertions(+), 42 deletions(-) diff --git a/README.md b/README.md index 42e6b22..38f8fb9 100644 --- a/README.md +++ b/README.md @@ -19,51 +19,22 @@ This code is still under development!! USE AT YOUR OWN RISK AND ONLY IF YOU KNOW ## Getting Started -Place the folder and contents on your hard drive in a location known to you. From there run the following command to import the module into your session: - -```PowerShell -PS C:\>Import-Module \ZertoApiWrapper\ZertoApiWrapper\ZertoApiWrapper.psm1 -force -``` - -This will import the module into your current session and make the function available to you use and test. - -### Connecting to a ZVM - -Before any of the functions will work, you will need to connect to a Zerto Virtual Manager server. To do this you will use the `Connect-ZertoServer` function passing in a Server Name or IP address of the Zerto Virtual Manager. If you are using a non-standard port, you will need to provide that as well with the `-zertoPort` parameter. You will also need to supply credentials to authenticate against the Zerto Virtual Manager. If credentials are not provided, the user will be prompted for a username and password. - -```PowerShell -PS C:\>$credential = Get-Credential -PS C:\>Connect-ZertoServer -zertoServer "192.168.222.20" -credential $credential -``` - -After successful execution, a few Module level variables are set that are not currently exposed. These variables keep track of the Zerto Server connection information such as Server Name and Port information along with the authentication headers. A "Last Action" variable is also set to keep track of when the last call was made to the API to determine if the authentication information has expired or not. Should this command be run again with a different server, the old information will be overwritten and all commands from that point will be executed against the new server information. - -### Using the Module - -A help system is currently under development. While each command has a help page, it may not be fully fleshed out yet. To see all possible functions you can use the following command after the module has been imported: - -```PowerShell -PS C:\>Get-Command -module ZertoApiWrapper -``` - -Once you have found the command that you want to know about you can call `Get-Help ` to take a look at the help page, or if you want to see syntax, `Get-Command -syntax`. - -### Ending the Session - -If you are using this as part of a larger script, I highly suggest explicitly ending your session with the `Disconnect-ZertoSession` command. This will delete the token authorization from the Zerto Virtual Manager as well as clear all Module scoped variables. +* [Getting Started with Zerto Virtual Manager and the ZertoApiWrapper](https://github.com/ZertoPublic/ZertoApiWrapper/wiki/Getting-Stated-with-Zerto-Virtual-Manager) +* [Getting Started with Zerto Analytics and the ZertoApiWrapper](https://github.com/ZertoPublic/ZertoApiWrapper/wiki/Getting-Started-with-Zerto-Analytics) ## Recent Updates -- May 31st, 2019: Implement logic to allow use of this module in both Windows PowerShell 5.1 and PowerShell Core. -- March 15th, 2019: Implement Export and Import Functionality. Please See [Export-ZertoVpg Help](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Export-ZertoVpg.md) and [Import-ZertoVpg Help](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Import-ZertoVpg.md) for assistance. No current pre-seed support. -- March 11th, 2019: Create basic VPG completed. Please see [New-ZertoVpg Help](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/New-ZertoVpg.md) +* June 10th, 2019: Added functionality for Zerto Analytics. +* May 31st, 2019: Implement logic to allow use of this module in both Windows PowerShell 5.1 and PowerShell Core. +* March 15th, 2019: Implement Export and Import Functionality. Please See [Export-ZertoVpg Help](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Export-ZertoVpg.md) and [Import-ZertoVpg Help](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Import-ZertoVpg.md) for assistance. No current pre-seed support. +* March 11th, 2019: Create basic VPG completed. Please see [New-ZertoVpg Help](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/New-ZertoVpg.md) ## TODO -- Complete Help Markdown Files -- JFLR Functionality -- Create VPG (Per-VM modification and Backup Settings) -- Edit VPG -- Delete Zerto License -- Flesh out Pester Tests -- Complete Automated Build Process +* Complete Help Markdown Files +* JFLR Functionality +* Create VPG (Per-VM modification and Backup Settings) +* Edit VPG +* Delete Zerto License +* Flesh out Pester Tests +* Complete Automated Build Process From 59a0112f2c107be22c26c46b383886e732d65352 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 10 Jun 2019 17:54:36 -0400 Subject: [PATCH 105/108] Update RELEASENOTES.md --- RELEASENOTES.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 3b4868a..3178e32 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -1,4 +1,11 @@ -* Initial Release -* Updated 'Invoke-ZertoRestRequest' to work in Powershell 5.1 as well as Powershell core +## Initial Release + +### Zerto Virtual Manager + +* Updated `Invoke-ZertoRestRequest` to work in Powershell 5.1 as well as Powershell core + +### Zerto Analytics + +* Implemented Zerto Analytics Functionality. Please see [Getting Started with Zerto Analytics](https://github.com/ZertoPublic/ZertoApiWrapper/wiki/Getting-Started-with-Zerto-Analytics) From 82df93143b36d8780a9624d5a6d2651725cf9b09 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 10 Jun 2019 17:54:53 -0400 Subject: [PATCH 106/108] Cleaning InvokeBuild Script --- ZertoApiWrapper.build.ps1 | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/ZertoApiWrapper.build.ps1 b/ZertoApiWrapper.build.ps1 index 69d0b3e..5674577 100644 --- a/ZertoApiWrapper.build.ps1 +++ b/ZertoApiWrapper.build.ps1 @@ -1,12 +1,5 @@ #Requires -Modules 'InvokeBuild' -. '.\ZertoApiWrapper.settings.ps1' -# import-module "$BuildRoot\ZertoApiWrapper\ZertoApiWrapper.psd1" -Verbose -Force - -<# [CmdletBinding()] -param([switch]$Install, - [string]$Configuration = (property Configuration Release)) -$targetDir = "temp/$Configuration/ZertoApiWrapper" #> $version = "{0}.{1}" -f $(Get-Content .\version.txt), $(get-date -format 'yyyyMMdd') task . CreateArtifacts @@ -54,7 +47,7 @@ task AnalyzeBuiltFiles CheckPSScriptAnalyzerInstalled, CreatePsm1ForRelease, { Severity = @('Error', 'Warning') Recurse = $true Verbose = $false - ExcludeRule = @() + ExcludeRule = @("PSUseBOMForUnicodeEncodedFile") } $saresults = Invoke-ScriptAnalyzer @scriptAnalyzerParams From c08df4c1a0f78cc1ee3d22fb3f77f1121906a399 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 17 Jun 2019 08:58:23 -0400 Subject: [PATCH 107/108] Update for Release --- README.md | 9 +++++++-- version.txt | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 38f8fb9..eb5dfe1 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,12 @@ In no event shall Zerto, its authors or anyone else involved in the creation, pr ## Disclaimer -This code is still under development!! USE AT YOUR OWN RISK AND ONLY IF YOU KNOW WHAT YOU ARE DOING!! +This code is still under development! Please use carefully and if you encounter any issues or have an idea, please submit an [issue](https://github.com/ZertoPublic/ZertoApiWrapper/issues). Along the same lines, should you be proficient in PowerShell, please feel free to submit any [Pull Requests](https://github.com/ZertoPublic/ZertoApiWrapper/pulls) with enhancements and bug fixes. + +## Installing the Module + +This module can be installed directly from the [PowerShell Gallery](https://www.powershellgallery.com/packages/ZertoApiWrapper) with the following command. +`PS> Install-Module -name ZertoApiWrapper ## Getting Started @@ -24,7 +29,7 @@ This code is still under development!! USE AT YOUR OWN RISK AND ONLY IF YOU KNOW ## Recent Updates -* June 10th, 2019: Added functionality for Zerto Analytics. +* June 16th, 2019: Added functionality for Zerto Analytics. * May 31st, 2019: Implement logic to allow use of this module in both Windows PowerShell 5.1 and PowerShell Core. * March 15th, 2019: Implement Export and Import Functionality. Please See [Export-ZertoVpg Help](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Export-ZertoVpg.md) and [Import-ZertoVpg Help](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Import-ZertoVpg.md) for assistance. No current pre-seed support. * March 11th, 2019: Create basic VPG completed. Please see [New-ZertoVpg Help](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/New-ZertoVpg.md) diff --git a/version.txt b/version.txt index 3eefcb9..9084fa2 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.0.0 +1.1.0 From e94c2b66e1db7bc519e4bdcfe9a1861862324f34 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 17 Jun 2019 09:07:45 -0400 Subject: [PATCH 108/108] Ignore Plural Nouns In PSSA --- ZertoApiWrapper.build.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ZertoApiWrapper.build.ps1 b/ZertoApiWrapper.build.ps1 index 5674577..e36079a 100644 --- a/ZertoApiWrapper.build.ps1 +++ b/ZertoApiWrapper.build.ps1 @@ -47,7 +47,7 @@ task AnalyzeBuiltFiles CheckPSScriptAnalyzerInstalled, CreatePsm1ForRelease, { Severity = @('Error', 'Warning') Recurse = $true Verbose = $false - ExcludeRule = @("PSUseBOMForUnicodeEncodedFile") + ExcludeRule = @("PSUseBOMForUnicodeEncodedFile", "PSUseSingularNouns") } $saresults = Invoke-ScriptAnalyzer @scriptAnalyzerParams