Oneprovider API
注意,重装系统时手动指定下分区,也许能提高重装成功率。
似乎是一定几率出现 bash: ${USER}: bad substitution
获取服务器信息
curl https://api.oneprovider.com/server/list/ -H "Api-Key: API_FzJRc3F2KadZ0RpXVt1QsApc3dYxucRt" -H "Client-Key: CK_UqRDp964tLVRCxBhrJ1TsltSH5jVjXOl" -A "OneApi/1.0"
id: 94671
获取可用操作
curl https://api.oneprovider.com/server/manage/94671/ -H "Api-Key: API_FzJRc3F2KadZ0RpXVt1QsApc3dYxucRt" -H "Client-Key: CK_UqRDp964tLVRCxBhrJ1TsltSH5jVjXOl" -A "OneApi/1.0"
获取安装 OS id
curl https://api.oneprovider.com/server/action/ -H "Api-Key: API_FzJRc3F2KadZ0RpXVt1QsApc3dYxucRt" -H "Client-Key: CK_UqRDp964tLVRCxBhrJ1TsltSH5jVjXOl" -A "OneApi/1.0" -d "server_id=94671&action=get_assigns"
"CentOS", { "id": "296", "version": "CentOS 6.7 32 bits", "price": "0.00" }, { "id": "297", "version": "CentOS 6.7 64 bits", "price": "0.00" }, { "id": "305", "version": "CentOS 7.2 64 bits", "price": "0.00" } "Debian", "versions": [ { "id": "328", "version": "Debian 8 64 bits", "price": "0.00" } "Ubuntu", "versions": [ { "id": "301", "version": "Ubuntu 14.04 LTS 64 bits", "price": "0.00" }, { "id": "302", "version": "Ubuntu 14.04 LTS 32 bits", "price": "0.00" }, { "id": "348", "version": "Ubuntu 16.04 LTS 64 bits", "price": "0.00" }, { "id": "349", "version": "Ubuntu 16.04 LTS 32 bits", "price": "0.00" }, { "id": "373", "version": "Ubuntu 18.04 LTS (The Bionic Beaver) 64 bits", "price": "0.00" }
重装系统
curl https://api.oneprovider.com/server/action/ -H "Api-Key: API_FzJRc3F2KadZ0RpXVt1QsApc3dYxucRt" -H "Client-Key: CK_UqRDp964tLVRCxBhrJ1TsltSH5jVjXOl" -A "OneApi/1.0" -d "server_id=94671&action=reinstall&os_id=305&hostname=dedi-par-31794&username=mrli&password=zZ4yVhrwLMVEFKm"
重启
curl https://api.oneprovider.com/server/action/ -H "Api-Key: API_FzJRc3F2KadZ0RpXVt1QsApc3dYxucRt" -H "Client-Key: CK_UqRDp964tLVRCxBhrJ1TsltSH5jVjXOl" -A "OneApi/1.0" -d "server_id=94671&action=reboot&reason=reboot"