Esta é uma tradução da página de documentação original em inglês. Ajude-nos a torná-la melhor.

valuemap.update

Description

object valuemap.update(object/array valuemaps)

This method allows to update existing value maps.

This method is only available to Super admin user type. Permissions to call the method can be revoked in user role settings. See User roles for more information.

Parameters

(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.

Valores de retorno

(objeto) Retorna um objete que contém os IDs de uma atualização de valor mapeia sob a propriedade valuemapids.

Exemplos

Changing value map name

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:

{
           "jsonrpc": "2.0",
           "result": {
               "valuemapids": [
                   "2"
               ]
           },
           "id": 1
       }

Changing mappings for one value map.

Request:

{
           "jsonrpc": "2.0",
           "method": "valuemap.update",
           "params": {
               "valuemapid": "2",
               "mappings": [
                   {
                       "type": "0",
                       "value": "0",
                       "newvalue": "Online"
                   },
                   {
                       "type": "0",
                       "value": "1",
                       "newvalue": "Offline"
                   }
               ]
           },
           "auth": "57562fd409b3b3b9a4d916d45207bbcb",
           "id": 1
       }

Response:

{
           "jsonrpc": "2.0",
           "result": {
               "valuemapids": [
                   "2"
               ]
           },
           "id": 1
       }

Fonte

CValueMap::update() in ui/include/classes/api/services/CValueMap.php.