mirror of
https://github.com/TeaOSLab/EdgeCommon.git
synced 2025-11-03 12:20:27 +08:00
添加快捷添加和删除网站源站API
This commit is contained in:
@@ -9513,7 +9513,10 @@
|
||||
"responseMessageName": "FindBasicPlanResponse",
|
||||
"code": "rpc findBasicPlan(FindBasicPlanRequest) returns (FindBasicPlanResponse);",
|
||||
"doc": "查找套餐基本信息",
|
||||
"roles": [],
|
||||
"roles": [
|
||||
"admin",
|
||||
"user"
|
||||
],
|
||||
"isDeprecated": false
|
||||
},
|
||||
{
|
||||
@@ -10527,6 +10530,30 @@
|
||||
],
|
||||
"isDeprecated": false
|
||||
},
|
||||
{
|
||||
"name": "addServerOrigin",
|
||||
"requestMessageName": "AddServerOriginRequest",
|
||||
"responseMessageName": "RPCSuccess",
|
||||
"code": "rpc addServerOrigin(AddServerOriginRequest) returns (RPCSuccess);",
|
||||
"doc": "为网站添加源站",
|
||||
"roles": [
|
||||
"admin",
|
||||
"user"
|
||||
],
|
||||
"isDeprecated": false
|
||||
},
|
||||
{
|
||||
"name": "deleteServerOrigin",
|
||||
"requestMessageName": "DeleteServerOriginRequest",
|
||||
"responseMessageName": "RPCSuccess",
|
||||
"code": "rpc deleteServerOrigin(DeleteServerOriginRequest) returns (RPCSuccess);",
|
||||
"doc": "从网站中删除某个源站",
|
||||
"roles": [
|
||||
"admin",
|
||||
"user"
|
||||
],
|
||||
"isDeprecated": false
|
||||
},
|
||||
{
|
||||
"name": "updateServerBasic",
|
||||
"requestMessageName": "UpdateServerBasicRequest",
|
||||
@@ -14007,6 +14034,11 @@
|
||||
"code": "message AddHTTPFirewallRuleGroupSetRequest {\n\tint64 firewallRuleGroupId = 1;\n\tbytes firewallRuleSetConfigJSON = 2;\n}",
|
||||
"doc": "添加规则集"
|
||||
},
|
||||
{
|
||||
"name": "AddServerOriginRequest",
|
||||
"code": "message AddServerOriginRequest {\n\tint64 serverId = 1; // 网站ID\n\tint64 originId = 2; // 源站ID,通过 OriginService 创建和查询\n\tbool isPrimary = 3; // 是否为主要源站\n}",
|
||||
"doc": "为网站添加源站"
|
||||
},
|
||||
{
|
||||
"name": "Admin",
|
||||
"code": "message Admin {\n\tint64 id = 1; // ID\n\tstring fullname = 2; // 全称\n\tstring username = 3; // 用户名\n\tbool isOn = 4; // 是否启用\n\tbool isSuper = 5; // 是否为超级用户\n\tint64 createdAt = 6; // 创建时间\n\trepeated AdminModule Modules = 7; // 有权限的模块\n\tLogin otpLogin = 8; // OTP认证\n\tbool canLogin = 9; // 是否可以登录\n\tbool hasWeakPassword = 10; // 是否设置了弱密码,只有超级管理员能看到此项\n}",
|
||||
@@ -15844,7 +15876,7 @@
|
||||
},
|
||||
{
|
||||
"name": "CreateOriginRequest",
|
||||
"code": "message CreateOriginRequest {\n\tstring name = 1; // 名称,为可选项\n\tNetworkAddress addr = 2; // 源站网络地址\n\tbytes ossJSON = 15; // OSS配置信息,源站网络地址中protocol为oss:开头时需要设置此项\n\tstring description = 3; // 描述,为可选项\n\tint32 weight = 4; // 权重,不小于0,一般设置为10\n\tbool isOn = 5; // 是否启用\n\tbytes connTimeoutJSON = 6; // 可选项,连接超时时间\n\tbytes readTimeoutJSON = 7; // 可选项,读取超时时间\n\tbytes idleTimeoutJSON = 8; // 可选项,空闲超时时间\n\tint32 maxConns = 9; // 可选项,最大连接数\n\tint32 maxIdleConns = 10; // 可选项,最大空闲连接数\n\trepeated string domains = 11; // 可选项,专属域名列表\n\tbytes certRefJSON = 12; // 可选项,证书设置\n\tstring host = 13; // 可选项,回源主机名\n\tbool followPort = 14; // 可选项,是否跟随端口\n\tbool http2Enabled = 16; // 可选项,是否支持HTTP/2,只在HTTPS源站时生效\n}",
|
||||
"code": "message CreateOriginRequest {\n\tstring name = 1; // 名称,为可选项\n\tNetworkAddress addr = 2; // 源站网络地址\n\tbytes ossJSON = 15; // OSS配置信息,源站网络地址中protocol为oss:开头时需要设置此项\n\tstring description = 3; // 描述,为可选项\n\tint32 weight = 4; // 权重,不小于0,一般设置为10\n\tbool isOn = 5; // 是否启用,一般为true\n\tbytes connTimeoutJSON = 6; // 可选项,连接超时时间\n\tbytes readTimeoutJSON = 7; // 可选项,读取超时时间\n\tbytes idleTimeoutJSON = 8; // 可选项,空闲超时时间\n\tint32 maxConns = 9; // 可选项,最大连接数\n\tint32 maxIdleConns = 10; // 可选项,最大空闲连接数\n\trepeated string domains = 11; // 可选项,专属域名列表\n\tbytes certRefJSON = 12; // 可选项,证书设置\n\tstring host = 13; // 可选项,回源主机名\n\tbool followPort = 14; // 可选项,是否跟随端口\n\tbool http2Enabled = 16; // 可选项,是否支持HTTP/2,只在HTTPS源站时生效\n}",
|
||||
"doc": "创建源站"
|
||||
},
|
||||
{
|
||||
@@ -16512,6 +16544,11 @@
|
||||
"code": "message DeleteServerGroupRequest {\n\tint64 serverGroupId = 1;\n}",
|
||||
"doc": "删除分组"
|
||||
},
|
||||
{
|
||||
"name": "DeleteServerOriginRequest",
|
||||
"code": "message DeleteServerOriginRequest {\n\tint64 serverId = 1; // 网站ID\n\tint64 originId = 2; // 源站ID,通过 OriginService 创建和查询\n}",
|
||||
"doc": "从网站中删除某个源站"
|
||||
},
|
||||
{
|
||||
"name": "DeleteServerRequest",
|
||||
"code": "message DeleteServerRequest {\n\tint64 serverId = 1; // 网站ID\n}",
|
||||
@@ -18764,22 +18801,22 @@
|
||||
},
|
||||
{
|
||||
"name": "FindEnabledOriginConfigRequest",
|
||||
"code": "message FindEnabledOriginConfigRequest {\n\tint64 originId = 1;\n}",
|
||||
"code": "message FindEnabledOriginConfigRequest {\n\tint64 originId = 1; // 源站ID\n}",
|
||||
"doc": "查找源站配置"
|
||||
},
|
||||
{
|
||||
"name": "FindEnabledOriginConfigResponse",
|
||||
"code": "message FindEnabledOriginConfigResponse {\n\tbytes originJSON = 1;\n}",
|
||||
"code": "message FindEnabledOriginConfigResponse {\n\tbytes originJSON = 1; // 源站信息\n}",
|
||||
"doc": ""
|
||||
},
|
||||
{
|
||||
"name": "FindEnabledOriginRequest",
|
||||
"code": "message FindEnabledOriginRequest {\n\tint64 originId = 1;\n}",
|
||||
"code": "message FindEnabledOriginRequest {\n\tint64 originId = 1; // 源站ID\n}",
|
||||
"doc": "查找单个源站信息"
|
||||
},
|
||||
{
|
||||
"name": "FindEnabledOriginResponse",
|
||||
"code": "message FindEnabledOriginResponse {\n\tOrigin Origin = 1;\n}",
|
||||
"code": "message FindEnabledOriginResponse {\n\tOrigin Origin = 1; // 源站信息\n}",
|
||||
"doc": ""
|
||||
},
|
||||
{
|
||||
|
||||
@@ -31,7 +31,7 @@ type CreateOriginRequest struct {
|
||||
OssJSON []byte `protobuf:"bytes,15,opt,name=ossJSON,proto3" json:"ossJSON,omitempty"` // OSS配置信息,源站网络地址中protocol为oss:开头时需要设置此项
|
||||
Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` // 描述,为可选项
|
||||
Weight int32 `protobuf:"varint,4,opt,name=weight,proto3" json:"weight,omitempty"` // 权重,不小于0,一般设置为10
|
||||
IsOn bool `protobuf:"varint,5,opt,name=isOn,proto3" json:"isOn,omitempty"` // 是否启用
|
||||
IsOn bool `protobuf:"varint,5,opt,name=isOn,proto3" json:"isOn,omitempty"` // 是否启用,一般为true
|
||||
ConnTimeoutJSON []byte `protobuf:"bytes,6,opt,name=connTimeoutJSON,proto3" json:"connTimeoutJSON,omitempty"` // 可选项,连接超时时间
|
||||
ReadTimeoutJSON []byte `protobuf:"bytes,7,opt,name=readTimeoutJSON,proto3" json:"readTimeoutJSON,omitempty"` // 可选项,读取超时时间
|
||||
IdleTimeoutJSON []byte `protobuf:"bytes,8,opt,name=idleTimeoutJSON,proto3" json:"idleTimeoutJSON,omitempty"` // 可选项,空闲超时时间
|
||||
@@ -417,7 +417,7 @@ type FindEnabledOriginRequest struct {
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
OriginId int64 `protobuf:"varint,1,opt,name=originId,proto3" json:"originId,omitempty"`
|
||||
OriginId int64 `protobuf:"varint,1,opt,name=originId,proto3" json:"originId,omitempty"` // 源站ID
|
||||
}
|
||||
|
||||
func (x *FindEnabledOriginRequest) Reset() {
|
||||
@@ -464,7 +464,7 @@ type FindEnabledOriginResponse struct {
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Origin *Origin `protobuf:"bytes,1,opt,name=Origin,proto3" json:"Origin,omitempty"`
|
||||
Origin *Origin `protobuf:"bytes,1,opt,name=Origin,proto3" json:"Origin,omitempty"` // 源站信息
|
||||
}
|
||||
|
||||
func (x *FindEnabledOriginResponse) Reset() {
|
||||
@@ -512,7 +512,7 @@ type FindEnabledOriginConfigRequest struct {
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
OriginId int64 `protobuf:"varint,1,opt,name=originId,proto3" json:"originId,omitempty"`
|
||||
OriginId int64 `protobuf:"varint,1,opt,name=originId,proto3" json:"originId,omitempty"` // 源站ID
|
||||
}
|
||||
|
||||
func (x *FindEnabledOriginConfigRequest) Reset() {
|
||||
@@ -559,7 +559,7 @@ type FindEnabledOriginConfigResponse struct {
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
OriginJSON []byte `protobuf:"bytes,1,opt,name=originJSON,proto3" json:"originJSON,omitempty"`
|
||||
OriginJSON []byte `protobuf:"bytes,1,opt,name=originJSON,proto3" json:"originJSON,omitempty"` // 源站信息
|
||||
}
|
||||
|
||||
func (x *FindEnabledOriginConfigResponse) Reset() {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -22,6 +22,8 @@ const (
|
||||
ServerService_CreateServer_FullMethodName = "/pb.ServerService/createServer"
|
||||
ServerService_CreateBasicHTTPServer_FullMethodName = "/pb.ServerService/createBasicHTTPServer"
|
||||
ServerService_CreateBasicTCPServer_FullMethodName = "/pb.ServerService/createBasicTCPServer"
|
||||
ServerService_AddServerOrigin_FullMethodName = "/pb.ServerService/addServerOrigin"
|
||||
ServerService_DeleteServerOrigin_FullMethodName = "/pb.ServerService/deleteServerOrigin"
|
||||
ServerService_UpdateServerBasic_FullMethodName = "/pb.ServerService/updateServerBasic"
|
||||
ServerService_UpdateServerGroupIds_FullMethodName = "/pb.ServerService/updateServerGroupIds"
|
||||
ServerService_UpdateServerIsOn_FullMethodName = "/pb.ServerService/updateServerIsOn"
|
||||
@@ -94,6 +96,10 @@ type ServerServiceClient interface {
|
||||
CreateBasicHTTPServer(ctx context.Context, in *CreateBasicHTTPServerRequest, opts ...grpc.CallOption) (*CreateBasicHTTPServerResponse, error)
|
||||
// 快速创建基本的TCP网站
|
||||
CreateBasicTCPServer(ctx context.Context, in *CreateBasicTCPServerRequest, opts ...grpc.CallOption) (*CreateBasicTCPServerResponse, error)
|
||||
// 为网站添加源站
|
||||
AddServerOrigin(ctx context.Context, in *AddServerOriginRequest, opts ...grpc.CallOption) (*RPCSuccess, error)
|
||||
// 从网站中删除某个源站
|
||||
DeleteServerOrigin(ctx context.Context, in *DeleteServerOriginRequest, opts ...grpc.CallOption) (*RPCSuccess, error)
|
||||
// 修改网站基本信息
|
||||
UpdateServerBasic(ctx context.Context, in *UpdateServerBasicRequest, opts ...grpc.CallOption) (*RPCSuccess, error)
|
||||
// 修改网站所在分组
|
||||
@@ -251,6 +257,24 @@ func (c *serverServiceClient) CreateBasicTCPServer(ctx context.Context, in *Crea
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *serverServiceClient) AddServerOrigin(ctx context.Context, in *AddServerOriginRequest, opts ...grpc.CallOption) (*RPCSuccess, error) {
|
||||
out := new(RPCSuccess)
|
||||
err := c.cc.Invoke(ctx, ServerService_AddServerOrigin_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *serverServiceClient) DeleteServerOrigin(ctx context.Context, in *DeleteServerOriginRequest, opts ...grpc.CallOption) (*RPCSuccess, error) {
|
||||
out := new(RPCSuccess)
|
||||
err := c.cc.Invoke(ctx, ServerService_DeleteServerOrigin_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *serverServiceClient) UpdateServerBasic(ctx context.Context, in *UpdateServerBasicRequest, opts ...grpc.CallOption) (*RPCSuccess, error) {
|
||||
out := new(RPCSuccess)
|
||||
err := c.cc.Invoke(ctx, ServerService_UpdateServerBasic_FullMethodName, in, out, opts...)
|
||||
@@ -801,6 +825,10 @@ type ServerServiceServer interface {
|
||||
CreateBasicHTTPServer(context.Context, *CreateBasicHTTPServerRequest) (*CreateBasicHTTPServerResponse, error)
|
||||
// 快速创建基本的TCP网站
|
||||
CreateBasicTCPServer(context.Context, *CreateBasicTCPServerRequest) (*CreateBasicTCPServerResponse, error)
|
||||
// 为网站添加源站
|
||||
AddServerOrigin(context.Context, *AddServerOriginRequest) (*RPCSuccess, error)
|
||||
// 从网站中删除某个源站
|
||||
DeleteServerOrigin(context.Context, *DeleteServerOriginRequest) (*RPCSuccess, error)
|
||||
// 修改网站基本信息
|
||||
UpdateServerBasic(context.Context, *UpdateServerBasicRequest) (*RPCSuccess, error)
|
||||
// 修改网站所在分组
|
||||
@@ -936,6 +964,12 @@ func (UnimplementedServerServiceServer) CreateBasicHTTPServer(context.Context, *
|
||||
func (UnimplementedServerServiceServer) CreateBasicTCPServer(context.Context, *CreateBasicTCPServerRequest) (*CreateBasicTCPServerResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method CreateBasicTCPServer not implemented")
|
||||
}
|
||||
func (UnimplementedServerServiceServer) AddServerOrigin(context.Context, *AddServerOriginRequest) (*RPCSuccess, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method AddServerOrigin not implemented")
|
||||
}
|
||||
func (UnimplementedServerServiceServer) DeleteServerOrigin(context.Context, *DeleteServerOriginRequest) (*RPCSuccess, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method DeleteServerOrigin not implemented")
|
||||
}
|
||||
func (UnimplementedServerServiceServer) UpdateServerBasic(context.Context, *UpdateServerBasicRequest) (*RPCSuccess, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method UpdateServerBasic not implemented")
|
||||
}
|
||||
@@ -1182,6 +1216,42 @@ func _ServerService_CreateBasicTCPServer_Handler(srv interface{}, ctx context.Co
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ServerService_AddServerOrigin_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(AddServerOriginRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ServerServiceServer).AddServerOrigin(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ServerService_AddServerOrigin_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ServerServiceServer).AddServerOrigin(ctx, req.(*AddServerOriginRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ServerService_DeleteServerOrigin_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(DeleteServerOriginRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ServerServiceServer).DeleteServerOrigin(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ServerService_DeleteServerOrigin_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ServerServiceServer).DeleteServerOrigin(ctx, req.(*DeleteServerOriginRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ServerService_UpdateServerBasic_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(UpdateServerBasicRequest)
|
||||
if err := dec(in); err != nil {
|
||||
@@ -2281,6 +2351,14 @@ var ServerService_ServiceDesc = grpc.ServiceDesc{
|
||||
MethodName: "createBasicTCPServer",
|
||||
Handler: _ServerService_CreateBasicTCPServer_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "addServerOrigin",
|
||||
Handler: _ServerService_AddServerOrigin_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "deleteServerOrigin",
|
||||
Handler: _ServerService_DeleteServerOrigin_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "updateServerBasic",
|
||||
Handler: _ServerService_UpdateServerBasic_Handler,
|
||||
|
||||
@@ -29,7 +29,7 @@ message CreateOriginRequest {
|
||||
bytes ossJSON = 15; // OSS配置信息,源站网络地址中protocol为oss:开头时需要设置此项
|
||||
string description = 3; // 描述,为可选项
|
||||
int32 weight = 4; // 权重,不小于0,一般设置为10
|
||||
bool isOn = 5; // 是否启用
|
||||
bool isOn = 5; // 是否启用,一般为true
|
||||
bytes connTimeoutJSON = 6; // 可选项,连接超时时间
|
||||
bytes readTimeoutJSON = 7; // 可选项,读取超时时间
|
||||
bytes idleTimeoutJSON = 8; // 可选项,空闲超时时间
|
||||
@@ -69,18 +69,18 @@ message UpdateOriginRequest {
|
||||
|
||||
// 查找单个源站信息
|
||||
message FindEnabledOriginRequest {
|
||||
int64 originId = 1;
|
||||
int64 originId = 1; // 源站ID
|
||||
}
|
||||
|
||||
message FindEnabledOriginResponse {
|
||||
Origin Origin = 1;
|
||||
Origin Origin = 1; // 源站信息
|
||||
}
|
||||
|
||||
// 查找源站配置
|
||||
message FindEnabledOriginConfigRequest {
|
||||
int64 originId = 1;
|
||||
int64 originId = 1; // 源站ID
|
||||
}
|
||||
|
||||
message FindEnabledOriginConfigResponse {
|
||||
bytes originJSON = 1;
|
||||
bytes originJSON = 1; // 源站信息
|
||||
}
|
||||
@@ -20,6 +20,12 @@ service ServerService {
|
||||
// 快速创建基本的TCP网站
|
||||
rpc createBasicTCPServer(CreateBasicTCPServerRequest) returns (CreateBasicTCPServerResponse);
|
||||
|
||||
// 为网站添加源站
|
||||
rpc addServerOrigin(AddServerOriginRequest) returns (RPCSuccess);
|
||||
|
||||
// 从网站中删除某个源站
|
||||
rpc deleteServerOrigin(DeleteServerOriginRequest) returns (RPCSuccess);
|
||||
|
||||
// 修改网站基本信息
|
||||
rpc updateServerBasic (UpdateServerBasicRequest) returns (RPCSuccess);
|
||||
|
||||
@@ -261,6 +267,19 @@ message CreateBasicTCPServerResponse {
|
||||
int64 serverId = 1; // 所创建的网站ID
|
||||
}
|
||||
|
||||
// 为网站添加源站
|
||||
message AddServerOriginRequest {
|
||||
int64 serverId = 1; // 网站ID
|
||||
int64 originId = 2; // 源站ID,通过 OriginService 创建和查询
|
||||
bool isPrimary = 3; // 是否为主要源站
|
||||
}
|
||||
|
||||
// 从网站中删除某个源站
|
||||
message DeleteServerOriginRequest {
|
||||
int64 serverId = 1; // 网站ID
|
||||
int64 originId = 2; // 源站ID,通过 OriginService 创建和查询
|
||||
}
|
||||
|
||||
// 修改网站基本信息
|
||||
message UpdateServerBasicRequest {
|
||||
int64 serverId = 1; // 网站ID
|
||||
|
||||
Reference in New Issue
Block a user