3.7 KiB
3.7 KiB
NSKeyService
NS密钥相关服务
countAllNSKeys
计算密钥数量
- 角色:
admin,user - HTTP:
POST https://backend.dooki.cloud/NSKeyService/countAllNSKeys - RPC:
rpc countAllNSKeys (CountAllNSKeysRequest) returns (RPCCountResponse);
请求对象 (CountAllNSKeysRequest)
{
"nsDomainId": "int64",
"nsZoneId": "int64"
}
响应对象 (RPCCountResponse)
{
"count": "int64 // 数量"
}
调用示例
curl -X POST "https://backend.dooki.cloud/NSKeyService/countAllNSKeys" \
-H "Content-Type: application/json" \
-H "X-Edge-Access-Token: <YOUR_TOKEN>" \
-d '{
...
}'
createNSKey
创建密钥
- 角色:
admin,user - HTTP:
POST https://backend.dooki.cloud/NSKeyService/createNSKey - RPC:
rpc createNSKey (CreateNSKeyRequest) returns (CreateNSKeyResponse);
请求对象 (CreateNSKeyRequest)
{
"nsDomainId": "int64",
"nsZoneId": "int64",
"name": "string // 名称",
"algo": "string",
"secret": "string",
"secretType": "string"
}
响应对象 (CreateNSKeyResponse)
{
"nsKeyId": "int64"
}
调用示例
curl -X POST "https://backend.dooki.cloud/NSKeyService/createNSKey" \
-H "Content-Type: application/json" \
-H "X-Edge-Access-Token: <YOUR_TOKEN>" \
-d '{
...
}'
deleteNSKey
删除密钥
- 角色:
admin,user - HTTP:
POST https://backend.dooki.cloud/NSKeyService/deleteNSKey - RPC:
rpc deleteNSKey (DeleteNSKeyRequest) returns (RPCSuccess);
请求对象 (DeleteNSKeyRequest)
{
"nsKeyId": "int64"
}
响应对象 (RPCSuccess)
{}
调用示例
curl -X POST "https://backend.dooki.cloud/NSKeyService/deleteNSKey" \
-H "Content-Type: application/json" \
-H "X-Edge-Access-Token: <YOUR_TOKEN>" \
-d '{
...
}'
findNSKey
查找单个密钥
- 角色:
admin,user - HTTP:
POST https://backend.dooki.cloud/NSKeyService/findNSKey - RPC:
rpc findNSKey (FindNSKeyRequest) returns (FindNSKeyResponse);
请求对象 (FindNSKeyRequest)
{
"nsKeyId": "int64"
}
响应对象 (FindNSKeyResponse)
{
"nsKey": "NSKey"
}
调用示例
curl -X POST "https://backend.dooki.cloud/NSKeyService/findNSKey" \
-H "Content-Type: application/json" \
-H "X-Edge-Access-Token: <YOUR_TOKEN>" \
-d '{
...
}'
listNSKeys
列出单页密钥
- 角色:
admin,user - HTTP:
POST https://backend.dooki.cloud/NSKeyService/listNSKeys - RPC:
rpc listNSKeys (ListNSKeysRequest) returns (ListNSKeysResponse);
请求对象 (ListNSKeysRequest)
{
"nsDomainId": "int64",
"nsZoneId": "int64",
"offset": "int64 // 读取位置",
"size": "int64 // 数量,通常不能小于0"
}
响应对象 (ListNSKeysResponse)
{
"nsKeys": "[]NSKey"
}
调用示例
curl -X POST "https://backend.dooki.cloud/NSKeyService/listNSKeys" \
-H "Content-Type: application/json" \
-H "X-Edge-Access-Token: <YOUR_TOKEN>" \
-d '{
...
}'
updateNSKey
修改密钥
- 角色:
admin,user - HTTP:
POST https://backend.dooki.cloud/NSKeyService/updateNSKey - RPC:
rpc updateNSKey (UpdateNSKeyRequest) returns (RPCSuccess);
请求对象 (UpdateNSKeyRequest)
{
"nsKeyId": "int64",
"name": "string // 名称",
"algo": "string",
"secret": "string",
"secretType": "string",
"isOn": "bool // 是否启用"
}
响应对象 (RPCSuccess)
{}
调用示例
curl -X POST "https://backend.dooki.cloud/NSKeyService/updateNSKey" \
-H "Content-Type: application/json" \
-H "X-Edge-Access-Token: <YOUR_TOKEN>" \
-d '{
...
}'