Áú»¢¶Ä²©

This is a translation of the original English documentation page. Help us make it better.

???? 1. ????? ???

?????

???? ????

?-API ?? Áú»¢¶Ä²© ???? ????? ??????? ????? ????:

|???|?????| |--------|---------------------------------------- -----------| |boolean|??? ???????, ???? 'true' ?? 'false'.| |flag|???? ???? ?-'true' ?? ??? ??? ????? ???? ?-'null' ?-'false' ????.| |???? ???|???? ???.| |float|???? ????? ???.| |string|?????? ????.| |text|?????? ???? ????? ????.| |timestamp|????? ??? ?? Unix.| |????|??? ????? ?? ?????, ????? ???? ????.| |object|???? ??????????.| |query|??? ?????? ???? ?????? ?? ??????.

???? ?????? ????? ?? ???? ???????? ??? ?????? ?? ???????? ????????, ?? ???? ??????? ???????? ????:
extend - ?????? ?? ?? ??????? ????????;
count - ?????? ?? ???? ??????? ???????, ??????? ?? ?? ??? ?????? ???? ???????.|

::: ???? ???? Áú»¢¶Ä²© API ???? ????? ????? ???????? ?? ?????? ????. :::

?????? ???

??? ???????? ?????????? ??????? ??????? ????? ?????? ????????. ???? ????? ??????? ?????:

  • ?????? ???? - ???? ?? ??????? ????? ???????? ? ?? ???? ?????? ?? ????? ?? ??? ?????;
  • ???? - ???? ?????? ?? ???? ?? ??????? ??? ????? an ???????, ?? ?? ???? ????? ???? ???? ???.

??? ???? ???? "0"

??? ???? ???? "0" ???? ???? ?????? ??????? ?????? ????????? ???????? ?????. ??????, ??? ????? ?????? ?? ????? ?-a host, proxy_hostid ???? ????? ????? ?-0 ("proxy_hostid": "0") ?? ? ?? ?????? ?????? ?????? ???????? ?? ??? proxyids ?? ???????? ??? ?-0 ("proxyids": "0").

??????? ?????? ?? ???? "??".

???????? ????? ?????? ?? ??? ?? ????? ?-'get':

|?????|???|?????| |--------|-------|-------------------------------- -------------------| |countOutput|boolean|???? ?? ???? ??????? ?????? ????? ??????? ?????.| |editable|boolean|?? ????? ?-'true', ???? ?? ????????? ?????? ?? ?????? ?????? ?????.

????? ????: 'false'.| |excludeSearch|boolean|???? ?????? ????? ?????? ?? ??????????? ??????? ?????? ?????.| |filter|object|???? ?? ?? ??????? ???????? ?????? ????? ?????.

???? ????, ???? ??????? ?? ???? ????????, ??????? ?? ??? ???? ?? ???? ?? ????? ??????.

?? ???? ???? ???? ????.| |limit|integer|????? ???? ??????? ????????.| |output|query|??????? ??????? ??? ??????.

????? ????: ??????.| |preservekeys|boolean|????? ?????? ??????? ????? ??????.| |search|object|???? ?????? ??????? ?????? ?????? ??????? ??????? (?? ???? ??????).

???? ????, ???? ??????? ?? ???? ????????, ??????? ?? ??????? ??????. ?? ?? ?????? ???????? ??????, ?? ???? ????? LIKE "%¡­%".

???? ?? ???? ???? ?????? ?????.| |searchByAny|boolean|?? ????? ?-'true' ????? ?????? ??????? ??? ??? ???????????? ??????? ?????? 'filter' ?? 'search' ????? ????.

????? ????: 'false'.| |searchWildcardsEnabled|boolean|?? ????? ?-'true' ????? ?? ?????? ?-"*" ???? ?? ???? ?????? 'search'.

????? ????: false.| |sortfield|string/array|???? ?? ?????? ??? ????????? ???????. ???? ?????? ???? ??? ?????? ?? API ???? ????? ?? ???????? ????? ?????? ??? ?????. ?????? ????? ???? ??????? ???? ?????.

