Consumer API¶
Register a new consumer¶
- POST /api/v1/consumer¶
Status Codes: - 200 – no error
Example request:
POST /api/v1/consumer HTTP/1.1 Host: localhost Accept: application/json
Example response:
HTTP/1.1 200 OK Content-Type: application/json { "id": "84928d40-ea5a-11e3-9b27-0002a5d5c51b", "ws": "ws://127.0.0.1:8701" }
Unregister a consumer¶
- DELETE /api/v1/consumer/(str: consumer_id)¶
Parameters: - consumer_id – the unique identifier of the consumer given in the registration step
Status Codes: - 200 – no error
- 404 – consumer not found
Example request:
POST /api/v1/consumer/84928d40-ea5a-11e3-9b27-0002a5d5c51b HTTP/1.1 Host: localhost Accept: application/json
Example response:
HTTP/1.1 200 OK Content-Type: application/json
Project API¶
Retrieve the project list¶
- GET /api/v1/projects¶
Status Codes: - 200 – no error
Example request:
POST /api/v1/projects HTTP/1.1 Host: localhost Accept: application/json
Example response:
HTTP/1.1 200 OK Content-Type: application/json [ { "id": "project_a", "name": "Project A" }, { "id": "project_b", "name": "Project B" } ]
Plugin API¶
Retrieve the plugin list of specific project¶
- GET /api/v1/(str: project_id)/plugins¶
Parameters: - project_id – the project identifier
Status Codes: - 200 – no error
- 404 – project does not exist
Example request:
GET /api/v1/project_a/plugins HTTP/1.1 Host: localhost Accept: application/json
Example response:
HTTP/1.1 200 OK Content-Type: application/json [ { "id": "pylint" }, { "id": "filesystem" } ]
Retrieve the plugin source for the given language¶
- GET /api/v1/(str: project_id)/(str: plugin_id)/source/(str: language)¶
Parameters: - project_id – the project identifier
- plugin_id – the plugin identifier
- language – the extension of the file with the sources for this language
Status Codes: - 200 – no error
- 404 – project, plugin or language not found
Example request:
GET /api/v1/project_a/pylint/source/js HTTP/1.1 Host: localhost Accept: application/json
Example response:
HTTP/1.1 200 OK Content-Type: application/json [javascript plugin source]
Retrieve the plugin states for the given project¶
- GET /api/v1/(str: project_id)/(str: plugin_id)/state¶
Parameters: - project_id – the project identifier
- plugin_id – the plugin identifier
Status Codes: - 200 – no error
- 404 – project and plugin combination not found
Example request:
GET /api/v1/project_a/pylint/state HTTP/1.1 Host: localhost Accept: application/json
Example response:
HTTP/1.1 200 OK Content-Type: application/json [ { "project": "test", "key": "geoffrey/testspace/test.py", "plugin": "pylint", "value": { "exitcode": 16, "stdout": "No config ..." } } ]
Subscription API¶
Modify the consumer subscription list¶
- POST /api/v1/subscription/(str: consumer_id)¶
Parameters: - consumer_id – the consumer identifier
Status Codes: - 200 – no error
- 404 – consumer not found
Example request:
POST /api/v1/subscription/84928d40-ea5a-11e3-9b27-0002a5d5c51b HTTP/1.1 Host: localhost Accept: application/json { "criteria": [ { "plugin": "pylint", "project": "project_a" }, { "plugin": "filesystem", "project": "project_b" } ] }
Example response:
HTTP/1.1 200 OK Content-Type: application/json
Note
Consecutive requests will override the subscription list for this consumer.