mirror of
https://github.com/benclaussen/NetboxPS.git
synced 2025-12-16 19:25:47 +00:00
rename ContentTypes to ObjectTypes
This commit is contained in:
parent
bc8d140ec5
commit
db1bc1e91d
6 changed files with 131 additions and 131 deletions
|
|
@ -148,7 +148,7 @@
|
||||||
$script:NetboxConfig.Connected = $true
|
$script:NetboxConfig.Connected = $true
|
||||||
Write-Verbose "Successfully connected!"
|
Write-Verbose "Successfully connected!"
|
||||||
|
|
||||||
$script:NetboxConfig.ContentTypes = Get-NetboxContentType -Limit 500
|
$script:NetboxConfig.ObjectTypes = Get-NetboxObjectType -Limit 500
|
||||||
|
|
||||||
Write-Verbose "Connection process completed"
|
Write-Verbose "Connection process completed"
|
||||||
}
|
}
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
function Get-NetboxContentType {
|
function Get-NetboxObjectType {
|
||||||
<#
|
<#
|
||||||
.SYNOPSIS
|
.SYNOPSIS
|
||||||
Get a content type definition from Netbox
|
Get a object type definition from Netbox
|
||||||
|
|
||||||
.DESCRIPTION
|
.DESCRIPTION
|
||||||
A detailed description of the Get-NetboxContentType function.
|
A detailed description of the Get-NetboxObjectType function.
|
||||||
|
|
||||||
.PARAMETER Model
|
.PARAMETER Model
|
||||||
A description of the Model parameter.
|
A description of the Model parameter.
|
||||||
|
|
@ -28,7 +28,7 @@
|
||||||
Return the unparsed data from the HTTP request
|
Return the unparsed data from the HTTP request
|
||||||
|
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
PS C:\> Get-NetboxContentType
|
PS C:\> Get-NetboxObjectType
|
||||||
|
|
||||||
.NOTES
|
.NOTES
|
||||||
Additional information about the function.
|
Additional information about the function.
|
||||||
|
|
@ -61,8 +61,8 @@
|
||||||
|
|
||||||
switch ($PSCmdlet.ParameterSetName) {
|
switch ($PSCmdlet.ParameterSetName) {
|
||||||
'ById' {
|
'ById' {
|
||||||
foreach ($ContentType_ID in $Id) {
|
foreach ($ObjectType_ID in $Id) {
|
||||||
$Segments = [System.Collections.ArrayList]::new(@('extras', 'content-types', $ContentType_ID))
|
$Segments = [System.Collections.ArrayList]::new(@('extras', 'object-types', $ObjectType_ID))
|
||||||
|
|
||||||
$URIComponents = BuildURIComponents -URISegments $Segments -ParametersDictionary $PSBoundParameters -SkipParameterByName 'Id'
|
$URIComponents = BuildURIComponents -URISegments $Segments -ParametersDictionary $PSBoundParameters -SkipParameterByName 'Id'
|
||||||
|
|
||||||
|
|
@ -75,7 +75,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
default {
|
default {
|
||||||
$Segments = [System.Collections.ArrayList]::new(@('extras', 'content-types'))
|
$Segments = [System.Collections.ArrayList]::new(@('extras', 'object-types'))
|
||||||
|
|
||||||
$URIComponents = BuildURIComponents -URISegments $Segments -ParametersDictionary $PSBoundParameters
|
$URIComponents = BuildURIComponents -URISegments $Segments -ParametersDictionary $PSBoundParameters
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@
|
||||||
'Choices' = @{
|
'Choices' = @{
|
||||||
}
|
}
|
||||||
'APIDefinition' = $null
|
'APIDefinition' = $null
|
||||||
'ContentTypes' = $null
|
'ObjectTypes' = $null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -79,19 +79,19 @@ FunctionsToExport = 'Add-NetboxDCIMFrontPort', 'Add-NetboxDCIMInterface',
|
||||||
'Get-NetboxCircuitProvider', 'Get-NetboxCircuitTermination',
|
'Get-NetboxCircuitProvider', 'Get-NetboxCircuitTermination',
|
||||||
'Get-NetboxCircuitType', 'GetNetboxConfigVariable',
|
'Get-NetboxCircuitType', 'GetNetboxConfigVariable',
|
||||||
'Get-NetboxContact', 'Get-NetboxContactAssignment',
|
'Get-NetboxContact', 'Get-NetboxContactAssignment',
|
||||||
'Get-NetboxContactRole', 'Get-NetboxContentType',
|
'Get-NetboxContactRole', 'Get-NetboxCredential',
|
||||||
'Get-NetboxCredential', 'Get-NetboxDCIMCable',
|
'Get-NetboxDCIMCable', 'Get-NetboxDCIMCableTermination',
|
||||||
'Get-NetboxDCIMCableTermination', 'Get-NetboxDCIMDevice',
|
'Get-NetboxDCIMDevice', 'Get-NetboxDCIMDeviceRole',
|
||||||
'Get-NetboxDCIMDeviceRole', 'Get-NetboxDCIMDeviceType',
|
'Get-NetboxDCIMDeviceType', 'Get-NetboxDCIMFrontPort',
|
||||||
'Get-NetboxDCIMFrontPort', 'Get-NetboxDCIMInterface',
|
'Get-NetboxDCIMInterface', 'Get-NetboxDCIMInterfaceConnection',
|
||||||
'Get-NetboxDCIMInterfaceConnection', 'Get-NetboxDCIMPlatform',
|
'Get-NetboxDCIMPlatform', 'Get-NetboxDCIMRearPort',
|
||||||
'Get-NetboxDCIMRearPort', 'Get-NetboxDCIMSite', 'Get-NetboxHostname',
|
'Get-NetboxDCIMSite', 'Get-NetboxHostname', 'Get-NetboxHostPort',
|
||||||
'Get-NetboxHostPort', 'Get-NetboxHostScheme',
|
'Get-NetboxHostScheme', 'Get-NetboxInvokeParams',
|
||||||
'Get-NetboxInvokeParams', 'Get-NetboxIPAMAddress',
|
'Get-NetboxIPAMAddress', 'Get-NetboxIPAMAddressRange',
|
||||||
'Get-NetboxIPAMAddressRange', 'Get-NetboxIPAMAggregate',
|
'Get-NetboxIPAMAggregate', 'Get-NetboxIPAMAvailableIP',
|
||||||
'Get-NetboxIPAMAvailableIP', 'Get-NetboxIPAMPrefix',
|
'Get-NetboxIPAMPrefix', 'Get-NetboxIPAMRole', 'Get-NetboxIPAMVLAN',
|
||||||
'Get-NetboxIPAMRole', 'Get-NetboxIPAMVLAN', 'Get-NetboxTag',
|
'Get-NetboxObjectType', 'Get-NetboxTag', 'Get-NetboxTenant',
|
||||||
'Get-NetboxTenant', 'Get-NetboxTimeout', 'Get-NetboxVersion',
|
'Get-NetboxTimeout', 'Get-NetboxVersion',
|
||||||
'Get-NetboxVirtualizationCluster',
|
'Get-NetboxVirtualizationCluster',
|
||||||
'Get-NetboxVirtualizationClusterGroup', 'Get-NetboxVirtualMachine',
|
'Get-NetboxVirtualizationClusterGroup', 'Get-NetboxVirtualMachine',
|
||||||
'Get-NetboxVirtualMachineInterface', 'InvokeNetboxRequest',
|
'Get-NetboxVirtualMachineInterface', 'InvokeNetboxRequest',
|
||||||
|
|
|
||||||
|
|
@ -79,19 +79,19 @@ FunctionsToExport = 'Add-NetboxDCIMFrontPort', 'Add-NetboxDCIMInterface',
|
||||||
'Get-NetboxCircuitProvider', 'Get-NetboxCircuitTermination',
|
'Get-NetboxCircuitProvider', 'Get-NetboxCircuitTermination',
|
||||||
'Get-NetboxCircuitType', 'GetNetboxConfigVariable',
|
'Get-NetboxCircuitType', 'GetNetboxConfigVariable',
|
||||||
'Get-NetboxContact', 'Get-NetboxContactAssignment',
|
'Get-NetboxContact', 'Get-NetboxContactAssignment',
|
||||||
'Get-NetboxContactRole', 'Get-NetboxContentType',
|
'Get-NetboxContactRole', 'Get-NetboxCredential',
|
||||||
'Get-NetboxCredential', 'Get-NetboxDCIMCable',
|
'Get-NetboxDCIMCable', 'Get-NetboxDCIMCableTermination',
|
||||||
'Get-NetboxDCIMCableTermination', 'Get-NetboxDCIMDevice',
|
'Get-NetboxDCIMDevice', 'Get-NetboxDCIMDeviceRole',
|
||||||
'Get-NetboxDCIMDeviceRole', 'Get-NetboxDCIMDeviceType',
|
'Get-NetboxDCIMDeviceType', 'Get-NetboxDCIMFrontPort',
|
||||||
'Get-NetboxDCIMFrontPort', 'Get-NetboxDCIMInterface',
|
'Get-NetboxDCIMInterface', 'Get-NetboxDCIMInterfaceConnection',
|
||||||
'Get-NetboxDCIMInterfaceConnection', 'Get-NetboxDCIMPlatform',
|
'Get-NetboxDCIMPlatform', 'Get-NetboxDCIMRearPort',
|
||||||
'Get-NetboxDCIMRearPort', 'Get-NetboxDCIMSite', 'Get-NetboxHostname',
|
'Get-NetboxDCIMSite', 'Get-NetboxHostname', 'Get-NetboxHostPort',
|
||||||
'Get-NetboxHostPort', 'Get-NetboxHostScheme',
|
'Get-NetboxHostScheme', 'Get-NetboxInvokeParams',
|
||||||
'Get-NetboxInvokeParams', 'Get-NetboxIPAMAddress',
|
'Get-NetboxIPAMAddress', 'Get-NetboxIPAMAddressRange',
|
||||||
'Get-NetboxIPAMAddressRange', 'Get-NetboxIPAMAggregate',
|
'Get-NetboxIPAMAggregate', 'Get-NetboxIPAMAvailableIP',
|
||||||
'Get-NetboxIPAMAvailableIP', 'Get-NetboxIPAMPrefix',
|
'Get-NetboxIPAMPrefix', 'Get-NetboxIPAMRole', 'Get-NetboxIPAMVLAN',
|
||||||
'Get-NetboxIPAMRole', 'Get-NetboxIPAMVLAN', 'Get-NetboxTag',
|
'Get-NetboxObjectType', 'Get-NetboxTag', 'Get-NetboxTenant',
|
||||||
'Get-NetboxTenant', 'Get-NetboxTimeout', 'Get-NetboxVersion',
|
'Get-NetboxTimeout', 'Get-NetboxVersion',
|
||||||
'Get-NetboxVirtualizationCluster',
|
'Get-NetboxVirtualizationCluster',
|
||||||
'Get-NetboxVirtualizationClusterGroup', 'Get-NetboxVirtualMachine',
|
'Get-NetboxVirtualizationClusterGroup', 'Get-NetboxVirtualMachine',
|
||||||
'Get-NetboxVirtualMachineInterface', 'InvokeNetboxRequest',
|
'Get-NetboxVirtualMachineInterface', 'InvokeNetboxRequest',
|
||||||
|
|
|
||||||
|
|
@ -615,7 +615,7 @@ function Connect-NetboxAPI {
|
||||||
$script:NetboxConfig.Connected = $true
|
$script:NetboxConfig.Connected = $true
|
||||||
Write-Verbose "Successfully connected!"
|
Write-Verbose "Successfully connected!"
|
||||||
|
|
||||||
$script:NetboxConfig.ContentTypes = Get-NetboxContentType -Limit 500
|
$script:NetboxConfig.ObjectTypes = Get-NetboxObjectType -Limit 500
|
||||||
|
|
||||||
Write-Verbose "Connection process completed"
|
Write-Verbose "Connection process completed"
|
||||||
}
|
}
|
||||||
|
|
@ -1411,100 +1411,6 @@ function Get-NetboxContactRole {
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region File Get-NetboxContentType.ps1
|
|
||||||
|
|
||||||
function Get-NetboxContentType {
|
|
||||||
<#
|
|
||||||
.SYNOPSIS
|
|
||||||
Get a content type definition from Netbox
|
|
||||||
|
|
||||||
.DESCRIPTION
|
|
||||||
A detailed description of the Get-NetboxContentType function.
|
|
||||||
|
|
||||||
.PARAMETER Model
|
|
||||||
A description of the Model parameter.
|
|
||||||
|
|
||||||
.PARAMETER Id
|
|
||||||
The database ID of the contact role
|
|
||||||
|
|
||||||
.PARAMETER App_Label
|
|
||||||
A description of the App_Label parameter.
|
|
||||||
|
|
||||||
.PARAMETER Query
|
|
||||||
A standard search query that will match one or more contact roles.
|
|
||||||
|
|
||||||
.PARAMETER Limit
|
|
||||||
Limit the number of results to this number
|
|
||||||
|
|
||||||
.PARAMETER Offset
|
|
||||||
Start the search at this index in results
|
|
||||||
|
|
||||||
.PARAMETER Raw
|
|
||||||
Return the unparsed data from the HTTP request
|
|
||||||
|
|
||||||
.EXAMPLE
|
|
||||||
PS C:\> Get-NetboxContentType
|
|
||||||
|
|
||||||
.NOTES
|
|
||||||
Additional information about the function.
|
|
||||||
#>
|
|
||||||
|
|
||||||
[CmdletBinding(DefaultParameterSetName = 'Query')]
|
|
||||||
param
|
|
||||||
(
|
|
||||||
[Parameter(ParameterSetName = 'Query',
|
|
||||||
Position = 0)]
|
|
||||||
[string]$Model,
|
|
||||||
|
|
||||||
[Parameter(ParameterSetName = 'ByID')]
|
|
||||||
[uint64[]]$Id,
|
|
||||||
|
|
||||||
[Parameter(ParameterSetName = 'Query')]
|
|
||||||
[string]$App_Label,
|
|
||||||
|
|
||||||
[Parameter(ParameterSetName = 'Query')]
|
|
||||||
[string]$Query,
|
|
||||||
|
|
||||||
[Parameter(ParameterSetName = 'Query')]
|
|
||||||
[uint16]$Limit,
|
|
||||||
|
|
||||||
[Parameter(ParameterSetName = 'Query')]
|
|
||||||
[uint16]$Offset,
|
|
||||||
|
|
||||||
[switch]$Raw
|
|
||||||
)
|
|
||||||
|
|
||||||
switch ($PSCmdlet.ParameterSetName) {
|
|
||||||
'ById' {
|
|
||||||
foreach ($ContentType_ID in $Id) {
|
|
||||||
$Segments = [System.Collections.ArrayList]::new(@('extras', 'content-types', $ContentType_ID))
|
|
||||||
|
|
||||||
$URIComponents = BuildURIComponents -URISegments $Segments -ParametersDictionary $PSBoundParameters -SkipParameterByName 'Id'
|
|
||||||
|
|
||||||
$uri = BuildNewURI -Segments $URIComponents.Segments -Parameters $URIComponents.Parameters
|
|
||||||
|
|
||||||
InvokeNetboxRequest -URI $uri -Raw:$Raw
|
|
||||||
}
|
|
||||||
|
|
||||||
break
|
|
||||||
}
|
|
||||||
|
|
||||||
default {
|
|
||||||
$Segments = [System.Collections.ArrayList]::new(@('extras', 'content-types'))
|
|
||||||
|
|
||||||
$URIComponents = BuildURIComponents -URISegments $Segments -ParametersDictionary $PSBoundParameters
|
|
||||||
|
|
||||||
$uri = BuildNewURI -Segments $URIComponents.Segments -Parameters $URIComponents.Parameters
|
|
||||||
|
|
||||||
InvokeNetboxRequest -URI $uri -Raw:$Raw
|
|
||||||
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region File Get-NetboxCredential.ps1
|
#region File Get-NetboxCredential.ps1
|
||||||
|
|
||||||
function Get-NetboxCredential {
|
function Get-NetboxCredential {
|
||||||
|
|
@ -2908,6 +2814,100 @@ function Get-NetboxIPAMVLAN {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region File Get-NetboxObjectType.ps1
|
||||||
|
|
||||||
|
function Get-NetboxObjectType {
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Get a object type definition from Netbox
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
A detailed description of the Get-NetboxObjectType function.
|
||||||
|
|
||||||
|
.PARAMETER Model
|
||||||
|
A description of the Model parameter.
|
||||||
|
|
||||||
|
.PARAMETER Id
|
||||||
|
The database ID of the contact role
|
||||||
|
|
||||||
|
.PARAMETER App_Label
|
||||||
|
A description of the App_Label parameter.
|
||||||
|
|
||||||
|
.PARAMETER Query
|
||||||
|
A standard search query that will match one or more contact roles.
|
||||||
|
|
||||||
|
.PARAMETER Limit
|
||||||
|
Limit the number of results to this number
|
||||||
|
|
||||||
|
.PARAMETER Offset
|
||||||
|
Start the search at this index in results
|
||||||
|
|
||||||
|
.PARAMETER Raw
|
||||||
|
Return the unparsed data from the HTTP request
|
||||||
|
|
||||||
|
.EXAMPLE
|
||||||
|
PS C:\> Get-NetboxObjectType
|
||||||
|
|
||||||
|
.NOTES
|
||||||
|
Additional information about the function.
|
||||||
|
#>
|
||||||
|
|
||||||
|
[CmdletBinding(DefaultParameterSetName = 'Query')]
|
||||||
|
param
|
||||||
|
(
|
||||||
|
[Parameter(ParameterSetName = 'Query',
|
||||||
|
Position = 0)]
|
||||||
|
[string]$Model,
|
||||||
|
|
||||||
|
[Parameter(ParameterSetName = 'ByID')]
|
||||||
|
[uint64[]]$Id,
|
||||||
|
|
||||||
|
[Parameter(ParameterSetName = 'Query')]
|
||||||
|
[string]$App_Label,
|
||||||
|
|
||||||
|
[Parameter(ParameterSetName = 'Query')]
|
||||||
|
[string]$Query,
|
||||||
|
|
||||||
|
[Parameter(ParameterSetName = 'Query')]
|
||||||
|
[uint16]$Limit,
|
||||||
|
|
||||||
|
[Parameter(ParameterSetName = 'Query')]
|
||||||
|
[uint16]$Offset,
|
||||||
|
|
||||||
|
[switch]$Raw
|
||||||
|
)
|
||||||
|
|
||||||
|
switch ($PSCmdlet.ParameterSetName) {
|
||||||
|
'ById' {
|
||||||
|
foreach ($ObjectType_ID in $Id) {
|
||||||
|
$Segments = [System.Collections.ArrayList]::new(@('extras', 'object-types', $ObjectType_ID))
|
||||||
|
|
||||||
|
$URIComponents = BuildURIComponents -URISegments $Segments -ParametersDictionary $PSBoundParameters -SkipParameterByName 'Id'
|
||||||
|
|
||||||
|
$uri = BuildNewURI -Segments $URIComponents.Segments -Parameters $URIComponents.Parameters
|
||||||
|
|
||||||
|
InvokeNetboxRequest -URI $uri -Raw:$Raw
|
||||||
|
}
|
||||||
|
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
|
default {
|
||||||
|
$Segments = [System.Collections.ArrayList]::new(@('extras', 'object-types'))
|
||||||
|
|
||||||
|
$URIComponents = BuildURIComponents -URISegments $Segments -ParametersDictionary $PSBoundParameters
|
||||||
|
|
||||||
|
$uri = BuildNewURI -Segments $URIComponents.Segments -Parameters $URIComponents.Parameters
|
||||||
|
|
||||||
|
InvokeNetboxRequest -URI $uri -Raw:$Raw
|
||||||
|
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region File Get-NetboxTag.ps1
|
#region File Get-NetboxTag.ps1
|
||||||
|
|
@ -6272,7 +6272,7 @@ function SetupNetboxConfigVariable {
|
||||||
'Choices' = @{
|
'Choices' = @{
|
||||||
}
|
}
|
||||||
'APIDefinition' = $null
|
'APIDefinition' = $null
|
||||||
'ContentTypes' = $null
|
'ObjectTypes' = $null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue