remove automatic add to status page + add apdex_t for updown.io

This commit is contained in:
Emilien Devos 2024-05-15 13:51:56 +02:00
parent c1d870cb15
commit 1b68e2610f

View File

@ -62,43 +62,14 @@ jobs:
period: '300',
mute_until: 'forever',
published: 'true',
apdex_t: '1.0',
alias: instanceHostname,
string_match: 'An alternative front-end to YouTube' } };
request(optionsAddNewCheck, async function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
if (body.token) {
var optionsGetStatusPages = {
method: 'GET',
url: 'https://updown.io/api/status_pages?api-key=${{ secrets.UPDOWN_API_KEY }}',
json: true
};
request(optionsGetStatusPages, async function (error, response, body) {
if (error) throw new Error(error);
const statusPage = body.filter(element => element.token === "resvf");
let checksOfStatusPage = statusPage[0].checks;
checksOfStatusPage.push(body.token)
var optionsAddCheckToStatusPage = {
method: 'PUT',
url: 'https://updown.io/api/status_pages/resvf?api-key=${{ secrets.UPDOWN_API_KEY }}',
headers: {
'content-type': 'application/json'
},
json: {checks: checksOfStatusPage}
};
request(optionsAddCheckToStatusPage, async function (error, response, body) {
if (error) throw new Error(error);
console.log(body)
});
});
var replyComment =
['Hello! Your instance has been added to our monitoring system: https://updown.io/' + body.token,
'You need to wait 30 days before we add your instance, this is to evaluate that your instance will keep a good uptime for one month.',