2020-03-23 12:18:01 -04:00
|
|
|
|
function Get-NetboxIPAMAddress {
|
|
|
|
|
|
[CmdletBinding()]
|
|
|
|
|
|
param
|
|
|
|
|
|
(
|
2020-04-09 09:58:36 -04:00
|
|
|
|
[string]$Address,
|
2020-03-23 12:18:01 -04:00
|
|
|
|
|
|
|
|
|
|
[uint16[]]$Id,
|
|
|
|
|
|
|
|
|
|
|
|
[string]$Query,
|
|
|
|
|
|
|
2020-04-09 09:58:36 -04:00
|
|
|
|
[object]$Family,
|
|
|
|
|
|
|
2020-03-23 12:18:01 -04:00
|
|
|
|
[uint16]$Parent,
|
|
|
|
|
|
|
|
|
|
|
|
[byte]$Mask_Length,
|
|
|
|
|
|
|
|
|
|
|
|
[string]$VRF,
|
|
|
|
|
|
|
|
|
|
|
|
[uint16]$VRF_Id,
|
|
|
|
|
|
|
|
|
|
|
|
[string]$Tenant,
|
|
|
|
|
|
|
|
|
|
|
|
[uint16]$Tenant_Id,
|
|
|
|
|
|
|
|
|
|
|
|
[string]$Device,
|
|
|
|
|
|
|
|
|
|
|
|
[uint16]$Device_ID,
|
|
|
|
|
|
|
|
|
|
|
|
[string]$Virtual_Machine,
|
|
|
|
|
|
|
|
|
|
|
|
[uint16]$Virtual_Machine_Id,
|
|
|
|
|
|
|
|
|
|
|
|
[uint16]$Interface_Id,
|
|
|
|
|
|
|
|
|
|
|
|
[object]$Status,
|
|
|
|
|
|
|
|
|
|
|
|
[object]$Role,
|
|
|
|
|
|
|
2020-04-09 09:58:36 -04:00
|
|
|
|
[uint16]$Limit,
|
|
|
|
|
|
|
|
|
|
|
|
[uint16]$Offset,
|
|
|
|
|
|
|
2020-03-23 12:18:01 -04:00
|
|
|
|
[switch]$Raw
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
if ($null -ne $Family) {
|
|
|
|
|
|
$PSBoundParameters.Family = ValidateIPAMChoice -ProvidedValue $Family -IPAddressFamily
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if ($null -ne $Status) {
|
|
|
|
|
|
$PSBoundParameters.Status = ValidateIPAMChoice -ProvidedValue $Status -IPAddressStatus
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if ($null -ne $Role) {
|
|
|
|
|
|
$PSBoundParameters.Role = ValidateIPAMChoice -ProvidedValue $Role -IPAddressRole
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$Segments = [System.Collections.ArrayList]::new(@('ipam', 'ip-addresses'))
|
|
|
|
|
|
|
|
|
|
|
|
$URIComponents = BuildURIComponents -URISegments $Segments -ParametersDictionary $PSBoundParameters
|
|
|
|
|
|
|
|
|
|
|
|
$uri = BuildNewURI -Segments $URIComponents.Segments -Parameters $URIComponents.Parameters
|
|
|
|
|
|
|
|
|
|
|
|
InvokeNetboxRequest -URI $uri -Raw:$Raw
|
|
|
|
|
|
}
|