[comment]: # translation:outdated

[comment]: # ({6d056871-6d056871})
# 1. függelék. Referenciakommentár

[comment]: # ({/6d056871-6d056871})

[comment]: # ({6594bdc4-6594bdc4})
### Jelölés

[comment]: # ({/6594bdc4-6594bdc4})

[comment]: # ({new-2df08058})
#### Data types

The Zabbix API supports the following data types as input:

|Type|Description|
|--------|---------------------------------------------------|
|boolean|A boolean value, accepts either `true` or `false`.|
|flag|The value is considered to be `true` if it is passed and not equal to `null` and `false` otherwise.|
|integer|A whole number.|
|float|A floating point number.|
|string|A text string.|
|text|A longer text string.|
|timestamp|A Unix timestamp.|
|array|An ordered sequence of values, that is, a plain array.|
|object|An associative array.|
|query|A value which defines, what data should be returned.<br><br>Can be defined as an array of property names to return only specific properties, or as one of the predefined values:<br>`extend` - returns all object properties;<br>`count` - returns the number of retrieved records, supported only by certain subselects.|

::: noteimportant
Zabbix API always returns values as strings or
arrays only.
:::

[comment]: # ({/new-2df08058})

[comment]: # ({new-a2c16a18})
#### Property labels

Some of the objects properties are marked with short labels to describe
their behavior. The following labels are used:

-   *readonly* - the value of the property is set automatically and
    cannot be defined or changed by the client;
-   *constant* - the value of the property can be set when creating an
    object, but cannot be changed after.

[comment]: # ({/new-a2c16a18})

[comment]: # ({new-5e99748d})
### Reserved ID value "0"

Reserved ID value "0" can be used to filter elements and to remove
referenced objects. For example, to remove a referenced proxy from a
host, proxy\_hostid should be set to 0 ("proxy\_hostid": "0") or to
filter hosts monitored by server option proxyids should be set to 0
("proxyids": "0").

[comment]: # ({/new-5e99748d})

[comment]: # ({new-b4e0f5ab})
### Common "get" method parameters

The following parameters are supported by all `get` methods:

