mirror of
https://github.com/benclaussen/NetboxPS.git
synced 2025-12-15 18:55:46 +00:00
Add-NetboxDCIMRearPort function
This commit is contained in:
parent
32a417fd2a
commit
9eac0bfacf
2 changed files with 69 additions and 0 deletions
38
Functions/DCIM/RearPorts/Add-NetboxDCIMRearPort.ps1
Normal file
38
Functions/DCIM/RearPorts/Add-NetboxDCIMRearPort.ps1
Normal 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
|
||||||
|
}
|
||||||
|
|
@ -983,6 +983,37 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"response": []
|
"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": []
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue