NetboxPS/Functions/DCIM/DCIM.ps1

107 lines
2.5 KiB
PowerShell
Raw Normal View History

2018-05-23 11:10:40 -04:00
<#
.NOTES
===========================================================================
Created with: SAPIEN Technologies, Inc., PowerShell Studio 2018 v5.5.152
Created on: 5/22/2018 4:47 PM
Created by: Ben Claussen
Organization: NEOnet
Filename: DCIM.ps1
===========================================================================
.DESCRIPTION
A description of the file.
#>
function Get-NetboxDCIMChoices {
[CmdletBinding()]
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseSingularNouns", "", Justification = "These are literally 'choices' in Netbox")]
param ()
$uriSegments = [System.Collections.ArrayList]::new(@('dcim', '_choices'))
$uri = BuildNewURI -Segments $uriSegments -Parameters $Parameters
InvokeNetboxRequest -URI $uri
}
2018-05-25 15:11:59 -04:00
#region GET commands
2018-05-25 15:11:59 -04:00
function Get-NetboxDCIMPlatform {
[CmdletBinding()]
2018-05-25 15:11:59 -04:00
[OutputType([pscustomobject])]
param
(
[uint16]$Limit,
[uint16]$Offset,
[Parameter(ParameterSetName = 'ById')]
[uint16[]]$Id,
[string]$Name,
[string]$Slug,
2018-05-25 15:11:59 -04:00
[uint16]$Manufacturer_Id,
2018-05-25 15:11:59 -04:00
[string]$Manufacturer,
[switch]$Raw
)
switch ($PSCmdlet.ParameterSetName) {
'ById' {
2018-05-25 15:11:59 -04:00
foreach ($PlatformID in $Id) {
$Segments = [System.Collections.ArrayList]::new(@('dcim', 'platforms', $PlatformID))
$URIComponents = BuildURIComponents -URISegments $Segments -ParametersDictionary $PSBoundParameters -SkipParameterByName 'Id', 'Raw'
$URI = BuildNewURI -Segments $URIComponents.Segments -Parameters $URIComponents.Parameters
InvokeNetboxRequest -URI $URI -Raw:$Raw
}
break
}
default {
2018-05-25 15:11:59 -04:00
$Segments = [System.Collections.ArrayList]::new(@('dcim', 'platforms'))
$URIComponents = BuildURIComponents -URISegments $Segments -ParametersDictionary $PSBoundParameters -SkipParameterByName 'Raw'
$URI = BuildNewURI -Segments $URIComponents.Segments -Parameters $URIComponents.Parameters
InvokeNetboxRequest -URI $URI -Raw:$Raw
}
}
}
2018-05-24 16:39:45 -04:00
2018-05-25 15:11:59 -04:00
#endregion GET commands
2018-05-25 12:56:12 -04:00
2018-05-24 16:39:45 -04:00
2018-05-25 15:11:59 -04:00
#region NEW/ADD commands
2018-05-25 15:11:59 -04:00
#endregion NEW/ADD commands
2018-05-24 16:39:45 -04:00
2018-05-25 12:56:12 -04:00
2018-05-25 15:11:59 -04:00
#region SET commands
2018-05-25 12:56:12 -04:00
2018-05-25 15:11:59 -04:00
#endregion SET commands
#region REMOVE commands
2018-05-25 12:56:12 -04:00
#endregion REMOVE commands