NetboxPS/Functions/DCIM/Interfaces/Get-NetboxDCIMInterface.ps1

50 lines
1 KiB
PowerShell
Raw Normal View History

2022-12-06 13:34:52 -05:00

2020-03-23 12:18:01 -04:00
function Get-NetboxDCIMInterface {
[CmdletBinding()]
[OutputType([pscustomobject])]
param
(
[uint16]$Limit,
2020-03-23 12:18:01 -04:00
[uint16]$Offset,
2020-03-23 12:18:01 -04:00
[Parameter(ValueFromPipelineByPropertyName = $true)]
[uint16]$Id,
2020-03-23 12:18:01 -04:00
[uint16]$Name,
2020-03-23 12:18:01 -04:00
[object]$Form_Factor,
2020-03-23 12:18:01 -04:00
[bool]$Enabled,
2020-03-23 12:18:01 -04:00
[uint16]$MTU,
2020-03-23 12:18:01 -04:00
[bool]$MGMT_Only,
2020-03-23 12:18:01 -04:00
[string]$Device,
2020-03-23 12:18:01 -04:00
[uint16]$Device_Id,
2020-03-23 12:18:01 -04:00
[uint16]$Type,
2020-03-23 12:18:01 -04:00
[uint16]$LAG_Id,
2020-03-23 12:18:01 -04:00
[string]$MAC_Address,
2020-03-23 12:18:01 -04:00
[switch]$Raw
)
process {
if ($null -ne $Form_Factor) {
$PSBoundParameters.Form_Factor = ValidateDCIMChoice -ProvidedValue $Form_Factor -InterfaceFormFactor
}
$Segments = [System.Collections.ArrayList]::new(@('dcim', 'interfaces'))
$URIComponents = BuildURIComponents -URISegments $Segments.Clone() -ParametersDictionary $PSBoundParameters
$URI = BuildNewURI -Segments $URIComponents.Segments -Parameters $URIComponents.Parameters
InvokeNetboxRequest -URI $URI -Raw:$Raw
2020-03-23 12:18:01 -04:00
}
}