rmbolger / Posh-IBWAPI

PowerShell module for interacting with the Infoblox WAPI (REST API).
MIT License
54 stars 8 forks source link

Get-IBObject throwing: "Paging is not supported for object reference read operations" #34

Closed basvinken closed 5 years ago

basvinken commented 5 years ago

example code:

$result = Get-IBObject -type range -filters 'network=192.168.1.1/24'
Get-IBObject -type dhcp:statistics -filters "statistics_object=$($result._ref)"

error:

AdmConProtoError: Paging is not supported for object reference read operations
At C:\Program Files\WindowsPowerShell\Modules\Posh-IBWAPI\Public\Invoke-IBWAPI.ps1:141 char:13
+             throw [Exception] "$($wapiErr.Error)"
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (:) [], Exception
    + FullyQualifiedErrorId : AdmConProtoError: Paging is not supported for object reference read operations

I think the easiest way to fix this is by adding $UsePaging to the parameterset with a default value of $true.

rmbolger commented 5 years ago

Thanks for the heads up. This is a weird one because it's not actually an object reference query, but it seems to act like one. And the docs indicate that even if you wanted to query it directly by reference, you can't.

As you say, adding a switch is likely the easiest way forward. But it will probably be something like -NoPaging because generally switches default to off and you can't tell if a switch defaults to true from the syntax text using Get-Help.

rmbolger commented 5 years ago

The -NoPaging option is now live in version 1.6.0.