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

101 lines
2 KiB
PowerShell
Raw Normal View History

<#
2020-03-23 12:18:01 -04:00
.NOTES
===========================================================================
Created with: SAPIEN Technologies, Inc., PowerShell Studio 2020 v5.7.172
Created on: 3/23/2020 12:06
Created by: Claussen
Organization: NEOnet
Filename: Get-NetboxDCIMDevice.ps1
===========================================================================
.DESCRIPTION
A description of the file.
#>
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,
2020-03-23 12:18:01 -04:00
[uint16]$Manufacturer_Id,
2020-03-23 12:18:01 -04:00
[string]$Manufacturer,
2020-03-23 12:18:01 -04:00
[uint16]$Device_Type_Id,
2020-03-23 12:18:01 -04:00
[uint16]$Role_Id,
2020-03-23 12:18:01 -04:00
[string]$Role,
2020-03-23 12:18:01 -04:00
[uint16]$Tenant_Id,
2020-03-23 12:18:01 -04:00
[string]$Tenant,
2020-03-23 12:18:01 -04:00
[uint16]$Platform_Id,
2020-03-23 12:18:01 -04:00
[string]$Platform,
2020-03-23 12:18:01 -04:00
[string]$Asset_Tag,
2020-03-23 12:18:01 -04:00
[uint16]$Site_Id,
2020-03-23 12:18:01 -04:00
[string]$Site,
2020-03-23 12:18:01 -04:00
[uint16]$Rack_Group_Id,
2020-03-23 12:18:01 -04:00
[uint16]$Rack_Id,
2020-03-23 12:18:01 -04:00
[uint16]$Cluster_Id,
2020-03-23 12:18:01 -04:00
[uint16]$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,
2020-03-23 12:18:01 -04:00
[uint16]$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 {
if ($null -ne $Status) {
$PSBoundParameters.Status = ValidateDCIMChoice -ProvidedValue $Status -DeviceStatus
}
$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
}
}