Skip to content

Commit efecc21

Browse files
authored
Merge pull request #53 from rebelinux/dev
v0.6.8
2 parents e1f54c6 + 0ab7a90 commit efecc21

31 files changed

+934
-46
lines changed

.github/workflows/PSScriptAnalyzer.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ jobs:
55
name: Run PSScriptAnalyzer
66
runs-on: ubuntu-latest
77
steps:
8-
- uses: actions/checkout@v2
8+
- uses: actions/checkout@v5
99
- name: lint
1010
uses: devblackops/github-action-psscriptanalyzer@master
1111
with:

.github/workflows/Release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
publish-to-gallery:
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@v4
11+
- uses: actions/checkout@v5
1212
- name: Set PSRepository to Trusted for PowerShell Gallery
1313
shell: pwsh
1414
run: |

.github/workflows/codeql.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
name: PSScriptAnalyzer
3030
runs-on: ubuntu-latest
3131
steps:
32-
- uses: actions/checkout@v4
32+
- uses: actions/checkout@v5
3333

3434
- name: Run PSScriptAnalyzer
3535
uses: microsoft/[email protected]

.vscode/launch.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": "PowerShell: Interactive Session",
9+
"type": "PowerShell",
10+
"request": "launch"
11+
}
12+
]
13+
}

