Files
pyGoEdge-UserPanel/reference/goedge 文档/NSNodeService.md
2025-11-18 03:36:49 +08:00

14 KiB
Raw Blame History

NSNodeService

域名服务器节点服务


checkNSNodeLatestVersion

检查NS节点新版本

  • 角色:dns, admin
  • HTTPPOST https://backend.dooki.cloud/NSNodeService/checkNSNodeLatestVersion
  • RPCrpc checkNSNodeLatestVersion (CheckNSNodeLatestVersionRequest) returns (CheckNSNodeLatestVersionResponse);

请求对象 (CheckNSNodeLatestVersionRequest)

{
  "os": "string",
  "arch": "string",
  "currentVersion": "string"
}

响应对象 (CheckNSNodeLatestVersionResponse)

{
  "hasNewVersion": "bool",
  "newVersion": "string"
}

调用示例

curl -X POST "https://backend.dooki.cloud/NSNodeService/checkNSNodeLatestVersion" \
  -H "Content-Type: application/json" \
  -H "X-Edge-Access-Token: <YOUR_TOKEN>" \
  -d '{
    ...
  }'

countAllNSNodes

所有可用的NS节点数量

  • 角色:admin
  • HTTPPOST https://backend.dooki.cloud/NSNodeService/countAllNSNodes
  • RPCrpc countAllNSNodes (CountAllNSNodesRequest) returns (RPCCountResponse);

请求对象 (CountAllNSNodesRequest)

{}

响应对象 (RPCCountResponse)

{
  "count": "int64 // 数量"
}

调用示例

curl -X POST "https://backend.dooki.cloud/NSNodeService/countAllNSNodes" \
  -H "Content-Type: application/json" \
  -H "X-Edge-Access-Token: <YOUR_TOKEN>" \
  -d '{
    ...
  }'

countAllNSNodesMatch

计算匹配的NS节点数量

  • 角色:admin
  • HTTPPOST https://backend.dooki.cloud/NSNodeService/countAllNSNodesMatch
  • RPCrpc countAllNSNodesMatch (CountAllNSNodesMatchRequest) returns (RPCCountResponse);

请求对象 (CountAllNSNodesMatchRequest)

{
  "nsClusterId": "int64",
  "installState": "int32",
  "activeState": "int32",
  "keyword": "string // int64 nodeGroupId = 5;",
  "nodeRegionId": "int64"
}

响应对象 (RPCCountResponse)

{
  "count": "int64 // 数量"
}

调用示例

curl -X POST "https://backend.dooki.cloud/NSNodeService/countAllNSNodesMatch" \
  -H "Content-Type: application/json" \
  -H "X-Edge-Access-Token: <YOUR_TOKEN>" \
  -d '{
    ...
  }'

countAllUpgradeNSNodesWithNSClusterId

计算需要升级的NS节点数量

  • 角色:admin
  • HTTPPOST https://backend.dooki.cloud/NSNodeService/countAllUpgradeNSNodesWithNSClusterId
  • RPCrpc countAllUpgradeNSNodesWithNSClusterId (CountAllUpgradeNSNodesWithNSClusterIdRequest) returns (RPCCountResponse);

请求对象 (CountAllUpgradeNSNodesWithNSClusterIdRequest)

{
  "nsClusterId": "int64"
}

响应对象 (RPCCountResponse)

{
  "count": "int64 // 数量"
}

调用示例

curl -X POST "https://backend.dooki.cloud/NSNodeService/countAllUpgradeNSNodesWithNSClusterId" \
  -H "Content-Type: application/json" \
  -H "X-Edge-Access-Token: <YOUR_TOKEN>" \
  -d '{
    ...
  }'

createNSNode

创建NS节点

  • 角色:admin
  • HTTPPOST https://backend.dooki.cloud/NSNodeService/createNSNode
  • RPCrpc createNSNode (CreateNSNodeRequest) returns (CreateNSNodeResponse);

请求对象 (CreateNSNodeRequest)

{
  "name": "string // 名称",
  "nodeClusterId": "int64 // 集群ID",
  "nodeLogin": "NodeLogin"
}

响应对象 (CreateNSNodeResponse)

{
  "nsNodeId": "int64"
}

调用示例

curl -X POST "https://backend.dooki.cloud/NSNodeService/createNSNode" \
  -H "Content-Type: application/json" \
  -H "X-Edge-Access-Token: <YOUR_TOKEN>" \
  -d '{
    ...
  }'

deleteNSNode

