Increment version to 1.5.0

This commit is contained in:
Ben Claussen 2021-07-23 16:19:03 -04:00
parent c11680a20e
commit 30ae377493
3 changed files with 185 additions and 216 deletions

View file

@ -12,7 +12,7 @@
RootModule = 'NetboxPS.psm1' RootModule = 'NetboxPS.psm1'
# Version number of this module. # Version number of this module.
ModuleVersion = '1.4.1' ModuleVersion = '1.5.0'
# Supported PSEditions # Supported PSEditions
# CompatiblePSEditions = @() # CompatiblePSEditions = @()

View file

@ -12,7 +12,7 @@
RootModule = 'NetboxPS.psm1' RootModule = 'NetboxPS.psm1'
# Version number of this module. # Version number of this module.
ModuleVersion = '1.4.1' ModuleVersion = '1.5.0'
# Supported PSEditions # Supported PSEditions
# CompatiblePSEditions = @() # CompatiblePSEditions = @()

View file

@ -147,8 +147,8 @@ function Add-NetboxDCIMInterfaceConnection {
} }
# Verify if both Interfaces exist # Verify if both Interfaces exist
$I_A = Get-NetboxDCIMInterface -Id $Interface_A -ErrorAction Stop Get-NetboxDCIMInterface -Id $Interface_A -ErrorAction Stop | Out-null
$I_B = Get-NetboxDCIMInterface -Id $Interface_B -ErrorAction Stop Get-NetboxDCIMInterface -Id $Interface_B -ErrorAction Stop | Out-null
$Segments = [System.Collections.ArrayList]::new(@('dcim', 'interface-connections')) $Segments = [System.Collections.ArrayList]::new(@('dcim', 'interface-connections'))
@ -428,25 +428,6 @@ function CheckNetboxIsConnected {
} }
} }
#endregion
#region File Circuits.ps1
<#
.NOTES
===========================================================================
Created with: SAPIEN Technologies, Inc., PowerShell Studio 2018 v5.5.148
Created on: 2/28/2018 4:06 PM
Created by: Ben Claussen
Organization: NEOnet
Filename: Circuits.ps1
===========================================================================
.DESCRIPTION
Circuit object functions
#>
#endregion #endregion
#region File Clear-NetboxCredential.ps1 #region File Clear-NetboxCredential.ps1
@ -921,6 +902,7 @@ function Get-NetboxCircuit {
[switch]$Raw [switch]$Raw
) )
process {
switch ($PSCmdlet.ParameterSetName) { switch ($PSCmdlet.ParameterSetName) {
'ById' { 'ById' {
foreach ($i in $ID) { foreach ($i in $ID) {
@ -945,6 +927,7 @@ function Get-NetboxCircuit {
} }
} }
} }
}
#endregion #endregion
@ -1291,6 +1274,7 @@ function Get-NetboxDCIMDevice {
#endregion Parameters #endregion Parameters
process {
if ($null -ne $Status) { if ($null -ne $Status) {
$PSBoundParameters.Status = ValidateDCIMChoice -ProvidedValue $Status -DeviceStatus $PSBoundParameters.Status = ValidateDCIMChoice -ProvidedValue $Status -DeviceStatus
} }
@ -1303,6 +1287,7 @@ function Get-NetboxDCIMDevice {
InvokeNetboxRequest -URI $URI -Raw:$Raw InvokeNetboxRequest -URI $URI -Raw:$Raw
} }
}
#endregion #endregion
@ -1490,6 +1475,7 @@ function Get-NetboxDCIMInterface {
[switch]$Raw [switch]$Raw
) )
process {
if ($null -ne $Form_Factor) { if ($null -ne $Form_Factor) {
$PSBoundParameters.Form_Factor = ValidateDCIMChoice -ProvidedValue $Form_Factor -InterfaceFormFactor $PSBoundParameters.Form_Factor = ValidateDCIMChoice -ProvidedValue $Form_Factor -InterfaceFormFactor
} }
@ -1502,6 +1488,7 @@ function Get-NetboxDCIMInterface {
InvokeNetboxRequest -URI $URI -Raw:$Raw InvokeNetboxRequest -URI $URI -Raw:$Raw
} }
}
#endregion #endregion
@ -1709,6 +1696,7 @@ function Get-NetboxDCIMSite {
[switch]$Raw [switch]$Raw
) )
process {
switch ($PSCmdlet.ParameterSetName) { switch ($PSCmdlet.ParameterSetName) {
'ById' { 'ById' {
foreach ($Site_ID in $ID) { foreach ($Site_ID in $ID) {
@ -1733,6 +1721,7 @@ function Get-NetboxDCIMSite {
} }
} }
} }
}
#endregion #endregion
@ -2954,6 +2943,7 @@ function Get-NetboxVirtualMachine {
[switch]$Raw [switch]$Raw
) )
process {
if ($null -ne $Status) { if ($null -ne $Status) {
$PSBoundParameters.Status = ValidateVirtualizationChoice -ProvidedValue $Status -VirtualMachineStatus $PSBoundParameters.Status = ValidateVirtualizationChoice -ProvidedValue $Status -VirtualMachineStatus
} }
@ -2966,6 +2956,7 @@ function Get-NetboxVirtualMachine {
InvokeNetboxRequest -URI $uri -Raw:$Raw InvokeNetboxRequest -URI $uri -Raw:$Raw
} }
}
#endregion #endregion
@ -3057,6 +3048,7 @@ function Get-NetboxVirtualMachineInterface {
[switch]$Raw [switch]$Raw
) )
process {
$Segments = [System.Collections.ArrayList]::new(@('virtualization', 'interfaces')) $Segments = [System.Collections.ArrayList]::new(@('virtualization', 'interfaces'))
$URIComponents = BuildURIComponents -URISegments $Segments -ParametersDictionary $PSBoundParameters $URIComponents = BuildURIComponents -URISegments $Segments -ParametersDictionary $PSBoundParameters
@ -3065,6 +3057,7 @@ function Get-NetboxVirtualMachineInterface {
InvokeNetboxRequest -URI $uri -Raw:$Raw InvokeNetboxRequest -URI $uri -Raw:$Raw
} }
}
#endregion #endregion
@ -3238,6 +3231,7 @@ function New-NetboxCircuit {
[switch]$Raw [switch]$Raw
) )
process {
$Segments = [System.Collections.ArrayList]::new(@('circuits', 'circuits')) $Segments = [System.Collections.ArrayList]::new(@('circuits', 'circuits'))
$Method = 'POST' $Method = 'POST'
@ -3249,6 +3243,7 @@ function New-NetboxCircuit {
InvokeNetboxRequest -URI $URI -Method $Method -Body $URIComponents.Parameters -Raw:$Raw InvokeNetboxRequest -URI $URI -Method $Method -Body $URIComponents.Parameters -Raw:$Raw
} }
} }
}
#endregion #endregion
@ -3269,7 +3264,8 @@ function New-NetboxCircuit {
function New-NetboxDCIMDevice { function New-NetboxDCIMDevice {
[CmdletBinding()] [CmdletBinding(ConfirmImpact = 'low',
SupportsShouldProcess = $true)]
[OutputType([pscustomobject])] [OutputType([pscustomobject])]
#region Parameters #region Parameters
param param
@ -3342,8 +3338,10 @@ function New-NetboxDCIMDevice {
$URI = BuildNewURI -Segments $URIComponents.Segments $URI = BuildNewURI -Segments $URIComponents.Segments
if ($PSCmdlet.ShouldProcess($Name, 'Create new Device')) {
InvokeNetboxRequest -URI $URI -Body $URIComponents.Parameters -Method POST InvokeNetboxRequest -URI $URI -Body $URIComponents.Parameters -Method POST
} }
}
#endregion #endregion
@ -3401,14 +3399,19 @@ function New-NetboxIPAMAddress {
.PARAMETER Dns_name .PARAMETER Dns_name
DNS Name of IP address (example : netbox.example.com) DNS Name of IP address (example : netbox.example.com)
.PARAMETER Force .PARAMETER Assigned_Object_Type
Do not prompt for confirmation to create IP. Assigned Object Type dcim.interface or virtualization.vminterface
.PARAMETER Assigned_Object_Id
Assigned Object ID
.PARAMETER Raw .PARAMETER Raw
Return raw results from API service Return raw results from API service
.EXAMPLE .EXAMPLE
PS C:\> Create-NetboxIPAMAddress New-NetboxIPAMAddress -Address 192.0.2.1/32
Add new IP Address 192.0.2.1/32 with status active
.NOTES .NOTES
Additional information about the function. Additional information about the function.
@ -3441,7 +3444,10 @@ function New-NetboxIPAMAddress {
[string]$Dns_name, [string]$Dns_name,
[switch]$Force, [ValidateSet('dcim.interface', 'virtualization.vminterface', IgnoreCase = $true)]
[string]$Assigned_Object_Type,
[int]$Assigned_Object_Id,
[switch]$Raw [switch]$Raw
) )
@ -3450,22 +3456,11 @@ function New-NetboxIPAMAddress {
$Segments = [System.Collections.ArrayList]::new(@('ipam', 'ip-addresses')) $Segments = [System.Collections.ArrayList]::new(@('ipam', 'ip-addresses'))
$Method = 'POST' $Method = 'POST'
# # Value validation
# $ModelDefinition = GetModelDefinitionFromURIPath -Segments $Segments -Method $Method
# $EnumProperties = GetModelEnumProperties -ModelDefinition $ModelDefinition
#
# foreach ($Property in $EnumProperties.Keys) {
# if ($PSBoundParameters.ContainsKey($Property)) {
# Write-Verbose "Validating property [$Property] with value [$($PSBoundParameters.$Property)]"
# $PSBoundParameters.$Property = ValidateValue -ModelDefinition $ModelDefinition -Property $Property -ProvidedValue $PSBoundParameters.$Property
# }
# }
#
$URIComponents = BuildURIComponents -URISegments $Segments -ParametersDictionary $PSBoundParameters $URIComponents = BuildURIComponents -URISegments $Segments -ParametersDictionary $PSBoundParameters
$URI = BuildNewURI -Segments $URIComponents.Segments $URI = BuildNewURI -Segments $URIComponents.Segments
if ($Force -or $PSCmdlet.ShouldProcess($Address, 'Create new IP address')) { if ($PSCmdlet.ShouldProcess($Address, 'Create new IP address')) {
InvokeNetboxRequest -URI $URI -Method $Method -Body $URIComponents.Parameters -Raw:$Raw InvokeNetboxRequest -URI $URI -Method $Method -Body $URIComponents.Parameters -Raw:$Raw
} }
} }
@ -3495,6 +3490,8 @@ function New-NetboxIPAMAddress {
function New-NetboxIPAMPrefix { function New-NetboxIPAMPrefix {
[CmdletBinding(ConfirmImpact = 'low',
SupportsShouldProcess = $true)]
[CmdletBinding()] [CmdletBinding()]
param param
( (
@ -3537,8 +3534,10 @@ function New-NetboxIPAMPrefix {
$URI = BuildNewURI -Segments $URIComponents.Segments $URI = BuildNewURI -Segments $URIComponents.Segments
if ($PSCmdlet.ShouldProcess($Prefix, 'Create new Prefix')) {
InvokeNetboxRequest -URI $URI -Method POST -Body $URIComponents.Parameters -Raw:$Raw InvokeNetboxRequest -URI $URI -Method POST -Body $URIComponents.Parameters -Raw:$Raw
} }
}
#endregion #endregion
@ -3586,7 +3585,8 @@ function New-NetboxIPAMVLAN {
Additional information about the function. Additional information about the function.
#> #>
[CmdletBinding()] [CmdletBinding(ConfirmImpact = 'low',
SupportsShouldProcess = $true)]
[OutputType([pscustomobject])] [OutputType([pscustomobject])]
param param
( (
@ -3621,8 +3621,10 @@ function New-NetboxIPAMVLAN {
$URI = BuildNewURI -Segments $URIComponents.Segments $URI = BuildNewURI -Segments $URIComponents.Segments
if ($PSCmdlet.ShouldProcess($nae, 'Create new Vlan $($vid)')) {
InvokeNetboxRequest -URI $URI -Method POST -Body $URIComponents.Parameters -Raw:$Raw InvokeNetboxRequest -URI $URI -Method POST -Body $URIComponents.Parameters -Raw:$Raw
} }
}
#endregion #endregion
@ -3643,7 +3645,8 @@ function New-NetboxIPAMVLAN {
function New-NetboxVirtualMachine { function New-NetboxVirtualMachine {
[CmdletBinding()] [CmdletBinding(ConfirmImpact = 'low',
SupportsShouldProcess = $true)]
[OutputType([pscustomobject])] [OutputType([pscustomobject])]
param param
( (
@ -3691,8 +3694,10 @@ function New-NetboxVirtualMachine {
$URI = BuildNewURI -Segments $URIComponents.Segments $URI = BuildNewURI -Segments $URIComponents.Segments
if ($PSCmdlet.ShouldProcess($name, 'Create new Virtual Machine')) {
InvokeNetboxRequest -URI $URI -Method POST -Body $URIComponents.Parameters InvokeNetboxRequest -URI $URI -Method POST -Body $URIComponents.Parameters
} }
}
@ -4206,7 +4211,8 @@ function Set-NetboxDCIMDevice {
function Set-NetboxDCIMInterface { function Set-NetboxDCIMInterface {
[CmdletBinding()] [CmdletBinding(ConfirmImpact = 'Medium',
SupportsShouldProcess = $true)]
[OutputType([pscustomobject])] [OutputType([pscustomobject])]
param param
( (
@ -4281,9 +4287,11 @@ function Set-NetboxDCIMInterface {
$URI = BuildNewURI -Segments $Segments $URI = BuildNewURI -Segments $Segments
if ($Force -or $pscmdlet.ShouldProcess("Interface ID $($CurrentInterface.Id)", "Set")) {
InvokeNetboxRequest -URI $URI -Body $URIComponents.Parameters -Method PATCH InvokeNetboxRequest -URI $URI -Body $URIComponents.Parameters -Method PATCH
} }
} }
}
end { end {
@ -4775,6 +4783,7 @@ function Set-NetboxVirtualMachine {
# $PSBoundParameters.Status = ValidateVirtualizationChoice -ProvidedValue $Status -VirtualMachineStatus # $PSBoundParameters.Status = ValidateVirtualizationChoice -ProvidedValue $Status -VirtualMachineStatus
# } # }
process {
$Segments = [System.Collections.ArrayList]::new(@('virtualization', 'virtual-machines', $Id)) $Segments = [System.Collections.ArrayList]::new(@('virtualization', 'virtual-machines', $Id))
Write-Verbose "Obtaining VM from ID $Id" Write-Verbose "Obtaining VM from ID $Id"
@ -4791,6 +4800,7 @@ function Set-NetboxVirtualMachine {
InvokeNetboxRequest -URI $URI -Body $URIComponents.Parameters -Method PATCH InvokeNetboxRequest -URI $URI -Body $URIComponents.Parameters -Method PATCH
} }
} }
}
#endregion #endregion
@ -4889,47 +4899,6 @@ function SetupNetboxConfigVariable {
#endregion #endregion
#region File Tenancy.ps1
<#
.NOTES
===========================================================================
Created with: SAPIEN Technologies, Inc., PowerShell Studio 2018 v5.5.152
Created on: 5/29/2018 1:45 PM
Created by: Ben Claussen
Organization: NEOnet
Filename: Tenancy.ps1
===========================================================================
.DESCRIPTION
A description of the file.
#>
#region GET commands
#endregion GET commands
#region SET commands
#endregion SET commands
#region ADD/NEW commands
#endregion ADD/NEW commands
#region REMOVE commands
#endregion REMOVE commands
#endregion
#region File ThrowNetboxRESTError.ps1 #region File ThrowNetboxRESTError.ps1
<# <#