Add-NetboxDCIMRearPort function

This commit is contained in:
sheffsix 2023-03-13 13:59:54 +00:00
parent 32a417fd2a
commit 9eac0bfacf
2 changed files with 69 additions and 0 deletions

View file

@ -0,0 +1,38 @@

function Add-NetboxDCIMRearPort
{
[CmdletBinding()]
[OutputType([pscustomobject])]
param
(
[Parameter(Mandatory = $true)]
[uint16]$Device,
[uint16]$Module,
[Parameter(Mandatory = $true)]
[string]$Name,
[string]$Label,
[Parameter(Mandatory = $true)]
[string]$Type,
[string]$Color,
[uint16]$Positions,
[string]$Description,
[string]$Tags
)
$Segments = [System.Collections.ArrayList]::new(@('dcim', 'rear-ports'))
$URIComponents = BuildURIComponents -URISegments $Segments.Clone() -ParametersDictionary $PSBoundParameters
$URI = BuildNewURI -Segments $URIComponents.Segments
InvokeNetboxRequest -URI $URI -Body $URIComponents.Parameters -Method POST
}

View file

@ -983,6 +983,37 @@
}
},
"response": []
},
{
"name": "Add Rear Port",
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\r\n \"device\": 62,\r\n \"name\": \"RearPort1\",\r\n \"type\": 110-punch\r\n}"
},
"url": {
"raw": "{{SCHEME}}://{{HOSTNAME}}:{{PORT}}/api/dcim/rear-ports/",
"protocol": "{{SCHEME}}",
"host": [
"{{HOSTNAME}}"
],
"port": "{{PORT}}",
"path": [
"api",
"dcim",
"rear-ports",
""
]
}
},
"response": []
}
]
},