NetboxPS/Functions/Virtualization/VirtualizationCluster/Get-NetboxVirtualizationCluster.ps1

89 lines
1.8 KiB
PowerShell
Raw Normal View History

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

2020-03-23 12:18:01 -04:00
function Get-NetboxVirtualizationCluster {
<#
.SYNOPSIS
Obtains virtualization clusters from Netbox.
2020-03-23 12:18:01 -04:00
.DESCRIPTION
Obtains one or more virtualization clusters based on provided filters.
2020-03-23 12:18:01 -04:00
.PARAMETER Limit
Number of results to return per page
2020-03-23 12:18:01 -04:00
.PARAMETER Offset
The initial index from which to return the results
2020-03-23 12:18:01 -04:00
.PARAMETER Query
A general query used to search for a cluster
2020-03-23 12:18:01 -04:00
.PARAMETER Name
Name of the cluster
2020-03-23 12:18:01 -04:00
.PARAMETER Id
Database ID(s) of the cluster
2020-03-23 12:18:01 -04:00
.PARAMETER Group
String value of the cluster group.
2020-03-23 12:18:01 -04:00
.PARAMETER Group_Id
Database ID of the cluster group.
2020-03-23 12:18:01 -04:00
.PARAMETER Type
String value of the Cluster type.
2020-03-23 12:18:01 -04:00
.PARAMETER Type_Id
Database ID of the cluster type.
2020-03-23 12:18:01 -04:00
.PARAMETER Site
String value of the site.
2020-03-23 12:18:01 -04:00
.PARAMETER Site_Id
Database ID of the site.
2020-03-23 12:18:01 -04:00
.PARAMETER Raw
A description of the Raw parameter.
2020-03-23 12:18:01 -04:00
.EXAMPLE
PS C:\> Get-NetboxVirtualizationCluster
2020-03-23 12:18:01 -04:00
.NOTES
Additional information about the function.
#>
2020-03-23 12:18:01 -04:00
[CmdletBinding()]
param
(
[string]$Name,
2020-03-23 12:18:01 -04:00
[Alias('q')]
[string]$Query,
2020-03-23 12:18:01 -04:00
[uint16[]]$Id,
2020-03-23 12:18:01 -04:00
[string]$Group,
2020-03-23 12:18:01 -04:00
[uint16]$Group_Id,
2020-03-23 12:18:01 -04:00
[string]$Type,
2020-03-23 12:18:01 -04:00
[uint16]$Type_Id,
2020-03-23 12:18:01 -04:00
[string]$Site,
2020-03-23 12:18:01 -04:00
[uint16]$Site_Id,
[uint16]$Limit,
[uint16]$Offset,
2020-03-23 12:18:01 -04:00
[switch]$Raw
)
$Segments = [System.Collections.ArrayList]::new(@('virtualization', 'clusters'))
$URIComponents = BuildURIComponents -URISegments $Segments -ParametersDictionary $PSBoundParameters
$uri = BuildNewURI -Segments $URIComponents.Segments -Parameters $URIComponents.Parameters
2020-03-23 12:18:01 -04:00
InvokeNetboxRequest -URI $uri -Raw:$Raw
}