Device Reservations Rest API
Digital.ai Continuous Testing allows device reservations management using the Rest API.
info
- The role of the user performing the Rest Operation is specified by the Authorization header. This supports authorization with an access key only.
- For more information see How To Execute Rest API.
Get Current and Future Reservations
Gets the information of the current and future reservation.
GET /api/v1/device-reservations
Parameters
Name | Type | Mandatory | Description |
---|---|---|---|
start (BETA) | String | No | Time and date of the beginning of the interval - ISO 8601 format, UTC time (eg: "2019-04-04T18:51:44.940Z") |
end (BETA) | String | No | Time and date of the ending of the interval - ISO 8601 format, UTC time - (eg: "2019-04-05T18:51:44.940Z") |
project | String | No | The project name - will return only reservations of devices for this project (Cloud Admin only) |
deviceUid | List<String> | No | The device uid (device unique identifier) - supports multiple values, will return only the reservations for these devices |
username | String | No | The user name - will return only the reservations of this user |
Response
Response Status: 200 OK
{
"status": "SUCCESS",
"data" :[
{
"reservationId": 3453,
"reservationStart": "2019-04-04T18:51:44.940+03:00",
"reservationEnd": "2019-04-04T19:36:44.940+03:00",
"ReservationNotes": "used for our regression testing",
"user": "yotam123",
"project": "ProjectA",
"deviceUid: "23423sdf234o2i34",
"deviceID": 523143
},
{
"reservationId": 5453,
"reservationStart": "2019-04-04T19:00:00.000+03:00",
"reservationEnd": "2019-04-04T21:00:00.000+03:00",
"ReservationNotes": "",
"user": "omer2",
"project": "ProjectB",
"deviceUid: "4kert235pojret09",
"deviceID": 21231
}
]
"code": "OK"
}
Remove Current and Future Reservations
Removes current and future reservations.
If a current reservation is removed, the device is released from its current user. Otherwise the reservation is deleted.
- Cloud Administrators can delete any reservation.
- Project Administrators can delete any reservation in their projects.
- Usesr can delete their reservations.
DELETE /api/v1/device-reservations/<reservationId>
reservationId - ID of the reservation
Response
Response Status: 200 OK
{
"status": "SUCCESS",
"code": "OK"
}
Add New Reservation for a Device
Creates a current or future reservation for a device or devices. This is available to Cloud and Project Administrators only.
- Cloud Administrators can reserve a device for any user.
- Project Administrators can reserve a device for any user in their project.
- Usesr can reserve a device for themselves.
POST /api/v1/device-reservations
Parameters
Name | Type | Mandatory | Description |
---|---|---|---|
deviceUid | List of Strings | Yes | Device uid (device unique identifier). Supports multiple values. Reserves only the stated devices. |
reservationStart | String | Yes | Time and date of the beginning of the interval in ISO 8601 format. It can be with Default UTC time or with specific time-zone: 1. UTC time format (Default) : 2021-02-24T19:00:00Z 2. Timezone format : 2021-02-24T19:00:00+03:00 / 2021-02-24T19:00:00-03:00 |
reservationEnd | String | Yes | Time and date of the ending of the interval in ISO 8601 format. It can be with Default UTC time or with specific time-zone: 1. UTC time format (Default) : 2021-02-24T19:00:00Z 2. Timezone format : 2021-02-24T19:00:00+03:00 / 2021-02-24T19:00:00-03:00 |
username | String | No | Name of the user the reservation is for. If left blank, the current user is used. |
project | String | No | Project name. This can be left blank if the user has one project only. Otherwise the field is mandatory. (Cloud Admin only) |
notes | String | No | Reservation notes. Best practice is to use this field to specify the reason for this reservation. |
Response
Response Status: 200 OK
{
"status": "SUCCESS",
"data" :[
{
"message": "Reservation added successfully"
"reservationId": 3453,
"deviceUid: "23423sdf234o2i34",
},
{
"message": "Reservation added successfully"
"reservationId": 4554,
"deviceUid: "ierw9823werwe30230",
}
]
"code": "OK"
}