Instances

JA
Last updated 4 months ago

get
Get List of Instances

https://sharedcloud.io
/api/v1/instances/
This endpoint allows you to get the list of instances
Request
Response
Headers
Authorization
required
string
Authentication token
200: OK
List of instances successfully retrieved.
[
{
"uuid": "91c34f50-5181-4739-915a-7615a6a72d2f",
"type": "cpu",
"gpu": "n/a",
"gpu_name": "n/a",
"num_running_jobs": 1,
"updated_at": "06-10-2018 18:08:02",
"created_at": "05-10-2018 16:02:04",
"num_assigned_jobs": 0,
"current_server_time": "06-10-2018 19:10:01",
"last_connection": "06-10-2018 18:08:02",
"name": "instance1",
"status": 1,
"ask_price": 0.02,
"downloaded_images": [],
"max_num_parallel_jobs": 2
}
]
401: Unauthorized
Invalid credentials.
{
"detail": "Invalid token."
}

get
Get Instance

https://sharedcloud.io
/api/v1/instances/:uuid/
This endpoint allows you to get a single instance
Request
Response
Path Parameters
uuid
required
string
UUID of the instance
Headers
Authorization
required
string
Authentication token
200: OK
Instance successfully retrieved.
{
"uuid": "90c34f50-5c81-4739-955a-7685a6a72d2f",
"type": "cpu",
"gpu": "n/a",
"gpu_name": "n/a",
"num_running_jobs": 1,
"updated_at": "06-10-2018 18:08:02",
"created_at": "05-10-2018 16:02:04",
"num_assigned_jobs": 0,
"current_server_time": "06-10-2018 19:10:01",
"last_connection": "06-10-2018 18:08:02",
"name": "instance1",
"status": 1,
"ask_price": 0.02,
"downloaded_images": [],
"max_num_parallel_jobs": 2
}
401: Unauthorized
Invalid credentials.
{
"detail": "Invalid token."
}
404: Not Found
Instance not found.
{
"detail": "Not found."
}

post
Create Instance

https://sharedcloud.io
/api/v1/instances/
This endpoint allows you to create an instance
Request
Response
Headers
Authorization
required
string
Authentication token
Body Parameters
gpu
optional
string
UUID of the GPU of the instance
type
optional
integer
type of the instance. It can be 1 (cpu) or 2 (gpu) (Default: 1)
name
required
string
name of the instance
ask_price
required
number
ask price of the instance
max_num_parallel_jobs
optional
string
max number of parallel jobs (Default: 1)
200: OK
Instance successfully created.
{
"uuid": "6baf15c3-5fb1-4312-b793-fc7d19629a7f",
"current_server_time": "05-10-2018 16:29:06",
"num_running_jobs": 0,
"num_assigned_jobs": 0,
"gpu_name": "n/a",
"updated_at": "05-10-2018 16:29:06",
"created_at": "05-10-2018 16:29:06",
"last_connection": null,
"type": 1,
"name": "instance1",
"status": 1,
"ask_price": 0.01,
"max_num_parallel_jobs": 1,
"gpu": null,
"downloaded_images": []
}
401: Unauthorized
Invalid credentials.
{
"detail": "Invalid token."
}

put
Update Instance

https://sharedcloud.io
/api/v1/instances/:uuid/
This endpoint allows you to update an instance
Request
Response
Path Parameters
uuid
required
string
UUID of the instance
Headers
Authorization
required
string
Authentication token
Body Parameters
gpu
optional
string
UUID of the GPU of the instance
type
optional
integer
type of the instance. It can be 1 (cpu) or 2 (gpu) (Default: 1)
name
required
string
name of the instance
ask_price
required
number
ask_price of the instance
max_num_parallel_jobs
optional
string
max number of parallel jobs (Default: 1)
200: OK
Instance successfully updated.
{
"uuid": "6bafb1c3-5f11-43d2-a713-fc7d19629a7f",
"current_server_time": "05-10-2018 16:29:06",
"num_running_jobs": 0,
"num_assigned_jobs": 0,
"gpu_name": "n/a",
"updated_at": "05-10-2018 16:29:06",
"created_at": "05-10-2018 16:29:06",
"last_connection": null,
"type": 1,
"name": "instance1",
"status": 1,
"ask_price": 0.01,
"max_num_parallel_jobs": 1,
"gpu": null,
"downloaded_images": []
}
401: Unauthorized
Invalid credentials.
{
"detail": "Invalid token."
}
404: Not Found
Instance not found.
{
"detail": "Not found."
}

patch
Partially update Instance

https://sharedcloud.io
/api/v1/instances/:uuid/
This endpoint allows you to partially update an instance
Request
Response
Path Parameters
uuid
required
string
UUID of the instance
Headers
Authorization
required
string
Authentication token
Body Parameters
gpu
optional
string
UUID of the GPU of the instance
type
optional
integer
type of the instance. It can be 1 (cpu) or 2 (gpu) (Default: 1)
name
optional
string
name of the instance
ask_price
optional
number
ask_price of the instance
max_num_parallel_jobs
optional
string
max number of parallel jobs (Default: 1)
200: OK
Instance partially updated successfully.
{
"uuid": "6b1fb5c3-5f11-43d2-a793-fc7d01629a7f",
"current_server_time": "05-10-2018 16:29:06",
"num_running_jobs": 0,
"num_assigned_jobs": 0,
"gpu_name": "n/a",
"updated_at": "05-10-2018 16:29:06",
"created_at": "05-10-2018 16:29:06",
"last_connection": null,
"type": 1,
"name": "instance1",
"status": 1,
"ask_price": 0.01,
"max_num_parallel_jobs": 1,
"gpu": null,
"downloaded_images": []
}
401: Unauthorized
Invalid credentials.
{
"detail": "Invalid token."
}
404: Not Found
Instance not found.
{
"detail": "Not found."
}

delete
Delete Instance

https://sharedcloud.io
/api/v1/instances/:uuid/
This endpoint allows you to delete an instance
Request
Response
Path Parameters
uuid
required
string
uuid of the instance
Headers
Authorization
required
string
Authentication token
200: OK
Instance deleted successfully
{}
401: Unauthorized
Invalid credentials.
{
"detail": "Invalid token."
}
404: Not Found
Instance not found.
{
"detail": "Not found."
}