API banners plugin for the Screwdriver API
const Hapi = require('@hapi/hapi');
const server = new Hapi.Server();
const bannersPlugin = require('./');
server.connection({ port: 3000 });
server.register({
register: bannersPlugin,
options: {}
}, () => {
server.start((err) => {
if (err) {
throw err;
}
console.log('Server running at:', server.info.uri);
});
});
POST /banners
Arguments
message
- Text of the banner to create.type
- An optional banner type. Options areinfo
andwarn
. Defaults toinfo
isActive
- An optional status flag to indicate whether banner should display. Defaults tofalse
Example payload:
{
"message": "The Screwdriver Team is currently investigating random failures.",
"type": "info",
"isActive": "true"
}
GET /banners
GET /banners/{id}
PUT /banners/{id}
Arguments
message
- An optional new string of text for the banner.type
- An optional new banner type. Options areinfo
andwarn
isActive
- An optional new status flag to indicate whether banner should display.
Example payload:
{
"message": "The Screwdriver Team has resolved the random failure issue.",
"type": "info",
"isActive": "true"
}
DELETE /banners/{id}