cancel
Showing results for 
Search instead for 
Did you mean: 

F5 iControl Rest API to get Stats of GTM pool members returns "Object not found" error when GTM server name has space character

Suji_T
Nimbostratus
Nimbostratus

From F5 v12 to V15, the iControl Rest API for getting stats of GTM pool members throws object not found error, when GTM server name has spcae character in it. We tried the same api provided in selflink with proper encoding.

 

Example :

"selfLink": "https://localhost/mgmt/tm/gtm/pool/a/~Common~pool%20with%20space/members/~Common~server%20with%20space:vs%20with%20space?ver=15.0.1",

 

Response:

{

  "code": 404,

  "message": "Object not found - /Common/server with space:vs with space",

  "errorStack": [],

  "apiError": 1

}

1 REPLY 1

Satoshi_Toyosa1
F5 Employee
F5 Employee

I believe this is a bug ID795633, which has not been fixed yet. Because the equivalent tmsh command can be run, as a workaround, you can make a POST call against /mgmt/tm/util/bash to run the tmsh command. For example, 

curl -sku $PASS https://$HOST/mgmt/tm/util/bash \ -H "Content-type: application/json" \ -X POST \ -d '{"command":"run", "utilCmdArgs": "-c \"tmsh list gtm pool a SNS_Pool members { \\\"DNS_Google2:Google server\\\" }\""}'

It is indeed ugly, but does the job. The output from the tmsh can be found in the "commandResult" property in the response body. The line terminator (LF) is represented as the literal '\n' (0x 5c 6e), so additional processing is necessary to get something readable. For example, pipe the output to the following Python one-liner.

| python -c 'import sys,json; print json.load(sys.stdin)["commandResult"]'

I hope this helps.