rename ContentTypes to ObjectTypes

This commit is contained in:
Pascal Liehne 2024-09-01 00:32:18 +02:00
parent bc8d140ec5
commit db1bc1e91d
6 changed files with 131 additions and 131 deletions

View file

@ -148,7 +148,7 @@
$script:NetboxConfig.Connected = $true
Write-Verbose "Successfully connected!"
$script:NetboxConfig.ContentTypes = Get-NetboxContentType -Limit 500
$script:NetboxConfig.ObjectTypes = Get-NetboxObjectType -Limit 500
Write-Verbose "Connection process completed"
}

View file

@ -1,10 +1,10 @@
function Get-NetboxContentType {
function Get-NetboxObjectType {
<#
.SYNOPSIS
Get a content type definition from Netbox
Get a object type definition from Netbox
.DESCRIPTION
A detailed description of the Get-NetboxContentType function.
A detailed description of the Get-NetboxObjectType function.
.PARAMETER Model
A description of the Model parameter.
@ -28,7 +28,7 @@
Return the unparsed data from the HTTP request
.EXAMPLE
PS C:\> Get-NetboxContentType
PS C:\> Get-NetboxObjectType
.NOTES
Additional information about the function.
@ -61,8 +61,8 @@
switch ($PSCmdlet.ParameterSetName) {
'ById' {
foreach ($ContentType_ID in $Id) {
$Segments = [System.Collections.ArrayList]::new(@('extras', 'content-types', $ContentType_ID))
foreach ($ObjectType_ID in $Id) {
$Segments = [System.Collections.ArrayList]::new(@('extras', 'object-types', $ObjectType_ID))
$URIComponents = BuildURIComponents -URISegments $Segments -ParametersDictionary $PSBoundParameters -SkipParameterByName 'Id'
@ -75,7 +75,7 @@
}
default {
$Segments = [System.Collections.ArrayList]::new(@('extras', 'content-types'))
$Segments = [System.Collections.ArrayList]::new(@('extras', 'object-types'))
$URIComponents = BuildURIComponents -URISegments $Segments -ParametersDictionary $PSBoundParameters

View file

@ -13,7 +13,7 @@
'Choices' = @{
}
'APIDefinition' = $null
'ContentTypes' = $null
'ObjectTypes' = $null
}
}

View file

@ -79,19 +79,19 @@ FunctionsToExport = 'Add-NetboxDCIMFrontPort', 'Add-NetboxDCIMInterface',
'Get-NetboxCircuitProvider', 'Get-NetboxCircuitTermination',
'Get-NetboxCircuitType', 'GetNetboxConfigVariable',
'Get-NetboxContact', 'Get-NetboxContactAssignment',
'Get-NetboxContactRole', 'Get-NetboxContentType',
'Get-NetboxCredential', 'Get-NetboxDCIMCable',
'Get-NetboxDCIMCableTermination', 'Get-NetboxDCIMDevice',
'Get-NetboxDCIMDeviceRole', 'Get-NetboxDCIMDeviceType',
'Get-NetboxDCIMFrontPort', 'Get-NetboxDCIMInterface',
'Get-NetboxDCIMInterfaceConnection', 'Get-NetboxDCIMPlatform',
'Get-NetboxDCIMRearPort', 'Get-NetboxDCIMSite', 'Get-NetboxHostname',
'Get-NetboxHostPort', 'Get-NetboxHostScheme',
'Get-NetboxInvokeParams', 'Get-NetboxIPAMAddress',
'Get-NetboxIPAMAddressRange', 'Get-NetboxIPAMAggregate',
'Get-NetboxIPAMAvailableIP', 'Get-NetboxIPAMPrefix',
'Get-NetboxIPAMRole', 'Get-NetboxIPAMVLAN', 'Get-NetboxTag',
'Get-NetboxTenant', 'Get-NetboxTimeout', 'Get-NetboxVersion',
'Get-NetboxContactRole', 'Get-NetboxCredential',
'Get-NetboxDCIMCable', 'Get-NetboxDCIMCableTermination',
'Get-NetboxDCIMDevice', 'Get-NetboxDCIMDeviceRole',
'Get-NetboxDCIMDeviceType', 'Get-NetboxDCIMFrontPort',
'Get-NetboxDCIMInterface', 'Get-NetboxDCIMInterfaceConnection',
'Get-NetboxDCIMPlatform', 'Get-NetboxDCIMRearPort',
'Get-NetboxDCIMSite', 'Get-NetboxHostname', 'Get-NetboxHostPort',
'Get-NetboxHostScheme', 'Get-NetboxInvokeParams',
'Get-NetboxIPAMAddress', 'Get-NetboxIPAMAddressRange',
'Get-NetboxIPAMAggregate', 'Get-NetboxIPAMAvailableIP',
'Get-NetboxIPAMPrefix', 'Get-NetboxIPAMRole', 'Get-NetboxIPAMVLAN',
'Get-NetboxObjectType', 'Get-NetboxTag', 'Get-NetboxTenant',
'Get-NetboxTimeout', 'Get-NetboxVersion',
'Get-NetboxVirtualizationCluster',
'Get-NetboxVirtualizationClusterGroup', 'Get-NetboxVirtualMachine',
'Get-NetboxVirtualMachineInterface', 'InvokeNetboxRequest',

View file

@ -79,19 +79,19 @@ FunctionsToExport = 'Add-NetboxDCIMFrontPort', 'Add-NetboxDCIMInterface',
'Get-NetboxCircuitProvider', 'Get-NetboxCircuitTermination',
'Get-NetboxCircuitType', 'GetNetboxConfigVariable',
'Get-NetboxContact', 'Get-NetboxContactAssignment',
'Get-NetboxContactRole', 'Get-NetboxContentType',
'Get-NetboxCredential', 'Get-NetboxDCIMCable',
'Get-NetboxDCIMCableTermination', 'Get-NetboxDCIMDevice',
'Get-NetboxDCIMDeviceRole', 'Get-NetboxDCIMDeviceType',
'Get-NetboxDCIMFrontPort', 'Get-NetboxDCIMInterface',
'Get-NetboxDCIMInterfaceConnection', 'Get-NetboxDCIMPlatform',
'Get-NetboxDCIMRearPort', 'Get-NetboxDCIMSite', 'Get-NetboxHostname',
'Get-NetboxHostPort', 'Get-NetboxHostScheme',
'Get-NetboxInvokeParams', 'Get-NetboxIPAMAddress',
'Get-NetboxIPAMAddressRange', 'Get-NetboxIPAMAggregate',
'Get-NetboxIPAMAvailableIP', 'Get-NetboxIPAMPrefix',
'Get-NetboxIPAMRole', 'Get-NetboxIPAMVLAN', 'Get-NetboxTag',
'Get-NetboxTenant', 'Get-NetboxTimeout', 'Get-NetboxVersion',
'Get-NetboxContactRole', 'Get-NetboxCredential',
'Get-NetboxDCIMCable', 'Get-NetboxDCIMCableTermination',
'Get-NetboxDCIMDevice', 'Get-NetboxDCIMDeviceRole',
'Get-NetboxDCIMDeviceType', 'Get-NetboxDCIMFrontPort',
'Get-NetboxDCIMInterface', 'Get-NetboxDCIMInterfaceConnection',
'Get-NetboxDCIMPlatform', 'Get-NetboxDCIMRearPort',
'Get-NetboxDCIMSite', 'Get-NetboxHostname', 'Get-NetboxHostPort',
'Get-NetboxHostScheme', 'Get-NetboxInvokeParams',
'Get-NetboxIPAMAddress', 'Get-NetboxIPAMAddressRange',
'Get-NetboxIPAMAggregate', 'Get-NetboxIPAMAvailableIP',
'Get-NetboxIPAMPrefix', 'Get-NetboxIPAMRole', 'Get-NetboxIPAMVLAN',
'Get-NetboxObjectType', 'Get-NetboxTag', 'Get-NetboxTenant',
'Get-NetboxTimeout', 'Get-NetboxVersion',
'Get-NetboxVirtualizationCluster',
'Get-NetboxVirtualizationClusterGroup', 'Get-NetboxVirtualMachine',
'Get-NetboxVirtualMachineInterface', 'InvokeNetboxRequest',

View file

@ -615,7 +615,7 @@ function Connect-NetboxAPI {
$script:NetboxConfig.Connected = $true
Write-Verbose "Successfully connected!"
$script:NetboxConfig.ContentTypes = Get-NetboxContentType -Limit 500
$script:NetboxConfig.ObjectTypes = Get-NetboxObjectType -Limit 500
Write-Verbose "Connection process completed"
}
@ -1411,100 +1411,6 @@ function Get-NetboxContactRole {
#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
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
#region File Get-NetboxTag.ps1
@ -6272,7 +6272,7 @@ function SetupNetboxConfigVariable {
'Choices' = @{
}
'APIDefinition' = $null
'ContentTypes' = $null
'ObjectTypes' = $null
}
}