此操作用来设置远程协助。
请求语法
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
}
}