使用 PHP 部署由 Scaleway 提供支持的 15 分钟试用 VPS

Use PHP to deploy 15 minutes trial VPS powered by Scaleway

我只知道那是 http://instantcloud.io api link is https://try.cloud.online.net

我想免费提供 15 分钟 VPS 给我的网站访问者享受更多,当然我会把积分留给 instantcloud.io 因为他们是主办方

有人可以告诉我一些 php 示例以开始构建吗?

编辑:纠正一下,Instantcloud.io 过去提供 20 分钟的试用期,但现在只有 15 分钟。


看起来很简单。

无论如何,Instantcloud.ioAPIlink是https://try.cloud.online.net/servers and not https://try.cloud.online.net.

和很多API一样,Instantcloud.ioAPIreturn的数据使用JSON.

目前,当我尝试在浏览器中浏览 https://try.cloud.online.net/servers 时,我得到 以下

{
  "message": "No server available at the moment",
  "type": "unknown_resource"
}

当我尝试单击 http://instantcloud.io/ 中的“获取您的 C2M 服务器”按钮时,我得到

Oops!

All cloud servers are busy, please retry in few minutes :)

所以,https://try.cloud.online.net/servers真的return正确答案!


首先制作 PHP 部分:

<?php
$instantcloud['api'] = "https://try.cloud.online.net/servers";
$instantcloud['jsonfalse'] = json_decode($instantcloud['api']);
if( $instantcloud['jsonfalse']->message == "No server available at the moment" ) {
    echo 'Failed creating server. Reason: no stocks available.';
    die();
}
?>

我真的不知道我们如何创建服务器 AT THE MOMENT ,因为我收到“目前没有可用的服务器”并且我不知道 API 会怎样 return 如果创建服务器...

所以请等到我能够创建一个服务器,然后我会编辑这个答案!