Giter Site home page Giter Site logo

meteor-galaxy-maintenance's Introduction

galaxy-maintenance

A package for Meteor that will set up an API endpoint to accept Galaxy status/maintenance updates.

Installation & Setup

Install the package:

$ meteor add ffxsam:galaxy-maintenance

Go to the Galaxy status page and click the "Subscribe to Updates" button. Click the <> symbol (webhooks), and enter your app's base URL, followed by /api/galaxyStatus, e.g.:

https://app.mymeteorapp.com/api/galaxyStatus

Once complete, status updates will hit the API endpoint and data will be stored in the galaxyIncidents Mongo collection.

Usage

To reference the maintenance data, you'll need to subscribe to the appropriate publication and fetch the data. Below is an example of a Meteor/React container that would serve up status information to a child component:

import { Meteor } from 'meteor/meteor';
import { createContainer } from 'meteor/react-meteor-data';
import { GalaxyIncidents } from 'meteor/ffxsam:galaxy-maintenance';
import MyComponent from './MyComponent';

export default createContainer(() => {
  Meteor.subscribe('galaxyIncidents');

  return {
    incidents: GalaxyIncidents.find().fetch(),
  }
}, MyComponent)

A typical document in galaxyIncidents might look like this:

{
  "_id" : "9kR7rqwuc8sXAHTRw",
  "impact" : "maintenance",
  "incidentId" : "n032xwhnw4nl",
  "scheduledFor" : ISODate("2016-10-17T21:30:00.000-0700"),
  "scheduledUntil" : ISODate("2016-10-18T00:30:00.000-0700"),
  "status" : "in_progress",
  "updatedAt" : ISODate("2016-10-17T21:31:04.976-0700")
}

When Galaxy (StatusPage, actually) sends out an update with a status of "completed", the incident in question will automatically be removed from the collection.

Subscribe Options

The galaxyIncidents collection will always contain incidents for both US and EU regions. You can limit the region by specifying it when subscribing to the publication:

Meteor.subscribe('galaxyIncidents', { region: 'EU' }); // or 'US'

Caveats

This seems to not work when added to a project that uses meteorhacks:picker. This might also apply to other REST API packages. When in doubt, use Meteor's built-in webapp package which plays nicely with this one.

Contributing

Please feel free to contribute and improve this package!

meteor-galaxy-maintenance's People

Contributors

ffxsam avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.