Reservations
Get availability information for reservations.
This endpoint supports three different modes for querying availability:
Mode: latest_end_time (default)
Get the latest possible end time for a reservation given a start time and quantity.
Required parameters:
start_time
: Desired start time for the reservationquantity
: Number of instances neededproject
: Project FIDinstance_type
: Instance type FIDregion
: Region name
Returns: Latest possible end time and availability status
Example:
GET /reservation/availability?
start_time=2024-01-01T00:00:00Z&
quantity=4&
project=proj_01h8x2k9m3n4p5q6r7s8t9u0v&
instance_type=it_01h8x2k9m3n4p5q6r7s8t9u0v&
region=us-central1-a
Mode: slots
Get all available slots in a time range.
Required parameters:
earliest_start_time
: Start of the time range to searchlatest_end_time
: End of the time range to searchproject
: Project FIDinstance_type
: Instance type FIDregion
: Region name
Returns: List of available time slots with quantities
Example:
GET /reservation/availability?
mode=slots&
earliest_start_time=2024-01-01T00:00:00Z&
latest_end_time=2024-01-02T00:00:00Z&
project=proj_01h8x2k9m3n4p5q6r7s8t9u0v&
instance_type=it_01h8x2k9m3n4p5q6r7s8t9u0v&
region=us-central1-a
Mode: check
Check if a specific time slot is available for reservation.
Required parameters:
start_time
: Start of the desired time slotend_time
: End of the desired time slotquantity
: Number of instances neededproject
: Project FIDinstance_type
: Instance type FIDregion
: Region name
Returns: Boolean indicating if the slot is available
Example:
GET /reservation/availability?
mode=check&
start_time=2024-01-01T00:00:00Z&
end_time=2024-01-01T12:00:00Z&
quantity=4&
project=proj_01h8x2k9m3n4p5q6r7s8t9u0v&
instance_type=it_01h8x2k9m3n4p5q6r7s8t9u0v&
region=us-central1-a
Common Parameters
All modes require these parameters:
project
: Project FIDinstance_type
: Instance type FIDregion
: Region name
Authentication
Requires authentication and user must be a member of the specified project.
latest_end_time
Possible values: 2024-01-01T00:00:00Z
2024-01-01T00:00:00Z
2024-01-01T00:00:00Z
2024-01-01T00:00:00Z
Successful Response
Validation Error
GET /v2/reservation/availability HTTP/1.1
Host: api.mithril.ai
Authorization: Bearer fkey_<key>
Accept: */*
[
{
"start_time": "2024-01-01T00:00:00Z",
"end_time": "2024-01-01T00:00:00Z",
"quantity": 1
}
]
Get all reservations for a project
it_abc123456
us-central1-a
Successful Response
Validation Error
GET /v2/reservation HTTP/1.1
Host: api.mithril.ai
Authorization: Bearer fkey_<key>
Accept: */*
{
"data": [
{
"fid": "res_abc123456",
"name": "text",
"project": "proj_abc123456",
"created_by": "user_abc123456",
"created_at": "2024-01-01T00:00:00Z",
"deactivated_at": "2024-01-01T00:00:00Z",
"instance_quantity": 4,
"instance_type": "it_abc123456",
"region": "us-central1-a",
"instances": [
"inst_abc123456"
],
"launch_specification": {
"volumes": [
"vol_1234567890",
"vol_1234567891"
],
"ssh_keys": [
"sshkey_1234567890",
"sshkey_1234567891"
],
"startup_script": "text",
"kubernetes_cluster": "clust_abc123456",
"image_version": "text"
},
"status": "Pending",
"start_time": "2024-01-01T00:00:00Z",
"end_time": "2024-01-01T00:00:00Z",
"total_price": "$47.76",
"unit_price": "$1.99"
}
],
"next_cursor": "text"
}
Create a new reservation
proj_abc123456
it_abc123456
us-central1-a
2024-01-01T00:00:00Z
2024-01-01T00:00:00Z
4
Successful Response
Validation Error
POST /v2/reservation HTTP/1.1
Host: api.mithril.ai
Authorization: Bearer fkey_<key>
Content-Type: application/json
Accept: */*
Content-Length: 400
{
"project": "proj_abc123456",
"instance_type": "it_abc123456",
"region": "us-central1-a",
"start_time": "2024-01-01T00:00:00Z",
"end_time": "2024-01-01T00:00:00Z",
"instance_quantity": 4,
"name": "text",
"launch_specification": {
"volumes": [
"vol_1234567890",
"vol_1234567891"
],
"ssh_keys": [
"sshkey_1234567890",
"sshkey_1234567891"
],
"startup_script": "text",
"kubernetes_cluster": "clust_abc123456",
"image_version": "text"
}
}
{
"fid": "res_abc123456",
"name": "text",
"project": "proj_abc123456",
"created_by": "user_abc123456",
"created_at": "2024-01-01T00:00:00Z",
"deactivated_at": "2024-01-01T00:00:00Z",
"instance_quantity": 4,
"instance_type": "it_abc123456",
"region": "us-central1-a",
"instances": [
"inst_abc123456"
],
"launch_specification": {
"volumes": [
"vol_1234567890",
"vol_1234567891"
],
"ssh_keys": [
"sshkey_1234567890",
"sshkey_1234567891"
],
"startup_script": "text",
"kubernetes_cluster": "clust_abc123456",
"image_version": "text"
},
"status": "Pending",
"start_time": "2024-01-01T00:00:00Z",
"end_time": "2024-01-01T00:00:00Z",
"total_price": "$47.76",
"unit_price": "$1.99"
}
Get extension availability for a reservation
res_abc123456
Successful Response
Validation Error
GET /v2/reservation/{reservation_fid}/extension-availability HTTP/1.1
Host: api.mithril.ai
Authorization: Bearer fkey_<key>
Accept: */*
{
"latest_extension_time": "2024-01-01T00:00:00Z",
"available": true
}
Extend a reservation to the requested time.
res_abc123456
2024-01-01T00:00:00Z
Successful Response
Validation Error
POST /v2/reservation/{reservation_fid}/extend HTTP/1.1
Host: api.mithril.ai
Authorization: Bearer fkey_<key>
Content-Type: application/json
Accept: */*
Content-Length: 35
{
"end_time": "2024-01-01T00:00:00Z"
}
{
"fid": "res_abc123456",
"name": "text",
"project": "proj_abc123456",
"created_by": "user_abc123456",
"created_at": "2024-01-01T00:00:00Z",
"deactivated_at": "2024-01-01T00:00:00Z",
"instance_quantity": 4,
"instance_type": "it_abc123456",
"region": "us-central1-a",
"instances": [
"inst_abc123456"
],
"launch_specification": {
"volumes": [
"vol_1234567890",
"vol_1234567891"
],
"ssh_keys": [
"sshkey_1234567890",
"sshkey_1234567891"
],
"startup_script": "text",
"kubernetes_cluster": "clust_abc123456",
"image_version": "text"
},
"status": "Pending",
"start_time": "2024-01-01T00:00:00Z",
"end_time": "2024-01-01T00:00:00Z",
"total_price": "$47.76",
"unit_price": "$1.99"
}