Merge remote-tracking branch 'origin/2.3' into 2.4

This commit is contained in:
Markus Mäkelä 2020-03-30 10:23:35 +03:00
commit 6fdb7ed089
No known key found for this signature in database
GPG Key ID: 5CE746D557ACC499
3 changed files with 11 additions and 2 deletions

View File

@ -366,7 +366,7 @@ Invalid JSON body:
### Destroy a monitor
```
DELETE /v1/monitors/:name/stop
DELETE /v1/monitors/:name
```
Destroy a created monitor. The monitor must not have relationships to any

View File

@ -122,6 +122,11 @@ const service_fields = [
path: 'relationships.servers.data[].id',
description: 'Servers that the service uses'
},
{
name: 'Filters',
path: 'relationships.filters.data[].id',
description: 'Filters that the service uses'
},
{
name: 'Parameters',
path: 'attributes.parameters',

View File

@ -1352,7 +1352,11 @@ bool runtime_destroy_monitor(Monitor* monitor)
{
bool rval = false;
if (Service* s = service_uses_monitor(monitor))
if (!monitor->servers().empty())
{
config_runtime_error("Cannot destroy monitor '%s', it is monitoring servers.", monitor->name());
}
else if (Service* s = service_uses_monitor(monitor))
{
config_runtime_error("Monitor '%s' cannot be destroyed as it is used by service '%s'",
monitor->name(), s->name());