Forum Discussion
Using the Rest API to extract the virtual server's advanced settings
I've been trying with the REST API to save all of our virtual server's configuration (every variable that can be accessed and changed through the web interface / console) in a file. I have found the "virtual/virtualServerName" method that returns some of the things I want; but I cannot find a way to retrieve all of the virtual server's properties of one server. Is it possible to do this through the API?
- iaine
Nacreous
How much info do you need....? You can add the expandSubcollections query parameter to your call to expand the config returned - https://x.x.x.x/mgmt/tm/ltm/virtual/vip_name/?expandSubcollections=true
Or if you want output like tmsh list ltm virtual vip_name all-properties you can run the command using the api bash util as detailed here - https://devcentral.f5.com/s/question/0D51T00006i7fLs/native-tmshbash-commands-via-rest-api
So call would be something like
curl -sk -u 'admin:admin' -X POST -H "Content-type: application/json" -d "{\"command\":\"run\", \"utilCmdArgs\": \"-c 'tmsh list ltm virtual vip_name all-properties'\"}" https://x.x.x.x/mgmt/tm/util/bash | sed 's/\\n/\n/g'
- JAPortal
Nimbostratus
Thank you very much for the help! I've been trying to use the bash but it keeps timing out, and now the API is not responding anymore, even when not using the bash with methods like https://x.x.x.x/mgmt/tm/ltm/virtual/vip_name/?expandSubcollections=true
- Satoshi_Toyosa1Ret. Employee
>> now the API is not responding anymore
You may want to try restarting the iControl REST process(es) on your BIG-IP.
# tmsh restart sys service restjavad
WRT the virtual's properies, the list is shown in the API Guide. If you cannot find the property you are after in this doc, please provide the (tmsh) property name.
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com