Skip to content

Commit

Permalink
Merge pull request #46 from rebelinux/dev
Browse files Browse the repository at this point in the history
v0.6.7
  • Loading branch information
rebelinux authored Aug 8, 2024
2 parents 75afb88 + ab64f83 commit 538ed4b
Show file tree
Hide file tree
Showing 11 changed files with 408 additions and 135 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/Release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
publish-to-gallery:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set PSRepository to Trusted for PowerShell Gallery
shell: pwsh
run: |
Expand All @@ -33,7 +33,7 @@ jobs:
needs: publish-to-gallery
runs-on: ubuntu-latest
steps:
- uses: Eomm/why-don-t-you-tweet@v1
- uses: Eomm/why-don-t-you-tweet@v2
# We don't want to tweet if the repository is not a public one
if: ${{ !github.event.repository.private }}
with:
Expand Down
1 change: 1 addition & 0 deletions AsBuiltReport.NetApp.ONTAP.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"Vserver": {
"Status": true,
"Iscsi": true,
"Nvme": true,
"FCP": true,
"CG": true,
"NFS": true,
Expand Down
8 changes: 3 additions & 5 deletions AsBuiltReport.NetApp.ONTAP.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@
RequiredModules = @(
@{
ModuleName = 'AsBuiltReport.Core';
ModuleVersion = '1.3.0'
ModuleVersion = '1.4.0'
},
@{
ModuleName = 'NetApp.ONTAP';
ModuleVersion = '9.10.1.2111'
ModuleVersion = '9.15.1.2407'
}
)

Expand Down Expand Up @@ -128,6 +128,4 @@
# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.
# DefaultCommandPrefix = ''

}


}
23 changes: 21 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,30 @@
# :arrows_counterclockwise: NetApp ONTAP Storage As Built Report Changelog

## [0.6.7] - 2024-02-02
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.6.7] - Unreleased

### Added

- Initial Vserver NVME support

### Changed

- Code Cleanup
- Update the Eomm/why-don-t-you-tweet action to v2.0.0
- General code cleanup/improvements
- Increased Required Modules version:
- AsBuiltReport.Core v1.4.0
- NetApp.Ontap v9.15.1.2407

### Fixed

