Seitenhierarchie
Zum Ende der Metadaten springen
Zum Anfang der Metadaten

URL: https://123.123.123.123/servicetemplates/add.json

Methode: POST

Response: JSON


JSON for creating a service template via REST API
{
    "Servicetemplate":{
        "container_id":1,
        "template_name":"api servicetemplate",
        "name":"api service through api servicetemplate",
        "description":"api servicetemplate description",
		"Servicegroup":[],
        "notes":"api servicetemplate notes",
        "priority":1,
        "notify_period_id":1,
        "notification_interval":7200,
        "notify_on_recovery":1,
        "notify_on_warning":1,
        "notify_on_unknown":1,
        "notify_on_critical":1,
        "notify_on_flapping":0,
        "notify_on_downtime":0,
        "process_performance_data":1,
        "active_checks_enabled":1,
        "Contact":[1],
        "Contactgroup":[],
        "command_id":3,
        "check_period_id":1,
        "max_check_attempts":3,
        "check_interval":300,
        "retry_interval":60,
        "tags":"api servicetemplate tags",
        "flap_detection_enabled":1,
        "flap_detection_on_ok":0,
        "flap_detection_on_warning":1,
        "flap_detection_on_unknown":0,
        "flap_detection_on_critical":1,
        "is_volatile":0,
        "freshness_checks_enabled":0,
        "freshness_threshold":60,
        "eventhandler_command_id":0
    },    
    "Servicetemplatecommandargumentvalue":{
        "1":{
            "value":"",
			"commandargument_id":1
        },
        "2":{
            "value":"",
			"commandargument_id":2
        }
    }
	"Customvariable":{
    	"1":{
    		"name" : "Custom1",
    		"value" : "$VALUE",
    		"objecttype_id":4096
    	}
    }
}
Minimal JSON
{
    "Servicetemplate":{
        "container_id":1,
        "template_name":"api servicetemplate minimal",
        "name":"api service through api servicetemplate",
        "notify_period_id":1,
        "notification_interval":7200,
        "notify_on_recovery":1,
        "notify_on_warning":1,
        "notify_on_unknown":1,
        "notify_on_critical":1,
        "notify_on_flapping":0,
        "notify_on_downtime":0,
        "command_id":3,
        "check_period_id":1,
        "max_check_attempts":3,
        "check_interval":300,
        "retry_interval":60
    }
}
Response bei erfolgreichem Aufruf
{
  "id": "$SERVICETEMPLATE_ID"
}
  • Keine Stichwörter