diff --git a/api/v1/service_manage/request.proto b/api/v1/service_manage/request.proto index 3757fba..1587cc2 100644 --- a/api/v1/service_manage/request.proto +++ b/api/v1/service_manage/request.proto @@ -3,6 +3,7 @@ syntax = "proto3"; package v1; import "service.proto"; +import "contract.proto"; option go_package = "github.com/polarismesh/specification/source/go/api/v1/service_manage"; option java_package = "com.tencent.polaris.specification.api.v1.service.manage"; @@ -30,6 +31,7 @@ message DiscoverRequest { DiscoverRequestType type = 1; Service service = 2; reserved 3 to 4; - DiscoverFilter Filter = 30; + DiscoverFilter Filter = 30; + ServiceContract service_contract = 31; } diff --git a/source/go/api/v1/service_manage/request.pb.go b/source/go/api/v1/service_manage/request.pb.go index 95ce72f..ef6d1fd 100644 --- a/source/go/api/v1/service_manage/request.pb.go +++ b/source/go/api/v1/service_manage/request.pb.go @@ -62,7 +62,7 @@ func (x DiscoverRequest_DiscoverRequestType) String() string { return proto.EnumName(DiscoverRequest_DiscoverRequestType_name, int32(x)) } func (DiscoverRequest_DiscoverRequestType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_request_15ca4e992c3d6be5, []int{1, 0} + return fileDescriptor_request_629075ca61fde1db, []int{1, 0} } type DiscoverFilter struct { @@ -76,7 +76,7 @@ func (m *DiscoverFilter) Reset() { *m = DiscoverFilter{} } func (m *DiscoverFilter) String() string { return proto.CompactTextString(m) } func (*DiscoverFilter) ProtoMessage() {} func (*DiscoverFilter) Descriptor() ([]byte, []int) { - return fileDescriptor_request_15ca4e992c3d6be5, []int{0} + return fileDescriptor_request_629075ca61fde1db, []int{0} } func (m *DiscoverFilter) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DiscoverFilter.Unmarshal(m, b) @@ -107,6 +107,7 @@ type DiscoverRequest struct { Type DiscoverRequest_DiscoverRequestType `protobuf:"varint,1,opt,name=type,proto3,enum=v1.DiscoverRequest_DiscoverRequestType" json:"type,omitempty"` Service *Service `protobuf:"bytes,2,opt,name=service,proto3" json:"service,omitempty"` Filter *DiscoverFilter `protobuf:"bytes,30,opt,name=Filter,proto3" json:"Filter,omitempty"` + ServiceContract *ServiceContract `protobuf:"bytes,31,opt,name=service_contract,json=serviceContract,proto3" json:"service_contract,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -116,7 +117,7 @@ func (m *DiscoverRequest) Reset() { *m = DiscoverRequest{} } func (m *DiscoverRequest) String() string { return proto.CompactTextString(m) } func (*DiscoverRequest) ProtoMessage() {} func (*DiscoverRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_request_15ca4e992c3d6be5, []int{1} + return fileDescriptor_request_629075ca61fde1db, []int{1} } func (m *DiscoverRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DiscoverRequest.Unmarshal(m, b) @@ -157,41 +158,50 @@ func (m *DiscoverRequest) GetFilter() *DiscoverFilter { return nil } +func (m *DiscoverRequest) GetServiceContract() *ServiceContract { + if m != nil { + return m.ServiceContract + } + return nil +} + func init() { proto.RegisterType((*DiscoverFilter)(nil), "v1.DiscoverFilter") proto.RegisterType((*DiscoverRequest)(nil), "v1.DiscoverRequest") proto.RegisterEnum("v1.DiscoverRequest_DiscoverRequestType", DiscoverRequest_DiscoverRequestType_name, DiscoverRequest_DiscoverRequestType_value) } -func init() { proto.RegisterFile("request.proto", fileDescriptor_request_15ca4e992c3d6be5) } - -var fileDescriptor_request_15ca4e992c3d6be5 = []byte{ - // 432 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0xc1, 0x6e, 0xd3, 0x40, - 0x10, 0x86, 0x71, 0x9a, 0x26, 0xd1, 0x24, 0x71, 0x57, 0x1b, 0x0e, 0x11, 0x07, 0x54, 0x45, 0x42, - 0x54, 0x1c, 0x6c, 0x52, 0x0e, 0x1c, 0x38, 0x39, 0xce, 0x16, 0x4c, 0x53, 0xbb, 0x5a, 0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0x4c, 0x1b, 0xe6, 0x43, 0xef, 0xf8, - 0x88, 0x3e, 0xfc, 0x0b, 0x00, 0x00, 0xff, 0xff, 0xf5, 0xa7, 0xc3, 0x97, 0x68, 0x02, 0x00, 0x00, +func init() { proto.RegisterFile("request.proto", fileDescriptor_request_629075ca61fde1db) } + +var fileDescriptor_request_629075ca61fde1db = []byte{ + // 462 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0xd1, 0x6e, 0xda, 0x30, + 0x14, 0x86, 0x17, 0xa0, 0x80, 0x0c, 0x04, 0xcb, 0xec, 0x02, 0xf5, 0x62, 0xab, 0x90, 0xa6, 0x55, + 0xbb, 0x48, 0x46, 0x77, 0xb1, 0x8b, 0x49, 0x93, 0x42, 0x70, 0xb7, 0xac, 0x34, 0x54, 0x8e, 0xb3, + 0x49, 0xbb, 0x89, 0x5c, 0xcb, 0x03, 0x4b, 0x10, 0x67, 0xb1, 0x89, 0xc4, 0x43, 0xec, 0x39, 0xf6, + 0x14, 0x7b, 0xb7, 0x29, 0x24, 0x91, 0xda, 0xaa, 0x97, 0xe7, 0xfc, 0xe7, 0xfb, 0xf3, 0xe7, 0xf8, + 0x80, 0x51, 0x2e, 0x7e, 0x1f, 0x84, 0x36, 0x4e, 0x96, 0x2b, 0xa3, 0x50, 0xab, 0x98, 0x9f, 0x8f, + 0xb4, 0xc8, 0x0b, 0xc9, 0x45, 0xd5, 0x3a, 0xb7, 0xb9, 0x4a, 0x4d, 0xce, 0x78, 0x3d, 0x32, 0x5b, + 0x00, 0x7b, 0x29, 0x35, 0x57, 0x85, 0xc8, 0xaf, 0xe5, 0xce, 0x88, 0x1c, 0xbd, 0x07, 0x93, 0x75, + 0xba, 0x3b, 0x7e, 0x15, 0x6c, 0x67, 0xb6, 0xc7, 0x20, 0xd5, 0x86, 0xa5, 0x5c, 0x4c, 0xad, 0x0b, + 0xeb, 0xb2, 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xbc, 0xa2, 0xc9, 0x12, 0x53, 0xec, 0xd3, + 0x35, 0x81, 0x23, 0xf4, 0x12, 0xc0, 0x9a, 0x48, 0xfc, 0x75, 0x48, 0x89, 0xe7, 0x53, 0x68, 0xcf, + 0x3a, 0xfd, 0x1e, 0x1c, 0x7c, 0xeb, 0xf4, 0xdb, 0xf0, 0x6c, 0xf1, 0xc7, 0x02, 0x1f, 0xb9, 0xda, + 0x3b, 0x46, 0xa4, 0x5c, 0xa4, 0xc6, 0xc9, 0xd4, 0x8e, 0xe5, 0x52, 0x3b, 0x3a, 0x13, 0x5c, 0xfe, + 0x92, 0x9c, 0x19, 0xa9, 0x52, 0x87, 0x65, 0xb2, 0xdc, 0x49, 0x73, 0x38, 0x7b, 0x96, 0xb2, 0x8d, + 0x58, 0x0c, 0xeb, 0xdf, 0xbe, 0x2b, 0xef, 0xe6, 0xe7, 0x72, 0x23, 0xcd, 0xf6, 0x70, 0xef, 0x70, + 0xb5, 0x77, 0x6b, 0x97, 0xbd, 0xd0, 0x5b, 0xf7, 0x91, 0x93, 0xab, 0xd5, 0x21, 0xe7, 0xc2, 0xdd, + 0x28, 0x97, 0x65, 0xd2, 0x2d, 0xe6, 0x6e, 0xf3, 0x06, 0x95, 0xe7, 0x7d, 0xf7, 0x74, 0x84, 0x1f, + 0xfe, 0x07, 0x00, 0x00, 0xff, 0xff, 0xc4, 0xa8, 0xe6, 0x44, 0xb8, 0x02, 0x00, 0x00, } diff --git a/source/java/polaris-specification/src/main/proto/code.proto b/source/java/polaris-specification/src/main/proto/code.proto index 9bc3d23..baad235 100644 --- a/source/java/polaris-specification/src/main/proto/code.proto +++ b/source/java/polaris-specification/src/main/proto/code.proto @@ -74,6 +74,7 @@ enum Code { InvalidFaultDetectName = 400901; InvalidFaultDetectNamespace = 400902; FaultDetectRuleExisted = 400903; + InvalidMatchRule = 400904; // network relative codes ServicesExistedMesh = 400170; @@ -190,4 +191,4 @@ enum Code { AuthTokenForbidden = 403001; OperationRoleForbidden = 403002; -} \ No newline at end of file +} diff --git a/source/java/polaris-specification/src/main/proto/config_file.proto b/source/java/polaris-specification/src/main/proto/config_file.proto index f7b08b4..80e2b8a 100644 --- a/source/java/polaris-specification/src/main/proto/config_file.proto +++ b/source/java/polaris-specification/src/main/proto/config_file.proto @@ -3,11 +3,11 @@ syntax = "proto3"; package v1; import "google/protobuf/wrappers.proto"; +import "model.proto"; option go_package = "github.com/polarismesh/specification/source/go/api/v1/config_manage"; option java_package = "com.tencent.polaris.specification.api.v1.config.manage"; option java_outer_classname = "ConfigFileProto"; - message ConfigFileGroup { google.protobuf.UInt64Value id = 1; google.protobuf.StringValue name = 2; @@ -82,6 +82,9 @@ message ConfigFileRelease { google.protobuf.BoolValue active = 15; google.protobuf.StringValue format = 16; google.protobuf.StringValue release_description = 17; + google.protobuf.StringValue release_type = 18; + // 配置灰度发布时需要匹配的客户端标签信息 + repeated ClientLabel beta_labels = 19; } message ConfigFileReleaseHistory { @@ -156,13 +159,55 @@ message ConfigFilePublishInfo { google.protobuf.StringValue content = 5; google.protobuf.StringValue comment = 6; google.protobuf.StringValue format = 7; - google.protobuf.StringValue release_description = 8 [ json_name = "release_description" ]; + google.protobuf.StringValue release_description = 8 + [ json_name = "release_description" ]; google.protobuf.StringValue create_by = 11 [ json_name = "create_by" ]; google.protobuf.StringValue modify_by = 13 [ json_name = "modify_by" ]; repeated ConfigFileTag tags = 14; + google.protobuf.StringValue md5 = 15; + // 是否为加密配置文件 + google.protobuf.BoolValue encrypted = 16; + // 加密算法 + google.protobuf.StringValue encrypt_algo = 17; } message ConfigFileGroupRequest { google.protobuf.StringValue revision = 1; - ConfigFileGroup config_file_group = 2; -} \ No newline at end of file + ConfigFileGroup config_file_group = 2 [ json_name = "config_file_group" ]; + // 配置标签 + map client_labels = 12 [ json_name = "client_labels" ]; +} + +message ConfigDiscoverRequest { + enum ConfigDiscoverRequestType { + UNKNOWN = 0; + CONFIG_FILE = 1; + CONFIG_FILE_Names = 2; + CONFIG_FILE_GROUPS = 3; + } + ConfigDiscoverRequestType type = 1; + ClientConfigFileInfo config_file = 2 [ json_name = "config_file" ]; + string revision = 3; +} + +message ConfigDiscoverResponse { + enum ConfigDiscoverResponseType { + UNKNOWN = 0; + CONFIG_FILE = 1; + CONFIG_FILE_Names = 2; + CONFIG_FILE_GROUPS = 3; + } + + uint32 code = 1; + string info = 2; + string revision = 3; + + ConfigDiscoverResponseType type = 4; + + ClientConfigFileInfo config_file = 5 [ json_name = "config_file" ]; + + repeated ClientConfigFileInfo config_file_names = 6 + [ json_name = "config_file_names" ]; + repeated ConfigFileGroup config_file_groups = 7 + [ json_name = "config_file_groups" ]; +} diff --git a/source/java/polaris-specification/src/main/proto/contract.proto b/source/java/polaris-specification/src/main/proto/contract.proto index 7615070..d50e04e 100644 --- a/source/java/polaris-specification/src/main/proto/contract.proto +++ b/source/java/polaris-specification/src/main/proto/contract.proto @@ -7,39 +7,53 @@ option java_package = "com.tencent.polaris.specification.api.v1.service.manage"; option java_outer_classname = "ServiceContractProto"; message ServiceContract { + // 契约ID + string id = 1; // 契约名称 - string name = 1; + string name = 2; // 所属命名空间 - string namespace = 2; + string namespace = 3; // 所属服务名称 - string service = 3; + string service = 4; // 协议,http/grpc/dubbo/thrift - string protocol = 4; + string protocol = 5; // 契约版本 - string version = 5; + string version = 6; // 信息摘要 - string revision = 6; + string revision = 7; // 额外描述 - string content = 7; + string content = 8; // 接口描述信息 - repeated InterfaceDescriptor interfaces = 8; + repeated InterfaceDescriptor interfaces = 9; // 创建时间 - string ctime = 9; + string ctime = 10; // 更新时间 - string mtime = 10; + string mtime = 11; + // 接口状态,Offline/Online + string status = 12; } message InterfaceDescriptor { + enum Source { + UNKNOWN = 0; + Manual = 1; + Client = 2; + } + + // 接口ID + string id = 1; // 方法名称,对应 http method/ dubbo interface func/grpc service func - string method = 1; + string method = 2; // 接口名称,http path/dubbo interface/grpc service - string path = 2; + string path = 3; // 接口描述信息 - string content = 3; + string content = 4; + // 创建来源 + Source source = 5; // 接口信息摘要 - string revision = 4; + string revision = 6; // 创建时间 - string ctime = 9; + string ctime = 7; // 更新时间 - string mtime = 10; + string mtime = 8; } diff --git a/source/java/polaris-specification/src/main/proto/grpc_config_api.proto b/source/java/polaris-specification/src/main/proto/grpc_config_api.proto index 887ce45..e91d024 100644 --- a/source/java/polaris-specification/src/main/proto/grpc_config_api.proto +++ b/source/java/polaris-specification/src/main/proto/grpc_config_api.proto @@ -29,4 +29,6 @@ service PolarisConfigGRPC { // 拉取指定配置分组下的配置文件列表 rpc GetConfigFileMetadataList(ConfigFileGroupRequest) returns (ConfigClientListResponse) {} + // 统一发现接口 + rpc Discover(stream ConfigDiscoverRequest) returns (stream ConfigDiscoverResponse) {} } diff --git a/source/java/polaris-specification/src/main/proto/grpcapi.proto b/source/java/polaris-specification/src/main/proto/grpcapi.proto index 0e7538e..db8bbb6 100644 --- a/source/java/polaris-specification/src/main/proto/grpcapi.proto +++ b/source/java/polaris-specification/src/main/proto/grpcapi.proto @@ -24,15 +24,19 @@ service PolarisGRPC { rpc Discover(stream DiscoverRequest) returns (stream DiscoverResponse) {} // 被调方上报心跳 rpc Heartbeat(Instance) returns (Response) {} - // 上报服务契约 - rpc ReportServiceContract(ServiceContract) returns (Response) {} } service PolarisHeartbeatGRPC { // 被调方批量上报心跳 - rpc BatchHeartbeat(stream HeartbeatsRequest) returns (stream HeartbeatsResponse) {} + rpc BatchHeartbeat(stream HeartbeatsRequest) + returns (stream HeartbeatsResponse) {} // 批量获取心跳记录 rpc BatchGetHeartbeat(GetHeartbeatsRequest) returns (GetHeartbeatsResponse) {} // 批量删除心跳记录 rpc BatchDelHeartbeat(DelHeartbeatsRequest) returns (DelHeartbeatsResponse) {} } + +service PolarisServiceContractGRPC { + // 上报服务契约 + rpc ReportServiceContract(ServiceContract) returns (Response) {} +} diff --git a/source/java/polaris-specification/src/main/proto/model.proto b/source/java/polaris-specification/src/main/proto/model.proto index fa72e87..6677db2 100644 --- a/source/java/polaris-specification/src/main/proto/model.proto +++ b/source/java/polaris-specification/src/main/proto/model.proto @@ -39,20 +39,23 @@ message MatchString { MatchStringType type = 1; google.protobuf.StringValue value = 2; - ValueType value_type = 3 [json_name = "value_type"]; + ValueType value_type = 3 [ json_name = "value_type" ]; } - -message StringList { - repeated string values = 1; -} +message StringList { repeated string values = 1; } // 汇总查询数据 message Summary { // 服务总数 - uint32 total_service_count = 1 [json_name = "total_service_count"]; + uint32 total_service_count = 1 [ json_name = "total_service_count" ]; // 健康实例总数 - uint32 total_health_instance_count = 2 [json_name = "total_health_instance_count"]; + uint32 total_health_instance_count = 2 + [ json_name = "total_health_instance_count" ]; // 实例总数 - uint32 total_instance_count = 3 [json_name = "total_instance_count"]; + uint32 total_instance_count = 3 [ json_name = "total_instance_count" ]; +} + +message ClientLabel { + string key = 1; + MatchString value = 2; } diff --git a/source/java/polaris-specification/src/main/proto/namespace.proto b/source/java/polaris-specification/src/main/proto/namespace.proto index c3998d4..a23850d 100644 --- a/source/java/polaris-specification/src/main/proto/namespace.proto +++ b/source/java/polaris-specification/src/main/proto/namespace.proto @@ -30,4 +30,6 @@ message Namespace { google.protobuf.StringValue id = 12; google.protobuf.BoolValue editable = 15; + + repeated google.protobuf.StringValue service_export_to = 16 [ json_name = "service_export_to" ]; } \ No newline at end of file diff --git a/source/java/polaris-specification/src/main/proto/request.proto b/source/java/polaris-specification/src/main/proto/request.proto index b82ba55..1587cc2 100644 --- a/source/java/polaris-specification/src/main/proto/request.proto +++ b/source/java/polaris-specification/src/main/proto/request.proto @@ -3,11 +3,16 @@ syntax = "proto3"; package v1; import "service.proto"; +import "contract.proto"; option go_package = "github.com/polarismesh/specification/source/go/api/v1/service_manage"; option java_package = "com.tencent.polaris.specification.api.v1.service.manage"; option java_outer_classname = "RequestProto"; +message DiscoverFilter { + bool OnlyHealthyInstance = 1; +} + message DiscoverRequest { enum DiscoverRequestType { UNKNOWN = 0; @@ -20,10 +25,13 @@ message DiscoverRequest { reserved 7 to 11; NAMESPACES = 12; FAULT_DETECTOR = 13; + SERVICE_CONTRACT = 14; } DiscoverRequestType type = 1; Service service = 2; reserved 3 to 4; + DiscoverFilter Filter = 30; + ServiceContract service_contract = 31; } diff --git a/source/java/polaris-specification/src/main/proto/response.proto b/source/java/polaris-specification/src/main/proto/response.proto index 15e34ba..5c94ef4 100644 --- a/source/java/polaris-specification/src/main/proto/response.proto +++ b/source/java/polaris-specification/src/main/proto/response.proto @@ -14,6 +14,7 @@ import "client.proto"; import "configrelease.proto"; import "fault_detector.proto"; import "auth.proto"; +import "contract.proto"; option go_package = "github.com/polarismesh/specification/source/go/api/v1/service_manage"; option java_package = "com.tencent.polaris.specification.api.v1.service.manage"; @@ -91,6 +92,7 @@ message DiscoverResponse { reserved "MESH", "MESH_CONFIG", "FLUX_DBREFRESH", "FLUX_SDK", "FLUX_SERVER"; NAMESPACES = 12; FAULT_DETECTOR = 13; + SERVICE_CONTRACT = 14; } DiscoverResponseType type = 3; @@ -104,6 +106,7 @@ message DiscoverResponse { FaultDetector faultDetector = 11; reserved 12 to 20; Service aliasFor = 21; + ServiceContract serviceContract = 22; } diff --git a/source/java/polaris-specification/src/main/proto/service.proto b/source/java/polaris-specification/src/main/proto/service.proto index c1c8438..9833805 100644 --- a/source/java/polaris-specification/src/main/proto/service.proto +++ b/source/java/polaris-specification/src/main/proto/service.proto @@ -33,7 +33,6 @@ message Service { google.protobuf.UInt32Value total_instance_count = 17 [json_name = "total_instance_count"]; google.protobuf.UInt32Value healthy_instance_count = 18 [json_name = "healthy_instance_count"]; - repeated google.protobuf.StringValue user_ids = 19 [json_name = "user_ids"]; repeated google.protobuf.StringValue group_ids = 20 [json_name = "group_ids"]; @@ -42,6 +41,7 @@ message Service { google.protobuf.StringValue id = 21; google.protobuf.BoolValue editable = 24; + repeated google.protobuf.StringValue export_to = 25 [ json_name = "export_to" ]; } enum AliasType {