- Fix [#40](https://github.com/AsBuiltReport/AsBuiltReport.NetApp.ONTAP/issues/40)
- Fix [#41](https://github.com/AsBuiltReport/AsBuiltReport.NetApp.ONTAP/issues/41)
- Fix [#42](https://github.com/AsBuiltReport/AsBuiltReport.NetApp.ONTAP/issues/42)
- Fix [#43](https://github.com/AsBuiltReport/AsBuiltReport.NetApp.ONTAP/issues/43)

## [0.6.6] - 2023-08-07

Expand Down
7 changes: 5 additions & 2 deletions Src/Private/Get-AbrOntapNetworkMGMT.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,14 @@ function Get-AbrOntapNetworkMgmt {
}
try {
Section -ExcludeFromTOC -Style Heading6 'Data Network Interfaces' {
$ClusterData = Get-NcNetInterface -Controller $Array | Where-Object { $_.Role -eq 'data' -and $_.DataProtocols -ne 'fcp' -and $_.Vserver -notin $options.Exclude.Vserver }
$ClusterData = Get-NcNetInterface -Controller $Array | Where-Object { $_.Role -eq 'data' -and $_.Vserver -notin $options.Exclude.Vserver }
$ClusterObj = @()
if ($ClusterData) {
foreach ($Item in $ClusterData) {
try {
if ($Item.Wwpn) {
$AddressData = $Item.Wwpn
} else {$AddressData = $Item.Address}
$inObj = [ordered] @{
'Data Interface' = $Item.InterfaceName
'Status' = Switch ($Item.OpStatus) {
Expand All @@ -166,7 +169,7 @@ function Get-AbrOntapNetworkMgmt {
default { $Item.OpStatus.ToString().ToUpper() }
}
'Data Protocols' = [string]$Item.DataProtocols
'Address' = $Item.Address
'Address' = $AddressData
'Vserver' = $Item.Vserver
}
$ClusterObj += [pscustomobject]$inobj
Expand Down
1 change: 1 addition & 0 deletions Src/Private/Get-AbrOntapVserverFcpAdapter.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ function Get-AbrOntapVserverFcpAdapter {
$TableParams = @{
Name = "FCP Physical Adapter - $($ClusterInfo.ClusterName)"
List = $false
ColumnWidths = 32, 17, 17, 17, 17
}
if ($Report.ShowTableCaptions) {
$TableParams['Caption'] = "- $($TableParams.Name)"
Expand Down
75 changes: 75 additions & 0 deletions Src/Private/Get-AbrOntapVserverNvmeFcAdapter.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
function Get-AbrOntapVserverNvmeFcAdapter {
<#
.SYNOPSIS
Used by As Built Report to retrieve NetApp ONTAP Vserver Nvme FC adapter information from the Cluster Management Network
.DESCRIPTION
.NOTES
Version: 0.6.7
Author: Jonathan Colon
Twitter: @jcolonfzenpr
Github: rebelinux
.EXAMPLE
.LINK
#>
param (
[Parameter (
Position = 0,
Mandatory)]
[string]
$Vserver
)

begin {
Write-PScriboMessage "Collecting ONTAP Vserver Nvme FC adapter information."
}

process {
try {
$VserverData = Get-NcNvmeInterface -VserverContext $Vserver -Controller $Array | Where-Object {$_.PhysicalProtocol -eq 'fibre_channel'} | Sort-Object -Property HomeNode
$VserverObj = @()
if ($VserverData) {
foreach ($Item in $VserverData) {
try {
$inObj = [ordered] @{
'Node Name' = $Item.HomeNode
'Adapter' = $Item.HomePort
'Protocol' = $Item.PhysicalProtocol
'WWNN' = $Item.FcWwnn
'WWPN' = $Item.FcWwpn
'Status' = Switch ($Item.StatusAdmin) {
'up' { 'Up' }
'down' { 'Down' }
default { $Item.StatusAdmin }
}
}
$VserverObj += [pscustomobject]$inobj
} catch {
Write-PScriboMessage -IsWarning $_.Exception.Message
}
}
if ($Healthcheck.Vserver.FCP) {
$VserverObj | Where-Object { $_.'Status' -like 'Down' } | Set-Style -Style Warning -Property 'Status'
}

$TableParams = @{
Name = "Nvme FC Physical Adapter - $($Vserver)"
List = $false
ColumnWidths = 25, 12, 15, 18, 18, 12

}
if ($Report.ShowTableCaptions) {
$TableParams['Caption'] = "- $($TableParams.Name)"
}
$VserverObj | Table @TableParams
}
} catch {
Write-PScriboMessage -IsWarning $_.Exception.Message
}
}

end {}

}
72 changes: 72 additions & 0 deletions Src/Private/Get-AbrOntapVserverNvmeInterface.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
function Get-AbrOntapVserverNvmeInterface {
<#
.SYNOPSIS
Used by As Built Report to retrieve NetApp ONTAP Vserver NVME interface information from the Cluster Management Network
.DESCRIPTION
.NOTES
Version: 0.6.7
Author: Jonathan Colon
Twitter: @jcolonfzenpr
Github: rebelinux
.EXAMPLE
.LINK
#>
param (
[Parameter (
Position = 0,
Mandatory)]
[string]
$Vserver
)

begin {
Write-PScriboMessage "Collecting ONTAP Vserver NVME interface information."
}

process {
try {
$VserverData = Get-NcNvmeInterface -VserverContext $Vserver -Controller $Array | Sort-Object -Property TransportProtocols
$VserverObj = @()
if ($VserverData) {
foreach ($Item in $VserverData) {
try {
$inObj = [ordered] @{
'Interface Name' = $Item.Lif
'Transport Address' = $Item.TransportAddress
'Transport Protocols' = $Item.TransportProtocols
'Status' = Switch ($Item.StatusAdmin) {
'up' { 'Up' }
'down' { 'Down' }
default { $Item.StatusAdmin }
}
}
$VserverObj += [pscustomobject]$inobj
} catch {
Write-PScriboMessage -IsWarning $_.Exception.Message
}
}
if ($Healthcheck.Vserver.Nvme) {
$VserverObj | Where-Object { $_.'Status' -like 'Down' } | Set-Style -Style Warning -Property 'Status'
}

$TableParams = @{
Name = "NVME Interface - $($Vserver)"
List = $false
ColumnWidths = 40, 36, 12, 12
}
if ($Report.ShowTableCaptions) {
$TableParams['Caption'] = "- $($TableParams.Name)"
}
$VserverObj | Table @TableParams
}
} catch {
Write-PScriboMessage -IsWarning $_.Exception.Message
}
}

end {}

}
74 changes: 74 additions & 0 deletions Src/Private/Get-AbrOntapVserverNvmeTcpAdapter.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
function Get-AbrOntapVserverNvmeTcpAdapter {
<#
.SYNOPSIS
Used by As Built Report to retrieve NetApp ONTAP Vserver Nvme TCP adapter information from the Cluster Management Network
.DESCRIPTION
.NOTES
Version: 0.6.7
Author: Jonathan Colon
Twitter: @jcolonfzenpr
Github: rebelinux
.EXAMPLE
.LINK
#>
param (
[Parameter (
Position = 0,
Mandatory)]
[string]
$Vserver
)

begin {
Write-PScriboMessage "Collecting ONTAP Vserver Nvme TCP adapter information."
}

process {
try {
$VserverData = Get-NcNvmeInterface -VserverContext $Vserver -Controller $Array | Where-Object {$_.PhysicalProtocol -eq 'ethernet'} | Sort-Object -Property HomeNode
$VserverObj = @()
if ($VserverData) {
foreach ($Item in $VserverData) {
try {
$inObj = [ordered] @{
'Node Name' = $Item.HomeNode
'Adapter' = $Item.HomePort
'Protocol' = $Item.PhysicalProtocol
'IP Address' = $Item.TransportAddress
'Status' = Switch ($Item.StatusAdmin) {
'up' { 'Up' }
'down' { 'Down' }
default { $Item.StatusAdmin }
}
}
$VserverObj += [pscustomobject]$inobj
} catch {
Write-PScriboMessage -IsWarning $_.Exception.Message
}
}
if ($Healthcheck.Vserver.FCP) {
$VserverObj | Where-Object { $_.'Status' -like 'Down' } | Set-Style -Style Warning -Property 'Status'
}

$TableParams = @{
Name = "Nvme TCP Physical Adapter - $($Vserver)"
List = $false
ColumnWidths = 30, 17, 17, 20, 16

}
if ($Report.ShowTableCaptions) {
$TableParams['Caption'] = "- $($TableParams.Name)"
}
$VserverObj | Table @TableParams
}
} catch {
Write-PScriboMessage -IsWarning $_.Exception.Message
}
}

end {}

}
7 changes: 6 additions & 1 deletion Src/Private/Get-NetAppOntapAPI.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,12 @@ function Get-NetAppOntapAPI {

Process {
Try {
$response = Invoke-RestMethod -Method Get -Uri ($api + $uri) -Headers $headers -SkipCertificateCheck
if ($PSVersionTable.PSEdition -eq 'Core') {
$response = Invoke-RestMethod -Method Get -Uri ($api + $uri) -Headers $headers -SkipCertificateCheck

} else {
$response = Invoke-RestMethod -Method Get -Uri ($api + $uri) -Headers $headers
}
$response.records
} Catch {
Write-Verbose -Message $_
Expand Down
Loading

0 comments on commit 538ed4b

Please sign in to comment.