The method allows to retrieve templates according to the given parameters该方法允许根据指定的参数检索模板.

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

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

    Retrieving templates by name按名称检索模板

    Request请求:

    Response响应:

    1. {
    2. "jsonrpc": "2.0",
    3. "result": [
    4. {
    5. "proxy_hostid": "0",
    6. "host": "Template OS Linux",
    7. "status": "3",
    8. "disable_until": "0",
    9. "error": "",
    10. "available": "0",
    11. "errors_from": "0",
    12. "lastaccess": "0",
    13. "ipmi_authtype": "0",
    14. "ipmi_privilege": "2",
    15. "ipmi_username": "",
    16. "ipmi_password": "",
    17. "ipmi_disable_until": "0",
    18. "ipmi_available": "0",
    19. "snmp_disable_until": "0",
    20. "snmp_available": "0",
    21. "maintenanceid": "0",
    22. "maintenance_status": "0",
    23. "maintenance_type": "0",
    24. "maintenance_from": "0",
    25. "ipmi_errors_from": "0",
    26. "ipmi_error": "",
    27. "snmp_error": "",
    28. "jmx_disable_until": "0",
    29. "jmx_available": "0",
    30. "jmx_errors_from": "0",
    31. "jmx_error": "",
    32. "name": "Template OS Linux",
    33. "flags": "0",
    34. "templateid": "10001",
    35. "description": "",
    36. "tls_connect": "1",
    37. "tls_accept": "1",
    38. "tls_issuer": "",
    39. "tls_subject": "",
    40. "tls_psk_identity": "",
    41. "tls_psk": ""
    42. },
    43. {
    44. "proxy_hostid": "0",
    45. "host": "Template OS Windows",
    46. "status": "3",
    47. "disable_until": "0",
    48. "error": "",
    49. "available": "0",
    50. "errors_from": "0",
    51. "lastaccess": "0",
    52. "ipmi_authtype": "0",
    53. "ipmi_privilege": "2",
    54. "ipmi_username": "",
    55. "ipmi_password": "",
    56. "ipmi_disable_until": "0",
    57. "snmp_disable_until": "0",
    58. "snmp_available": "0",
    59. "maintenanceid": "0",
    60. "maintenance_status": "0",
    61. "maintenance_type": "0",
    62. "maintenance_from": "0",
    63. "ipmi_errors_from": "0",
    64. "snmp_errors_from": "0",
    65. "ipmi_error": "",
    66. "snmp_error": "",
    67. "jmx_disable_until": "0",
    68. "jmx_available": "0",
    69. "jmx_errors_from": "0",
    70. "jmx_error": "",
    71. "name": "Template OS Windows",
    72. "flags": "0",
    73. "templateid": "10081",
    74. "description": "",
    75. "tls_connect": "1",
    76. "tls_accept": "1",
    77. "tls_issuer": "",
    78. "tls_subject": "",
    79. "tls_psk_identity": "",
    80. "tls_psk": ""
    81. }
    82. ],
    83. "id": 1
    84. }

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