Skip to content

Files

Latest commit

bb8975d · Jul 28, 2023

History

History
This branch is 4 commits ahead of master.

buildClusters

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": "[email protected]",
    "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": "[email protected]",
    "weightage": 20
}

Delete a specific build cluster

DELETE /buildclusters/{name}