获取

    此方法允许根据给出的参数检索Web场景。

    此方法适用于任何类型的用户。可以在用户角色设置中撤销调用该方法的权限。更多信息请查看 User roles

    参数

    此方法支持以下参数。

    (integer/array) 返回以下其中一种结果:

    • 一个对象数组;
    • 如果使用了参数countOutput,则返回检索到的对象的数量。

    示例

    检索一个Web场景

    请求:

    响应:

    1. {
    2. "jsonrpc": "2.0",
    3. "result": [
    4. {
    5. "httptestid": "9",
    6. "name": "Homepage check",
    7. "nextcheck": "0",
    8. "delay": "1m",
    9. "status": "0",
    10. "variables": [],
    11. "agent": "Zabbix",
    12. "authentication": "0",
    13. "http_user": "",
    14. "http_password": "",
    15. "templateid": "0",
    16. "retries": "1",
    17. "ssl_cert_file": "",
    18. "ssl_key_file": "",
    19. "ssl_key_password": "",
    20. "verify_peer": "0",
    21. "verify_host": "0",
    22. "headers": [],
    23. "steps": [
    24. {
    25. "httpstepid": "36",
    26. "httptestid": "9",
    27. "name": "Homepage",
    28. "no": "1",
    29. "url": "http://example.com",
    30. "timeout": "15s",
    31. "posts": "",
    32. "required": "",
    33. "status_codes": "200",
    34. "variables": [
    35. {
    36. "name":"{var}",
    37. "value":"12"
    38. }
    39. "follow_redirects": "1",
    40. "headers": [],
    41. "query_fields": []
    42. },
    43. {
    44. "httpstepid": "37",
    45. "httptestid": "9",
    46. "name": "Homepage / About",
    47. "no": "2",
    48. "url": "http://example.com/about",
    49. "timeout": "15s",
    50. "posts": "",
    51. "required": "",
    52. "status_codes": "200",
    53. "variables": [],
    54. "follow_redirects": "1",
    55. "retrieve_mode": "0",
    56. "headers": [],
    57. "query_fields": []
    58. }
    59. ]
    60. }
    61. ],
    62. "id": 1

    来源