[comment]: # ({0ec30c22-0ec30c22})
# item.update

[comment]: # ({/0ec30c22-0ec30c22})

[comment]: # ({0b698cb9-38961105})
### Leírás

`object item.update(object/array items)`

Ez a módszer lehetővé teszi a meglévő elemek frissítését.

::: noteclassic
A webes elemek nem frissíthetők a Zabbix API-n keresztül.
:::

::: noteclassic
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](/manual/web_interface/frontend_sections/administration/user_roles)
további információért.
:::

[comment]: # ({/0b698cb9-38961105})

[comment]: # ({b138871d-4e151fd6})
### Paraméterek

`(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](object#item) mellett a metódus
elfogadja a következő paramétereket.

|Paraméter|[Típus](/manual/api/reference_commentary#data_types)|Leírás|
|--|--|------|
|preprocessing|array|[Elem előfeldolgozása](/manual/api/reference/item/object#item_preprocessing) opciók a jelenlegi előfeldolgozási beállítások helyettesítésére.|
|tags|array|Elem [címkék.](/manual/api/reference/item/object#item_tag)|

[comment]: # ({/b138871d-4e151fd6})

[comment]: # ({aefff750-aefff750})
### Visszatérési értékek

`(object)` A frissített elemek azonosítóit tartalmazó objektumot ad vissza
az `itemids` tulajdonság alatt.

[comment]: # ({/aefff750-aefff750})

[comment]: # ({b41637d2-b41637d2})
### Példák

[comment]: # ({/b41637d2-b41637d2})

[comment]: # ({534da9af-5388578b})
#### Enabling an item

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

Request:

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

Response:

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

[comment]: # ({/534da9af-5388578b})

[comment]: # ({d312232b-0bf89382})
#### 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:

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

Response:

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

[comment]: # ({/d312232b-0bf89382})

[comment]: # ({f05084a9-8f365363})
#### Update HTTP agent item

Enable item value trapping.

Request:

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

Response:

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

[comment]: # ({/f05084a9-8f365363})

[comment]: # ({134fd698-44f323b8})
#### Updating an item with preprocessing

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

Request:

```json
{
    "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:

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

[comment]: # ({/134fd698-44f323b8})

[comment]: # ({5c588e1f-dcfb98a0})
#### Updating a script item

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

Request:

```json
{
    "jsonrpc": "2.0",
    "method": "item.update",
    "params": {
        "itemid": "23865",
        "parameters": [],
        "script": "Zabbix.Log(3, 'Log test');\nreturn 1;"
    },
    "auth": "700ca65537074ec963db7efabda78259",
    "id": 1
}
```

Response:

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

[comment]: # ({/5c588e1f-dcfb98a0})

[comment]: # ({646fe32a-646fe32a})
### Forrás

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

[comment]: # ({/646fe32a-646fe32a})
