screen.update

Description

object screen.update(object/array **screens**)

This method allows to update existing screens.

Parameters

(object/array) Screen properties to be updated.

The screenid property must be defined for each screen, all other properties are optional. Only the passed properties will be updated, all others will remain unchanged.

Additionally to the standard screen properties, the method accepts the following parameters.

ParameterTypeDescription
screenitemsarrayScreen items to replace existing screen items.

Screen items are updated by coordinates, so each screen item must have the x and y properties defined.
usersarrayScreen user shares to replace the existing elements.
userGroupsarrayScreen user group shares to replace the existing elements.

Return values

(object) Returns an object containing the IDs of the updated screens under the screenids property.

Examples

Renaming a screen

Rename a screen to “CPU Graphs”.

Request:

  1. {
  2. "jsonrpc": "2.0",
  3. "method": "screen.update",
  4. "params": {
  5. "screenid": "26",
  6. "name": "CPU Graphs"
  7. },
  8. "auth": "038e1d7b1735c6a5436ee9eae095879e",
  9. "id": 1
  10. }

Response:

  1. {
  2. "jsonrpc": "2.0",
  3. "result": {
  4. "screenids": [
  5. "26"
  6. ]
  7. },
  8. "id": 1
  9. }

Change screen owner

Available only for admins and super admins.

Request:

  1. {
  2. "jsonrpc": "2.0",
  3. "method": "screen.update",
  4. "params": {
  5. "screenid": "83",
  6. "userid": "1"
  7. },
  8. "auth": "038e1d7b1735c6a5436ee9eae095879e",
  9. "id": 2
  10. }

Response:

  1. {
  2. "jsonrpc": "2.0",
  3. "result": {
  4. "screenids": [
  5. "83"
  6. ]
  7. },
  8. "id": 2
  9. }

See also

Source

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