The method allows to retrieve host prototypes according to the given parameters.该方法允许根据给定的参数检索主机原型。

    Parameters 参数

    (object) Parameters defining the desired output.定义所需输出的参数。

    The method supports the following parameters.该方法支持以下参数。

    • an array of objects;一组对象;

    • the count of retrieved objects, if the parameter has been used.如果已经使用“countOutput”参数,则检索到的对象的计数。

    Examples 示例

    Retrieving host prototypes from an LLD rule从LLD规则检索主机原型

    Retrieve all host prototypes and their group links and group prototypes from an LLD rule.从LLD规则中检索所有主机原型及其组链接和组原型。

    Response:

    1. {
    2. "jsonrpc": "2.0",
    3. "result": [
    4. {
    5. "hostid": "10092",
    6. "host": "{#HV.UUID}",
    7. "name": "{#HV.NAME}",
    8. "templateid": "0",
    9. "tls_connect": "1",
    10. "tls_accept": "1",
    11. "tls_issuer": "",
    12. "tls_subject": "",
    13. "tls_psk_identity": "",
    14. "tls_psk": "",
    15. "groupLinks": [
    16. {
    17. "group_prototypeid": "4",
    18. "hostid": "10092",
    19. "groupid": "7",
    20. "templateid": "0"
    21. }
    22. "groupPrototypes": [
    23. {
    24. "group_prototypeid": "7",
    25. "hostid": "10092",
    26. "name": "{#CLUSTER.NAME}",
    27. "templateid": "0"
    28. }
    29. ]
    30. }
    31. ],
    32. "id": 1
    33. }

    Source 来源

    CHostPrototype::get() in frontends/php/include/classes/api/services/CHostPrototype.php.