cURL
curl --request POST \ --url https://www.chenyu.cn/api/open/v2/instance/destroy \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "instance_uuid": "<string>" }'
{ "code": 123, "msg": "<string>" }
销毁指定的实例
import requests url = "https://www.chenyu.cn/api/open/v2/instance/destroy" headers = { "Authorization": "Bearer your_api_key", "Content-Type": "application/json" } data = { "instance_uuid": "inst_12345678-1234-1234-1234-123456789012" } response = requests.post(url, headers=headers, json=data) result = response.json() if result['code'] == 0: print("实例销毁成功") else: print(f"销毁失败: {result['msg']}")
{ "code": 0, "msg": "销毁成功" }