設置遠程協助
更新時間 2025-04-23 15:02:34
最近更新時間: 2025-04-23 15:02:34
分享文章
本節主要介紹如何使用API設置遠程協助。
此操作用來設置遠程協助。
請求語法
PUT /rest/v1/system/config/remoteAccess HTTP/1.1
Date: date
Content-Type: application/json; charset=utf-8
Content-Length: length
Host: ip:port
Authorization: authorization
{
"serverId": serverId,
"status": status,
"host": host,
"port": port
}請求參數
| 名稱 | 類型 | 描述 | 是否必須 |
|---|---|---|---|
| serverId | String | 服務器ID。 如果不指定,默認設置當前被請求的服務器。 | 否 |
| status | String | 是否啟用遠程協助。 取值:
| 是 |
| host | String | 遠程協助的服務端IP或域名。 說明 請聯系軟件供應商獲取host信息。 除下列情況host必填外,其他情況選填:
| 否 |
| port | Integer | 遠程協助的端口。 說明 請聯系軟件供應商獲取端口號。 取值:[1,65535],默認18100。 | 否 |
響應結果
| 名稱 | 類型 | 描述 |
|---|---|---|
| code | Integer | 遠程協助碼,6位數字。 |
| host | String | 遠程協助的服務端IP。 |
| port | Integer | 遠程協助端口。 |
請求示例
設置遠程協助。
PUT /rest/v1/system/config/remoteAccess HTTP/1.1
Date: Thu, 17 Mar 2022 09: 20: 16 GMT
Content-Type: application/json; charset=utf-8
Content-Length: 113
Host: 192.168.0.121: 1443
Authorization: HBlock userName:signature
{
"serverId": "hblock_1",
"status": "Enabled",
"host": "182.151.21.174",
"port": 18100
}響應示例
HTTP/1.1 200 OK
Date: Thu, 17 Mar 2022 09: 20: 16 GMT
Content-Length: 63
Connection:keep-alive
Content-Type: application/json; charset=utf-8
x-hblock-request-id: a839f9f8e76a4f18969f7e2637c957eb
Server: HBlock
{
"data": {
"code": "999342",
"host": "182.151.21.174",
"port": 18100
}
}