NetboxPS/Functions/Setup/Support/Get-NetboxAPIDefinition.ps1
2023-11-09 12:04:05 -05:00

21 lines
590 B
PowerShell

function Get-NetboxAPIDefinition {
[CmdletBinding()]
param
(
[ValidateSet('json', 'yaml', IgnoreCase = $true)]
[string]$Format = 'json'
)
#$URI = "https://netbox.neonet.org/api/schema/?format=json"
$Segments = [System.Collections.ArrayList]::new(@('schema'))
$URIComponents = BuildURIComponents -URISegments $Segments -ParametersDictionary @{
'format' = $Format.ToLower()
}
$URI = BuildNewURI -Segments $URIComponents.Segments -Parameters $URIComponents.Parameters -SkipConnectedCheck
InvokeNetboxRequest -URI $URI
}