object valuemap.update(object/array valuemaps)
该方法允许更新现有的值映射。
object valuemap.update(object/array valuemaps)
This method allows to update existing value maps.
(object/array)
要更新的值映射特性。
必须为每个值映射定义valuemapid
属性,所有其他属性都是可选的。 只有通过的属性将被更新,所有其他属性将保持不变。
(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)
返回一个对象,它包含valuemapids
属性下更新的值映射的ID。
(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 frontends/php/include/classes/api/services/CValueMap.php.