-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add lossless rule specification (#117)
* feat: add ratelimit spec & remove temporary proto files * Update version to 1.5.3-SNAPSHOT * fix: change maxAmount to max_amount * feat: add lossless rule specification
- Loading branch information
1 parent
99802f7
commit ea422dc
Showing
3 changed files
with
93 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
syntax = "proto3"; | ||
|
||
package v1; | ||
|
||
import "google/protobuf/wrappers.proto"; | ||
import "google/protobuf/duration.proto"; | ||
import "model.proto"; | ||
|
||
option go_package = "github.com/polarismesh/specification/source/go/api/v1/traffic_manage"; | ||
option java_package = "com.tencent.polaris.specification.api.v1.traffic.manage"; | ||
option java_outer_classname = "LosslessProto"; | ||
|
||
// 优雅上下线规则的模型 | ||
message LosslessRule { | ||
// rule id | ||
string id = 1 [ json_name = "id" ]; | ||
// service for rule belongs to | ||
string service = 2 [ json_name = "service" ]; | ||
// namespace for rule belongs to | ||
string namespace = 3 [ json_name = "namespace" ]; | ||
// revision routing version | ||
string revision = 4 [ json_name = "revision" ]; | ||
// ctime create time of the rules | ||
string ctime = 5 [ json_name = "ctime" ]; | ||
// mtime modify time of the rules | ||
string mtime = 6 [ json_name = "mtime" ]; | ||
// configuration for lossless online | ||
LosslessOnline losslessOnline = 7 [ json_name = "lossless_online" ]; | ||
// configuration for lossless offline | ||
LosslessOffline losslessOffline = 8 [ json_name = "lossless_offline" ]; | ||
} | ||
|
||
message LosslessOnline { | ||
// configuration for delayRegister | ||
DelayRegister delayRegister = 1 [ json_name = "delay_register" ]; | ||
// configuration for warmup | ||
Warmup warmup = 2 [ json_name = "warmup" ]; | ||
// configuration for readiness probe | ||
Readiness readiness = 3 [ json_name = "readiness" ]; | ||
} | ||
|
||
message DelayRegister { | ||
// enable delay registry | ||
bool enable = 1 [ json_name = "enable" ]; | ||
enum DelayStrategy { | ||
// register instance after delay specific time | ||
DELAY_BY_TIME = 0; | ||
// register instance until health check successfully | ||
DELAY_BY_HEALTH_CHECK = 1; | ||
} | ||
// delay register strategy | ||
DelayStrategy strategy = 2 [ json_name = "strategy" ]; | ||
// delay register time by second, active when strategy == DELAY_BY_TIME | ||
int32 intervalSecond = 3 [ json_name = "interval_second" ]; | ||
// protocol to do health check, default http, active when strategy == DELAY_BY_HEALTH_CHECK | ||
string healthCheckProtocol = 4 [ json_name = "health_check_protocol" ]; | ||
// method to do health check, default GET, active when strategy == DELAY_BY_HEALTH_CHECK | ||
string healthCheckMethod = 5 [ json_name = "health_check_method" ]; | ||
// path to do health check, no default value, active when strategy == DELAY_BY_HEALTH_CHECK | ||
string healthCheckPath = 6 [ json_name = "health_check_path" ]; | ||
// health check interval second, default is 30, active when strategy == DELAY_BY_HEALTH_CHECK | ||
string healthCheckIntervalSecond = 7 [ json_name = "health_check_interval_second" ]; | ||
} | ||
|
||
message Warmup { | ||
// enable warmup | ||
bool enable = 1 [ json_name = "enable" ]; | ||
// total warmup interval by second | ||
int32 intervalSecond = 2 [ json_name = "interval_second" ]; | ||
// warmup stop when most of the instances in service are in warmup status | ||
bool enableOverloadProtection = 3 [ json_name = "enable_overload_protection" ]; | ||
// the threshold to active overload protection, default is 50, threshld = sum(WarmupInstances)/sum(AllInstances)*100 | ||
int32 overloadProtectionThreshold = 4 [ json_name = "overload_protection_threshold" ]; | ||
// curvature for warmup register, default is 1 | ||
int32 curvature = 5 [ json_name = "curvature" ]; | ||
} | ||
|
||
message Readiness { | ||
// enable /readiness expose | ||
bool enable = 1 [ json_name = "enable" ]; | ||
} | ||
|
||
message LosslessOffline { | ||
// enable /offline expose | ||
bool enable = 1 [ json_name = "enable" ]; | ||
} |