Showing results for 
Search instead for 
Did you mean: 

netbackup api - oDataQueryFilter

Level 4

I am working with using the /preview-asset-group or the /asset-groups object and i am stuck with the oDataQueryFilter string value.


I am getting this error :

"The OData filter criteria is invalid. The property 'poweredOn', used in a query expression, is not defined in type 'NetBackup.VipQueryFilterSchema'


When i am using this as the string:

"extendedAttributes/powerState eq poweredOn"


Has anyone seen any details on what or how this string should look like, or had any luck with it?


Level 6

Not 100% sure - but the capitalisation of the power state might be causing your problems.
In the GUI the first P is upper and the S is lower - i.e. Powerstate - not powerState as you have shown. It probably matters.
Try changing and see if that helps. 

I can give that a try but if I comment that line out and return everything , the capitalization matches the json returned.

You are correct on the capitalisation my mistake.
The powerState schema is string, so maybe you need to quote the "poweredOn" in your query. So it might look something like this:

extendedAttributes/powerState eq 'poweredOn'

I just tried a similar filtered query in a test environment and this worked (with appropriate authorization set):
https://nbumaster:1556/netbackup/assets?filter=extendedAttributes/powerState eq 'poweredOn'

I know it's not the same API call - but if I leave the quotes out, I get a similar 'The OData filter criteria is invalid" message. 

I've done some more testing this time using the preview-asset-group, and have run into the same issue you are having. I'm seeing if someone internally can help resolve the issue. Stay tuned.


Okay - after much toing and froing I have now been informed that this is a defect. There is an eTrack ET 3984681 to cover this (this has only just been opened).

Part of the issue - and this is where you came unstuck, is that the oDataQueryFilter uses the variable as powerstate (note no capitalisation), which the string being compared does have the capitalisation you used - so it will never match. 
I have confirmed in a test environment, that I can use the query, but nothing is returned, so avoid the error you would need to set up the query like this "oDataQueryFilter": "extendedAttributes/powerstate eq 'poweredOn'" 

I suspect a EEB will be created to cover this, although I'm not sure how far back they will port the fix. I've asked for at least 8.1.2 & 8.2, but we'll see - I also am unable to say how quickly a fix will be provided - but I'll monitor the eTrack and update if one does appear.

Sorry I couldn't be more helpful...

Thanks!   I will try that, i will also open a case to have that etrack refernced.