| Verb | URI | Description | ||||
| POST | /loadbalancers/loadBalancerId/metadata |
Add a new metadata item to the load balancer. | ||||
| POST | /loadbalancers/loadBalancerId/nodes/nodeId/metadata |
Add a new metadata item to the node. | ||||
Normal Response Code(s): 200
Error Response Code(s): loadbalancerFault (400, 500), serviceUnavailable (503), unauthorized (401), badRequest (400), overLimit (413)
When a metadata item is added, it is assigned a unique identifier that can be used for mutating operations such as changing the value attribute or removing it.
The following table lists the required and optional attributes for Add Metadata:
| Name | Description | Required | ||
| key | Key that is used to identify the metadata. Must be 256 characters or less. All UTF-8 characters are valid. Refer to http://www.utf8-chartable.de/ for information about the UTF-8 character set. | Yes | ||
| value |
Value for the metadata item. Must be 256 characters or less. All UTF-8 characters are valid. |
Yes | ||
Example 4.105. Add Metadata Request: XML
<metadata xmlns="http://docs.openstack.org/loadbalancers/api/v1.0">
<meta key="color">red</meta>
<meta key="label">web-load-balancer</meta>
</metadata>
Example 4.106. Add Metadata Request: JSON
{
"metadata": [
{
"key":"color",
"value":"red"
},
{
"key":"label",
"value":"web-load-balancer"
}
]
}
Example 4.107. Add Metadata Response: XML
<metadata xmlns="http://docs.openstack.org/loadbalancers/api/v1.0">
<meta id="1" key="color">red</meta>
<meta id="2" key="label">web-load-balancer</meta>
</metadata>
Example 4.108. Add Metadata Response: JSON
{
"metadata": [
{
"id":"1",
"key":"color",
"value":"red"
},
{
"id":"2",
"key":"label",
"value":"web-load-balancer"
}
]
}

