2021-07-23 22:06:42 +02:00
|
|
|
|
<#
|
2021-09-10 17:34:37 +02:00
|
|
|
|
.NOTES
|
|
|
|
|
|
===========================================================================
|
|
|
|
|
|
Created with: SAPIEN Technologies, Inc., PowerShell Studio 2020 v5.7.181
|
|
|
|
|
|
Created on: 2020-10-02 15:52
|
|
|
|
|
|
Created by: Claussen
|
|
|
|
|
|
Organization: NEOnet
|
|
|
|
|
|
Filename: Get-NetboxDCIMSite.ps1
|
|
|
|
|
|
===========================================================================
|
|
|
|
|
|
.DESCRIPTION
|
|
|
|
|
|
A description of the file.
|
2021-03-25 16:52:08 -04:00
|
|
|
|
#>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function Get-NetboxDCIMSite {
|
2021-09-10 17:34:37 +02:00
|
|
|
|
[CmdletBinding(DefaultParameterSetName = 'Query')]
|
2021-03-25 16:52:08 -04:00
|
|
|
|
[OutputType([pscustomobject])]
|
|
|
|
|
|
param
|
|
|
|
|
|
(
|
|
|
|
|
|
[Parameter(ParameterSetName = 'ByID', ValueFromPipelineByPropertyName = $true)]
|
|
|
|
|
|
[uint32]$Id,
|
2021-07-23 22:06:42 +02:00
|
|
|
|
|
2021-03-25 16:52:08 -04:00
|
|
|
|
[Parameter(ParameterSetName = 'Query')]
|
|
|
|
|
|
[string]$Name,
|
2021-07-23 22:06:42 +02:00
|
|
|
|
|
2021-03-25 16:52:08 -04:00
|
|
|
|
[Parameter(ParameterSetName = 'Query')]
|
|
|
|
|
|
[string]$Query,
|
2021-07-23 22:06:42 +02:00
|
|
|
|
|
2021-03-25 16:52:08 -04:00
|
|
|
|
[Parameter(ParameterSetName = 'Query')]
|
|
|
|
|
|
[string]$Slug,
|
2021-07-23 22:06:42 +02:00
|
|
|
|
|
2021-03-25 16:52:08 -04:00
|
|
|
|
[Parameter(ParameterSetName = 'Query')]
|
|
|
|
|
|
[string]$Facility,
|
2021-07-23 22:06:42 +02:00
|
|
|
|
|
2021-03-25 16:52:08 -04:00
|
|
|
|
[Parameter(ParameterSetName = 'Query')]
|
|
|
|
|
|
[uint32]$ASN,
|
2021-07-23 22:06:42 +02:00
|
|
|
|
|
2021-03-25 16:52:08 -04:00
|
|
|
|
[Parameter(ParameterSetName = 'Query')]
|
|
|
|
|
|
[decimal]$Latitude,
|
2021-07-23 22:06:42 +02:00
|
|
|
|
|
2021-03-25 16:52:08 -04:00
|
|
|
|
[Parameter(ParameterSetName = 'Query')]
|
|
|
|
|
|
[decimal]$Longitude,
|
2021-07-23 22:06:42 +02:00
|
|
|
|
|
2021-03-25 16:52:08 -04:00
|
|
|
|
[Parameter(ParameterSetName = 'Query')]
|
|
|
|
|
|
[string]$Contact_Name,
|
2021-07-23 22:06:42 +02:00
|
|
|
|
|
2021-03-25 16:52:08 -04:00
|
|
|
|
[Parameter(ParameterSetName = 'Query')]
|
|
|
|
|
|
[string]$Contact_Phone,
|
2021-07-23 22:06:42 +02:00
|
|
|
|
|
2021-03-25 16:52:08 -04:00
|
|
|
|
[Parameter(ParameterSetName = 'Query')]
|
|
|
|
|
|
[string]$Contact_Email,
|
2021-07-23 22:06:42 +02:00
|
|
|
|
|
2021-03-25 16:52:08 -04:00
|
|
|
|
[Parameter(ParameterSetName = 'Query')]
|
|
|
|
|
|
[uint32]$Tenant_Group_ID,
|
2021-07-23 22:06:42 +02:00
|
|
|
|
|
2021-03-25 16:52:08 -04:00
|
|
|
|
[Parameter(ParameterSetName = 'Query')]
|
|
|
|
|
|
[string]$Tenant_Group,
|
2021-07-23 22:06:42 +02:00
|
|
|
|
|
2021-03-25 16:52:08 -04:00
|
|
|
|
[Parameter(ParameterSetName = 'Query')]
|
|
|
|
|
|
[uint32]$Tenant_ID,
|
2021-07-23 22:06:42 +02:00
|
|
|
|
|
2021-03-25 16:52:08 -04:00
|
|
|
|
[Parameter(ParameterSetName = 'Query')]
|
|
|
|
|
|
[string]$Tenant,
|
2021-07-23 22:06:42 +02:00
|
|
|
|
|
2021-03-25 16:52:08 -04:00
|
|
|
|
[Parameter(ParameterSetName = 'Query')]
|
|
|
|
|
|
[string]$Status,
|
2021-07-23 22:06:42 +02:00
|
|
|
|
|
2021-03-25 16:52:08 -04:00
|
|
|
|
[Parameter(ParameterSetName = 'Query')]
|
|
|
|
|
|
[uint32]$Region_ID,
|
2021-07-23 22:06:42 +02:00
|
|
|
|
|
2021-03-25 16:52:08 -04:00
|
|
|
|
[Parameter(ParameterSetName = 'Query')]
|
|
|
|
|
|
[string]$Region,
|
2021-07-23 22:06:42 +02:00
|
|
|
|
|
2021-03-25 16:52:08 -04:00
|
|
|
|
[Parameter(ParameterSetName = 'Query')]
|
|
|
|
|
|
[uint16]$Limit,
|
2021-07-23 22:06:42 +02:00
|
|
|
|
|
2021-03-25 16:52:08 -04:00
|
|
|
|
[Parameter(ParameterSetName = 'Query')]
|
|
|
|
|
|
[uint16]$Offset,
|
2021-07-23 22:06:42 +02:00
|
|
|
|
|
2021-03-25 16:52:08 -04:00
|
|
|
|
[switch]$Raw
|
|
|
|
|
|
)
|
2021-07-23 22:06:42 +02:00
|
|
|
|
|
|
|
|
|
|
process {
|
|
|
|
|
|
switch ($PSCmdlet.ParameterSetName) {
|
|
|
|
|
|
'ById' {
|
|
|
|
|
|
foreach ($Site_ID in $ID) {
|
|
|
|
|
|
$Segments = [System.Collections.ArrayList]::new(@('dcim', 'sites', $Site_Id))
|
|
|
|
|
|
|
|
|
|
|
|
$URIComponents = BuildURIComponents -URISegments $Segments.Clone() -ParametersDictionary $PSBoundParameters -SkipParameterByName "Id"
|
|
|
|
|
|
|
|
|
|
|
|
$URI = BuildNewURI -Segments $URIComponents.Segments -Parameters $URIComponents.Parameters
|
|
|
|
|
|
|
|
|
|
|
|
InvokeNetboxRequest -URI $URI -Raw:$Raw
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
default {
|
|
|
|
|
|
$Segments = [System.Collections.ArrayList]::new(@('dcim', 'sites'))
|
|
|
|
|
|
|
|
|
|
|
|
$URIComponents = BuildURIComponents -URISegments $Segments.Clone() -ParametersDictionary $PSBoundParameters
|
|
|
|
|
|
|
2021-03-25 16:52:08 -04:00
|
|
|
|
$URI = BuildNewURI -Segments $URIComponents.Segments -Parameters $URIComponents.Parameters
|
2021-07-23 22:06:42 +02:00
|
|
|
|
|
2021-03-25 16:52:08 -04:00
|
|
|
|
InvokeNetboxRequest -URI $URI -Raw:$Raw
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|