meteor-galaxy-helpers v0.7.2
Meteor Galaxy Helpers
A package for Meteor that will set up an API endpoint to accept Galaxy status/maintenance updates. I've kept the name generic ("helpers") in case other Galaxy-related stuff is added later.
Setup
$ meteor add meteorhacks:picker
$ meteor npm install meteor-galaxy-helpers
On the server side, initialize the API endpoint:
import { Meteor } from 'meteor/meteor';
import { initApiRoute } from 'meteor-galaxy-helpers';
Meteor.startup(() => {
initApiRoute();
});
And that's it! Your API endpoint will be /api/galaxyStatus
, but you can configure that to be whatever you like:
initApiRoute({ route: '/api/my-route' });
To access the status collection, simply import it on the client side:
import { GalaxyStatus } from 'meteor-galaxy-helpers';
Enabling Webhooks
To enable Galaxy webhooks, go to http://status.meteor.com/ and click "Subscribe to Updates." Click the "<>" icon and enter your API endpoint.
Dummy Data
If you'd like to test your API endpoint, run Meteor, copy and paste the text below into a file called dummy.json
:
{
"meta": {
"unsubscribe": "---",
"documentation": "http://doers.statuspage.io/customer-notifications/webhooks/",
"generated_at": "2016-10-18T04:31:05.464Z"
},
"page": {
"id": "cl25nd1s1tdr",
"status_indicator": "none",
"status_description": "All Systems Operational"
},
"incident": {
"name": "[US] Minor infrastructure upgrade",
"status": "in_progress",
"created_at": "2016-10-14T17:12:14.507-07:00",
"updated_at": "2016-10-17T21:31:04.976-07:00",
"monitoring_at": null,
"resolved_at": null,
"impact": "maintenance",
"shortlink": "http://stspg.io/4E4n",
"postmortem_ignored": true,
"postmortem_body": null,
"postmortem_body_last_updated_at": null,
"postmortem_published_at": null,
"postmortem_notified_subscribers": false,
"postmortem_notified_twitter": false,
"backfilled": false,
"scheduled_for": "2016-10-17T21:30:00.000-07:00",
"scheduled_until": "2016-10-18T00:30:00.000-07:00",
"scheduled_remind_prior": true,
"scheduled_reminded_at": "2016-10-18T03:30:00.099Z",
"impact_override": null,
"scheduled_auto_in_progress": true,
"scheduled_auto_completed": false,
"id": "n032xwhnw4nl",
"page_id": "cl25nd1s1tdr",
"incident_updates": [
{
"status": "in_progress",
"body": "Scheduled maintenance is currently in progress. We will provide updates as necessary.",
"created_at": "2016-10-17T21:31:04.974-07:00",
"wants_twitter_update": false,
"twitter_updated_at": null,
"updated_at": "2016-10-17T21:31:04.974-07:00",
"display_at": "2016-10-17T21:31:04.974-07:00",
"affected_components": [
{
"name": "No components were affected by this update."
}
],
"id": "swxxmvptjdnb",
"incident_id": "n032xwhnw4nl"
},
{
"status": "scheduled",
"body": "Maintenance will begin as scheduled in 60 minutes.",
"created_at": "2016-10-17T20:30:00.040-07:00",
"wants_twitter_update": false,
"twitter_updated_at": null,
"updated_at": "2016-10-17T20:30:00.040-07:00",
"display_at": "2016-10-17T20:30:00.040-07:00",
"affected_components": null,
"id": "v6pnvb2rv9wj",
"incident_id": "n032xwhnw4nl"
},
{
"status": "scheduled",
"body": "This is a periodic update of the operating system behind our infrastructure. This update will perform a coordinated restart of most containers. Additionally, the proxy tier will be upgraded forcing a coordinated reconnection of all clients.\r\n\r\nThis update applies only to the `us-east-1` region.",
"created_at": "2016-10-14T17:12:14.941-07:00",
"wants_twitter_update": false,
"twitter_updated_at": null,
"updated_at": "2016-10-14T17:12:14.941-07:00",
"display_at": "2016-10-14T17:12:14.941-07:00",
"affected_components": [
{
"name": "No components were affected by this update."
}
],
"id": "hwgynvxmgc56",
"incident_id": "n032xwhnw4nl"
}
]
}
}
Then run the following curl command:
curl -X POST -H 'Content-Type: application/json' --data @dummy.json http://localhost:3000/api/galaxyStatus
You should see a document show up in the galaxyStatus
collection.