实例开机
启动一个已停止的实例。请求参数
实例uuid
gpu型号id,默认使用创建时的gpu型号
gpu数量,支持1/2/4/8,默认使用创建时的gpu数量
响应参数
响应码
响应信息
curl --request POST \
--url https://www.chenyu.cn/api/open/v2/instance/startup \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"instance_uuid": "<string>",
"gpu_uuid": "<string>",
"gpu_nums": 123
}'
{
"code": 123,
"msg": "<string>"
}
启动指定的实例
curl --request POST \
--url https://www.chenyu.cn/api/open/v2/instance/startup \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"instance_uuid": "<string>",
"gpu_uuid": "<string>",
"gpu_nums": 123
}'
{
"code": 123,
"msg": "<string>"
}
import requests
url = "https://www.chenyu.cn/api/open/v2/instance/startup"
headers = {
"Authorization": "Bearer your_api_key",
"Content-Type": "application/json"
}
data = {
"instance_uuid": "inst_12345678-1234-1234-1234-123456789012",
"gpu_uuid": "gpu_12345678-1234-1234-1234-123456789012",
"gpu_nums": 1
}
response = requests.post(url, headers=headers, json=data)
result = response.json()
if result['code'] == 0:
print("实例启动成功")
else:
print(f"启动失败: {result['msg']}")
{
"code": 0,
"msg": "启动成功"
}