Glows.ai SDK API (1.0.0)

API documentation for Glows.ai SDK

Start an instance

Start a new instance using the SDK

Request Body schema: application/json
required
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

Responses

Response Schema: application/json
code
integer

Return code, 0 means success, and others (not 0) means failure

msg
string

Returned message, typically a failure description

object

Request samples

Content type
application/json
{
  • "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}]"
}

Response samples

Content type
application/json
{
  • "code": 0,
  • "msg": "",
  • "instance": {
    }
}

Retrieve instance info

Retrieve information about a specific instance

Authorizations:
bearerAuth
query Parameters
request_id
string

Request ID, returned after instance creation

meta_key
string

Meta key, specified by instance creation and is globally unique

Responses

Response Schema: application/json
code
integer

Return code, 0 means success, and others (not 0) means failure

msg
string

Returned message, typically a failure description

object

Response samples

Content type
application/json
{
  • "code": 0,
  • "msg": "",
  • "instance": {
    }
}

Cancel instance

Cancel an instance using request_id or meta_key

Authorizations:
bearerAuth
query Parameters
request_id
string

Request ID of the instance to be canceled

meta_key
string

Meta key of the instance to be canceled

Responses

Response Schema: application/json
code
integer

Return code, 0 means success, and others (not 0) means failure

msg
string

Returned message, typically a failure description

Response samples

Content type
application/json
{
  • "code": 0,
  • "msg": ""
}

Stat instance

Retrieve the statistics of instances

Authorizations:
bearerAuth

Responses

Response Schema: application/json
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

Response samples

Content type
application/json
{
  • "code": 0,
  • "msg": "",
  • "stats": {
    }
}

Instance list

Retrieve a list of instances with pagination and filtering options

Authorizations:
bearerAuth
query Parameters
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

Responses

Response Schema: application/json
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

Response samples

Content type
application/json
{
  • "code": 0,
  • "msg": "",
  • "pagination": {
    },
  • "instances": [ ]
}