NetboxPS/Functions/Setup/Support/Get-NetboxAPIDefinition.ps1

22 lines
590 B
PowerShell
Raw Normal View History

2022-12-06 13:34:52 -05:00

function Get-NetboxAPIDefinition {
2021-07-22 11:39:39 -04:00
[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()
}
2021-07-22 11:39:39 -04:00
$URI = BuildNewURI -Segments $URIComponents.Segments -Parameters $URIComponents.Parameters -SkipConnectedCheck
2021-07-22 11:39:39 -04:00
InvokeNetboxRequest -URI $URI
}