diff options
author | Milo Casagrande <milo.casagrande@linaro.org> | 2014-08-12 14:11:36 +0200 |
---|---|---|
committer | Milo Casagrande <milo.casagrande@linaro.org> | 2014-08-12 14:11:36 +0200 |
commit | 70d2475dde0a2bc49e5448643027a641e34df2e8 (patch) | |
tree | 20007422082417d00415d3ce90317eb30fde7b78 /doc | |
parent | 5e94fcae26a88f17d5b5672a1025d2fde5532635 (diff) |
doc: Completed job collection methods.
Change-Id: I66251f07488e7940bcb5c76c2cb8253caac66f62
Diffstat (limited to 'doc')
-rw-r--r-- | doc/job-collection.rst | 92 |
1 files changed, 77 insertions, 15 deletions
diff --git a/doc/job-collection.rst b/doc/job-collection.rst index 7b1f55c..eb1e8df 100644 --- a/doc/job-collection.rst +++ b/doc/job-collection.rst @@ -14,25 +14,25 @@ GET :reqheader Authorization: The token necessary to authorize the request. :reqheader Accept-Encoding: Accept the ``gzip`` coding. - :query limit: Number of results to return. Default 0 (all results). - :type limit: int - :query skip: Number of results to skip. Default 0 (none). - :type skip: int - :query sort: Field to sort the results on. Can be repeated multiple times. - :query sort_order: The sort order of the results: -1 (descending), 1 + :resheader Content-Type: Will be ``application/json; charset=UTF-8``. + + :query int limit: Number of results to return. Default 0 (all results). + :query int skip: Number of results to skip. Default 0 (none). + :query string sort: Field to sort the results on. Can be repeated multiple times. + :query int sort_order: The sort order of the results: -1 (descending), 1 (ascending). This will be applied only to the first ``sort`` parameter passed. Default -1. - :type sort_order: int - :query date_range: Number of days to consider, starting from today + :query int date_range: Number of days to consider, starting from today (:ref:`more info <schema_time_date>`). By default consider all results. - :type date_range: int - :query field: The field that should be returned in the response. Can be + :query string field: The field that should be returned in the response. Can be repeated multiple times. - :type field: string - :query job: A job name. - :type job: string - :query kernel: A kernel name. - :type kernel: string + :query string job: A job name. + :query string kernel: A kernel name. + + :status 200: Resuslts found. + :status 403: Not authorized to perform the operation. + :status 404: The provided resource has not been found. + :status 500: Internal database error. **Example Requests** @@ -127,5 +127,67 @@ GET POST **** +.. http:post:: /job + + Create or update a job as defined in the JSON data. The request will be accepted and it will begin to parse the data. + + :reqjson string job: The name of the job. + :reqjson string kernel: The name of the kernel. + + :reqheader Authorization: The token necessary to authorize the request. + :reqheader Content-Type: Content type of the transmitted data, must be ``application/json``. + :reqheader Accept-Encoding: Accept the ``gzip`` coding. + + :resheader Content-Type: Will be ``application/json; charset=UTF-8``. + + :status 202: The request has been accepted and is going to be created. + :status 400: JSON data not valid. + :status 403: Not authorized to perform the operation. + :status 415: Wrong content type. + :status 422: No real JSON data provided. + + **Example Requests** + + .. sourcecode:: http + + POST /api/job HTTP/1.1 + Host: api.backend.linaro.org + Content-Type: application/json + Accept: */* + Authorization: token + + { + "job": "next", + "kernel": "next-20140801" + } + DELETE ****** + +.. http:delete:: /job/job_id + + Delete the job identified by ``job_id``. + + :param job_id: The job ID in the form of ``job``-``kernel``. + :type job_id: string + + :reqheader Authorization: The token necessary to authorize the request. + :reqheader Content-Type: Content type of the transmitted data, must be ``application/json``. + :reqheader Accept-Encoding: Accept the ``gzip`` coding. + + :resheader Content-Type: Will be ``application/json; charset=UTF-8``. + + :status 200: Resource deleted. + :status 403: Not authorized to perform the operation. + :status 404: The provided resource has not been found. + :status 500: Internal database error. + + **Example Requests** + + .. sourcecode:: http + + DELETE /job/next-next-20140612 HTTP/1.1 + Host: api.backend.linaro.org + Accept: */* + Content-Type: application/json + Authorization: token |