删除NS节点

  • 角色:admin
  • HTTPPOST https://backend.dooki.cloud/NSNodeService/deleteNSNode
  • RPCrpc deleteNSNode (DeleteNSNodeRequest) returns (RPCSuccess);

请求对象 (DeleteNSNodeRequest)

{
  "nsNodeId": "int64"
}

响应对象 (RPCSuccess)

{}

调用示例

curl -X POST "https://backend.dooki.cloud/NSNodeService/deleteNSNode" \
  -H "Content-Type: application/json" \
  -H "X-Edge-Access-Token: <YOUR_TOKEN>" \
  -d '{
    ...
  }'

findAllNSNodesWithNSClusterId

根据集群查找所有NS节点

  • 角色:admin
  • HTTPPOST https://backend.dooki.cloud/NSNodeService/findAllNSNodesWithNSClusterId
  • RPCrpc findAllNSNodesWithNSClusterId (FindAllNSNodesWithNSClusterIdRequest) returns (FindAllNSNodesWithNSClusterIdResponse);

请求对象 (FindAllNSNodesWithNSClusterIdRequest)

{
  "nsClusterId": "int64"
}

响应对象 (FindAllNSNodesWithNSClusterIdResponse)

{
  "nsNodes": "[]NSNode"
}

调用示例

curl -X POST "https://backend.dooki.cloud/NSNodeService/findAllNSNodesWithNSClusterId" \
  -H "Content-Type: application/json" \
  -H "X-Edge-Access-Token: <YOUR_TOKEN>" \
  -d '{
    ...
  }'

findLatestNSNodeVersion

获取NS节点最新版本

  • 角色:admin
  • HTTPPOST https://backend.dooki.cloud/NSNodeService/findLatestNSNodeVersion
  • RPCrpc findLatestNSNodeVersion (FindLatestNSNodeVersionRequest) returns (FindLatestNSNodeVersionResponse);

请求对象 (FindLatestNSNodeVersionRequest)

{}

响应对象 (FindLatestNSNodeVersionResponse)

{
  "version": "string"
}

调用示例

curl -X POST "https://backend.dooki.cloud/NSNodeService/findLatestNSNodeVersion" \
  -H "Content-Type: application/json" \
  -H "X-Edge-Access-Token: <YOUR_TOKEN>" \
  -d '{
    ...
  }'

findNSNode

获取单个NS节点信息

  • 角色:admin
  • HTTPPOST https://backend.dooki.cloud/NSNodeService/findNSNode
  • RPCrpc findNSNode (FindNSNodeRequest) returns (FindNSNodeResponse);

请求对象 (FindNSNodeRequest)

{
  "nsNodeId": "int64"
}

响应对象 (FindNSNodeResponse)

{
  "nsNode": "NSNode"
}

调用示例

curl -X POST "https://backend.dooki.cloud/NSNodeService/findNSNode" \
  -H "Content-Type: application/json" \
  -H "X-Edge-Access-Token: <YOUR_TOKEN>" \
  -d '{
    ...
  }'

findNSNodeAPIConfig

查找单个节点的API相关配置

  • 角色:admin
  • HTTPPOST https://backend.dooki.cloud/NSNodeService/findNSNodeAPIConfig
  • RPCrpc findNSNodeAPIConfig(FindNSNodeAPIConfigRequest) returns (FindNSNodeAPIConfigResponse);

请求对象 (FindNSNodeAPIConfigRequest)

{
  "nsNodeId": "int64"
}

响应对象 (FindNSNodeAPIConfigResponse)

{
  "apiNodeAddrsJSON": "bytes"
}

调用示例

curl -X POST "https://backend.dooki.cloud/NSNodeService/findNSNodeAPIConfig" \
  -H "Content-Type: application/json" \
  -H "X-Edge-Access-Token: <YOUR_TOKEN>" \
  -d '{
    ...
  }'

findNSNodeDDoSProtection

获取NS节点的DDoS设置

  • 角色:admin, dns
  • HTTPPOST https://backend.dooki.cloud/NSNodeService/findNSNodeDDoSProtection
  • RPCrpc findNSNodeDDoSProtection(FindNSNodeDDoSProtectionRequest) returns (FindNSNodeDDoSProtectionResponse);

请求对象 (FindNSNodeDDoSProtectionRequest)

{
  "nsNodeId": "int64"
}

响应对象 (FindNSNodeDDoSProtectionResponse)

{
  "ddosProtectionJSON": "bytes"
}

调用示例

curl -X POST "https://backend.dooki.cloud/NSNodeService/findNSNodeDDoSProtection" \
  -H "Content-Type: application/json" \
  -H "X-Edge-Access-Token: <YOUR_TOKEN>" \
  -d '{
    ...
  }'

