NetboxPS/Functions/DCIM/Devices/Get-NetboxDCIMDevice.ps1

84 lines
1.5 KiB
PowerShell
Raw Normal View History

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

2020-03-23 12:18:01 -04:00
function Get-NetboxDCIMDevice {
[CmdletBinding()]
#region Parameters
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
[string]$Query,
2020-03-23 12:18:01 -04:00
[string]$Name,
[uint64]$Manufacturer_Id,
2020-03-23 12:18:01 -04:00
[string]$Manufacturer,
[uint64]$Device_Type_Id,
[uint64]$Role_Id,
2020-03-23 12:18:01 -04:00
[string]$Role,
[uint64]$Tenant_Id,
2020-03-23 12:18:01 -04:00
[string]$Tenant,
[uint64]$Platform_Id,
2020-03-23 12:18:01 -04:00
[string]$Platform,
2020-03-23 12:18:01 -04:00
[string]$Asset_Tag,
[uint64]$Site_Id,
2020-03-23 12:18:01 -04:00
[string]$Site,
[uint64]$Rack_Group_Id,
[uint64]$Rack_Id,
[uint64]$Cluster_Id,
[uint64]$Model,
2020-03-23 12:18:01 -04:00
[object]$Status,
2020-03-23 12:18:01 -04:00
[bool]$Is_Full_Depth,
2020-03-23 12:18:01 -04:00
[bool]$Is_Console_Server,
2020-03-23 12:18:01 -04:00
[bool]$Is_PDU,
2020-03-23 12:18:01 -04:00
[bool]$Is_Network_Device,
2020-03-23 12:18:01 -04:00
[string]$MAC_Address,
2020-03-23 12:18:01 -04:00
[bool]$Has_Primary_IP,
[uint64]$Virtual_Chassis_Id,
2020-03-23 12:18:01 -04:00
[uint16]$Position,
2020-03-23 12:18:01 -04:00
[string]$Serial,
2020-03-23 12:18:01 -04:00
[switch]$Raw
)
2020-03-23 12:18:01 -04:00
#endregion Parameters
process {
$Segments = [System.Collections.ArrayList]::new(@('dcim', 'devices'))
$URIComponents = BuildURIComponents -URISegments $Segments.Clone() -ParametersDictionary $PSBoundParameters -SkipParameterByName 'Raw'
$URI = BuildNewURI -Segments $URIComponents.Segments -Parameters $URIComponents.Parameters
InvokeNetboxRequest -URI $URI -Raw:$Raw
2020-03-23 12:18:01 -04:00
}
}