Áú»¢¶Ä²©

This is the documentation page for an unsupported version of Áú»¢¶Ä²©.
Is this not what you were looking for? Switch to the current version or choose one from the drop-down menu.

item.update

³¢±ð¨ª°ù¨¢²õ

object item.update(object/array items)

Ez a m¨®dszer lehet?v¨¦ teszi a megl¨¦v? elemek friss¨ªt¨¦s¨¦t.

A webes elemek nem friss¨ªthet?k a Áú»¢¶Ä²© API-n kereszt¨¹l.

Ez a m¨®dszer csak az Admin ¨¦s a Kiemelt rendszergazda sz¨¢m¨¢ra ¨¦rhet? el felhaszn¨¢l¨®i t¨ªpusok. A met¨®dus megh¨ªv¨¢s¨¢ra vonatkoz¨® enged¨¦lyek felhaszn¨¢l¨®i szerepk?rben visszavonhat¨®k be¨¢ll¨ªt¨¢sok. L¨¢sd: User roles tov¨¢bbi inform¨¢ci¨®¨¦rt.

±Ê²¹°ù²¹³¾¨¦³Ù±ð°ù±ð°ì

(objektum/t?mb) Friss¨ªtend? elemtulajdons¨¢gok.

Az "itemid" tulajdons¨¢got minden elemhez meg kell hat¨¢rozni, az ?sszes t?bbihez a tulajdons¨¢gok nem k?telez?ek. Csak az ¨¢tadott tulajdons¨¢gok friss¨¹lnek a t?bbi v¨¢ltozatlan marad.

A standard item properties mellett a met¨®dus elfogadja a k?vetkez? param¨¦tereket.

±Ê²¹°ù²¹³¾¨¦³Ù±ð°ù °Õ¨ª±è³Ü²õ ³¢±ð¨ª°ù¨¢²õ
preprocessing array Elem el?feldolgoz¨¢sa opci¨®k a jelenlegi el?feldolgoz¨¢si be¨¢ll¨ªt¨¢sok helyettes¨ªt¨¦s¨¦re.
tags array Elem ³¦¨ª³¾°ì¨¦°ì.

Visszat¨¦r¨¦si ¨¦rt¨¦kek

(object) A friss¨ªtett elemek azonos¨ªt¨®it tartalmaz¨® objektumot ad vissza az itemids tulajdons¨¢g alatt.

±Ê¨¦±ô»å¨¢°ì

Enabling an item

Enable an item, that is, set its status to "0".

Request:

{
           "jsonrpc": "2.0",
           "method": "item.update",
           "params": {
               "itemid": "10092",
               "status": 0
           },
           "auth": "700ca65537074ec963db7efabda78259",
           "id": 1
       }

Response:

{
           "jsonrpc": "2.0",
           "result": {
               "itemids": [
                   "10092"
               ]
           },
           "id": 1
       }

Update dependent item

Update Dependent item name and Master item ID. Only dependencies on same host are allowed, therefore Master and Dependent item should have same hostid.

Request:

{
           "jsonrpc": "2.0",
           "method": "item.update",
           "params": {
               "name": "Dependent item updated name",
               "master_itemid": "25562",
               "itemid": "189019"
           },
           "auth": "700ca65537074ec963db7efabda78259",
           "id": 1
       }

Response:

{
           "jsonrpc": "2.0",
           "result": {
               "itemids": [
                   "189019"
               ]
           },
           "id": 1
       }

Update HTTP agent item

Enable item value trapping.

Request:

{
           "jsonrpc": "2.0",
           "method": "item.update",
           "params": {
               "itemid": "23856",
               "allow_traps": 1
           },
           "auth": "700ca65537074ec963db7efabda78259",
           "id": 1
       }

Response:

{
           "jsonrpc": "2.0",
           "result": {
               "itemids": [
                   "23856"
               ]
           },
           "id": 1
       }

Updating an item with preprocessing

Update an item with item preprocessing rule "In range".

Request:

{
           "jsonrpc": "2.0",
           "method": "item.update",
           "params": {
               "itemid": "23856",
               "preprocessing": [
                   {
                       "type": 13,
                       "params": "\n100",
                       "error_handler": 1,
                       "error_handler_params": ""
                   }
               ]
           },
           "auth": "700ca65537074ec963db7efabda78259",
           "id": 1
       }

Response:

{
           "jsonrpc": "2.0",
           "result": {
               "itemids": [
                   "23856"
               ]
           },
           "id": 1
       }

Updating a script item

Update a script item with a different script and remove unnecessary parameters that were used by previous script.

Request:

{
           "jsonrpc": "2.0",
           "method": "item.update",
           "params": {
               "itemid": "23865",
               "parameters": [],
               "script": "Áú»¢¶Ä²©.Log(3, 'Log test');\nreturn 1;"
           },
           "auth": "700ca65537074ec963db7efabda78259",
           "id": 1
       }

Response:

{
           "jsonrpc": "2.0",
           "result": {
               "itemids": [
                   "23865"
               ]
           },
           "id": 1
       }

¹ó´Ç°ù°ù¨¢²õ

CItem::update() az ui/include/classes/api/services/CItem.php-ban.