Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions AsBuiltReport.NetApp.ONTAP.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
RootModule = 'AsBuiltReport.NetApp.ONTAP.psm1'

# Version number of this module.
ModuleVersion = '0.6.9'
ModuleVersion = '0.6.10'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down Expand Up @@ -62,7 +62,7 @@
},
@{
ModuleName = 'Diagrammer.Core';
ModuleVersion = '0.2.32'
ModuleVersion = '0.2.33'
}
)

Expand Down
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,24 @@ 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.10] - Unreleased

### Added

- Add WaterMarkFontOpacity parameter to Export-AbrOntapDiagram function

### Changed

- Refactor Export-AbrOntapDiagram to handle image format for Unix platforms and improve error messaging
- Bump Diagrammer.Core module requirement to v0.2.33
- Bump module version to v0.6.10
- Refactor Get-NetAppOntapAPI to streamline certificate validation for Unix platforms
- Update SignatureLogoName in Export-AbrOntapDiagram function for consistency

### Fixed

- Fix Get-AbrOntapStorageAggrDiagram for drawing node management and aggregate storage relationships correctly.

## [0.6.9] - 2025-10-21

### Changed
Expand All @@ -16,12 +34,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- NetApp.Ontap v9.17.1.2509
- AsBuiltReport.Core v1.5.0
- Refactor Get-NetAppOntapAPI to handle Unix platform and improve error handling in Invoke-AsBuiltReport.NetApp.ONTAP
- Refactor Export-AbrOntapDiagram to handle image format for Unix platforms and improve error messaging

### Fixed

