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

2.5 KiB
Raw Blame History

IPLibraryService

IP库


createIPLibrary

创建IP库

  • 角色:admin

  • HTTPPOST https://backend.dooki.cloud/IPLibraryService/createIPLibrary

  • RPC`rpc createIPLibrary (CreateIPLibraryRequest) returns (CreateIPLibraryResponse) { option deprecated = true; };

    // 查找最新的IP库 rpc findLatestIPLibraryWithType (FindLatestIPLibraryWithTypeRequest) returns (FindLatestIPLibraryWithTypeResponse) { option deprecated = true; };

    // 查找单个IP库 rpc findEnabledIPLibrary (FindEnabledIPLibraryRequest) returns (FindEnabledIPLibraryResponse) { option deprecated = true; };

    // 列出某个类型的所有IP库 rpc findAllEnabledIPLibrariesWithType (FindAllEnabledIPLibrariesWithTypeRequest) returns (FindAllEnabledIPLibrariesWithTypeResponse) { option deprecated = true; };

    // 删除IP库 rpc deleteIPLibrary (DeleteIPLibraryRequest) returns (RPCSuccess) { option deprecated = true; };`

请求对象 (CreateIPLibraryRequest)

{
  "type": "string",
  "fileId": "int64 // 文件ID"
}

响应对象 (CreateIPLibraryResponse)

{
  "ipLibraryId": "int64"
}

调用示例

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

lookupIPRegion

查询某个IP信息

  • 角色:admin, user
  • HTTPPOST https://backend.dooki.cloud/IPLibraryService/lookupIPRegion
  • RPCrpc lookupIPRegion (LookupIPRegionRequest) returns (LookupIPRegionResponse);

请求对象 (LookupIPRegionRequest)

{
  "ip": "string"
}

响应对象 (LookupIPRegionResponse)

{
  "ipRegion": "IPRegion"
}

调用示例

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

lookupIPRegions

查询一组IP信息

  • 角色:admin, user
  • HTTPPOST https://backend.dooki.cloud/IPLibraryService/lookupIPRegions
  • RPCrpc lookupIPRegions (LookupIPRegionsRequest) returns (LookupIPRegionsResponse);

请求对象 (LookupIPRegionsRequest)

{
  "ipList": "[]string"
}

响应对象 (LookupIPRegionsResponse)

{
  "ipRegionMap": "map"
}

调用示例

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