Files
EdgeCommon/pkg/rpc/protos/service_origin.proto
2023-06-07 17:26:34 +08:00

84 lines
2.4 KiB
Protocol Buffer
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

syntax = "proto3";
option go_package = "./pb";
package pb;
import "models/model_origin.proto";
import "models/model_network_address.proto";
import "models/rpc_messages.proto";
// 源站管理服务
service OriginService {
// 创建源站
rpc createOrigin (CreateOriginRequest) returns (CreateOriginResponse);
// 修改源站
rpc updateOrigin (UpdateOriginRequest) returns (RPCSuccess);
// 查找单个源站信息
rpc findEnabledOrigin (FindEnabledOriginRequest) returns (FindEnabledOriginResponse);
// 查找源站配置
rpc findEnabledOriginConfig (FindEnabledOriginConfigRequest) returns (FindEnabledOriginConfigResponse);
}
// 创建源站
message CreateOriginRequest {
string name = 1; // 名称,为可选项
NetworkAddress addr = 2; // 源站网络地址
bytes ossJSON = 15; // OSS配置信息源站网络地址中protocol为oss:开头时需要设置此项
string description = 3; // 描述,为可选项
int32 weight = 4; // 权重不小于0一般设置为10
bool isOn = 5; // 是否启用
bytes connTimeoutJSON = 6; // 可选项
bytes readTimeoutJSON = 7; // 可选项
bytes idleTimeoutJSON = 8; // 可选项
int32 maxConns = 9; // 可选项
int32 maxIdleConns = 10; // 可选项
repeated string domains = 11; // 可选项
bytes certRefJSON = 12; // 可选项
string host = 13; // 可选项
bool followPort = 14; // 可选项
}
message CreateOriginResponse {
int64 originId = 1;
}
// 修改源站
message UpdateOriginRequest {
int64 originId = 1; // 源站ID
string name = 2; // 可选项
NetworkAddress addr = 3; // 源站网络地址
bytes ossJSON = 16; // OSS配置信息源站网络地址中protocol为oss:开头时需要设置此项
string description = 4; // 可选项
int32 weight = 5; // 权重不小于0一般设置为10
bool isOn = 6; // 是否启用
bytes connTimeoutJSON = 7; // 可选项
bytes readTimeoutJSON = 8; // 可选项
bytes idleTimeoutJSON = 9; // 可选项
int32 maxConns = 10; // 可选项
int32 maxIdleConns = 11; // 可选项
repeated string domains = 12; // 可选项
bytes certRefJSON = 13; // 可选项
string host = 14; // 可选项
bool followPort = 15; // 可选项
}
// 查找单个源站信息
message FindEnabledOriginRequest {
int64 originId = 1;
}
message FindEnabledOriginResponse {
Origin Origin = 1;
}
// 查找源站配置
message FindEnabledOriginConfigRequest {
int64 originId = 1;
}
message FindEnabledOriginConfigResponse {
bytes originJSON = 1;
}