2023-03-17 19:27:55 +00:00
|
|
|
|
function Add-NetboxDCIMFrontPort {
|
|
|
|
|
|
[CmdletBinding()]
|
|
|
|
|
|
[OutputType([pscustomobject])]
|
|
|
|
|
|
param
|
|
|
|
|
|
(
|
|
|
|
|
|
[Parameter(Mandatory = $true)]
|
2023-07-28 15:38:16 -04:00
|
|
|
|
[uint64]$Device,
|
2023-03-17 19:27:55 +00:00
|
|
|
|
|
2023-07-28 15:38:16 -04:00
|
|
|
|
[uint64]$Module,
|
2023-03-17 19:27:55 +00:00
|
|
|
|
|
|
|
|
|
|
[Parameter(Mandatory = $true)]
|
|
|
|
|
|
[string]$Name,
|
|
|
|
|
|
|
|
|
|
|
|
[string]$Label,
|
|
|
|
|
|
|
|
|
|
|
|
[Parameter(Mandatory = $true)]
|
|
|
|
|
|
[string]$Type,
|
|
|
|
|
|
|
|
|
|
|
|
[ValidatePattern('^[0-9a-f]{6}$')]
|
|
|
|
|
|
[string]$Color,
|
|
|
|
|
|
|
|
|
|
|
|
[Parameter(Mandatory = $true)]
|
2023-07-28 15:38:16 -04:00
|
|
|
|
[uint64]$Rear_Port,
|
2023-03-17 19:27:55 +00:00
|
|
|
|
|
2023-07-28 15:38:16 -04:00
|
|
|
|
[uint64]$Rear_Port_Position,
|
2023-03-17 19:27:55 +00:00
|
|
|
|
|
|
|
|
|
|
[string]$Description,
|
|
|
|
|
|
|
|
|
|
|
|
[bool]$Mark_Connected,
|
|
|
|
|
|
|
|
|
|
|
|
[uint16[]]$Tags
|
|
|
|
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
$Segments = [System.Collections.ArrayList]::new(@('dcim', 'front-ports'))
|
|
|
|
|
|
|
|
|
|
|
|
$URIComponents = BuildURIComponents -URISegments $Segments.Clone() -ParametersDictionary $PSBoundParameters
|
|
|
|
|
|
|
|
|
|
|
|
$URI = BuildNewURI -Segments $URIComponents.Segments
|
|
|
|
|
|
|
|
|
|
|
|
InvokeNetboxRequest -URI $URI -Body $URIComponents.Parameters -Method POST
|
|
|
|
|
|
}
|