This is an super simple API which get you know some value changes! Implemented with Serverless. So this service couldn't be down as long as AWS services are going well.
You can watch for example, registration count of some service, a product price, temparature, .etc. Anything which has value can be monitored.
Of cource you can build in your private environment and run:smile:
- Create your resource that is to be monitored. Define initial value and Slack webhook info for receive notifications.
- Just only PUT a value continuously.
POST a JSON to create a resource.
https://monitor.ecp.plus/resources
JSON schema is following.
{
"name": "TEST",
"initialValue": 0,
"slack": {
"url": "https://hooks.slack.com/services/AAAA/1111/qwerty",
"channel": "#value_test",
"template": "Users count is {value}",
"icon_emoji": ":smile:"
}
}
All fields except slack.icon_emoji
are required.
template
. It includes a special placeholder {value}
. When posting a notification, the {value}
will be replaced to the actual value.
curl https://monitor.ecp.plus/resources -X POST -d "{name: 'Registration count', initialValue: 0, slack: {url: 'https://hooks.slack.com/services/1111/AAAA/qwerty', channel: '#value_changing_test', template: 'Awesome value is {value}'
, icon_emoji: ':smile:'}}"
{
"uuid": "f0d675cf-b8dc-46c9-9536-23ab358d2817",
"name": "Registration count",
"value": 0
}
Please keep the uuid
.
You will use uuid
to PUT values.
If PUT value is different from previous value, you will receive a Slack notification.
https://monitor.ecp.plus/resources/{uuid}
{uuid}
is that you got when creating.
PUT only a value.
{
"value": 100
}
curl https://monitor.ecp.plus/resources/f0d675cf-b8dc-46c9-9536-23ab358d2817 -X PUT -d "{value: 100}"
If the value has changed.
{
"result": "changed"
}
If the value hasn't changed.
{
"result": "not changed"
}