count¶
GET¶
-
GET
/count/
(string: resource)/
¶ Count the elements in all resources or in the provided
resource
.Parameters: - resource (string) – The name of the resource to get the count of.
Can be one of
boot
,defconfig
,job
.
Request Headers: - Authorization – The token necessary to authorize the request.
- Accept-Encoding – Accept the
gzip
coding.
Response Headers: - Content-Type – Will be
application/json; charset=UTF-8
.
Query Parameters: - limit (int) – Number of results to return. Default 0 (all results).
- skip (int) – Number of results to skip. Default 0 (none).
- sort (string) – Field to sort the results on. Can be repeated multiple times.
- sort_order (int) – The sort order of the results: -1 (descending), 1
(ascending). This will be applied only to the first
sort
parameter passed. Default -1. - date_range (int) – Number of days to consider, starting from today (more info). By default consider all results.
- arch (string) – A type of computer architecture (like
arm
,arm64
). - board (string) – The name of a board.
- created_on (string) – The creation date: accepted formats are
YYYY-MM-DD
andYYYYMMDD
. - defconfig (string) – A defconfig name.
- errors (int) – The number of errors.
- job (string) – A job name.
- job_id (string) – A job ID.
- kernel (string) – A kernel name.
- private (boolean) – The private status.
- status (string) – The status of the elements to get the count of. Can be
one of:
PASS
orFAIL
. - warnings (int) – The number of warnings.
Status Codes: - 200 OK – Results found.
- 403 Forbidden – Not authorized to perform the operation.
- 404 Not Found – The provided resource has not been found.
- 500 Internal Server Error – Internal database error.
Note
Not all the query parameters are valid for each resource. Please refer to the GET method documentation of the resource to know which parameters can be used.
Example Requests
GET /count/ HTTP/1.1 Host: api.kernelci.org Accept: */* Authorization: token
GET /count/job/ HTTP/1.1 Host: api.kernelci.org Accept: */* Authorization: token
GET /count/job?job=next&date_range=1 HTTP/1.1 Host: api.kernelci.org Accept: */* Authorization: token
Example Responses
HTTP/1.1 200 OK Vary: Accept-Encoding Date: Wed, 06 Aug 2014 13:08:12 GMT Content-Type: application/json; charset=UTF-8 { "code": 200, "result": [ { "count": 260, "collection": "job" }, { "count": 32810, "collection": "defconfig" }, { "count": 10746, "collection": "boot" } ] }
HTTP/1.1 200 OK Vary: Accept-Encoding Date: Wed, 06 Aug 2014 13:23:42 GMT { "code": 200, "result": [ { "count": 260, "collection": "job" } ] }
HTTP/1.1 200 OK Vary: Accept-Encoding Date: Fri, 08 Aug 2014 14:15:40 GMT { "code": 200, "result": [ { "count": 1, "collection": "job", "fields": { "job": "next", "created_on": { "$lt": { "$date": 1407542399000 }, "$gte": { "$date": 1407369600000 } } } } ] }
- resource (string) – The name of the resource to get the count of.
Can be one of
POST¶
Caution
Not implemented. Will return a status code
of 501
.
DELETE¶
Caution
Not implemented. Will return a status code
of 501
.