const axios = require('axios');
const url = "https://incident-query.api.pinghome.io/default/v1/rulesets";
axios.get(url, {
headers: {
'Authorization': 'Bearer YOUR_TOKEN'
}
})
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error(error);
});
const axios = require('axios');
const url = 'https://incident-cmd.api.pinghome.io/default/v1/ruleset';
const data = {
rule_type: 'state-change',
conditions: [{ values: ['10'], operator: 'equal', type: 'json-check', key: 'products[0].count' }],
level: 'team',
team_id: 'c03b02ec-244f-4d2c-8f68-3910071ed5c8',
name: 'Name',
description: 'Description',
urgency: 'medium',
assignees: [{ type: 'team', id: '445a5c1f-c0eb-403a-96d7-3976e5dc74ed' }]
};
axios.post(url, data, {
headers: {
'Authorization': 'Bearer YOUR_TOKEN',
'Content-Type': 'application/json'
}
})
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error(error);
});
const axios = require('axios');
const url = 'https://incident-cmd.api.pinghome.io/default/v1/ruleset/c03b02ec-244f-4d2c-8f68-3910071ed5c8';
const data = {
rule_type: 'state-change',
conditions: [{ values: ['10'], operator: 'equal', type: 'json-check', key: 'products[0].count' }],
level: 'team',
team_id: 'c03b02ec-244f-4d2c-8f68-3910071ed5c8',
name: 'Name',
description: 'Description',
urgency: 'medium',
assignees: [{ type: 'team', id: '445a5c1f-c0eb-403a-96d7-3976e5dc74ed' }]
};
axios.put(url, data, {
headers: {
'Authorization': 'Bearer YOUR_TOKEN',
'Content-Type': 'application/json'
}
})
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error(error);
});
const axios = require('axios');
const url = 'https://incident-cmd.api.pinghome.io/default/v1/ruleset/c03b02ec-244f-4d2c-8f68-3910071ed5c8';
axios.delete(url, {
headers: {
'Authorization': 'Bearer YOUR_TOKEN'
}
})
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error(error);
});
const axios = require('axios');
const url = "https://incident-query.api.pinghome.io/default/v1/ruleset/c03b02ec-244f-4d2c-8f68-3910071ed5c8/actions";
axios.get(url, {
headers: {
'Authorization': 'Bearer YOUR_TOKEN'
}
})
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error(error);
});
const axios = require('axios');
const url = 'https://incident-cmd.api.pinghome.io/default/v1/ruleset/445a5c1f-c0eb-403a-96d7-3976e5dc74ed/actions';
const data = {
actions: [
{
type: 'trigger-alerts',
settings: [
{
status_page_id: '445a5c1f-c0eb-403a-96d7-3976e5dc74ed',
component_id: '445a5c1f-c0eb-403a-96d7-3976e5dc74ed'
}
]
}
]
};
axios.put(url, data, {
headers: {
'Authorization': 'Bearer YOUR_TOKEN',
'Content-Type': 'application/json'
}
})
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error(error);
});
const axios = require('axios');
const url = "https://incident-query.api.pinghome.io/default/v1/webhooks";
axios.get(url, {
headers: {
'Authorization': 'Bearer YOUR_TOKEN'
}
})
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error(error);
});
const axios = require('axios');
const url = "https://incident-query.api.pinghome.io/default/v1/webhook/c03b02ec-244f-4d2c-8f68-3910071ed5c8/events?limit=10&last_received_at=2024-03-15T19:09:39Z";
axios.get(url, {
headers: {
'Authorization': 'Bearer YOUR_TOKEN'
}
})
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error(error);
});
const axios = require('axios');
const url = 'https://incident-cmd.api.pinghome.io/default/v1/webhook';
const data = {
name: "Webhook name",
description: "Webhook description"
};
axios.post(url, data, {
headers: {
'Authorization': 'Bearer YOUR_TOKEN',
'Content-Type': 'application/json'
}
})
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error(error);
});
const axios = require('axios');
const url = 'https://data-gateway.api.pinghome.io/default/v1/incident/webhook/{id}';
const data = {
example_key: 'example_value'
};
axios.post(url, data, {
headers: {
'Content-Type': 'application/json'
}
})
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error(error);
});