findNSNodeInstallStatus

读取NS节点安装状态

  • 角色:admin
  • HTTPPOST https://backend.dooki.cloud/NSNodeService/findNSNodeInstallStatus
  • RPCrpc findNSNodeInstallStatus (FindNSNodeInstallStatusRequest) returns (FindNSNodeInstallStatusResponse);

请求对象 (FindNSNodeInstallStatusRequest)

{
  "nsNodeId": "int64"
}

响应对象 (FindNSNodeInstallStatusResponse)

{
  "installStatus": "NodeInstallStatus"
}

调用示例

curl -X POST "https://backend.dooki.cloud/NSNodeService/findNSNodeInstallStatus" \
  -H "Content-Type: application/json" \
  -H "X-Edge-Access-Token: <YOUR_TOKEN>" \
  -d '{
    ...
  }'

installNSNode

安装NS节点

  • 角色:admin
  • HTTPPOST https://backend.dooki.cloud/NSNodeService/installNSNode
  • RPCrpc installNSNode (InstallNSNodeRequest) returns (InstallNSNodeResponse);

请求对象 (InstallNSNodeRequest)

{
  "nsNodeId": "int64"
}

响应对象 (InstallNSNodeResponse)

{}

调用示例

curl -X POST "https://backend.dooki.cloud/NSNodeService/installNSNode" \
  -H "Content-Type: application/json" \
  -H "X-Edge-Access-Token: <YOUR_TOKEN>" \
  -d '{
    ...
  }'

listNSNodesMatch

列出单页NS节点

  • 角色:admin
  • HTTPPOST https://backend.dooki.cloud/NSNodeService/listNSNodesMatch
  • RPCrpc listNSNodesMatch (ListNSNodesMatchRequest) returns (ListNSNodesMatchResponse);

请求对象 (ListNSNodesMatchRequest)

{
  "offset": "int64 // 读取位置",
  "size": "int64 // 数量通常不能小于0",
  "nsClusterId": "int64",
  "installState": "int32",
  "activeState": "int32",
  "keyword": "string // int64 nodeGroupId = 7;",
  "nodeRegionId": "int64"
}

响应对象 (ListNSNodesMatchResponse)

{
  "nsNodes": "[]NSNode"
}

调用示例

curl -X POST "https://backend.dooki.cloud/NSNodeService/listNSNodesMatch" \
  -H "Content-Type: application/json" \
  -H "X-Edge-Access-Token: <YOUR_TOKEN>" \
  -d '{
    ...
  }'

sendCommandToNSNode

向NS节点发送命令

  • 角色:admin
  • HTTPPOST https://backend.dooki.cloud/NSNodeService/sendCommandToNSNode
  • RPCrpc sendCommandToNSNode (NSNodeStreamMessage) returns (NSNodeStreamMessage);

请求对象 (NSNodeStreamMessage)

{
  "nsNodeId": "int64",
  "requestId": "int64",
  "timeoutSeconds": "int32",
  "code": "string",
  "dataJSON": "bytes",
  "isOk": "bool",
  "message": "string"
}

响应对象 (NSNodeStreamMessage)

{
  "nsNodeId": "int64",
  "requestId": "int64",
  "timeoutSeconds": "int32",
  "code": "string",
  "dataJSON": "bytes",
  "isOk": "bool",
  "message": "string"
}

调用示例

curl -X POST "https://backend.dooki.cloud/NSNodeService/sendCommandToNSNode" \
  -H "Content-Type: application/json" \
  -H "X-Edge-Access-Token: <YOUR_TOKEN>" \
  -d '{
    ...
  }'

startNSNode

启动NS节点

  • 角色:admin
  • HTTPPOST https://backend.dooki.cloud/NSNodeService/startNSNode
  • RPCrpc startNSNode (StartNSNodeRequest) returns (StartNSNodeResponse);

请求对象 (StartNSNodeRequest)

{
  "nsNodeId": "int64"
}

响应对象 (StartNSNodeResponse)

{
  "isOk": "bool",
  "error": "string"
}

调用示例

curl -X POST "https://backend.dooki.cloud/NSNodeService/startNSNode" \
  -H "Content-Type: application/json" \
  -H "X-Edge-Access-Token: <YOUR_TOKEN>" \
  -d '{
    ...
  }'

stopNSNode

停止NS节点

  • 角色:admin
  • HTTPPOST https://backend.dooki.cloud/NSNodeService/stopNSNode
  • RPCrpc stopNSNode (StopNSNodeRequest) returns (StopNSNodeResponse);

