- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
Filter extattrs issue
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2022 11:09 AM
Hello,
I'm trying to find a specific extattrs called "Sub: Location" in the object network.
Example:
"extattrs": {
"Sub: Location": {
"value": "Test"
},
}
curl -k -u username -X GET "https://url/wapi/v2.11/network?_return_fields%20=extattrs&*Location~:=Test"
It gives me this error:
{ "Error": "AdmConProtoError: Illegal option modifier : _return_fields =extattrs",
"code": "Client.Ibap.Proto",
"text": "Illegal option modifier : _return_fields =extattrs"
}
How can I fix this?
Thank you,
Solved! Go to Solution.
Re: Filter extattrs issue
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2022 04:31 AM
The space is definately special and must be escaped, and the colon is special enough that I'd want to escape it too.
A regex can only be used against values, not the names of EAs. We can search for networks that have any value (period is the wildcard) in the "Sub: Location: EA.
Try it like this.
curl -k -u username -X GET "https://url/wapi/v2.11/network?_return_fields%2b=extattrs&*Sub%3a%20Location~=."
And a response looks like this:
[ { "_ref": "network/ZG5zLm5ldHdvcmskMTcyLjE2LjEwNC4wLzI0LzA:172.16.104.0/24/default", "comment": "Honolulu Datacenter", "extattrs": { "Data Center": { "value": "Honolulu" }, "Network Type": { "value": "Data Center" }, "Sub: Location": { "value": "Test" } }, "network": "172.16.104.0/24", "network_view": "default" } ]
Re: Filter extattrs issue
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2022 04:57 AM
Thank you Richard, that have solve my issue!