?? ?? ???? ???, ??????? ?????? ??? ????.| |sortorder|??????/????|??? ????. ?? ????? ????, ?? ??? ????? ??????? ????? ????? ?????? sortfield.

????? ??????? ??:
ASC - (????? ????) ????;
DESC - ????.| |startSearch|boolean|?????? search ????? ?? ????? ?????, ?????, ??? ????? ??? ????? LIKE "¡­%".

????? ?? searchWildcardsEnabled ????? ?-true. |

???????

????? ?????? ?????

??? ?????? ?? ????? ????? ??????? ???????? ??????? ? "MySQL" ?? "Linux"?

?????????:

{
            "jsonrpc": "2.0",
            "method": "host.get",
            "params": {
                "countOutput": ????,
                "????": {
                    "host": ["MySQL", "Linux"]
                },
                "???? ??????": ????,
                "startSearch": ????,
                "searchByAny": ????
            },
            "auth": "766b71ee543230a1182ca5c44d353e36",
            "????": 1
       }

????????:

{
            "jsonrpc": "2.0",
            "result": "0",
            "????": 1
       }

????? ??? ?????? ???? ?????? ?? ?????/????? ??????.

????? ?? ?????

???? ?? ???? ??????? ???????? ???? ?????? ?? ??????? ????? "???????"

?????????:

{
            "jsonrpc": "2.0",
            "method": "host.get",
            "params": {
                "countOutput": ????,
                "????": {
                    "????": "???????"
                },
                "excludeSearch": true
            },
            "auth": "766b71ee543230a1182ca5c44d353e36",
            "????": 1
       }

????????:

{
            "jsonrpc": "2.0",
            "result": "44",
            "????": 1
       }

????? ?????? ??????? ????? ??????

??? ?????? ???? ???? ?? ????? "???" ??? ??? ?????? ???? "10050" ?? "10071". ???? ?? ?????? ??? ?? ????? ???? ???? ? ?????? ?? ?? ?-5 ??????.

?????????:

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

????????:

{
            "jsonrpc": "2.0",
            "?????": [
                {
                    "hostid": "50003",
                    "host": "WebServer-Tomcat02",
                    "??????": [
                        {
                            "port": "10071"
                        }
                    ]
                },
                {
                    "hostid": "50005",
                    "host": "WebServer-Tomcat01",
                    "??????": [
                        {
                            "port": "10071"
                        }
                    ]
                },
                {
                    "hostid": "50004",
                    "host": "WebServer-Nginx",
                    "??????": [
                        {
                            "port": "10071"
                        }
                    ]
                },
                {
                    "hostid": "99032",
                    "host": "??? MySQL 01",
                    "??????": [
                        {
                            "port": "10050"
                        }
                    ]
                },
                {
                    "hostid": "99061",
                    "host": "??? ?????? 01",
                    "??????": [
                        {
                            "port": "10050"
                        }
                    ]
                }
            ],
            "????": 1
       }

????? ?????? ??????? ????? ?????? ?? "?????? ?????"

?? ????? ?? ?????? "preservekeys" ????? ??????, ?- ?????? ?????? ????? ??????????, ???? ??????? ?? ????? ?? ??????.

?????????:

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

????????:

{
            "jsonrpc": "2.0",
            "?????": {
                "50003": {
                    "hostid": "50003",
                    "host": "WebServer-Tomcat02",
                    "??????": [
                        {
                            "port": "10071"
                        }
                    ]
                },
                "50005": {
                    "hostid": "50005",
                    "host": "WebServer-Tomcat01",
                    "??????": [
                        {
                            "port": "10071"
                        }
                    ]
                },
                "50004": {
                    "hostid": "50004",
                    "host": "WebServer-Nginx",
                    "??????": [
                        {
                            "port": "10071"
                        }
                    ]
                },
                "99032": {
                    "hostid": "99032",
                    "host": "??? MySQL 01",
                    "??????": [
                        {
                            "port": "10050"
                        }
                    ]
                },
                "99061": {
                    "hostid": "99061",
                    "host": "??? ?????? 01",
                    "??????": [
                        {
                            "port": "10050"
                        }
                    ]
                }
            },
            "????": 1
       }