REST api server for nci.
npm install nci-rest-api-serverTo enable add this plugin to the plugins section at server config:
{
"plugins": [
"nci-rest-api-server"
],
"http": {
"host": "127.0.0.1",
"port": 3000,
"url": "http://127.0.0.1:3000"
},
....
}after that you can access api according to your server http.host and
http.port options.
Notes:
- Currently destructive api methods (project removing/renaming)
protected by token which could be set at config (
http.apiAccessTokenfield) or will be generated and printed to the server log during server startup. Client should send token astokenfield at request body. - Currently server respond format is only json.
Get builds sorted by date in descending order.
Query parameters:
project- optional project filterlimit- maximum builds count to get (20 by default)
Get particular build by id.
Create build by running given project.
Body parameters:
project- project to buildwithScmChangesOnly- if true then build will be started only if there is scm changes for projectqueueQueued- if true then currently queued project can be queued again
Update build.
Body parameters:
cancel- if set to true then build will be canceled
Get configs for all currently loaded projects.
Get particular project by name.
Create new project and set config.
Body parameters:
name- project nameconfig- project configuratjion objectconfigFile- project config file object withnameandcontentfields (it's alternative forconfigoption when need to set file in specific format)loadConfig- if true then project will be loaded
Modify project.
To rename project, body parameters:
name- new project name
To set project config, body parameters:
config- project configuratjion objectconfigFile- project cconfig file object withnameandcontentfields (it's alternative forconfigoption when need to set file in specific format)loadConfig- if true then project will be loaded
To archive/unarchive project, body parameters:
archived- boolean, new state of the project
Remove project.