Skip to content

Commit

Permalink
rename context with extra
Browse files Browse the repository at this point in the history
Change-Id: If42270f388caa69c60a8e8f3e2dcdce4ffcefdaf
  • Loading branch information
shunjiazhu committed Nov 5, 2024
1 parent f22e5ff commit 646ef3b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
14 changes: 7 additions & 7 deletions config_server/protocol/v2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
int64 version = 2; // Required, Config's version number or hash code
ConfigStatus status = 3; // Config's status
string message = 4; // Optional error message
map<string, bytes> context = 5; // Optional context
map<string, bytes> extra = 5; // Optional extra info
}

// Define the Command information carried in the request
Expand All @@ -61,7 +61,7 @@
string name = 2; // Required, Command's unique identification
ConfigStatus status = 3; // Command's status
string message = 4; // Optional error message
map<string, bytes> context = 5; // Optional context
map<string, bytes> extra = 5; // Optional extra info
}

// Define Agent's basic attributes
Expand Down Expand Up @@ -114,15 +114,15 @@
string name = 1; // Required, Config's unique identification
int64 version = 2; // Required, Config's version number or hash code
bytes detail = 3; // Required, Config's detail
map<string, bytes> context = 4; // Optional context
map<string, bytes> extra = 4; // Optional extra info
}

message CommandDetail {
string type = 1; // Required, Command type
string name = 2; // Required, Command name
bytes detail = 3; // Required, Command's detail
int64 expire_time = 4; // After which the command can be safely removed from history
map<string, bytes> context = 5; // Optional context
map<string, bytes> extra = 5; // Optional extra info
}

enum ServerCapabilities {
Expand Down Expand Up @@ -174,7 +174,7 @@ Server:应当通过capbilitiies上报Server自身的能力,这样如果新

Client:Agent启动后第一次向Server汇报全量信息,request字段应填尽填。request\_id、sequence\_num、capabilities、instance\_id、agent\_type、startup\_time为必填字段。

Server:Server根据上报的信息返回响应。pipeline\_config\_updates、instance\_config\_updates中包含agent需要同步的配置,updates中必然包含name和version,是否包含详情context和detail取决于server端实现。custom\_command_updates包含要求agent执行的命令command中必然包含type、name和expire\_time。
Server:Server根据上报的信息返回响应。pipeline\_config\_updates、instance\_config\_updates中包含agent需要同步的配置,updates中必然包含name和version,是否包含detail取决于server端实现。custom\_command_updates包含要求agent执行的命令command中必然包含type、name和expire\_time。

Server是否保存Client信息取决于Server实现,如果服务端找不到或保存的sequence\_num + 1 ≠ 心跳的sequence\_num,那么就立刻返回并且flags中必须设置ReportFullStatus标识位。

Expand Down Expand Up @@ -257,6 +257,6 @@ Server: 服务端正常返回时HeartbeatResponse中的code应始终设置为0
Client: 当HeartbeatResponse中的code为0时,Agent应该正常处理下发的配置。当HeartbeatResponse中的code不为0时,Agent必须忽略除code和message外的其他字段,并择机重试。

### 辅助信息
在command\_info, command\_detail, config\_info, config\_detail中,都预留了context字段,可以用于传递一些额外的用户自定义的辅助信息。\
在command\_info, command\_detail, config\_info, config\_detail中,都预留了extra字段,可以用于传递一些额外的用户自定义的辅助信息。\

注意:context仅作传递辅助信息使用,不会对管控行为造成任何影响。
注意:extra字段仅作传递辅助信息使用,不会对管控行为造成任何影响。
8 changes: 4 additions & 4 deletions config_server/protocol/v2/agentV2.proto
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ message ConfigInfo {
int64 version = 2; // Required, Config's version number or hash code
ConfigStatus status = 3; // Config's status
string message = 4; // Optional error message
map<string, bytes> context = 5; // Optional context
map<string, bytes> extra = 5; // Optional extra info
}

// Define the Command information carried in the request
Expand All @@ -34,7 +34,7 @@ message CommandInfo {
string name = 2; // Required, Command's unique identification
ConfigStatus status = 3; // Command's status
string message = 4; // Optional error message
map<string, bytes> context = 5; // Optional context
map<string, bytes> extra = 5; // Optional extra info
}

// Define Agent's basic attributes
Expand Down Expand Up @@ -96,15 +96,15 @@ message ConfigDetail {
string name = 1; // Required, Config's unique identification
int64 version = 2; // Required, Config's version number or hash code
bytes detail = 3; // Required, Config's detail
map<string, bytes> context = 4; // Optional context
map<string, bytes> extra = 4; // Optional extra info
}

message CommandDetail {
string type = 1; // Required, Command type
string name = 2; // Required, Command name
bytes detail = 3; // Required, Command's detail
int64 expire_time = 4; // After which the command can be safely removed from history
map<string, bytes> context = 5; // Optional context
map<string, bytes> extra = 5; // Optional extra info
}

enum ServerCapabilities {
Expand Down

0 comments on commit 646ef3b

Please sign in to comment.