diff --git a/Functions/Setup/Connect-NetboxAPI.ps1 b/Functions/Setup/Connect-NetboxAPI.ps1 index 89e900c..bb36287 100644 --- a/Functions/Setup/Connect-NetboxAPI.ps1 +++ b/Functions/Setup/Connect-NetboxAPI.ps1 @@ -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" } \ No newline at end of file diff --git a/Functions/Setup/Support/Get-NetboxObjectType.ps1 b/Functions/Setup/Support/Get-NetboxObjectType.ps1 index 84859fb..ad8dca8 100644 --- a/Functions/Setup/Support/Get-NetboxObjectType.ps1 +++ b/Functions/Setup/Support/Get-NetboxObjectType.ps1 @@ -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 diff --git a/Functions/Setup/Support/SetupNetboxConfigVariable.ps1 b/Functions/Setup/Support/SetupNetboxConfigVariable.ps1 index 12e5e9c..006d593 100644 --- a/Functions/Setup/Support/SetupNetboxConfigVariable.ps1 +++ b/Functions/Setup/Support/SetupNetboxConfigVariable.ps1 @@ -13,7 +13,7 @@ 'Choices' = @{ } 'APIDefinition' = $null - 'ContentTypes' = $null + 'ObjectTypes' = $null } } diff --git a/NetboxPS.psd1 b/NetboxPS.psd1 index 3f03e75..ac2c422 100644 --- a/NetboxPS.psd1 +++ b/NetboxPS.psd1 @@ -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', diff --git a/NetboxPS/NetboxPS.psd1 b/NetboxPS/NetboxPS.psd1 index 3f03e75..ac2c422 100644 --- a/NetboxPS/NetboxPS.psd1 +++ b/NetboxPS/NetboxPS.psd1 @@ -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', diff --git a/NetboxPS/NetboxPS.psm1 b/NetboxPS/NetboxPS.psm1 index 640c622..e444b2c 100644 --- a/NetboxPS/NetboxPS.psm1 +++ b/NetboxPS/NetboxPS.psm1 @@ -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 } }