mirror of
https://github.com/benclaussen/NetboxPS.git
synced 2025-12-15 02:35:46 +00:00
Correct New-NetboxIPAMVLAN function copied from Net-NetboxIPAMAddress
This commit is contained in:
parent
909cd73327
commit
bf8cbb41cc
1 changed files with 20 additions and 26 deletions
|
|
@ -1,41 +1,38 @@
|
||||||
function New-NetboxIPAMAddress {
|
function New-NetboxIPAMVLAN {
|
||||||
<#
|
<#
|
||||||
.SYNOPSIS
|
.SYNOPSIS
|
||||||
Create a new IP address to Netbox
|
Create a new VLAN
|
||||||
|
|
||||||
.DESCRIPTION
|
.DESCRIPTION
|
||||||
Create a new IP address to Netbox with a status of Active by default.
|
Create a new VLAN in Netbox with a status of Active by default.
|
||||||
|
|
||||||
.PARAMETER Address
|
.PARAMETER VID
|
||||||
IP address in CIDR notation: 192.168.1.1/24
|
The VLAN ID.
|
||||||
|
|
||||||
|
.PARAMETER Name
|
||||||
|
The name of the VLAN.
|
||||||
|
|
||||||
.PARAMETER Status
|
.PARAMETER Status
|
||||||
Status of the IP. Defaults to Active
|
Status of the VLAN. Defaults to Active
|
||||||
|
|
||||||
.PARAMETER Tenant
|
.PARAMETER Tenant
|
||||||
Tenant ID
|
Tenant ID
|
||||||
|
|
||||||
.PARAMETER VRF
|
|
||||||
VRF ID
|
|
||||||
|
|
||||||
.PARAMETER Role
|
.PARAMETER Role
|
||||||
Role such as anycast, loopback, etc... Defaults to nothing
|
Role such as anycast, loopback, etc... Defaults to nothing
|
||||||
|
|
||||||
.PARAMETER NAT_Inside
|
|
||||||
ID of IP for NAT
|
|
||||||
|
|
||||||
.PARAMETER Custom_Fields
|
|
||||||
Custom field hash table. Will be validated by the API service
|
|
||||||
|
|
||||||
.PARAMETER Interface
|
|
||||||
ID of interface to apply IP
|
|
||||||
|
|
||||||
.PARAMETER Description
|
.PARAMETER Description
|
||||||
Description of IP address
|
Description of IP address
|
||||||
|
|
||||||
|
.PARAMETER Custom_Fields
|
||||||
|
Custom field hash table. Will be validated by the API service
|
||||||
|
|
||||||
.PARAMETER Raw
|
.PARAMETER Raw
|
||||||
Return raw results from API service
|
Return raw results from API service
|
||||||
|
|
||||||
|
.PARAMETER Address
|
||||||
|
IP address in CIDR notation: 192.168.1.1/24
|
||||||
|
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
PS C:\> Create-NetboxIPAMAddress
|
PS C:\> Create-NetboxIPAMAddress
|
||||||
|
|
||||||
|
|
@ -50,22 +47,19 @@
|
||||||
[Parameter(Mandatory = $true)]
|
[Parameter(Mandatory = $true)]
|
||||||
[uint16]$VID,
|
[uint16]$VID,
|
||||||
|
|
||||||
|
[Parameter(Mandatory = $true)]
|
||||||
|
[string]$Name,
|
||||||
|
|
||||||
[object]$Status = 'Active',
|
[object]$Status = 'Active',
|
||||||
|
|
||||||
[uint16]$Tenant,
|
[uint16]$Tenant,
|
||||||
|
|
||||||
[uint16]$VRF,
|
|
||||||
|
|
||||||
[object]$Role,
|
[object]$Role,
|
||||||
|
|
||||||
[uint16]$NAT_Inside,
|
[string]$Description,
|
||||||
|
|
||||||
[hashtable]$Custom_Fields,
|
[hashtable]$Custom_Fields,
|
||||||
|
|
||||||
[uint16]$Interface,
|
|
||||||
|
|
||||||
[string]$Description,
|
|
||||||
|
|
||||||
[switch]$Raw
|
[switch]$Raw
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -75,7 +69,7 @@
|
||||||
$PSBoundParameters.Role = ValidateIPAMChoice -ProvidedValue $Role -IPAddressRole
|
$PSBoundParameters.Role = ValidateIPAMChoice -ProvidedValue $Role -IPAddressRole
|
||||||
}
|
}
|
||||||
|
|
||||||
$segments = [System.Collections.ArrayList]::new(@('ipam', 'ip-addresses'))
|
$segments = [System.Collections.ArrayList]::new(@('ipam', 'vlans'))
|
||||||
|
|
||||||
$URIComponents = BuildURIComponents -URISegments $segments -ParametersDictionary $PSBoundParameters
|
$URIComponents = BuildURIComponents -URISegments $segments -ParametersDictionary $PSBoundParameters
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue