A very simple JSON
based API to store and report back on test
results from Ceph tests.
To install and use paddles:
git python-dev python-virtualenv postgresql postgresql-contrib postgresql-server-dev-all supervisor
virtualenv ./virtualenv
cp config.py.in config.py
source ./virtualenv/bin/activate
pip install -r requirements.txt
python setup.py develop
pecan populate config.py
cp alembic.ini.in alembic.ini
alembic stamp head
pecan serve config.py
- though for production use it's wise to use a real server. We use gunicorn managed by supervisord. Sample config files are provided for gunicorn and supervisord.~/.teuthology.yaml
: results_server: http://paddles.example.com/
/runs/
On GET
operations it will display the latest 100 runs with a JSON
object of all recent jobs reported.
{ "teuthology-2013-09-25_23:00:06-rados-master-testing-basic-plana": { "href": "http://paddles/runs/teuthology-2013-09-25_23:00:06-rados-master-testing-basic-plana/", "status": "running", "results": { "pass": 10, "running": 15, "fail": 0 } }, "teuthology-2013-09-26_01:30:26-upgrade-fs-next-testing-basic-plana": { "href": "http://paddles/teuthology-2013-09-26_01:30:26-upgrade-fs-next-testing-basic-plana", "status": "running", "results": { "pass": 3, "running": 10, "fail": 1 } }, "teuthology-2013-09-26_01:30:26-rados-next-testing-basic-plana": { "href": "http://paddles/runs/teuthology-2013-09-26_01:30:26-rados-next-testing-basic-plana/", "status": "finished", "results": { "pass": 8, "running": 0, "fail": 2 } } }
The example above gives returns the three result types available for jobs:
pass
, fail
, and running
with its respective links. These are built
from the information for every run as the results come in. They are read-only
values. It will also report on the overall status of the run: running or
finished.
These operations create new entries for runs, it is only required to POST
a JSON
object that has a name key and the actual name of the run as the
value:
{ "name": "teuthology-2013-09-01_23:59:59-rados-master-testing-basic-plana" }
HTTP responses:
/runs/{name}/
To read information for a specific run a GET
needs to be requested. On
valid requests (for existing runs) a JSON
object with all the jobs
scheduled for that specific run are returned. Below is an example of a valid
request:
{ "1500": { "href": "http://paddles/runs/teuthology-2013-09-01_23:59:59-rados-master-testing-basic-plana/1500/", "status": "running", "results": { "pass": 8, "running": 13, "fail": 2 } }, "1501": { "href": "http://paddles/runs/teuthology-2013-09-01_23:59:59-rados-master-testing-basic-plana/1501/", "status": "finished", "results": { "pass": 8, "running": 0, "fail": 4 } }, "1502": { "href": "http://paddles/runs/teuthology-2013-09-01_23:59:59-rados-master-testing-basic-plana/1502/", "status": "finished", "results": { "pass": 3, "running": 0, "fail": 17 } } }
/runs/{name}/jobs/
GET
requests will return a full list of all the jobs associated with the
current run
.
If no jobs exist, an empty array is returned, otherwise this is how a single object would look like:
[ { "archive_path": null, "kernel": null, "teuthology_branch": null, "tasks": null, "verbose": null, "description": null, "roles": null, "overrides": null, "pid": null, "success": null, "name": null, "targets": null, "owner": null, "last_in_suite": null, "os_type": null, "machine_type": null, "nuke_on_error": null, "duration": null, "flavor": null, "email": null, "job_id": "1" } ]
POST
requests with valid metadata for a job can create new jobs. Keys that
are not part of the schema will be ignored. Keys that are saved to the
database are:
For initial creation of a job
associated to its run
a job_id
key is
required. It is the only key in the JSON body that must exist, otherwise
a 400 error is returned.
HTTP responses:
Note
updates for the results of these runs are programatically calculated from individual jobs
/runs/{name}/jobs/{job_id}/
On GET
requests an object with all metadata saved from the actual job will
be returned.
PUT
requests can contain any of the keys accepted for metadata, they get
updated accordingly except for job_id
. That is the one key that can
never be changed.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。