Skip to content

Commit 51dde5f

Browse files
Feat/sync spec (#153)
* feat:协议同步 * feat:协议同步,提交go编译后的文件
1 parent 23348e9 commit 51dde5f

20 files changed

Lines changed: 1839 additions & 1307 deletions

File tree

api/v1/config_manage/config_file.proto

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@ message ConfigFileReleaseHistory {
128128
// 配置发布失败的原因
129129
google.protobuf.StringValue reason = 17;
130130
google.protobuf.StringValue release_description = 18;
131+
ConfigFileSupportedClient supported_client = 19 [ json_name = "supported_client" ];
132+
ConfigFilePersistent persistent = 20 [ json_name = "persistent" ];
131133
}
132134

133135
message ConfigFileTemplate {
@@ -159,6 +161,7 @@ message ClientConfigFileInfo {
159161
// 配置文件的发布时间
160162
google.protobuf.StringValue release_time = 11 [ json_name = "release_time" ];
161163
ConfigClientType client_type = 12 [ json_name = "client_type" ];
164+
ConfigFileSupportedClient supported_client = 13 [ json_name = "supported_client" ];
162165
ConfigFilePersistent persistent = 14 [ json_name = "persistent" ];
163166
}
164167

@@ -182,6 +185,17 @@ message ConfigFileExportRequest {
182185
repeated google.protobuf.UInt64Value ids = 4;
183186
}
184187

188+
message ConfigFileImportRequest {
189+
google.protobuf.StringValue namespace = 1;
190+
google.protobuf.StringValue base64Content = 2 [json_name = "base64_content"];
191+
ConflictHandling conflict_handling = 3 [json_name = "conflict_handling"];
192+
}
193+
194+
enum ConflictHandling {
195+
CONFLICT_HANDLING_SKIP = 0;
196+
CONFLICT_HANDLING_OVERWRITE = 1;
197+
}
198+
185199
message ConfigFilePublishInfo {
186200
google.protobuf.StringValue release_name = 1 [ json_name = "release_name" ];
187201
google.protobuf.StringValue namespace = 2;
@@ -199,6 +213,7 @@ message ConfigFilePublishInfo {
199213
google.protobuf.BoolValue encrypted = 16;
200214
// 加密算法
201215
google.protobuf.StringValue encrypt_algo = 17;
216+
ConfigFileSupportedClient supported_client = 18 [ json_name = "supported_client" ];
202217
ConfigFilePersistent persistent = 19 [ json_name = "persistent" ];
203218
}
204219

api/v1/config_manage/config_file_response.proto

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ message ConfigResponse {
2323
ConfigFileRelease configFileRelease = 5;
2424
ConfigFileReleaseHistory configFileReleaseHistory = 6;
2525
ConfigFileTemplate configFileTemplate = 7;
26+
27+
repeated ConfigFile configFiles = 8;
2628
}
2729

2830
message ConfigBatchWriteResponse {
@@ -57,12 +59,14 @@ message ConfigImportResponse {
5759
repeated ConfigFile createConfigFiles = 3;
5860
repeated ConfigFile skipConfigFiles = 4;
5961
repeated ConfigFile overwriteConfigFiles = 5;
62+
repeated ConfigFile failedConfigFiles = 6;
6063
}
6164

6265
message ConfigExportResponse {
6366
google.protobuf.UInt32Value code = 1;
6467
google.protobuf.StringValue info = 2;
6568
google.protobuf.BytesValue data = 3;
69+
google.protobuf.StringValue base64Content = 4 [json_name = "base64_content"];
6670
}
6771

6872
message ConfigEncryptAlgorithmResponse {

api/v1/model/code.proto

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,10 @@ enum Code {
162162
EncryptConfigFileException = 400809;
163163
GroupExistActiveRelease = 400810;
164164
DecryptConfigFileException = 400811;
165+
InvalidConfigId = 400815;
166+
InvalidConfigReleaseId = 400812;
167+
NotMatchContentToFormat = 400813;
168+
InvalidConfigContent = 400814;
165169

166170
// auth codes
167171
InvalidUserOwners = 400410;

api/v1/model/namespace.proto

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,8 @@ message Namespace {
3434
repeated google.protobuf.StringValue service_export_to = 16 [ json_name = "service_export_to" ];
3535

3636
map<string, string> metadata = 17;
37-
google.protobuf.BoolValue deleteable = 18;
37+
38+
bool sync_to_global_registry = 18 [ json_name = "sync_to_global_registry" ];
39+
40+
google.protobuf.BoolValue deleteable = 100;
3841
}

api/v1/security/block_allow_list.proto

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ syntax = "proto3";
22

33
package v1;
44

5-
import "google/protobuf/wrappers.proto";
65
import "model.proto";
76

87
option go_package = "github.com/polarismesh/specification/source/go/api/v1/security";
@@ -47,6 +46,9 @@ message BlockAllowListRule {
4746
// block or allow configuration
4847
repeated BlockAllowConfig blockAllowConfig = 12 [ json_name = "block_allow_config" ];
4948

49+
//revision
50+
string revision = 13 [json_name = "revision" ];
51+
5052
}
5153

5254
message BlockAllowConfig {

api/v1/service_manage/heartbeat.proto

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ message HeartbeatRecord {
1212
reserved 2 to 5;
1313
int64 lastHeartbeatSec = 6 [ json_name = "last_heartbeat_sec" ];
1414
bool exist = 7 [ json_name = "exist" ];
15+
int64 count = 8 [ json_name = "count" ];
1516
}
1617

1718
message InstanceHeartbeat {

api/v1/service_manage/response.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ message DiscoverResponse {
141141
// 就近路由规则内容
142142
repeated RouteRule nearbyRouteRules = 24;
143143
// 无损上下线规则内容(兼容老版本)
144-
repeated LosslessRule losslessRules = 25;
144+
LosslessRule lossless = 25;
145145
// 服务黑白名单鉴权规则
146146
repeated BlockAllowListRule blockAllowListRule = 26;
147147
// 流量镜像规则内容

api/v1/service_manage/service.proto

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,19 @@ message Service {
4242
google.protobuf.StringValue id = 21;
4343
google.protobuf.BoolValue editable = 24;
4444
repeated google.protobuf.StringValue export_to = 25 [ json_name = "export_to" ];
45-
google.protobuf.BoolValue deleteable = 26;
45+
46+
bool sync_to_global_registry = 26 [ json_name = "sync_to_global_registry" ];
47+
48+
google.protobuf.UInt32Value isolate_instance_count = 27 [json_name = "isolate_instance_count"];
49+
ServiceStatus service_status = 28 [json_name = "service_status"];
50+
51+
google.protobuf.BoolValue deleteable = 100;
52+
}
53+
54+
enum ServiceStatus {
55+
NORMAL = 0; //服务状态正常
56+
ABNORMAL = 1; //服务状态异常
57+
OFFLINE = 2; //服务离线
4658
}
4759

4860
enum AliasType {
@@ -66,6 +78,8 @@ message ServiceAlias {
6678
google.protobuf.StringValue id = 11;
6779
google.protobuf.BoolValue editable = 12;
6880
google.protobuf.BoolValue deleteable = 13;
81+
repeated google.protobuf.StringValue export_to = 25 [ json_name = "export_to" ];
82+
map<string, string> metadata = 26;
6983
}
7084

7185
message Instance {

api/v1/traffic_manage/lane.proto

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,20 @@ option java_outer_classname = "LaneProto";
1313
// 流量入口
1414
message TrafficEntry {
1515
// 标记流量入口类型
16-
// type == "polarismesh.cn/gateway/spring-cloud-gateway", 则 selector 为
17-
// ServiceGatewaySelector type == "polarismesh.cn/service, 则 selector 为
18-
// ServiceSelector
16+
// type == "polarismesh.cn/gateway/tse-gateway, 则 selector 为
17+
// TSEGatewaySelector type == "polarismesh.cn/gateway/spring-cloud-gateway",
18+
// 则 selector 为 ServiceGatewaySelector type == "polarismesh.cn/service, 则
19+
// selector 为 ServiceSelector
1920
string type = 1;
2021
google.protobuf.Any selector = 2;
2122
}
2223

24+
// 网关入口定义
25+
message TSEGatewaySelector {
26+
string instance_id = 1 [ json_name = "instance_id" ];
27+
repeated string services = 2;
28+
}
29+
2330
// 微服务网关入口定义
2431
message ServiceGatewaySelector {
2532
string namespace = 1;
@@ -74,7 +81,7 @@ message TrafficMatchRule {
7481
// 或模式
7582
OR = 1;
7683
}
77-
TrafficMatchMode matchMode = 14;
84+
TrafficMatchMode matchMode = 14 [ json_name = "match_mode" ];
7885
}
7986

8087
// TrafficGray 流量灰度配置
@@ -109,9 +116,9 @@ message LaneRule {
109116
// 所属泳道组的名称
110117
string group_name = 3 [ json_name = "group_name" ];
111118
// 流量匹配规则
112-
TrafficMatchRule traffic_match_rule = 4;
119+
TrafficMatchRule traffic_match_rule = 4 [ json_name = "traffic_match_rule" ];
113120
// 保存这个泳道的默认实例标签
114-
string default_label_value = 5;
121+
string default_label_value = 5 [ json_name = "default_label_value" ];
115122
// 泳道规则是否启用
116123
bool enable = 6;
117124
enum LaneMatchMode {
@@ -120,7 +127,7 @@ message LaneRule {
120127
// 宽松匹配模式
121128
PERMISSIVE = 1;
122129
}
123-
LaneMatchMode match_mode = 7;
130+
LaneMatchMode match_mode = 7 [ json_name = "match_mode" ];
124131
// 流量灰度配置
125132
TrafficGray traffic_gray = 15 [ json_name = "traffic_gray" ];
126133
// revision routing version

api/v1/traffic_manage/ratelimit.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ message MatchArgument {
132132

133133
// concurrency rate-limit amount config
134134
message ConcurrencyAmount {
135-
uint32 maxAmount = 1 [ json_name = "max_amount" ];
135+
uint32 maxAmount = 1 [ json_name = "maxAmount" ];
136136
}
137137

138138
// custom response text when limited

0 commit comments

Comments
 (0)