Last active
May 17, 2023 12:21
-
-
Save shairyar/2877e2a7024af32969b73b42acdf9fc5 to your computer and use it in GitHub Desktop.
Create uptime monitor in AppSignal using GraphQL API
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mutation createUptimeMonitorMutation($appId: String!, $uptimeMonitor: UptimeMonitorInput!) { | |
createUptimeMonitor(appId: $appId, uptimeMonitor: $uptimeMonitor) { | |
...UptimeMonitor | |
__typename | |
} | |
} | |
fragment UptimeMonitor on UptimeMonitor { | |
id | |
name | |
url | |
description | |
notifierIds | |
warmupDuration | |
checkBodyContent | |
regions | |
notifiers { | |
id | |
name | |
icon | |
__typename | |
} | |
headers { | |
key | |
value | |
__typename | |
} | |
alerts { | |
...Alert | |
__typename | |
} | |
statusPages { | |
...StatusPage | |
__typename | |
} | |
__typename | |
} | |
fragment Alert on Alert { | |
id | |
state | |
message | |
metricDigest | |
createdAt | |
openedAt | |
resolvedAt | |
closedAt | |
timeframeStartAt | |
timeframeEndAt | |
lastValue | |
peakValue | |
mean | |
tags { | |
key | |
value | |
__typename | |
} | |
__typename | |
} | |
fragment StatusPage on StatusPage { | |
id | |
title | |
hasSsl | |
forceSsl | |
hostname | |
description | |
threshold | |
uptimeMonitorIds | |
__typename | |
} |
To delete the uptime monitor
mutation deleteUptimeMonitorMutation($appId: String!, $id: String!) {
deleteUptimeMonitor(appId: $appId, id: $id) {
...UptimeMonitor
__typename
}
}
fragment UptimeMonitor on UptimeMonitor {
id
name
url
description
notifierIds
warmupDuration
checkBodyContent
regions
notifiers {
id
name
icon
__typename
}
headers {
key
value
__typename
}
alerts {
...Alert
__typename
}
statusPages {
...StatusPage
__typename
}
__typename
}
fragment Alert on Alert {
id
state
message
metricDigest
createdAt
openedAt
resolvedAt
closedAt
timeframeStartAt
timeframeEndAt
lastValue
peakValue
mean
tags {
key
value
__typename
}
__typename
}
fragment StatusPage on StatusPage {
id
title
hasSsl
forceSsl
hostname
description
threshold
uptimeMonitorIds
__typename
}
Variables
{
"id": "ID-OF-UPTIME-MONITOR",
"appId": "YOUR-APP-ID"
}
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To update the uptime monitor