Reply

Filter extattrs issue

New Member
Posts: 2
2395     0

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,

Re: Filter extattrs issue

Moderator
Moderator
Posts: 315
2396     0

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

New Member
Posts: 2
2396     0

Thank you Richard, that have solve my issue!

Showing results for 
Search instead for 
Did you mean: 

Recommended for You