Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
23c40c89ee | ||
![]() |
77f84944c7 |
@@ -0,0 +1,43 @@
|
|||||||
|
import defineAction from '../../../../helpers/define-action.js';
|
||||||
|
|
||||||
|
export default defineAction({
|
||||||
|
name: 'Acknowledge incident',
|
||||||
|
key: 'acknowledgeIncident',
|
||||||
|
description: 'Acknowledges an incident.',
|
||||||
|
arguments: [
|
||||||
|
{
|
||||||
|
label: 'Incident ID',
|
||||||
|
key: 'incidentId',
|
||||||
|
type: 'string',
|
||||||
|
required: true,
|
||||||
|
variables: true,
|
||||||
|
description:
|
||||||
|
'This serves as the incident ID that requires your acknowledgment.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Acknowledged by',
|
||||||
|
key: 'acknowledgedBy',
|
||||||
|
type: 'string',
|
||||||
|
required: false,
|
||||||
|
variables: true,
|
||||||
|
description:
|
||||||
|
"This refers to the individual's name, email, or another form of identification that the person who acknowledged the incident has provided.",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
|
||||||
|
async run($) {
|
||||||
|
const acknowledgedBy = $.step.parameters.acknowledgedBy;
|
||||||
|
const incidentId = $.step.parameters.incidentId;
|
||||||
|
|
||||||
|
const body = {
|
||||||
|
acknowledged_by: acknowledgedBy,
|
||||||
|
};
|
||||||
|
|
||||||
|
const response = await $.http.post(
|
||||||
|
`/v2/incidents/${incidentId}/acknowledge`,
|
||||||
|
body
|
||||||
|
);
|
||||||
|
|
||||||
|
$.setActionItem({ raw: response.data.data });
|
||||||
|
},
|
||||||
|
});
|
@@ -0,0 +1,120 @@
|
|||||||
|
import defineAction from '../../../../helpers/define-action.js';
|
||||||
|
|
||||||
|
export default defineAction({
|
||||||
|
name: 'Create incident',
|
||||||
|
key: 'createIncident',
|
||||||
|
description: 'Creates an incident that informs the team.',
|
||||||
|
arguments: [
|
||||||
|
{
|
||||||
|
label: 'Brief Summary',
|
||||||
|
key: 'briefSummary',
|
||||||
|
type: 'string',
|
||||||
|
required: true,
|
||||||
|
variables: true,
|
||||||
|
description: 'A short description outlining the issue.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Description',
|
||||||
|
key: 'description',
|
||||||
|
type: 'string',
|
||||||
|
required: false,
|
||||||
|
variables: true,
|
||||||
|
description:
|
||||||
|
'An elaborate description of the situation, offering insights into what is occurring, along with instructions to reproduce the problem.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Requester Email',
|
||||||
|
key: 'requesterEmail',
|
||||||
|
type: 'string',
|
||||||
|
required: true,
|
||||||
|
variables: true,
|
||||||
|
description:
|
||||||
|
'This represents the email address of the individual who initiated the incident request.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Alert Settings - Call',
|
||||||
|
key: 'alertSettingsCall',
|
||||||
|
type: 'dropdown',
|
||||||
|
required: true,
|
||||||
|
description: 'Should we call the on-call person?',
|
||||||
|
variables: true,
|
||||||
|
options: [
|
||||||
|
{ label: 'Yes', value: 'true' },
|
||||||
|
{ label: 'No', value: 'false' },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Alert Settings - Text',
|
||||||
|
key: 'alertSettingsText',
|
||||||
|
type: 'dropdown',
|
||||||
|
required: true,
|
||||||
|
description: 'Should we text the on-call person?',
|
||||||
|
variables: true,
|
||||||
|
options: [
|
||||||
|
{ label: 'Yes', value: 'true' },
|
||||||
|
{ label: 'No', value: 'false' },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Alert Settings - Email',
|
||||||
|
key: 'alertSettingsEmail',
|
||||||
|
type: 'dropdown',
|
||||||
|
required: true,
|
||||||
|
description: 'Should we email the on-call person?',
|
||||||
|
variables: true,
|
||||||
|
options: [
|
||||||
|
{ label: 'Yes', value: 'true' },
|
||||||
|
{ label: 'No', value: 'false' },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Alert Settings - Push Notification',
|
||||||
|
key: 'alertSettingsPushNotification',
|
||||||
|
type: 'dropdown',
|
||||||
|
required: true,
|
||||||
|
description: 'Should we send a push notification to the on-call person?',
|
||||||
|
variables: true,
|
||||||
|
options: [
|
||||||
|
{ label: 'Yes', value: 'true' },
|
||||||
|
{ label: 'No', value: 'false' },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Team Alert Wait Time',
|
||||||
|
key: 'teamAlertWaitTime',
|
||||||
|
type: 'string',
|
||||||
|
required: true,
|
||||||
|
variables: true,
|
||||||
|
description:
|
||||||
|
"What is the time threshold for acknowledgment before escalating to the entire team? (Specify in seconds) - Use a negative value to indicate no team alert if the on-call person doesn't respond, and use 0 for an immediate alert to the entire team.",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
|
||||||
|
async run($) {
|
||||||
|
const {
|
||||||
|
briefSummary,
|
||||||
|
description,
|
||||||
|
requesterEmail,
|
||||||
|
alertSettingsCall,
|
||||||
|
alertSettingsText,
|
||||||
|
alertSettingsEmail,
|
||||||
|
alertSettingsPushNotification,
|
||||||
|
teamAlertWaitTime,
|
||||||
|
} = $.step.parameters;
|
||||||
|
|
||||||
|
const body = {
|
||||||
|
summary: briefSummary,
|
||||||
|
description,
|
||||||
|
requester_email: requesterEmail,
|
||||||
|
call: alertSettingsCall,
|
||||||
|
sms: alertSettingsText,
|
||||||
|
email: alertSettingsEmail,
|
||||||
|
push: alertSettingsPushNotification,
|
||||||
|
team_wait: teamAlertWaitTime,
|
||||||
|
};
|
||||||
|
|
||||||
|
const response = await $.http.post('/v2/incidents', body);
|
||||||
|
|
||||||
|
$.setActionItem({ raw: response.data.data });
|
||||||
|
},
|
||||||
|
});
|
4
packages/backend/src/apps/better-stack/actions/index.js
Normal file
4
packages/backend/src/apps/better-stack/actions/index.js
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
import acknowledgeIncident from './acknowledge-incident/index.js';
|
||||||
|
import createIncident from './create-incident/index.js';
|
||||||
|
|
||||||
|
export default [acknowledgeIncident, createIncident];
|
@@ -1,6 +1,7 @@
|
|||||||
import defineApp from '../../helpers/define-app.js';
|
import defineApp from '../../helpers/define-app.js';
|
||||||
import addAuthHeader from './common/add-auth-header.js';
|
import addAuthHeader from './common/add-auth-header.js';
|
||||||
import auth from './auth/index.js';
|
import auth from './auth/index.js';
|
||||||
|
import actions from './actions/index.js';
|
||||||
|
|
||||||
export default defineApp({
|
export default defineApp({
|
||||||
name: 'Better Stack',
|
name: 'Better Stack',
|
||||||
@@ -13,4 +14,5 @@ export default defineApp({
|
|||||||
primaryColor: '000000',
|
primaryColor: '000000',
|
||||||
beforeRequest: [addAuthHeader],
|
beforeRequest: [addAuthHeader],
|
||||||
auth,
|
auth,
|
||||||
|
actions,
|
||||||
});
|
});
|
||||||
|
@@ -37,6 +37,7 @@ export default defineConfig({
|
|||||||
collapsible: true,
|
collapsible: true,
|
||||||
collapsed: true,
|
collapsed: true,
|
||||||
items: [
|
items: [
|
||||||
|
{ text: 'Actions', link: '/apps/better-stack/actions' },
|
||||||
{ text: 'Connection', link: '/apps/better-stack/connection' },
|
{ text: 'Connection', link: '/apps/better-stack/connection' },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
14
packages/docs/pages/apps/better-stack/actions.md
Normal file
14
packages/docs/pages/apps/better-stack/actions.md
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
---
|
||||||
|
favicon: /favicons/better-stack.svg
|
||||||
|
items:
|
||||||
|
- name: Acknowledge incident
|
||||||
|
desc: Acknowledges an incident.
|
||||||
|
- name: Create incident
|
||||||
|
desc: Creates an incident that informs the team.
|
||||||
|
---
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import CustomListing from '../../components/CustomListing.vue'
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<CustomListing />
|
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
The following integrations are currently supported by Automatisch.
|
The following integrations are currently supported by Automatisch.
|
||||||
|
|
||||||
|
- [Better Stack](/apps/better-stack/actions)
|
||||||
- [Carbone](/apps/carbone/actions)
|
- [Carbone](/apps/carbone/actions)
|
||||||
- [DeepL](/apps/deepl/actions)
|
- [DeepL](/apps/deepl/actions)
|
||||||
- [Delay](/apps/delay/actions)
|
- [Delay](/apps/delay/actions)
|
||||||
|
Reference in New Issue
Block a user