API documentation for Glows.ai SDK
Start a new instance using the SDK
from_image_id | string Basic Image |
from_snap_id | string Basic Snapshot |
gpu_name | string GPU Name |
instance_category | string Container or VM |
custom_meta_key | string Unique key for caller |
remark | string Remark |
envs | string Environment variable in the format foo=bar;tik=tok |
ports | string JSON String in the format [{"port":7890,"protocol":2}] |
cmd | string Instance entry commands |
code | integer Return code, 0 means success, and others (not 0) means failure |
msg | string Returned message, typically a failure description |
object |
{- "from_image_id": "87p9kq26",
- "custom_meta_key": "order.123456",
- "remark": "this is from sdk",
- "envs": "foo=bar",
- "gpu_name": "NVIDIA GeForce RTX 4090",
- "instance_category": "container",
- "ports": "[{\"port\":7890,\"protocol\":2}]"
}
{- "code": 0,
- "msg": "",
- "instance": {
- "instanceID": "boyqp4g8",
- "category": "container",
- "status": "SchedQueued",
- "priceCent": 0,
- "hardware": {
- "gpuName": "NVIDIA GeForce RTX 4090",
- "cpuName": "",
- "gpuNum": 0,
- "gpuRamMB": 0,
- "cpuCoresNum": 0,
- "ramMB": 0,
- "diskGB": 0
}, - "baseImage": {
- "imageID": "87p9kq26",
- "imageName": "Ubuntu20.04 CUDA12.2 Python3.9"
}, - "baseSnap": null,
- "sshCred": {
- "user": "root",
- "password": ")Xdk%2XnZr{t6#EL"
}, - "accesses": [
- {
- "protocol": "ssh",
- "listenPort": 22,
- "url": ""
}, - {
- "protocol": "http",
- "listenPort": 8888,
- "url": ""
}, - {
- "protocol": "http",
- "listenPort": 7890,
- "url": ""
}
], - "domain": 0,
- "createTime": {
- "seconds": 1726810944
}, - "cmd": "",
- "envs": "foo=bar",
- "remark": "this is from sdk",
- "metaKey": "order.123456",
- "sourceType": "SourceSDK"
}
}
Retrieve information about a specific instance
request_id | string Request ID, returned after instance creation |
meta_key | string Meta key, specified by instance creation and is globally unique |
code | integer Return code, 0 means success, and others (not 0) means failure |
msg | string Returned message, typically a failure description |
object |
{- "code": 0,
- "msg": "",
- "instance": {
- "instanceID": "boyqp4g8",
- "category": "container",
- "status": "Running",
- "priceCent": 65,
- "hardware": {
- "gpuName": "NVIDIA GeForce RTX 4090",
- "cpuName": "Intel(R) Xeon(R) Platinum 8352V CPU @ 2.10GHz",
- "gpuNum": 1,
- "gpuRamMB": 24564,
- "cpuCoresNum": 10,
- "ramMB": 43008,
- "diskGB": 100
}, - "baseImage": {
- "imageID": "87p9kq26",
- "imageName": "Ubuntu20.04 CUDA12.2 Python3.9"
}, - "baseSnap": null,
- "sshCred": {
- "user": "root",
- "password": ")Xdk%2XnZr{t6#EL"
}, - "accesses": [
- {
- "protocol": "ssh",
- "listenPort": 22,
- "url": "ssh://tw-01.access.glows.ai:15692"
}, - {
- "protocol": "http",
- "listenPort": 8888,
}, - {
- "protocol": "http",
- "listenPort": 7890,
}
], - "domain": 0,
- "createTime": {
- "seconds": 1726810944
}, - "cmd": "",
- "envs": "foo=bar",
- "remark": "this is from sdk",
- "metaKey": "order.123456",
- "sourceType": "SourceSDK"
}
}
Cancel an instance using request_id or meta_key
request_id | string Request ID of the instance to be canceled |
meta_key | string Meta key of the instance to be canceled |
code | integer Return code, 0 means success, and others (not 0) means failure |
msg | string Returned message, typically a failure description |
{- "code": 0,
- "msg": ""
}
Retrieve the statistics of instances
code | integer Return code, 0 means success, and others (not 0) means failure |
msg | string Returned message, typically a failure description |
object Instances amount corresponding to each status; status with a statistic of 0 are not displayed |
{- "code": 0,
- "msg": "",
- "stats": {
- "Running": 1
}
}
Retrieve a list of instances with pagination and filtering options
page | integer Pagination number |
per_page | integer Number of pages per pagination |
ascending | boolean Whether to create in ascending order, default is reverse order |
statuses | Array of strings Display instances of the specified status |
code | integer Return code, 0 means success, and others (not 0) means failure |
msg | string Returned message, typically a failure description |
object | |
Array of objects |
{- "code": 0,
- "msg": "",
- "pagination": {
- "total": 0,
- "numPages": 0,
- "page": 1,
- "perPage": 10
}, - "instances": [ ]
}