Commit dac96720 authored by Nils Bandener's avatar Nils Bandener
Browse files

Added activate APIs

parent 2fc0e6e9
......@@ -67,3 +67,8 @@ This will give this role complete access to all Signals features and indices.
* [Get Settings](rest_api_settings_get.md)
* [Put Settings](rest_api_settings_put.md)
## Administration APIs
* [Activate and Deactivate Execution for Tenant](rest_api_tenant_activate.md)
* [Activate and Deactivate Execution Globally](rest_api_admin_activate.md)
\ No newline at end of file
---
title: Activate and deactivate watch
html_title: Activating and deactivating a watch with the REST API
slug: elasticsearch-alerting-rest-api-watch-activate
category: signals-rest
order: 500
layout: docs
edition: beta
description:
---
<!--- Copyright 2019 floragunn GmbH -->
# Activate/Deactivate Signals API
{: .no_toc}
{% include toc.md %}
## Endpoint
```
PUT /_signals/admin/_active
```
```
DELETE /_signals/admin/_active
```
These endpoints can be used to globally activate and deactivate the execution of all watches in Signals.
Using the PUT verb activates the execution, using the DELETE verb deactivates the execution.
This is equivalent to changing the value of the Signals setting `active`. However, this API requires a distinct permission. Thus, it is possible to allow a user activation and deactivation of Signals while the user cannot change other settings.
## Request Body
No request body is required for this endpoint.
## Responses
### 200 OK
The execution was successfully enabled or disabled.
### 403 Forbidden
The user does not have the permission to activate or deactivate the execution globally.
## Permissions
For being able to access the endpoint, the user needs to have the privilege `cluster:admin:searchguard:signals:admin/start_stop` .
This permission is included in the following [built-in action groups](security_permissions.md):
* SGS\_SIGNALS\_ALL
---
title: Activate and deactivate watch
html_title: Activating and deactivating a watch with the REST API
slug: elasticsearch-alerting-rest-api-watch-activate
category: signals-rest
order: 500
layout: docs
edition: beta
description:
---
<!--- Copyright 2019 floragunn GmbH -->
# Activate/Deactivate Signals API
{: .no_toc}
{% include toc.md %}
## Endpoint
```
PUT /_signals/tenant/{tenant}/_active
```
```
DELETE /_signals/tenant/{tenant}/_active
```
These endpoints can be used to activate and deactivate the execution of all watches configured for a Signals tenant.
Using the PUT verb activates the execution, using the DELETE verb deactivates the execution.
This is equivalent to changing the value of the Signals setting `tenant.{tenant}.active`. However, this API requires a distinct permission. Thus, it is possible to allow a user activation and deactivation of a tenant while the user cannot change other settings.
## Path Parameters
**{tenant}:** The name of the tenant to be activated or deactivated. `_main` refers to the default tenant. Users of the community edition will can only use `_main` here.
## Request Body
No request body is required for this endpoint.
## Responses
### 200 OK
The execution was successfully enabled or disabled.
### 403 Forbidden
The user does not have the permission to activate or deactivate the execution of a tenant.
## Permissions
For being able to access the endpoint, the user needs to have the privilege `cluster:admin:searchguard:tenant:signals:tenant/start_stop` .
This permission is included in the following [built-in action groups](security_permissions.md):
* SGS\_SIGNALS\_ALL
......@@ -20,15 +20,17 @@ description:
## Endpoint
```
PUT /_signals/watch/{tenant}/{watch_id}/_activate
PUT /_signals/watch/{tenant}/{watch_id}/_active
```
```
PUT /_signals/watch/{tenant}/{watch_id}/_deactivate
DELETE /_signals/watch/{tenant}/{watch_id}/_active
```
These endpoints can be used to activate and deactivate watches. Inactive watches are not automatically executed.
Using the PUT verb activates a watch, using the DELETE verb deactivates a watch.
## Path Parameters
**{tenant}:** The name of the tenant which contains the watch to be activated or deactivated. `_main` refers to the default tenant. Users of the community edition will can only use `_main` here.
......@@ -66,10 +68,10 @@ This permission is included in the following [built-in action groups](security_p
## Examples
### Basic
### Deactivate a Watch
```
PUT /_signals/watch/_main/bad_weather/_deactivate
DELETE /_signals/watch/_main/bad_weather/_active
```
**Response**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment