Skip to content

Commit 74b1c82

Browse files
feat: sync spec (#157)
* feat:协议同步 * feat:协议同步,提交go编译后的文件 * fix:去掉暂时没有用到editable和deleteable
1 parent 23348e9 commit 74b1c82

29 files changed

Lines changed: 2184 additions & 1772 deletions

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/fault_tolerance/circuitbreaker.proto

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -287,9 +287,6 @@ message CircuitBreakerRule {
287287
uint32 priority = 30 [ json_name = "priority" ];
288288
// 熔断规则标签数据
289289
map<string, string> metadata = 50 [ json_name = "metadata" ];
290-
// 操作标志位
291-
bool editable = 40 [ json_name = "editable" ];
292-
bool deleteable = 41 [ json_name = "deleteable" ];
293290
}
294291

295292
// the condition to judge an input invocation as an error

api/v1/fault_tolerance/fault_detector.proto

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,6 @@ message FaultDetectRule {
6868
map<string, string> metadata = 30 [ json_name = "metadata" ];
6969
// extend info, put some custom info to display in console
7070
map<string, string> extendInfo = 31 [ json_name = "extend_info" ];
71-
// 操作标志位
72-
bool editable = 40 [ json_name = "editable" ];
73-
bool deleteable = 41 [ json_name = "deleteable" ];
7471
}
7572

7673
message HttpProtocolConfig {

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 {

0 commit comments

Comments
 (0)