valuemap.get

Description

integer/array valuemap.get(object **parameters**)

The method allows to retrieve value maps according to the given parameters.

Parameters

(object) Parameters defining the desired output.

The method supports the following parameters.

ParameterTypeDescription
valuemapidsstring/arrayReturn only value maps with the given IDs.
selectMappingsqueryReturn the value mappings for current value map in the mappings property.

Supports count.
sortfieldstring/arraySort the result by the given properties.

Possible values are: valuemapid, name.
countOutputbooleanThese parameters being common for all get methods are described in detail in the reference commentary.
editableboolean
excludeSearchboolean
filterobject
limitinteger
outputquery
preservekeysboolean
searchobject
searchByAnyboolean
searchWildcardsEnabledboolean
sortorderstring/array
startSearchboolean

Return values

(integer/array) Returns either:

  • an array of objects;

  • the count of retrieved objects, if the countOutput parameter has been used.

Examples

Retrieving value maps

Retrieve all configured value maps.

Request:

  1. {
  2. "jsonrpc": "2.0",
  3. "method": "valuemap.get",
  4. "params": {
  5. "output": "extend"
  6. },
  7. "auth": "57562fd409b3b3b9a4d916d45207bbcb",
  8. "id": 1
  9. }

Response:

  1. {
  2. "jsonrpc": "2.0",
  3. "result": [
  4. {
  5. "valuemapid": "4",
  6. "name": "APC Battery Replacement Status"
  7. },
  8. {
  9. "valuemapid": "5",
  10. "name": "APC Battery Status"
  11. },
  12. {
  13. "valuemapid": "7",
  14. "name": "Dell Open Manage System Status"
  15. }
  16. ],
  17. "id": 1
  18. }

Retrieve one value map with its mappings.

Request:

  1. {
  2. "jsonrpc": "2.0",
  3. "method": "valuemap.get",
  4. "params": {
  5. "output": "extend",
  6. "selectMappings": "extend",
  7. "valuemapids": ["4"]
  8. },
  9. "auth": "57562fd409b3b3b9a4d916d45207bbcb",
  10. "id": 1
  11. }

Response:

  1. {
  2. "jsonrpc": "2.0",
  3. "result": [
  4. {
  5. "valuemapid": "4",
  6. "name": "APC Battery Replacement Status",
  7. "mappings": [
  8. {
  9. "value": "1",
  10. "newvalue": "unknown"
  11. },
  12. {
  13. "value": "2",
  14. "newvalue": "notInstalled"
  15. },
  16. {
  17. "value": "3",
  18. "newvalue": "ok"
  19. },
  20. {
  21. "value": "4",
  22. "newvalue": "failed"
  23. },
  24. {
  25. "value": "5",
  26. "newvalue": "highTemperature"
  27. },
  28. {
  29. "value": "6",
  30. "newvalue": "replaceImmediately"
  31. },
  32. {
  33. "value": "7",
  34. "newvalue": "lowCapacity"
  35. }
  36. ]
  37. }
  38. ],
  39. "id": 1
  40. }

Source

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