lab

More info about the lab schema can be found here.

Note

This resource can also be accessed using the plural form labs.

GET

GET /lab/(string: id)/

Get all the available registered lab or a single one if id is provided.

Parameters:
  • id (string) – The ID of the lab to retrieve.
Request Headers:
 
Response Headers:
 
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.
  • field (string) – The field that should be returned in the response. Can be repeated multiple times.
  • nfield (string) – The field that should not be returned in the response. Can be repeated multiple times.
  • _id (string) – The internal ID of the registered lab.
  • created_on (string) – The creation date: accepted formats are YYYY-MM-DD and YYYYMMDD.
  • name (string) – The name of the lab.
  • private (boolean) – If the lab is private or not.
  • token (string) – The ID of the token associated with the lab.
Status Codes:

Example Requests

GET /lab/ HTTP/1.1
Host: api.kernelci.org
Accept: */*
Authorization: token
GET /boot/lab-01 HTTP/1.1
Host: api.kernelci.org
Accept: */*
Authorization: token

Example Responses

HTTP/1.1 200 OK
Vary: Accept-Encoding
Date: Tue, 10 Nov 2014 12:28:50 GMT
Content-Type: application/json; charset=UTF-8

{
    "code": 200,
    "result": [
        {
            "name": "lab-01",
            "private": false,
            "address": {
                "street_1": "Example street"
            },
            "contact": {
                "name": "Name",
                "surname": "Surname",
                "email": "example@example.net"
            }
        },
    ],
}

Note

Results shown here do not include the full JSON response.

POST

POST /lab

Create a new lab document as defined in the JSON data.

For more info on all the required JSON request fields, see the lab schema.

Request JSON Object:
 
  • name (string) – The name that should be given to the lab.
  • contact (object) – The contact data associated with the lab.
Request Headers:
 
Response Headers:
 
Status Codes:

Example Requests

POST /lab HTTP/1.1
Host: api.kernelci.org
Content-Type: application/json
Accept: */*
Authorization: token

{
    "name": "lab-01",
    "contact": {
        "name": "Name",
        "surname": "Surname",
        "email": "example@example.net"
    }
}

PUT

PUT /lab/(string: id)

Update an existing lab document identified by the id value.

For more info on all the required JSON request fields, see the lab schema.

Request Headers:
 
Response Headers:
 
Status Codes:

Example Requests

PUT /lab/0123456789ab0123456789ab HTTP/1.1
Host: api.kernelci.org
Content-Type: application/json
Accept: */*
Authorization: token

{
    "name": "update-lab-name",
}

DELETE

DELETE /lab/(string: id)

Delete the lab document identified by the id value.

Parameters:
  • id (string) – The ID of the lab document to delete.
Request Headers:
 
Response Headers:
 
Query Parameters:
 
  • _id (string) – The internal ID of the registered lab.
  • private (string) – If the lab is private or not.
  • token (string) – The ID of token associated with the lab.
Status Codes:

Example Requests

DELETE /lab/0123456789ab0123456789ab HTTP/1.1
Host: api.kernelci.org
Accept: */*
Content-Type: application/json
Authorization: token