NetboxPS/Functions/Virtualization/VirtualMachineInterface/Get-NetboxVirtualMachineInterface.ps1

96 lines
2.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/19/2020 12:47
Created by: Claussen
Organization: NEOnet
Filename: Get-NetboxVirtualMachineInterface.ps1
===========================================================================
.DESCRIPTION
A description of the file.
#>
function Get-NetboxVirtualMachineInterface {
<#
2020-03-23 12:18:01 -04:00
.SYNOPSIS
Gets VM interfaces
2020-03-23 12:18:01 -04:00
.DESCRIPTION
Obtains the interface objects for one or more VMs
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 Id
Database ID of the interface
2020-03-23 12:18:01 -04:00
.PARAMETER Name
Name of the interface
2020-03-23 12:18:01 -04:00
.PARAMETER Enabled
True/False if the interface is enabled
2020-03-23 12:18:01 -04:00
.PARAMETER MTU
Maximum Transmission Unit size. Generally 1500 or 9000
2020-03-23 12:18:01 -04:00
.PARAMETER Virtual_Machine_Id
ID of the virtual machine to which the interface(s) are assigned.
2020-03-23 12:18:01 -04:00
.PARAMETER Virtual_Machine
Name of the virtual machine to get interfaces
2020-03-23 12:18:01 -04:00
.PARAMETER MAC_Address
MAC address assigned to the interface
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-NetboxVirtualMachineInterface
2020-03-23 12:18:01 -04:00
.NOTES
Additional information about the function.
#>
2020-03-23 12:18:01 -04:00
[CmdletBinding()]
param
(
[Parameter(ValueFromPipeline = $true)]
[uint16]$Id,
2020-03-23 12:18:01 -04:00
[string]$Name,
[string]$Query,
2020-03-23 12:18:01 -04:00
[boolean]$Enabled,
2020-03-23 12:18:01 -04:00
[uint16]$MTU,
2020-03-23 12:18:01 -04:00
[uint16]$Virtual_Machine_Id,
2020-03-23 12:18:01 -04:00
[string]$Virtual_Machine,
2020-03-23 12:18:01 -04:00
[string]$MAC_Address,
[uint16]$Limit,
[uint16]$Offset,
2020-03-23 12:18:01 -04:00
[switch]$Raw
)
process {
$Segments = [System.Collections.ArrayList]::new(@('virtualization', 'interfaces'))
$URIComponents = BuildURIComponents -URISegments $Segments -ParametersDictionary $PSBoundParameters
$uri = BuildNewURI -Segments $URIComponents.Segments -Parameters $URIComponents.Parameters
InvokeNetboxRequest -URI $uri -Raw:$Raw
}
2020-03-23 12:18:01 -04:00
}