AsBuiltReport.NetApp.ONTAP.json

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,19 @@
1212
"Exclude": {
1313
"Vserver": [],
1414
"MetroCluster": false
15-
}
15+
},
16+
"EnableDiagrams": true,
17+
"EnableDiagramDebug": false,
18+
"DiagramTheme": "White",
19+
"DiagramWaterMark": "",
20+
"ExportDiagrams": false,
21+
"ExportDiagramsFormat": [
22+
"png"
23+
],
24+
"EnableDiagramSignature": false,
25+
"DiagramColumnSize": 4,
26+
"SignatureAuthorName": "",
27+
"SignatureCompanyName": ""
1628
},
1729
"InfoLevel": {
1830
"_comment_": "0 = Disabled, 1 = Enabled, 2 = Adv Summary",

AsBuiltReport.NetApp.ONTAP.psd1

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,15 @@
5454
RequiredModules = @(
5555
@{
5656
ModuleName = 'AsBuiltReport.Core';
57-
ModuleVersion = '1.4.0'
57+
ModuleVersion = '1.4.3'
5858
},
5959
@{
6060
ModuleName = 'NetApp.ONTAP';
61-
ModuleVersion = '9.15.1.2407'
61+
ModuleVersion = '9.16.1.2501'
62+
},
63+
@{
64+
ModuleName = 'Diagrammer.Core';
65+
ModuleVersion = '0.2.29'
6266
}
6367
)
6468

CHANGELOG.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,25 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## [0.6.8] - Unreleased
8+
## [0.6.8] - 2025-08-18
9+
10+
### Added
11+
12+
- Add Infrastructure diagram support
13+
- Cluster
14+
- Storage Aggretates (Tiers)
15+
- Replication
16+
- Added various icon files for report generation.
17+
18+
### Changed
19+
20+
- Improved Invoke-AsBuiltReport.NetApp.ONTAP.ps1 to provide better user feedback and check for module versions.
21+
- Refactor and enhance ONTAP report generation scripts
22+
- Updated Get-AbrOntapClusterHA.ps1 to remove unnecessary string conversion to uppercase for HA Mode and HA State.
23+
- Modified Get-AbrOntapNetworkRoute.ps1 and Get-AbrOntapNetworkRouteLifs.ps1 to remove uppercase conversion for Address Family.
24+
- Enhanced Get-AbrOntapRepRelations.ps1 to handle empty Schedule and Status fields more gracefully.
25+
- Updated Get-AbrOntapVserverCIFSSummary.ps1 to remove uppercase conversion for Status.
26+
- Improved Invoke-AsBuiltReport.NetApp.ONTAP.ps1 to provide better user feedback and check for module versions.
927

1028
### Fixed
1129

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,17 @@ The **Options** schema allows certain options within the report to be toggled on
141141
| --------------------- | ------------ | ------- | -------------------------------------------------- |
142142
| Exclude: Vserver | Array List | Empty | Allow to filter on Vserver Name |
143143
| Exclude: MetroCluster | true / false | false | Allow to filter automatically all Vserver with -mc |
144+
| DiagramColumnSize | int | 3 | Set the diagram node table size |
145+
| DiagramTheme | string | White | Set the diagram theme (Black/White/Neon) |
146+
| DiagramWaterMark | string | empty | Set the diagram watermark |
147+
| DiagramType | true / false | true | Toggle to enable/disable the export of individual diagram diagrams |
148+
| EnableDiagrams | true / false | false | Toggle to enable/disable infrastructure diagrams |
149+
| EnableDiagramsDebug | true / false | false | Toggle to enable/disable diagram debug option |
150+
| EnableDiagramSignature | true / false | false | Toggle to enable/disable diagram signature (bottom right corner) |
151+
| ExportDiagrams | true / false | true | Toggle to enable/disable diagram export option |
152+
| ExportDiagramsFormat | string array | png | Set the format used to export the infrastructure diagram (dot, png, pdf, svg) |
153+
| SignatureAuthorName | string | empty | Set the signature author name |
154+
| SignatureCompanyName | string | empty | Set the signature company name |
144155

145156
### InfoLevel
146157

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
function Export-AbrOntapDiagram {
2+
<#
3+
.SYNOPSIS
4+
Used by As Built Report to export NetApp Ontap infrastructure diagram
5+
.DESCRIPTION
6+
Documents the configuration of NetApp Ontap in Word/HTML/Text formats using PScribo.
7+
.NOTES
8+
Version: 0.6.8
9+
Author: Jonathan Colon
10+
Twitter: @jcolonfzenpr
11+
Github: rebelinux
12+
Credits: Iain Brighton (@iainbrighton) - PScribo module
13+
14+
.LINK
15+
https://github.com/AsBuiltReport/AsBuiltReport.NetApp.Ontap
16+
#>
17+
18+
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingCmdletAliases", "", Scope = "Function")]
19+
20+
[CmdletBinding()]
21+
param (
22+
$DiagramObject,
23+
[string] $MainDiagramLabel = 'Change Me',
24+
[Parameter(Mandatory = $true)]
25+
[string] $FileName
26+
)
27+
28+
begin {
29+
Write-PScriboMessage -Message "EnableDiagrams set to $($Options.EnableDiagrams)."
30+
}
31+
32+
process {
33+
if ($Options.EnableDiagrams) {
34+
Write-PScriboMessage -Message "Collecting NetApp Ontap Infrastructure diagram"
35+
36+
$RootPath = Split-Path (Split-Path $PSScriptRoot -Parent) -Parent
37+
[System.IO.FileInfo]$IconPath = Join-Path $RootPath 'icons'
38+
39+
$DiagramParams = @{
40+
'FileName' = $FileName
41+
'OutputFolderPath' = $OutputFolderPath
42+
'MainDiagramLabel' = $MainDiagramLabel
43+
'MainDiagramLabelFontsize' = 28
44+
'MainDiagramLabelFontcolor' = '#565656'
45+
'MainDiagramLabelFontname' = 'Segoe UI Black'
46+
'IconPath' = $IconPath
47+
'ImagesObj' = $Images
48+
'LogoName' = 'AsBuiltReport_LOGO'
49+
'SignatureLogoName' = 'Abr_LOGO_Footer'
50+
'WaterMarkText' = $Options.DiagramWaterMark
51+
'Direction' = &{
52+
if ($MainDiagramLabel -eq 'Cluster Replication Diagram') {
53+
'left-to-right'
54+
} else {
55+
'top-to-bottom'
56+
}
57+
}
58+
}
59+
60+
if ($Options.DiagramTheme -eq 'Black') {
61+
$DiagramParams.add('MainGraphBGColor', 'Black')
62+
$DiagramParams.add('Edgecolor', 'White')
63+
$DiagramParams.add('Fontcolor', 'White')
64+
$DiagramParams.add('NodeFontcolor', 'White')
65+
$DiagramParams.add('WaterMarkColor', 'White')
66+
} elseif ($Options.DiagramTheme -eq 'Neon') {
67+
$DiagramParams.add('MainGraphBGColor', 'grey14')
68+
$DiagramParams.add('Edgecolor', 'gold2')
69+
$DiagramParams.add('Fontcolor', 'gold2')
70+
$DiagramParams.add('NodeFontcolor', 'gold2')
71+
$DiagramParams.add('WaterMarkColor', '#FFD700')
72+
} else {
73+
$DiagramParams.add('WaterMarkColor', '#333333')
74+
}
75+
76+
if ($Options.ExportDiagrams) {
77+
if (-not $Options.ExportDiagramsFormat) {
78+
$DiagramFormat = 'png'
79+
} else {
80+
$DiagramFormat = $Options.ExportDiagramsFormat
81+
}
82+
$DiagramParams.Add('Format', $DiagramFormat)
83+
} else {
84+
$DiagramParams.Add('Format', "base64")
85+
}
86+
87+
if ($Options.EnableDiagramDebug) {
88+
89+
$DiagramParams.Add('DraftMode', $True)
90+
91+
}
92+
93+
if ($Options.EnableDiagramSignature) {
94+
$DiagramParams.Add('Signature', $True)
95+
$DiagramParams.Add('AuthorName', $Options.SignatureAuthorName)
96+
$DiagramParams.Add('CompanyName', $Options.SignatureCompanyName)
97+
}
98+
99+
if ($Options.ExportDiagrams) {
100+
try {
101+
Write-PScriboMessage -Message "Generating NetApp Ontap diagram"
102+
$Graph = $DiagramObject
103+
if ($Graph) {
104+
Write-PScriboMessage -Message "Saving NetApp Ontap diagram"
105+
$Diagram = New-Diagrammer @DiagramParams -InputObject $Graph
106+
if ($Diagram) {
107+
foreach ($OutputFormat in $DiagramFormat) {
108+
Write-Information -MessageData "Saved '$($FileName).$($OutputFormat)' diagram to '$($OutputFolderPath)'." -InformationAction Continue
109+
}
110+
}
111+
}
112+
} catch {
113+
Write-PScriboMessage -IsWarning -Message "Unable to export the NetApp Diagram: $($_.Exception.Message)"
114+
}
115+
}
116+
try {
117+
$DiagramParams.Remove('Format')
118+
$DiagramParams.Add('Format', "base64")
119+
120+
$Graph = $DiagramObject
121+
$Diagram = New-Diagrammer @DiagramParams -InputObject $Graph
122+
if ($Diagram) {
123+
if ((Get-DiaImagePercent -GraphObj $Diagram).Width -gt 600) { $ImagePrty = 40 } else { $ImagePrty = 30 }
124+
Section -Style Heading2 $MainDiagramLabel {
125+
Image -Base64 $Diagram -Text "NetApp Ontap Diagram" -Percent $ImagePrty -Align Center
126+
Paragraph "Image preview: Opens the image in a new tab to view it at full resolution." -Tabs 2
127+
}
128+
}
129+
} catch {
130+
Write-PScriboMessage -IsWarning -Message "Unable to generate the Ontap Diagram: $($_.Exception.Message)"
131+
}
132+
}
133+
}
134+
135+
end {}
136+
}

Src/Private/Get-AbrOntapCluster.ps1

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ function Get-AbrOntapCluster {
55
.DESCRIPTION
66
77
.NOTES
8-
Version: 0.6.7
8+
Version: 0.6.8
99
Author: Jonathan Colon
1010
Twitter: @jcolonfzenpr
1111
Github: rebelinux
@@ -40,7 +40,11 @@ function Get-AbrOntapCluster {
4040
'Ontap Version' = $ClusterVersion.value
4141
'Number of Aggregates' = $ArrayAggr.count
4242
'Number of Volumes' = $ArrayVolumes.count
43-
'Overall System Health' = $ClusterDiag.Status.ToUpper()
43+
'Overall System Health' = switch ([string]::IsNullOrEmpty($ClusterDiag.Status)) {
44+
$true { '--' }
45+
$false { $ClusterDiag.Status.ToUpper() }
46+
Default { 'Unknown' }
47+
}
4448
}
4549
if ($Healthcheck.Cluster.Summary) {
4650
$ClusterSummary | Where-Object { $_.'Overall System Health' -like 'OK' } | Set-Style -Style OK -Property 'Overall System Health'

0 commit comments

Comments
 (0)