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

    Parameters 参数

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

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

    (integer/array) Returns either:

    • the count of retrieved objects, if the countOutput parameter has been used.

    Examples示例

    Retrieving item prototypes from an LLD rule

    Retrieve all item prototypes from an LLD rule.

    Request:

    Response:

    1. {
    2. "jsonrpc": "2.0",
    3. "result": [
    4. {
    5. "itemid": "27427",
    6. "type": "0",
    7. "snmp_community": "",
    8. "snmp_oid": "",
    9. "hostid": "10202",
    10. "name": "Incoming network traffic on $1 23",
    11. "key_": "2net.if.in[{#IFNAME}]",
    12. "delay": "1m",
    13. "history": "7d",
    14. "trends": "365d",
    15. "status": "0",
    16. "value_type": "3",
    17. "trapper_hosts": "",
    18. "units": "bps",
    19. "multiplier": "1",
    20. "delta": "1",
    21. "snmpv3_securityname": "",
    22. "snmpv3_securitylevel": "0",
    23. "snmpv3_authpassphrase": "",
    24. "snmpv3_privpassphrase": "",
    25. "logtimefmt": "",
    26. "templateid": "23881",
    27. "valuemapid": "0",
    28. "params": "",
    29. "ipmi_sensor": "",
    30. "data_type": "0",
    31. "authtype": "0",
    32. "username": "",
    33. "password": "",
    34. "publickey": "",
    35. "privatekey": "",
    36. "mtime": "0",
    37. "filter": "",
    38. "interfaceid": "119",
    39. "port": "",
    40. "description": "",
    41. "snmpv3_authprotocol": "0",
    42. "snmpv3_privprotocol": "0"
    43. },
    44. {
    45. "itemid": "27428",
    46. "type": "0",
    47. "snmp_community": "",
    48. "snmp_oid": "",
    49. "hostid": "10202",
    50. "name": "Incoming network traffic on $1",
    51. "key_": "net.if.in[{#IFNAME}]",
    52. "delay": "1m",
    53. "history": "7d",
    54. "trends": "365d",
    55. "status": "0",
    56. "value_type": "3",
    57. "trapper_hosts": "",
    58. "multiplier": "1",
    59. "delta": "1",
    60. "snmpv3_securityname": "",
    61. "snmpv3_securitylevel": "0",
    62. "snmpv3_authpassphrase": "",
    63. "snmpv3_privpassphrase": "",
    64. "formula": "8",
    65. "logtimefmt": "",
    66. "templateid": "22446",
    67. "valuemapid": "0",
    68. "params": "",
    69. "ipmi_sensor": "",
    70. "data_type": "0",
    71. "authtype": "0",
    72. "username": "",
    73. "password": "",
    74. "publickey": "",
    75. "privatekey": "",
    76. "mtime": "0",
    77. "filter": "",
    78. "interfaceid": "119",
    79. "port": "",
    80. "description": "",
    81. "snmpv3_authprotocol": "0",
    82. "snmpv3_privprotocol": "0"
    83. }
    84. ],
    85. "id": 1
    86. }

    Source 来源

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