Forum Discussion
Satoshi_Toyosa1
May 19, 2020Employee
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.