Forum Discussion
custom metadata and icontrol REST
- Dec 17, 2014
Bas,
Since TMOS version 11.2, metadata in the form of name/value pairs can be associated with specific objects in TMOS. One of the objects which supports metadata are LTM virtual server objects. Assuming when you say a 'Load Balancer' you are referencing a specific LTM virtual server, you can simply add a list as a 'metadata' attribute to the virtual server object in your REST calls.
As an example, let's say we have virtual server named 'lbaas_12345' in folder 'Common' (which by-the-way, if this is multi-tenant you should be building folders per tenant for isolation). When you make the POST request to create the virtual server, include in the request body a JSON attribute that looks like this.
"metadata": [ { "name": "name1", "persist": "true", "value": "value1" }, { "name": "name2", "persist": "true", "value": "value2" }, { "name": "name3", "persist": "true", "value": "value3" } ]
If you want to update the metadata for that virtual server, you would issue a PUT request as follows:
PUT https://[yourbigip]/mgmt/tm/ltm/virtual/~Common~lbaas_12345
{ "metadata": [ { "name": "name1", "persist": "true", "value": "value1" }, { "name": "name2", "persist": "true", "value": "value2" }, { "name": "name3", "persist": "true", "value": "value3" }, { "name": "name4", "persist": "true", "value": "value4" } ] }
Let me know if that's enough to get you where you need to go..
John
Exactly what I need, thanks a lot.
Is there a way to show metadata within the F5 BUI?
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