Skip to main content

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

NameTypeMandatoryDescription
start (BETA)StringNoTime and date of the beginning of the interval - ISO 8601 format, UTC time (eg: "2019-04-04T18:51:44.940Z")
end (BETA)StringNoTime and date of the ending of the interval - ISO 8601 format, UTC time - (eg: "2019-04-05T18:51:44.940Z")
projectStringNoThe project name - will return only reservations of devices for this project (Cloud Admin only)
deviceUidList<String>NoThe device uid (device unique identifier) - supports multiple values, will return only the reservations for these devices
usernameStringNoThe 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

NameTypeMandatoryDescription
deviceUidList of StringsYesDevice uid (device unique identifier). Supports multiple values. Reserves only the stated devices.
reservationStartStringYesTime 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
reservationEndStringYesTime 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
usernameStringNoName of the user the reservation is for. If left blank, the current user is used.
projectStringNoProject name. This can be left blank if the user has one project only. Otherwise the field is mandatory. (Cloud Admin only)
notesStringNoReservation 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"
}