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-aMode: 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-aMode: 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-aCommon 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_timePossible values: 2024-01-01T00:00:00Z2024-01-01T00:00:00Z2024-01-01T00:00:00Z2024-01-01T00:00:00ZSuccessful Response
Validation Error
GET /v2/reservation/availability?project=text&instance_type=text®ion=text HTTP/1.1
Host: api.mithril.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
[
{
"start_time": "2024-01-01T00:00:00Z",
"end_time": "2024-01-01T00:00:00Z",
"quantity": 1
}
]Get all reservations for a project
it_abc123456us-central1-aSuccessful Response
Validation Error
GET /v2/reservation?project=text HTTP/1.1
Host: api.mithril.ai
Authorization: Bearer YOUR_SECRET_TOKEN
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": "imgver_abc123456",
"memory_gb": 1
},
"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_abc123456it_abc123456us-central1-a2024-01-01T00:00:00Z2024-01-01T00:00:00Z4Successful Response
Validation Error
POST /v2/reservation HTTP/1.1
Host: api.mithril.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 426
{
"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": "imgver_abc123456",
"memory_gb": 1
}
}{
"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": "imgver_abc123456",
"memory_gb": 1
},
"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_abc123456Successful Response
Validation Error
GET /v2/reservation/{reservation_fid}/extension-availability HTTP/1.1
Host: api.mithril.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"latest_extension_time": "2024-01-01T00:00:00Z",
"available": true
}Extend a reservation to the requested time.
res_abc1234562024-01-01T00:00:00ZSuccessful Response
Validation Error
POST /v2/reservation/{reservation_fid}/extend HTTP/1.1
Host: api.mithril.ai
Authorization: Bearer YOUR_SECRET_TOKEN
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": "imgver_abc123456",
"memory_gb": 1
},
"status": "Pending",
"start_time": "2024-01-01T00:00:00Z",
"end_time": "2024-01-01T00:00:00Z",
"total_price": "$47.76",
"unit_price": "$1.99"
}Update a reservation's pause/resume status and/or volumes
res_abc123456Successful Response
Validation Error
PATCH /v2/reservation/{reservation_fid} HTTP/1.1
Host: api.mithril.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 43
{
"paused": true,
"volumes": [
"vol_abc123456"
]
}{
"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": "imgver_abc123456",
"memory_gb": 1
},
"status": "Pending",
"start_time": "2024-01-01T00:00:00Z",
"end_time": "2024-01-01T00:00:00Z",
"total_price": "$47.76",
"unit_price": "$1.99"
}Last updated