mirror of https://github.com/Icinga/icinga2.git
Update status code
This commit is contained in:
parent
cb32786880
commit
edbd8688fb
|
@ -626,13 +626,13 @@ Dictionary::Ptr ApiActions::ExecuteCommand(const ConfigObject::Ptr& object,
|
|||
/* Check if resolved_command exists and it is of type command_type */
|
||||
if (command_type == "CheckCommand") {
|
||||
if (!CheckCommand::GetByName(resolved_command))
|
||||
return ApiActions::CreateResult(400, "Can't find a valid " + command_type + " for '" + resolved_command + "'.");
|
||||
return ApiActions::CreateResult(404, "Can't find a valid " + command_type + " for '" + resolved_command + "'.");
|
||||
} else if (command_type == "EventCommand") {
|
||||
if (!EventCommand::GetByName(resolved_command))
|
||||
return ApiActions::CreateResult(400, "Can't find a valid " + command_type + " for '" + resolved_command + "'.");
|
||||
return ApiActions::CreateResult(404, "Can't find a valid " + command_type + " for '" + resolved_command + "'.");
|
||||
} else if (command_type == "NotificationCommand") {
|
||||
if (!NotificationCommand::GetByName(resolved_command))
|
||||
return ApiActions::CreateResult(400, "Can't find a valid " + command_type + " for '" + resolved_command + "'.");
|
||||
return ApiActions::CreateResult(404, "Can't find a valid " + command_type + " for '" + resolved_command + "'.");
|
||||
}
|
||||
|
||||
/* Get TTL param */
|
||||
|
|
Loading…
Reference in New Issue