node-buildapi v0.0.2
Install
npm install buildapiExample
var buildapi = require('./index')({username: 'me', password: 'supersecret'});
buildapi.rebuildBuildId('gaia-try', {'build_id': '45705150'}, function(e, d) {
if (e) {
console.log(e);
}
console.log(d);
}API Reference
For complete information see the real docs
All functions can take an options argument, some functions have required options and all require a callback.
Call backs are in the form function(err, data)
For query (i.e. GET) functions, the raw response body is passed back an Object. For all other
functions, the build api status response is checked. If there is an API Error
, an Error object is created with a plaintext explanation
On success the request_id is passed back
buildapi#listBranches(callback)Does a GET to
/self-serve/branchesbuildapi#listJobs(callback)Does a GET to
/self-serve/jobsbuildapi#getJob(job_id, callback)Does a GET to
/self-serve/jobs/:job_idbuildapi#getBranch(branch_id, callback)Does a GET to
/self-serve/:branch_idbuildapi#rebuildBuildId(branch_id, opts, callback)Does a POST to
/self-serve/:branch_id/buildRequired options
build_id
Optional options
prioritycount
buildapi#cancelBuild(branch_id, build_id, callback)Does a DELETE to
/self-serve/:branch_id/build/:build_idbuildapi#getBuild(branch_id, build_id, callback)Does a GET to
/self-serve/:branch_id/build/:build_idbuildapi#getBuilders(branch_id, callback)Does a GET to
/self-serve/:branch_id/buildersbuildapi#triggerBuildername(branch_id, builder_name, revision, callback)Does a POST to
/self-serve/:branch_id/builders/:builder_name/:revisionOptional options
propertiesfiles
buildapi#rebuildRequest(branch_id, callback)Does a POST to
/self-serve/:branch_id/requestOptional options
prioritycount
buildapi#cancelRequest(branch_id, request_id, callback)Does a DELETE to
/self-serve/:branch_id/request/:request_idbuildapi#getRequest(branch_id, callback)Does a GET to
/self-serve/:branch_idbuildapi#reprioritizeRequest(branch_id, request_id, opts, callback)Does a PUT to
/self-serve/:branch_id/request/:request_idRequired options
priority
buildapi#cancelRev(branch_id, revision, callback)Does a DELETE to
/self-serve/:branch_id/rev/:revisionbuildapi#getRev(branch_id, revision, callback)Does a GET to
/self-serve/:branch_id/rev/:revisionbuildapi#triggerRev(branch_id, revision, callback)Does a POST to
/self-serve/:branch_id/rev/:revisionbuildapi#isDone(branch_id, revision, callback)Does a GET to
/self-serve/:branch_id/rev/:revision/is_donebuildapi#triggerRevNightly(branch_id, revision, callback)Does a POST to
/self-serve/:branch_id/rev/:revision/nightlyOptional options
priority
buildapi#triggerRevPgo(branch_id, revision, callback)Does a POST to
/self-serve/:branch_id/rev/:revision/pgoOptional options
priority
buildapi#getBuildsForUser(branch_id, user, callback)Does a GET to
/self-serve/:branch_id/user/:user
Docs build with node -e "require('./index').docs()"