Mutators API
The /mutators
API endpoint
/mutators
(GET)
The /mutators
API endpoint provides HTTP GET access to mutator data.
EXAMPLE
The following example demonstrates a request to the /mutators
API, resulting in
a JSON Array containing mutator definitions.
curl http://127.0.0.1:8080/api/core/v2/namespaces/default/mutators -H "Authorization: Bearer $SENSU_TOKEN"
[
{
"metadata": {
"name": "example-mutator",
"namespace": "default",
"labels": null,
"annotations": null
},
"command": "example_mutator.go",
"timeout": 0,
"env_vars": [],
"runtime_assets": []
}
]
API Specification
/mutators (GET) | |
---|---|
description | Returns the list of mutators. |
example url | http://hostname:8080/api/core/v2/namespaces/default/mutators |
pagination | This endpoint supports pagination using the limit and continue query parameters. See the API overview for details. |
response type | Array |
response codes |
|
output |
|
/mutators
(POST)
/mutators (POST) | |
---|---|
description | Create a Sensu mutator. |
example URL | http://hostname:8080/api/core/v2/namespaces/default/mutators |
payload |
|
response codes |
|
The /mutators/:mutator
API endpoint
/mutators/:mutator
(GET)
The /mutators/:mutator
API endpoint provides HTTP GET access to mutator data for specific :mutator
definitions, by mutator name
.
EXAMPLE
In the following example, querying the /mutators/:mutator
API returns a JSON Map
containing the requested :mutator
definition (in this example: for the :mutator
named
example-mutator
).
curl http://127.0.0.1:8080/api/core/v2/namespaces/default/mutators/example-mutator -H "Authorization: Bearer $SENSU_TOKEN"
{
"metadata": {
"name": "example-mutator",
"namespace": "default",
"labels": null,
"annotations": null
},
"command": "example_mutator.go",
"timeout": 0,
"env_vars": [],
"runtime_assets": []
}
API Specification
/mutators/:mutator (GET) | |
---|---|
description | Returns a mutator. |
example url | http://hostname:8080/api/core/v2/namespaces/default/mutators/mutator-name |
response type | Map |
response codes |
|
output |
|
/mutators/:mutator
(PUT)
API Specification
/mutators/:mutator (PUT) | |
---|---|
description | Create or update a Sensu mutator. |
example URL | http://hostname:8080/api/core/v2/namespaces/default/mutators/example-mutator |
payload |
|
response codes |
|
/mutators/:mutator
(DELETE)
The /mutators/:mutator
API endpoint provides HTTP DELETE access to delete a mutator from Sensu given the mutator name.
EXAMPLE
The following example shows a request to delete the mutator example-mutator
, resulting in a successful HTTP 204 No Content response.
curl -X DELETE \
-H "Authorization: Bearer $SENSU_TOKEN" \
http://127.0.0.1:8080/api/core/v2/namespaces/default/mutators/example-mutator
HTTP/1.1 204 No Content
API Specification
/mutators/:mutator (DELETE) | |
---|---|
description | Removes a mutator from Sensu given the mutator name. |
example url | http://hostname:8080/api/core/v2/namespaces/default/mutators/example-mutator |
response codes |
|