Implement API
tadhglewis opened this issue · 3 comments
It would be nice to have a node API which can easily be run on a server to handle automating Component / Incident reporting, currently reporting is manual, using a service or the GitHub API directly to add/edit components and incidents
An API wrapper for the GitHub API which will expose simplified endpoints to help integrate with services. Example listens for requests on https://example.com/CDN?status=major outage
and updates the current label for CDN
to major outage
If you are interested in this GitHub Issue leave a comment so I can put this as priority.
That would really help
This would be very useful
if it helps anyone, I wrote a shell script to update an issue with a label to help automate alerts from nagios
#/bin/sh
if [ $# -lt 2]
then
echo "Missing options"
echo "$0 <SERVICESTATEID> <SERVICENOTESURL>"
exit 1
else
STATUSID=$1
ISSUEID=$2
fi
case ${STATUSID} in
0)
ISSUELABEL='operational'
;;
1)
ISSUELABEL='partial outage'
;;
2)
ISSUELABEL='major outage'
;;
3)
ISSUELABEL='major outage'
;;
curl -L \
-X PATCH \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <GITHUB_TOKEN_HERE>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
${ISSUEID} \
-d "{\"labels\":[\"component\",\"issue status\",\"$ISSUELABEL\"]}"