|Parameter|[Type](#data_types)|Description|
|---------|------|---------------------------------------------------|
|countOutput|boolean|Return the number of records in the result instead of the actual data.|
|editable|boolean|If set to `true` return only objects that the user has write permissions to.<br><br>Default: `false`.|
|excludeSearch|boolean|Return results that do not match the criteria given in the `search` parameter.|
|filter|object|Return only those results that exactly match the given filter.<br><br>Accepts an array, where the keys are property names, and the values are either a single value or an array of values to match against.<br><br>Doesn't work for `text` fields.|
|limit|integer|Limit the number of records returned.|
|output|query|Object properties to be returned.<br><br>Default: `extend`.|
|preservekeys|boolean|Use IDs as keys in the resulting array.|
|search|object|Return results that match the given wildcard search (case-insensitive).<br><br>Accepts an array, where the keys are property names, and the values are strings to search for. If no additional options are given, this will perform a `LIKE "%…%"` search.<br><br>Works only for `string` and `text` fields.|
|searchByAny|boolean|If set to `true` return results that match any of the criteria given in the `filter` or `search` parameter instead of all of them.<br><br>Default: `false`.|
|searchWildcardsEnabled|boolean|If set to `true` enables the use of "\*" as a wildcard character in the `search` parameter.<br><br>Default: `false`.|
|sortfield|string/array|Sort the result by the given properties. Refer to a specific API get method description for a list of properties that can be used for sorting. Macros are not expanded before sorting.<br><br>If no value is specified, data will be returned unsorted.|
|sortorder|string/array|Order of sorting. If an array is passed, each value will be matched to the corresponding property given in the `sortfield` parameter.<br><br>Possible values are:<br>`ASC` - *(default)* ascending;<br>`DESC` - descending.|
|startSearch|boolean|The `search` parameter will compare the beginning of fields, that is, perform a `LIKE "…%"` search instead.<br><br>Ignored if `searchWildcardsEnabled` is set to `true`.|

[comment]: # ({/new-b4e0f5ab})

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

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

[comment]: # ({74abb8d6-7a121fac})
#### Felhasználói engedélyek ellenőrzése

Van-e a felhasználónak joga írni olyan gazdagépekhez, amelyek neve ezzel kezdődik?
"MySQL" vagy "Linux"?

Kérés:

``` json
{
    "jsonrpc": "2.0",
    "method": "host.get",
    "params": {
        "countOutput": igaz,
        "search": {
            "host": ["MySQL", "Linux"]
        },
        "editable": igaz,
        "startSearch": igaz,
        "searchByAny": igaz
    },
    "auth": "766b71ee543230a1182ca5c44d353e36",
    "id": 1
}
```

Válasz:

``` json
{
    "jsonrpc": "2.0",
    "result": "0",
    "id": 1
}
```

::: noteclassic
A nulla eredmény azt jelenti, hogy nincsenek olvasási/írási hosztok
engedélyeket.
:::

[comment]: # ({/74abb8d6-7a121fac})

[comment]: # ({4d566cba-ea3cccd8})
#### Nem megfelelő számlálás

Számolja meg azoknak a gazdagépeknek a számát, amelyek neve nem tartalmazza az alkarakterláncot
"ubuntu"

Kérés:

``` json
{
    "jsonrpc": "2.0",
    "method": "host.get",
    "params": {
        "countOutput": true,
        "keresés": {
            "host": "ubuntu"
        },
        "excludeSearch": true
    },
    "auth": "766b71ee543230a1182ca5c44d353e36",
    "id": 1
}
```

Válasz:

``` json
{
    "jsonrpc": "2.0",
    "result": "44",
    "id": 1
}
```

[comment]: # ({/4d566cba-ea3cccd8})

[comment]: # ({new-e911c08b})
#### Searching for hosts using wildcards

Find hosts whose name contains word "server" and have interface ports
"10050" or "10071". Sort the result by host name in descending order and
limit it to 5 hosts.

Request:

```json
{
    "jsonrpc": "2.0",
    "method": "host.get",
    "params": {
        "output": ["hostid", "host"],
        "selectInterfaces": ["port"],
        "filter": {
            "port": ["10050", "10071"]
        },
        "search": {
            "host": "*server*"
        },
        "searchWildcardsEnabled": true,
        "searchByAny": true,
        "sortfield": "host",
        "sortorder": "DESC",
        "limit": 5
    },
    "auth": "766b71ee543230a1182ca5c44d353e36",
    "id": 1
}
```

Response:

```json
{
    "jsonrpc": "2.0",
    "result": [
        {
            "hostid": "50003",
            "host": "WebServer-Tomcat02",
            "interfaces": [
                {
                    "port": "10071"
                }
            ]
        },
        {
            "hostid": "50005",
            "host": "WebServer-Tomcat01",
            "interfaces": [
                {
                    "port": "10071"
                }
            ]
        },
        {
            "hostid": "50004",
            "host": "WebServer-Nginx",
            "interfaces": [
                {
                    "port": "10071"
                }
            ]
        },
        {
            "hostid": "99032",
            "host": "MySQL server 01",
            "interfaces": [
                {
                    "port": "10050"
                }
            ]
        },
        {
            "hostid": "99061",
            "host": "Linux server 01",
            "interfaces": [
                {
                    "port": "10050"
                }
            ]
        }
    ],
    "id": 1
}
```

[comment]: # ({/new-e911c08b})

[comment]: # ({new-8ce6f554})
#### Searching for hosts using wildcards with "preservekeys"

If you add the parameter "preservekeys" to the previous request, the
result is returned as an associative array, where the keys are the id of
the objects.

Request:

```json
{
    "jsonrpc": "2.0",
    "method": "host.get",
    "params": {
        "output": ["hostid", "host"],
        "selectInterfaces": ["port"],
        "filter": {
            "port": ["10050", "10071"]
        },
        "search": {
            "host": "*server*"
        },
        "searchWildcardsEnabled": true,
        "searchByAny": true,
        "sortfield": "host",
        "sortorder": "DESC",
        "limit": 5,
        "preservekeys": true
    },
    "auth": "766b71ee543230a1182ca5c44d353e36",
    "id": 1
}
```

Response:

```json
{
    "jsonrpc": "2.0",
    "result": {
        "50003": {
            "hostid": "50003",
            "host": "WebServer-Tomcat02",
            "interfaces": [
                {
                    "port": "10071"
                }
            ]
        },
        "50005": {
            "hostid": "50005",
            "host": "WebServer-Tomcat01",
            "interfaces": [
                {
                    "port": "10071"
                }
            ]
        },        
        "50004": {
            "hostid": "50004",
            "host": "WebServer-Nginx",
            "interfaces": [
                {
                    "port": "10071"
                }
            ]
        },
        "99032": {
            "hostid": "99032",
            "host": "MySQL server 01",
            "interfaces": [
                {
                    "port": "10050"
                }
            ]
        },
        "99061": {
            "hostid": "99061",
            "host": "Linux server 01",
            "interfaces": [
                {
                    "port": "10050"
                }
            ]
        }
    },
    "id": 1
}
```

[comment]: # ({/new-8ce6f554})
