From e40af029cc804630821f66cf04bd67c412da15cb Mon Sep 17 00:00:00 2001 From: sheffsix Date: Mon, 13 Mar 2023 17:15:18 +0000 Subject: [PATCH] Create function to get tag information --- Functions/Extras/Get-NetboxTag.ps1 | 33 ++++++++++++++++++++++++++ Postman/Netbox.postman_collection.json | 27 +++++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 Functions/Extras/Get-NetboxTag.ps1 diff --git a/Functions/Extras/Get-NetboxTag.ps1 b/Functions/Extras/Get-NetboxTag.ps1 new file mode 100644 index 0000000..b67f095 --- /dev/null +++ b/Functions/Extras/Get-NetboxTag.ps1 @@ -0,0 +1,33 @@ + +function Get-NetboxTag +{ + [CmdletBinding()] + [OutputType([pscustomobject])] + param + ( + [uint16]$Limit, + + [uint16]$Offset, + + [Parameter(ValueFromPipelineByPropertyName = $true)] + [uint16]$Id, + + [string]$Name, + + [string]$Slug, + + [switch]$Raw + ) + + process + { + + $Segments = [System.Collections.ArrayList]::new(@('extras', 'tags')) + + $URIComponents = BuildURIComponents -URISegments $Segments.Clone() -ParametersDictionary $PSBoundParameters + + $URI = BuildNewURI -Segments $URIComponents.Segments -Parameters $URIComponents.Parameters + + InvokeNetboxRequest -URI $URI -Raw:$Raw + } +} \ No newline at end of file diff --git a/Postman/Netbox.postman_collection.json b/Postman/Netbox.postman_collection.json index 1282201..645362b 100644 --- a/Postman/Netbox.postman_collection.json +++ b/Postman/Netbox.postman_collection.json @@ -1061,6 +1061,33 @@ } ] }, + { + "name": "Extras", + "item": [ + { + "name": "Get Tags", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{SCHEME}}://{{HOSTNAME}}:{{PORT}}/api/extras/tags/", + "protocol": "{{SCHEME}}", + "host": [ + "{{HOSTNAME}}" + ], + "port": "{{PORT}}", + "path": [ + "api", + "extras", + "tags", + "" + ] + } + }, + "response": [] + } + ] + }, { "name": "Circuits", "item": [