URL: https://123.123.123.123/hosttemplates/add.json
Methode: POST
Response: HTML
JSON zum Erzeugen eines Hosttemplates via REST API { "Hosttemplate":{ "container_id":1, "name":"api hosttemplate", "description":"api hosttemplate description", "Hostgroup":[], "notes":"api hosttemplate notes", "host_url":"http://api-hosttemplate.url", "priority":1, "tags":"api hosttemplate tags", "notify_period_id":1, "notification_interval":7200, "notify_on_recovery":1, "notify_on_down":1, "notify_on_unreachable":1, "notify_on_flapping":0, "notify_on_downtime":0, "active_checks_enabled":0, "Contact":[1], "Contactgroup":[], "command_id":4, "check_period_id":1, "max_check_attempts":3, "check_interval":600, "retry_interval":60, "flap_detection_enabled":0, "flap_detection_on_up":0, "flap_detection_on_down":0, "flap_detection_on_unreachable":0 }, "Hosttemplatecommandargumentvalue":{ "3":{ "value":"123", "commandargument_id":3 }, "4":{ "value":"456", "commandargument_id":4 } }, "Customvariable":{ "1":{ "name":"NAME1", "value":"value1", "objecttype_id":512 } } } Minimales JSON { "Hosttemplate":{ "container_id":1, "name":"api hosttemplate", "priority":1, "notify_period_id":1, "notification_interval":7200, "notify_on_recovery":1, "notify_on_down":1, "notify_on_unreachable":1, "notify_on_flapping":0, "notify_on_downtime":0, "active_checks_enabled":0, "Contact":[1], "Contactgroup":[], "command_id":4, "check_period_id":1, "max_check_attempts":3, "check_interval":600, "retry_interval":60 } } Response bei erfolgreichem Aufruf { "id": "$HOSTTEMPLATE_ID" } |