mirror of
https://github.com/benclaussen/NetboxPS.git
synced 2025-12-15 02:35:46 +00:00
Update version to 1.8.4
This commit is contained in:
parent
2233de974d
commit
88647882cc
5 changed files with 90 additions and 27 deletions
|
|
@ -72,9 +72,9 @@ function New-NetboxIPAMAddressRange {
|
||||||
[uint64]$VRF,
|
[uint64]$VRF,
|
||||||
|
|
||||||
[object]$Role,
|
[object]$Role,
|
||||||
|
|
||||||
[hashtable]$Custom_Fields,
|
[hashtable]$Custom_Fields,
|
||||||
|
|
||||||
[string]$Description,
|
[string]$Description,
|
||||||
|
|
||||||
[string]$Comments,
|
[string]$Comments,
|
||||||
|
|
|
||||||
|
|
@ -7,50 +7,50 @@ function Set-NetboxIPAMAddressRange {
|
||||||
[Parameter(Mandatory = $true,
|
[Parameter(Mandatory = $true,
|
||||||
ValueFromPipelineByPropertyName = $true)]
|
ValueFromPipelineByPropertyName = $true)]
|
||||||
[uint64[]]$Id,
|
[uint64[]]$Id,
|
||||||
|
|
||||||
[string]$Start_Address,
|
[string]$Start_Address,
|
||||||
|
|
||||||
[string]$End_Address,
|
[string]$End_Address,
|
||||||
|
|
||||||
[object]$Status,
|
[object]$Status,
|
||||||
|
|
||||||
[uint64]$Tenant,
|
[uint64]$Tenant,
|
||||||
|
|
||||||
[uint64]$VRF,
|
[uint64]$VRF,
|
||||||
|
|
||||||
[object]$Role,
|
[object]$Role,
|
||||||
|
|
||||||
[hashtable]$Custom_Fields,
|
[hashtable]$Custom_Fields,
|
||||||
|
|
||||||
[string]$Description,
|
[string]$Description,
|
||||||
|
|
||||||
[string]$Comments,
|
[string]$Comments,
|
||||||
|
|
||||||
[object[]]$Tags,
|
[object[]]$Tags,
|
||||||
|
|
||||||
[switch]$Mark_Utilized,
|
[switch]$Mark_Utilized,
|
||||||
|
|
||||||
[switch]$Force,
|
[switch]$Force,
|
||||||
|
|
||||||
[switch]$Raw
|
[switch]$Raw
|
||||||
)
|
)
|
||||||
|
|
||||||
begin {
|
begin {
|
||||||
$Method = 'PATCH'
|
$Method = 'PATCH'
|
||||||
}
|
}
|
||||||
|
|
||||||
process {
|
process {
|
||||||
foreach ($RangeID in $Id) {
|
foreach ($RangeID in $Id) {
|
||||||
$Segments = [System.Collections.ArrayList]::new(@('ipam', 'ip-ranges', $RangeID))
|
$Segments = [System.Collections.ArrayList]::new(@('ipam', 'ip-ranges', $RangeID))
|
||||||
|
|
||||||
Write-Verbose "Obtaining IP range from ID $RangeID"
|
Write-Verbose "Obtaining IP range from ID $RangeID"
|
||||||
$CurrentRange = Get-NetboxIPAMAddressRange -Id $RangeID -ErrorAction Stop
|
$CurrentRange = Get-NetboxIPAMAddressRange -Id $RangeID -ErrorAction Stop
|
||||||
|
|
||||||
if ($Force -or $PSCmdlet.ShouldProcess("$($CurrentRange.Start_Address) - $($CurrentRange.End_Address)", 'Set')) {
|
if ($Force -or $PSCmdlet.ShouldProcess("$($CurrentRange.Start_Address) - $($CurrentRange.End_Address)", 'Set')) {
|
||||||
$URIComponents = BuildURIComponents -URISegments $Segments.Clone() -ParametersDictionary $PSBoundParameters -SkipParameterByName 'Id', 'Force'
|
$URIComponents = BuildURIComponents -URISegments $Segments.Clone() -ParametersDictionary $PSBoundParameters -SkipParameterByName 'Id', 'Force'
|
||||||
|
|
||||||
$URI = BuildNewURI -Segments $URIComponents.Segments
|
$URI = BuildNewURI -Segments $URIComponents.Segments
|
||||||
|
|
||||||
InvokeNetboxRequest -URI $URI -Body $URIComponents.Parameters -Method $Method
|
InvokeNetboxRequest -URI $URI -Body $URIComponents.Parameters -Method $Method
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
RootModule = 'NetboxPS.psm1'
|
RootModule = 'NetboxPS.psm1'
|
||||||
|
|
||||||
# Version number of this module.
|
# Version number of this module.
|
||||||
ModuleVersion = '1.8.3'
|
ModuleVersion = '1.8.4'
|
||||||
|
|
||||||
# Supported PSEditions
|
# Supported PSEditions
|
||||||
# CompatiblePSEditions = @()
|
# CompatiblePSEditions = @()
|
||||||
|
|
@ -106,7 +106,8 @@ FunctionsToExport = 'Add-NetboxDCIMFrontPort', 'Add-NetboxDCIMInterface',
|
||||||
'Set-NetboxDCIMInterface', 'Set-NetboxDCIMInterfaceConnection',
|
'Set-NetboxDCIMInterface', 'Set-NetboxDCIMInterfaceConnection',
|
||||||
'Set-NetboxDCIMRearPort', 'Set-NetboxHostName', 'Set-NetboxHostPort',
|
'Set-NetboxDCIMRearPort', 'Set-NetboxHostName', 'Set-NetboxHostPort',
|
||||||
'Set-NetboxHostScheme', 'Set-NetboxInvokeParams',
|
'Set-NetboxHostScheme', 'Set-NetboxInvokeParams',
|
||||||
'Set-NetboxIPAMAddress', 'Set-NetboxIPAMPrefix', 'Set-NetboxTimeout',
|
'Set-NetboxIPAMAddress', 'Set-NetboxIPAMAddressRange',
|
||||||
|
'Set-NetboxIPAMPrefix', 'Set-NetboxTimeout',
|
||||||
'Set-NetboxUnstrustedSSL', 'Set-NetboxVirtualMachine',
|
'Set-NetboxUnstrustedSSL', 'Set-NetboxVirtualMachine',
|
||||||
'Set-NetboxVirtualMachineInterface', 'Test-NetboxAPIConnected'
|
'Set-NetboxVirtualMachineInterface', 'Test-NetboxAPIConnected'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
RootModule = 'NetboxPS.psm1'
|
RootModule = 'NetboxPS.psm1'
|
||||||
|
|
||||||
# Version number of this module.
|
# Version number of this module.
|
||||||
ModuleVersion = '1.8.3'
|
ModuleVersion = '1.8.4'
|
||||||
|
|
||||||
# Supported PSEditions
|
# Supported PSEditions
|
||||||
# CompatiblePSEditions = @()
|
# CompatiblePSEditions = @()
|
||||||
|
|
@ -106,7 +106,8 @@ FunctionsToExport = 'Add-NetboxDCIMFrontPort', 'Add-NetboxDCIMInterface',
|
||||||
'Set-NetboxDCIMInterface', 'Set-NetboxDCIMInterfaceConnection',
|
'Set-NetboxDCIMInterface', 'Set-NetboxDCIMInterfaceConnection',
|
||||||
'Set-NetboxDCIMRearPort', 'Set-NetboxHostName', 'Set-NetboxHostPort',
|
'Set-NetboxDCIMRearPort', 'Set-NetboxHostName', 'Set-NetboxHostPort',
|
||||||
'Set-NetboxHostScheme', 'Set-NetboxInvokeParams',
|
'Set-NetboxHostScheme', 'Set-NetboxInvokeParams',
|
||||||
'Set-NetboxIPAMAddress', 'Set-NetboxIPAMPrefix', 'Set-NetboxTimeout',
|
'Set-NetboxIPAMAddress', 'Set-NetboxIPAMAddressRange',
|
||||||
|
'Set-NetboxIPAMPrefix', 'Set-NetboxTimeout',
|
||||||
'Set-NetboxUnstrustedSSL', 'Set-NetboxVirtualMachine',
|
'Set-NetboxUnstrustedSSL', 'Set-NetboxVirtualMachine',
|
||||||
'Set-NetboxVirtualMachineInterface', 'Test-NetboxAPIConnected'
|
'Set-NetboxVirtualMachineInterface', 'Test-NetboxAPIConnected'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4263,8 +4263,6 @@ function New-NetboxIPAMAddressRange {
|
||||||
|
|
||||||
[hashtable]$Custom_Fields,
|
[hashtable]$Custom_Fields,
|
||||||
|
|
||||||
[uint64]$Interface,
|
|
||||||
|
|
||||||
[string]$Description,
|
[string]$Description,
|
||||||
|
|
||||||
[string]$Comments,
|
[string]$Comments,
|
||||||
|
|
@ -5790,6 +5788,69 @@ function Set-NetboxIPAMAddress {
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region File Set-NetboxIPAMAddressRange.ps1
|
||||||
|
|
||||||
|
|
||||||
|
function Set-NetboxIPAMAddressRange {
|
||||||
|
[CmdletBinding(ConfirmImpact = 'Medium',
|
||||||
|
SupportsShouldProcess = $true)]
|
||||||
|
param
|
||||||
|
(
|
||||||
|
[Parameter(Mandatory = $true,
|
||||||
|
ValueFromPipelineByPropertyName = $true)]
|
||||||
|
[uint64[]]$Id,
|
||||||
|
|
||||||
|
[string]$Start_Address,
|
||||||
|
|
||||||
|
[string]$End_Address,
|
||||||
|
|
||||||
|
[object]$Status,
|
||||||
|
|
||||||
|
[uint64]$Tenant,
|
||||||
|
|
||||||
|
[uint64]$VRF,
|
||||||
|
|
||||||
|
[object]$Role,
|
||||||
|
|
||||||
|
[hashtable]$Custom_Fields,
|
||||||
|
|
||||||
|
[string]$Description,
|
||||||
|
|
||||||
|
[string]$Comments,
|
||||||
|
|
||||||
|
[object[]]$Tags,
|
||||||
|
|
||||||
|
[switch]$Mark_Utilized,
|
||||||
|
|
||||||
|
[switch]$Force,
|
||||||
|
|
||||||
|
[switch]$Raw
|
||||||
|
)
|
||||||
|
|
||||||
|
begin {
|
||||||
|
$Method = 'PATCH'
|
||||||
|
}
|
||||||
|
|
||||||
|
process {
|
||||||
|
foreach ($RangeID in $Id) {
|
||||||
|
$Segments = [System.Collections.ArrayList]::new(@('ipam', 'ip-ranges', $RangeID))
|
||||||
|
|
||||||
|
Write-Verbose "Obtaining IP range from ID $RangeID"
|
||||||
|
$CurrentRange = Get-NetboxIPAMAddressRange -Id $RangeID -ErrorAction Stop
|
||||||
|
|
||||||
|
if ($Force -or $PSCmdlet.ShouldProcess("$($CurrentRange.Start_Address) - $($CurrentRange.End_Address)", 'Set')) {
|
||||||
|
$URIComponents = BuildURIComponents -URISegments $Segments.Clone() -ParametersDictionary $PSBoundParameters -SkipParameterByName 'Id', 'Force'
|
||||||
|
|
||||||
|
$URI = BuildNewURI -Segments $URIComponents.Segments
|
||||||
|
|
||||||
|
InvokeNetboxRequest -URI $URI -Body $URIComponents.Parameters -Method $Method
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
#region File Set-NetboxIPAMPrefix.ps1
|
#region File Set-NetboxIPAMPrefix.ps1
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue