update_remote_node
const url = 'https://example.com/api/v1/admin/remote-nodes/1';const options = { method: 'PATCH', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"base_url":"example","is_enabled":true,"name":"example","transport_mode":"direct"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}use std::str::FromStr;use serde_json::json;use reqwest;
#[tokio::main]pub async fn main() { let url = "https://example.com/api/v1/admin/remote-nodes/1";
let payload = json!({ "base_url": "example", "is_enabled": true, "name": "example", "transport_mode": "direct" });
let mut headers = reqwest::header::HeaderMap::new(); headers.insert("Authorization", "Bearer <token>".parse().unwrap()); headers.insert("Content-Type", "application/json".parse().unwrap());
let client = reqwest::Client::new(); let response = client.request(reqwest::Method::from_str("PATCH").unwrap(), url) .headers(headers) .json(&payload) .send() .await;
let results = response.unwrap() .json::<serde_json::Value>() .await .unwrap();
dbg!(results);}curl --request PATCH \ --url https://example.com/api/v1/admin/remote-nodes/1 \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "base_url": "example", "is_enabled": true, "name": "example", "transport_mode": "direct" }'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Remote node ID
Request Bodyrequired
Section titled “Request Bodyrequired”Responses
Section titled “Responses”Remote node updated
统一 API 响应格式
成功: { "code": "success", "msg": "", "data": {...} }
失败: { "code": "auth.credentials_failed", "msg": "Invalid Credentials" }
object
object
Direct transport base URL, or empty when reverse tunnel is selected.
Capabilities returned by the most recent explicit probe.
object
object
object
object
Time at which the remote node was created.
Current enrollment lifecycle state.
Stable database identifier of the remote node.
Whether the remote node is enabled for administration and transport.
Timestamp of the most recent explicit capability probe.
Result of the most recent explicit capability probe or connection test.
Administrative display name.
Configured transport choice; auto is resolved from base_url at runtime.
Runtime reverse-tunnel health telemetry, separate from probe state above.
object
Transient runtime error from the tunnel control/data path. The next successful poll or stream handshake clears it; it is not a historical error log.
Last successful poll or stream handshake persisted by the primary.
Online status derived from recent successful tunnel handshakes and the online TTL.
Time of the latest administrative remote-node change.
Example
{ "code": "success", "data": { "enrollment_status": "not_started", "transport_mode": "direct", "tunnel": { "status": "online" } }}Unauthorized
Forbidden
Remote node not found