Skip to content

Latest commit

 

History

History
73 lines (55 loc) · 1.29 KB

File metadata and controls

73 lines (55 loc) · 1.29 KB

Build Clusters Plugin

API build clusters plugin for the Screwdriver API

Usage

Register plugin

const Hapi = require('@hapi/hapi');
const server = new Hapi.Server();
const buildClustersPlugin = require('./');

server.connection({ port: 3000 });

server.register({
    register: buildClustersPlugin,
    options: {}
}, () => {
    server.start((err) => {
        if (err) {
            throw err;
        }
        console.log('Server running at:', server.info.uri);
    });
});

Routes

Create a build cluster

POST /buildclusters

Example payload:

{
    "name": "iOS",
    "scmOrganizations": ["screwdriver-cd"],
    "managedByScrewdriver": false,
    "maintainer": "foo@bar.com",
    "isActive": true,
    "description": "Build cluster for iOS team",
    "weightage": 100
}

Get a listing of all build clusters

GET /buildclusters

Get a specific build cluster

GET /buildclusters/{name}

Update a build cluster

PUT /buildclusters/{name}

Example payload:

{
    "description": "Build cluster for iOS team",
    "scmOrganizations": ["screwdriver-cd"],
    "isActive": true,
    "managedByScrewdriver": true,
    "maintainer": "foo@bar.com",
    "weightage": 20
}

Delete a specific build cluster

DELETE /buildclusters/{name}