Forum Discussion

nbritton's avatar
nbritton
Level 4
6 years ago

netbackup api - oDataQueryFilter

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?

7 Replies

  • 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. 

    • nbritton's avatar
      nbritton
      Level 4
      I can give that a try but if I comment that line out and return everything , the capitalization matches the json returned.
      • davidmoline's avatar
        davidmoline
        Level 6

        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.