mirror of
https://github.com/benclaussen/NetboxPS.git
synced 2025-12-13 18:02:29 +00:00
Update Get-NetboxAPIDefinition for new path
- Add $Format parameter for json or yaml
This commit is contained in:
parent
8326e3eb29
commit
cceb8fe765
1 changed files with 15 additions and 9 deletions
|
|
@ -1,13 +1,19 @@
|
|||
|
||||
function Get-NetboxAPIDefinition {
|
||||
[CmdletBinding()]
|
||||
param ()
|
||||
param
|
||||
(
|
||||
[ValidateSet('json', 'yaml', IgnoreCase = $true)]
|
||||
[string]$Format = 'json'
|
||||
)
|
||||
|
||||
#$URI = "https://netbox.neonet.org/api/docs/?format=openapi"
|
||||
#$URI = "https://netbox.neonet.org/api/schema/?format=json"
|
||||
|
||||
$Segments = [System.Collections.ArrayList]::new(@('docs'))
|
||||
$Segments = [System.Collections.ArrayList]::new(@('schema'))
|
||||
|
||||
$URIComponents = BuildURIComponents -URISegments $Segments -ParametersDictionary @{'format' = 'openapi' }
|
||||
$URIComponents = BuildURIComponents -URISegments $Segments -ParametersDictionary @{
|
||||
'format' = $Format.ToLower()
|
||||
}
|
||||
|
||||
$URI = BuildNewURI -Segments $URIComponents.Segments -Parameters $URIComponents.Parameters -SkipConnectedCheck
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue