VPS主机相关 - API文档

重置VPS密码

/Vps/Password

API分类 VPS主机相关 请求方法 POST

API简介

重置VPS主机的远程密码。

请求参数

名称 必须 说明
ApiKey API请求时必须提供的密钥,请和管理员联系索取
Password 登录朝暮数据用户管理的密码
VpsName VPS主机编号,非IP地址
VpsPassword VPS主机远程密码

注:参数名称不区分大小写。

请求示例

BASE_URL/Vps/Password

以下参数请用 POST 方式提交到 Form Data 中。

  • ApiKey=testApi
  • Password=testPassword
  • VpsName=VPS123456
  • VpsPassword=newPassword

输出结果

{
    success: true
    info: "密码重置成功"
}

代码示例

using RestSharp; //使用第三方组件RestSharp

var client = new RestClient();
client.BaseUrl = new Uri("http://BASE_URL");

var request = new RestRequest("/Vps/Password",Method.POST);
request.AddParameter("ApiKey", "testApi");
request.AddParameter("Password", "testPassword");
request.AddParameter("VpsName", "VPS123456");
request.AddParameter("VpsPassword", "newPassword");

var response = client.Execute(request);
string result = response.Content;
$url = 'http://BASE_URL/Vps/Password';
$param = array(
  'ApiKey' => 'testApi',
  'Password' => 'testPassword',
  'VpsName' => 'VPS123456'    
  'VpsPassword' => 'newPassword'    
);
$data = http_build_query($param);

$options = array(
            'http' => array(
                'method' => 'POST',
                'header' => 'Content-Type: application/x-www-form-urlencoded',
                'content' => $data
        ));
$context = stream_context_create($options);
$result = file_get_contents($url, FILE_TEXT, $context);
?>
'API请求的URL地址
const url = "http://BASE_URL/Vps/Password"

'API请求的提交数据
postData = "ApiKey=testApi&Password=testPassword&VpsName=VPS123456&VpsPassword=newPassword"

'执行HTTP请求
Set http = Server.CreateObject("MSXML2.ServerXMLHTTP")
http.Open "POST", url, False
http.setRequestHeader "Content-Type","application/x-www-form-urlencoded"
http.Send

'获取并分析结果
result = http.responseText