2022-12-06 13:34:52 -05:00
|
|
|
|
|
2021-03-25 16:52:08 -04:00
|
|
|
|
function Get-NetboxAPIDefinition {
|
2021-07-22 11:39:39 -04:00
|
|
|
|
[CmdletBinding()]
|
2023-11-09 11:07:43 -05:00
|
|
|
|
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
|
2023-11-09 11:07:43 -05:00
|
|
|
|
|
2021-07-22 11:39:39 -04:00
|
|
|
|
InvokeNetboxRequest -URI $URI
|
2021-03-25 16:52:08 -04:00
|
|
|
|
}
|