mirror of
https://github.com/benclaussen/NetboxPS.git
synced 2025-12-12 17:32:29 +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,
|
||||
|
||||
[object]$Role,
|
||||
|
||||
|
||||
[hashtable]$Custom_Fields,
|
||||
|
||||
|
||||
[string]$Description,
|
||||
|
||||
[string]$Comments,
|
||||
|
|
|
|||
|
|
@ -7,50 +7,50 @@ function Set-NetboxIPAMAddressRange {
|
|||
[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
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
RootModule = 'NetboxPS.psm1'
|
||||
|
||||
# Version number of this module.
|
||||
ModuleVersion = '1.8.3'
|
||||
ModuleVersion = '1.8.4'
|
||||
|
||||
# Supported PSEditions
|
||||
# CompatiblePSEditions = @()
|
||||
|
|
@ -106,7 +106,8 @@ FunctionsToExport = 'Add-NetboxDCIMFrontPort', 'Add-NetboxDCIMInterface',
|
|||
'Set-NetboxDCIMInterface', 'Set-NetboxDCIMInterfaceConnection',
|
||||
'Set-NetboxDCIMRearPort', 'Set-NetboxHostName', 'Set-NetboxHostPort',
|
||||
'Set-NetboxHostScheme', 'Set-NetboxInvokeParams',
|
||||
'Set-NetboxIPAMAddress', 'Set-NetboxIPAMPrefix', 'Set-NetboxTimeout',
|
||||
'Set-NetboxIPAMAddress', 'Set-NetboxIPAMAddressRange',
|
||||
'Set-NetboxIPAMPrefix', 'Set-NetboxTimeout',
|
||||
'Set-NetboxUnstrustedSSL', 'Set-NetboxVirtualMachine',
|
||||
'Set-NetboxVirtualMachineInterface', 'Test-NetboxAPIConnected'
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
RootModule = 'NetboxPS.psm1'
|
||||
|
||||
# Version number of this module.
|
||||
ModuleVersion = '1.8.3'
|
||||
ModuleVersion = '1.8.4'
|
||||
|
||||
# Supported PSEditions
|
||||
# CompatiblePSEditions = @()
|
||||
|
|
@ -106,7 +106,8 @@ FunctionsToExport = 'Add-NetboxDCIMFrontPort', 'Add-NetboxDCIMInterface',
|
|||
'Set-NetboxDCIMInterface', 'Set-NetboxDCIMInterfaceConnection',
|
||||
'Set-NetboxDCIMRearPort', 'Set-NetboxHostName', 'Set-NetboxHostPort',
|
||||
'Set-NetboxHostScheme', 'Set-NetboxInvokeParams',
|
||||
'Set-NetboxIPAMAddress', 'Set-NetboxIPAMPrefix', 'Set-NetboxTimeout',
|
||||
'Set-NetboxIPAMAddress', 'Set-NetboxIPAMAddressRange',
|
||||
'Set-NetboxIPAMPrefix', 'Set-NetboxTimeout',
|
||||
'Set-NetboxUnstrustedSSL', 'Set-NetboxVirtualMachine',
|
||||
'Set-NetboxVirtualMachineInterface', 'Test-NetboxAPIConnected'
|
||||
|
||||
|
|
|
|||
|
|
@ -4263,8 +4263,6 @@ function New-NetboxIPAMAddressRange {
|
|||
|
||||
[hashtable]$Custom_Fields,
|
||||
|
||||
[uint64]$Interface,
|
||||
|
||||
[string]$Description,
|
||||
|
||||
[string]$Comments,
|
||||
|
|
@ -5790,6 +5788,69 @@ function Set-NetboxIPAMAddress {
|
|||
|
||||
#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
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue