2022-12-06 13:34:52 -05:00
|
|
|
|
|
2021-03-25 16:52:08 -04:00
|
|
|
|
function New-NetboxCircuit {
|
|
|
|
|
|
[CmdletBinding(ConfirmImpact = 'Low',
|
2021-07-23 22:06:42 +02:00
|
|
|
|
SupportsShouldProcess = $true)]
|
2021-03-25 16:52:08 -04:00
|
|
|
|
[OutputType([pscustomobject])]
|
|
|
|
|
|
param
|
|
|
|
|
|
(
|
|
|
|
|
|
[Parameter(Mandatory = $true,
|
2021-07-23 22:06:42 +02:00
|
|
|
|
ValueFromPipelineByPropertyName = $true)]
|
2021-03-25 16:52:08 -04:00
|
|
|
|
[string]$CID,
|
2021-07-23 22:06:42 +02:00
|
|
|
|
|
2021-03-25 16:52:08 -04:00
|
|
|
|
[Parameter(Mandatory = $true)]
|
2023-07-28 16:17:23 -04:00
|
|
|
|
[uint64]$Provider,
|
2021-07-23 22:06:42 +02:00
|
|
|
|
|
2021-03-25 16:52:08 -04:00
|
|
|
|
[Parameter(Mandatory = $true)]
|
2023-07-28 16:17:23 -04:00
|
|
|
|
[uint64]$Type,
|
2021-07-23 22:06:42 +02:00
|
|
|
|
|
2021-03-25 16:52:08 -04:00
|
|
|
|
#[ValidateSet('Active', 'Planned', 'Provisioning', 'Offline', 'Deprovisioning', 'Decommissioned ')]
|
|
|
|
|
|
[uint16]$Status = 'Active',
|
2021-07-23 22:06:42 +02:00
|
|
|
|
|
2021-03-25 16:52:08 -04:00
|
|
|
|
[string]$Description,
|
2021-07-23 22:06:42 +02:00
|
|
|
|
|
2023-07-28 16:17:23 -04:00
|
|
|
|
[uint64]$Tenant,
|
2021-07-23 22:06:42 +02:00
|
|
|
|
|
2021-03-25 16:52:08 -04:00
|
|
|
|
[string]$Termination_A,
|
2021-07-23 22:06:42 +02:00
|
|
|
|
|
2021-03-25 16:52:08 -04:00
|
|
|
|
[datetime]$Install_Date,
|
2021-07-23 22:06:42 +02:00
|
|
|
|
|
2021-03-25 16:52:08 -04:00
|
|
|
|
[string]$Termination_Z,
|
2021-07-23 22:06:42 +02:00
|
|
|
|
|
2021-03-25 16:52:08 -04:00
|
|
|
|
[ValidateRange(0, 2147483647)]
|
2023-07-28 16:17:23 -04:00
|
|
|
|
[uint64]$Commit_Rate,
|
2021-07-23 22:06:42 +02:00
|
|
|
|
|
2021-03-25 16:52:08 -04:00
|
|
|
|
[string]$Comments,
|
2021-07-23 22:06:42 +02:00
|
|
|
|
|
2021-03-25 16:52:08 -04:00
|
|
|
|
[hashtable]$Custom_Fields,
|
2021-07-23 22:06:42 +02:00
|
|
|
|
|
2021-03-25 16:52:08 -04:00
|
|
|
|
[switch]$Force,
|
2021-07-23 22:06:42 +02:00
|
|
|
|
|
2021-03-25 16:52:08 -04:00
|
|
|
|
[switch]$Raw
|
|
|
|
|
|
)
|
2021-07-23 22:06:42 +02:00
|
|
|
|
|
|
|
|
|
|
process {
|
|
|
|
|
|
$Segments = [System.Collections.ArrayList]::new(@('circuits', 'circuits'))
|
|
|
|
|
|
$Method = 'POST'
|
|
|
|
|
|
|
|
|
|
|
|
$URIComponents = BuildURIComponents -URISegments $Segments -ParametersDictionary $PSBoundParameters
|
|
|
|
|
|
|
|
|
|
|
|
$URI = BuildNewURI -Segments $URIComponents.Segments
|
|
|
|
|
|
|
|
|
|
|
|
if ($Force -or $PSCmdlet.ShouldProcess($CID, 'Create new circuit')) {
|
|
|
|
|
|
InvokeNetboxRequest -URI $URI -Method $Method -Body $URIComponents.Parameters -Raw:$Raw
|
|
|
|
|
|
}
|
2021-03-25 16:52:08 -04:00
|
|
|
|
}
|
|
|
|
|
|
}
|