1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// @jumo generated
#[derive(
Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize, ::jumo_derive::Jumo,
)]
#[jumo(
kind = "struct",
domain = "Control",
module = "Control.Gateway.Supervision"
)]
pub struct GatewayUpgradePlan {
pub gateway_id: String,
pub has_plan: bool,
pub plan_id: Option<String>,
pub component: Option<String>,
pub to_version: Option<String>,
// NOTE(hand-added): 中心**派生**的制品下发地址(镜像后的可下载 URL)。
// 执行器据此取件(gops `--to <url>`);缺省 = 无对应 release 记录,回落用 `to_version`。
#[serde(default)]
pub artifact_url: Option<String>,
// NOTE(hand-added): 计划动作(`upgrade` / `push-agent-package`)。缺省 = 老中心,按 `upgrade` 处理;
// gwlinkd 据此分派执行器:升级走 gops,包下发走环回写网关包管理。
#[serde(default)]
pub action: Option<String>,
// NOTE(hand-added): `artifact_url` 的期望摘要(sha256,裸 hex / `sha256:` 前缀)。
// **仅**「agent 包下发」(②)带它;① 升级路径为空(给 ① 加摘要会改变其既有取件/校验行为)。
// 见设计 `edge/agent-package-push-to-gateways.md`。
#[serde(default)]
pub artifact_sha256: Option<String>,
// NOTE(hand-added): 「agent 包下发」(②)的**多平台**制品清单:该版本**全部平台**的地址 + 摘要。
// ② 要网关替 **Agent 机队**托管各平台的包(机队平台可能 ≠ 网关自己主机的平台),故用列表;
// ① 升级仍用单值 `artifact_url`(网关本机就一个平台)。见设计 `edge/agent-package-push-to-gateways.md`。
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub artifacts: Vec<GatewayUpgradeArtifact>,
}
// NOTE(hand-added): 「Agent 包下发」(②)里的一个平台制品:平台(target-triple)+ 中心派生地址 + 期望摘要。
#[derive(
Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize, ::jumo_derive::Jumo,
)]
#[jumo(
kind = "struct",
domain = "Control",
module = "Control.Gateway.Supervision"
)]
pub struct GatewayUpgradeArtifact {
pub platform: String,
pub artifact_url: String,
pub artifact_sha256: String,
}