请求对象 (StopNSNodeRequest)

{
  "nsNodeId": "int64"
}

响应对象 (StopNSNodeResponse)

{
  "isOk": "bool",
  "error": "string"
}

调用示例

curl -X POST "https://backend.dooki.cloud/NSNodeService/stopNSNode" \
  -H "Content-Type: application/json" \
  -H "X-Edge-Access-Token: <YOUR_TOKEN>" \
  -d '{
    ...
  }'

updateNSNode

修改NS节点

  • 角色:admin
  • HTTPPOST https://backend.dooki.cloud/NSNodeService/updateNSNode
  • RPCrpc updateNSNode (UpdateNSNodeRequest) returns (RPCSuccess);

请求对象 (UpdateNSNodeRequest)

{
  "nsNodeId": "int64",
  "name": "string // 名称",
  "nsClusterId": "int64",
  "nodeLogin": "NodeLogin",
  "isOn": "bool // 是否启用"
}

响应对象 (RPCSuccess)

{}

调用示例

curl -X POST "https://backend.dooki.cloud/NSNodeService/updateNSNode" \
  -H "Content-Type: application/json" \
  -H "X-Edge-Access-Token: <YOUR_TOKEN>" \
  -d '{
    ...
  }'

updateNSNodeAPIConfig

修改某个节点的API相关配置

  • 角色:admin
  • HTTPPOST https://backend.dooki.cloud/NSNodeService/updateNSNodeAPIConfig
  • RPCrpc updateNSNodeAPIConfig(UpdateNSNodeAPIConfigRequest) returns (RPCSuccess);

请求对象 (UpdateNSNodeAPIConfigRequest)

{
  "nsNodeId": "int64",
  "apiNodeAddrsJSON": "bytes"
}

响应对象 (RPCSuccess)

{}

调用示例

curl -X POST "https://backend.dooki.cloud/NSNodeService/updateNSNodeAPIConfig" \
  -H "Content-Type: application/json" \
  -H "X-Edge-Access-Token: <YOUR_TOKEN>" \
  -d '{
    ...
  }'

updateNSNodeDDoSProtection

修改NS节点的DDoS设置

  • 角色:admin
  • HTTPPOST https://backend.dooki.cloud/NSNodeService/updateNSNodeDDoSProtection
  • RPCrpc updateNSNodeDDoSProtection(UpdateNSNodeDDoSProtectionRequest) returns (RPCSuccess);

请求对象 (UpdateNSNodeDDoSProtectionRequest)

{
  "nsNodeId": "int64",
  "ddosProtectionJSON": "bytes"
}

响应对象 (RPCSuccess)

{}

调用示例

curl -X POST "https://backend.dooki.cloud/NSNodeService/updateNSNodeDDoSProtection" \
  -H "Content-Type: application/json" \
  -H "X-Edge-Access-Token: <YOUR_TOKEN>" \
  -d '{
    ...
  }'

updateNSNodeIsInstalled

修改NS节点安装状态

  • 角色:admin
  • HTTPPOST https://backend.dooki.cloud/NSNodeService/updateNSNodeIsInstalled
  • RPCrpc updateNSNodeIsInstalled (UpdateNSNodeIsInstalledRequest) returns (RPCSuccess);

请求对象 (UpdateNSNodeIsInstalledRequest)

{
  "nsNodeId": "int64",
  "isInstalled": "bool"
}

响应对象 (RPCSuccess)

{}

调用示例

curl -X POST "https://backend.dooki.cloud/NSNodeService/updateNSNodeIsInstalled" \
  -H "Content-Type: application/json" \
  -H "X-Edge-Access-Token: <YOUR_TOKEN>" \
  -d '{
    ...
  }'

updateNSNodeLogin

修改NS节点登录信息

  • 角色:admin
  • HTTPPOST https://backend.dooki.cloud/NSNodeService/updateNSNodeLogin
  • RPCrpc updateNSNodeLogin (UpdateNSNodeLoginRequest) returns (RPCSuccess);

请求对象 (UpdateNSNodeLoginRequest)

{
  "nsNodeId": "int64",
  "nodeLogin": "NodeLogin"
}

响应对象 (RPCSuccess)

{}

调用示例

curl -X POST "https://backend.dooki.cloud/NSNodeService/updateNSNodeLogin" \
  -H "Content-Type: application/json" \
  -H "X-Edge-Access-Token: <YOUR_TOKEN>" \
  -d '{
    ...
  }'