- Fix issue where cluster replication diagram generation fails if no replication relationships are found.
- Fix issue where certain sections of the report may not render correctly on Unix-based systems.
- Close [#58](https://github.com/AsBuiltReport/AsBuiltReport.NetApp.ONTAP/issues/58)
- Fix Get-AbrOntapStorageAggrDiagram for drawing node management and aggregate storage relationships correctly.

## [0.6.8] - 2025-08-18

Expand Down
26 changes: 11 additions & 15 deletions Src/Private/Export-AbrOntapDiagram.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ function Export-AbrOntapDiagram {
'IconPath' = $IconPath
'ImagesObj' = $Images
'LogoName' = 'AsBuiltReport_LOGO'
'SignatureLogoName' = 'Abr_LOGO_Footer'
'SignatureLogoName' = 'AsBuiltReport_Signature'
'WaterMarkText' = $Options.DiagramWaterMark
'WaterMarkFontOpacity' = 20
'Direction' = & {
if ($MainDiagramLabel -eq 'Cluster Replication Diagram') {
'left-to-right'
Expand Down Expand Up @@ -114,22 +115,17 @@ function Export-AbrOntapDiagram {
}
}
try {
if ($PSVersionTable.Platform -ne 'Unix') {
$DiagramParams.Remove('Format')
$DiagramParams.Add('Format', "base64")
$DiagramParams.Remove('Format')
$DiagramParams.Add('Format', "base64")

$Graph = $DiagramObject
$Diagram = New-Diagrammer @DiagramParams -InputObject $Graph
if ($Diagram) {
if ((Get-DiaImagePercent -GraphObj $Diagram).Width -gt 600) { $ImagePrty = 40 } else { $ImagePrty = 30 }
Section -Style Heading2 $MainDiagramLabel {
Image -Base64 $Diagram -Text "NetApp Ontap Diagram" -Percent $ImagePrty -Align Center
Paragraph "Image preview: Opens the image in a new tab to view it at full resolution." -Tabs 2
}
$Graph = $DiagramObject
$Diagram = New-Diagrammer @DiagramParams -InputObject $Graph
if ($Diagram) {
if ((Get-DiaImagePercent -GraphObj $Diagram).Width -gt 600) { $ImagePrty = 40 } else { $ImagePrty = 30 }
Section -Style Heading2 $MainDiagramLabel {
Image -Base64 $Diagram -Text "NetApp Ontap Diagram" -Percent $ImagePrty -Align Center
Paragraph "Image preview: Opens the image in a new tab to view it at full resolution." -Tabs 2
}
} else {
Write-PScriboMessage -IsWarning -Message "PSCribo Images embedding is not supported on PowerShell Core running on Linux or MacOS."

}
} catch {
Write-PScriboMessage -IsWarning -Message "Unable to generate the Ontap Diagram: $($_.Exception.Message)"
Expand Down
16 changes: 8 additions & 8 deletions Src/Private/Get-AbrOntapNodeAggrDiagram.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ function Get-AbrOntapStorageAggrDiagram {
"Mgmt" = switch ([string]::IsNullOrEmpty($NodeMgmtAddress)) {
$true { "Unknown" }
$false { $NodeMgmtAddress }
Default { "Unknown" }
default { "Unknown" }
}
}
}
Expand All @@ -115,11 +115,11 @@ function Get-AbrOntapStorageAggrDiagram {
"raid0" { "RAID 0" }
"raid1" { "RAID 1" }
"raid10" { "RAID 10" }
Default { "Unknown" }
default { "Unknown" }
}
}
}
Default { "Unknown" }
default { "Unknown" }
}
"Raid Size" = $Aggr.RaidSize
"State" = $Aggr.State
Expand All @@ -132,7 +132,7 @@ function Get-AbrOntapStorageAggrDiagram {

foreach ($Node in $NodeAdditionalInfo) {
$ClusterNodeObj = @()
$ClusterNodeObj += Add-DiaHTMLNodeTable -ImagesObj $Images -inputObject $Node.NodeName -Align "Center" -iconType "Ontap_Node" -columnSize 1 -IconDebug $IconDebug -MultiIcon -AditionalInfo $Node.AdditionalInfo -Subgraph -SubgraphLabel $Node.NodeName -SubgraphLabelPos "top" -SubgraphTableStyle "dashed,rounded" -TableBorderColor "#71797E" -TableBorder 0 -SubgraphLabelFontsize 22 -fontSize 18
$ClusterNodeObj += Add-DiaHtmlNodeTable -ImagesObj $Images -inputObject $Node.NodeName -Align "Center" -iconType "Ontap_Node" -ColumnSize 1 -IconDebug $IconDebug -MultiIcon -AditionalInfo $Node.AdditionalInfo -Subgraph -SubgraphLabel $Node.NodeName -SubgraphLabelPos "top" -SubgraphTableStyle "dashed,rounded" -TableBorderColor "#71797E" -TableBorder 0 -SubgraphLabelFontSize 22 -FontSize 18

if ($ClusterNodeObj) {
if ($AggrInfo.Count -eq 1) {
Expand All @@ -142,11 +142,11 @@ function Get-AbrOntapStorageAggrDiagram {
} else {
$AggrInfoColumnSize = $AggrInfo.Count
}
$ClusterNodeObj += Add-DiaHTMLNodeTable -ImagesObj $Images -inputObject ($AggrInfo | Where-Object { $_.NodeName -eq $Node.Nodename }).AggregateName -Align "Center" -iconType "Ontap_Aggregate" -columnSize $AggrInfoColumnSize -IconDebug $IconDebug -MultiIcon -AditionalInfo ($AggrInfo | Where-Object { $_.NodeName -eq $Node.Nodename }).AdditionalInfo -Subgraph -SubgraphLabel "Aggregates" -SubgraphLabelPos "top" -SubgraphTableStyle "dashed,rounded" -TableBorderColor "#71797E" -TableBorder 1 -SubgraphLabelFontsize 22 -fontSize 18
$ClusterNodeObj += Add-DiaHtmlNodeTable -ImagesObj $Images -inputObject ($AggrInfo | Where-Object { $_.NodeName -eq $Node.Nodename }).AggregateName -Align "Center" -iconType "Ontap_Aggregate" -ColumnSize $AggrInfoColumnSize -IconDebug $IconDebug -MultiIcon -AditionalInfo ($AggrInfo | Where-Object { $_.NodeName -eq $Node.Nodename }).AdditionalInfo -Subgraph -SubgraphLabel "Aggregates" -SubgraphLabelPos "top" -SubgraphTableStyle "dashed,rounded" -TableBorderColor "#71797E" -TableBorder 1 -SubgraphLabelFontSize 22 -FontSize 18
}

if ($ClusterNodeObj) {
$ClusterNodeSubgraphObj = Add-DiaHTMLSubGraph -ImagesObj $Images -TableArray $ClusterNodeObj -Align 'Center' -IconDebug $IconDebug -Label " " -LabelPos 'top' -TableStyle "dashed,rounded" -TableBorderColor $Edgecolor -TableBorder 1 -columnSize 1 -fontSize 12
$ClusterNodeSubgraphObj = Add-DiaHtmlSubGraph -ImagesObj $Images -TableArray $ClusterNodeObj -Align 'Center' -IconDebug $IconDebug -Label " " -LabelPos 'top' -TableStyle "dashed,rounded" -TableBorderColor $Edgecolor -TableBorder 1 -ColumnSize 1 -FontSize 12
}

$ClusterNodesObj += $ClusterNodeSubgraphObj
Expand All @@ -160,10 +160,10 @@ function Get-AbrOntapStorageAggrDiagram {
} else {
$ClusterNodesObjColumnSize = $ClusterNodesObj.Count
}
$ClusterMgmtObj = Add-DiaHTMLSubGraph -ImagesObj $Images -TableArray $ClusterNodesObj -Align 'Right' -IconDebug $IconDebug -Label "Management: $($ClusterInfo.NcController)" -LabelPos 'down' -TableStyle "dashed,rounded" -TableBorderColor $Edgecolor -TableBorder 0 -columnSize $ClusterNodesObjColumnSize -fontSize 18
$ClusterMgmtObj = Add-DiaHtmlSubGraph -ImagesObj $Images -TableArray $ClusterNodesObj -Align 'Right' -IconDebug $IconDebug -Label "Management: $($ClusterInfo.NcController.Name)" -LabelPos 'down' -TableStyle "dashed,rounded" -TableBorderColor $Edgecolor -TableBorder 0 -ColumnSize $ClusterNodesObjColumnSize -FontSize 18

if ($ClusterMgmtObj) {
Node Cluster @{Label = $ClusterMgmtObj; shape = 'plain'; fillColor = 'transparent'; fontsize = 14 }
Node ClusterAggrs @{Label = $ClusterMgmtObj; shape = 'plain'; fillColor = 'transparent'; fontsize = 14 }

} else {
Write-PScriboMessage -IsWarning "Unable to create ClusterNodesObj. No Cluster Management Object found."
Expand Down
8 changes: 4 additions & 4 deletions Src/Private/Get-NetAppOntapAPI.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,7 @@ function Get-NetAppOntapAPI {
)

begin {
if ($PSVersionTable.Platform -ne 'Unix') {
#region Workaround for SelfSigned Cert an force TLS 1.2
if (-not ([System.Management.Automation.PSTypeName]'ServerCertificateValidationCallback').Type) {
$certCallback = @"
$certCallback = @"
using System;
using System.Net;
using System.Net.Security;
Expand All @@ -55,6 +52,9 @@ function Get-NetAppOntapAPI {
}
}
"@
if ($PSVersionTable.PSEdition -ne 'Core') {
#region Workaround for SelfSigned Cert an force TLS 1.2
if (-not ([System.Management.Automation.PSTypeName]'ServerCertificateValidationCallback').Type) {
Add-Type $certCallback
}
[ServerCertificateValidationCallback]::Ignore()
Expand Down