object valuemap.update(object/array valuemaps)
This method allows to update existing value maps.
(object/array)
Value map properties to be updated.
The valuemapid
property must be defined for each value map, all other properties are optional. Only the passed properties will be updated, all others will remain unchanged.
(object)
Returns an object containing the IDs of the updated value maps under the valuemapids
property.
Change value map name to "Device status".
Request:
{
"jsonrpc": "2.0",
"method": "valuemap.update",
"params": {
"valuemapid": "2",
"name": "Device status"
},
"auth": "57562fd409b3b3b9a4d916d45207bbcb",
"id": 1
}
Response:
Request:
{
"jsonrpc": "2.0",
"method": "valuemap.update",
"params": {
"valuemapid": "2",
"mappings": [
{
"value": "0",
"newvalue": "Online"
},
{
"value": "1",
"newvalue": "Offline"
}
]
},
"auth": "57562fd409b3b3b9a4d916d45207bbcb",
"id": 1
}
Response:
CValueMap::update() in ui/include/classes/api/services/CValueMap.php.