-
Notifications
You must be signed in to change notification settings - Fork 396
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
<fix>[host]: Enhanced grayscale upgrade
DBImpact Resolves: ZSTAC-56920 Change-Id: I6268627663736675786f6d7778727071676b7762
- Loading branch information
kaicai.hu
committed
Jan 15, 2024
1 parent
07ead38
commit 8a451d0
Showing
53 changed files
with
1,614 additions
and
150 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
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,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<service xmlns="http://zstack.org/schema/zstack"> | ||
<id>upgrade</id> | ||
<message> | ||
<name>org.zstack.core.upgrade.APIQueryAgentVersionMsg</name> | ||
<serviceId>query</serviceId> | ||
</message> | ||
</service> |
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,20 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<beans xmlns="http://www.springframework.org/schema/beans" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop" | ||
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:zstack="http://zstack.org/schema/zstack" | ||
xsi:schemaLocation="http://www.springframework.org/schema/beans | ||
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd | ||
http://www.springframework.org/schema/aop | ||
http://www.springframework.org/schema/aop/spring-aop-3.0.xsd | ||
http://www.springframework.org/schema/tx | ||
http://www.springframework.org/schema/tx/spring-tx-3.0.xsd | ||
http://zstack.org/schema/zstack | ||
http://zstack.org/schema/zstack/plugin.xsd" | ||
default-init-method="init" default-destroy-method="destroy"> | ||
|
||
<bean id="UpgradeChecker" class="org.zstack.core.upgrade.UpgradeChecker"> | ||
<zstack:plugin> | ||
<zstack:extension interface="org.zstack.header.Component" /> | ||
</zstack:plugin> | ||
</bean> | ||
</beans> |
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
23 changes: 23 additions & 0 deletions
23
core/src/main/java/org/zstack/core/upgrade/APIQueryAgentVersionMsg.java
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,23 @@ | ||
package org.zstack.core.upgrade; | ||
|
||
import org.springframework.http.HttpMethod; | ||
import org.zstack.header.query.APIQueryMessage; | ||
import org.zstack.header.query.AutoQuery; | ||
import org.zstack.header.rest.RestRequest; | ||
|
||
import java.util.Collections; | ||
import java.util.List; | ||
|
||
|
||
@AutoQuery(replyClass = APIQueryAgentVersionReply.class, inventoryClass = AgentVersionInventory.class) | ||
@RestRequest( | ||
path = "/agent-version", | ||
optionalPaths = {"/agent-version/{uuid}"}, | ||
method = HttpMethod.GET, | ||
responseClass = APIQueryAgentVersionReply.class | ||
) | ||
public class APIQueryAgentVersionMsg extends APIQueryMessage { | ||
public static List<String> __example__() { | ||
return Collections.emptyList(); | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
core/src/main/java/org/zstack/core/upgrade/APIQueryAgentVersionMsgDoc_zh_cn.groovy
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,31 @@ | ||
package org.zstack.core.upgrade | ||
|
||
import org.zstack.core.upgrade.APIQueryAgentVersionReply | ||
import org.zstack.header.query.APIQueryMessage | ||
|
||
doc { | ||
title "QueryAgentVersion" | ||
|
||
category "core" | ||
|
||
desc """查询 Agent 版本信息""" | ||
|
||
rest { | ||
request { | ||
url "GET /v1/agent-version" | ||
url "GET /v1/agent-version/{uuid}" | ||
|
||
header (Authorization: 'OAuth the-session-uuid') | ||
|
||
clz APIQueryAgentVersionMsg.class | ||
|
||
desc """""" | ||
|
||
params APIQueryMessage.class | ||
} | ||
|
||
response { | ||
clz APIQueryAgentVersionReply.class | ||
} | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
core/src/main/java/org/zstack/core/upgrade/APIQueryAgentVersionReply.java
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,25 @@ | ||
package org.zstack.core.upgrade; | ||
|
||
import org.zstack.header.query.APIQueryReply; | ||
import org.zstack.header.rest.RestResponse; | ||
|
||
import java.util.List; | ||
|
||
@RestResponse(allTo = "inventories") | ||
public class APIQueryAgentVersionReply extends APIQueryReply { | ||
private List<AgentVersionInventory> inventories; | ||
|
||
public List<AgentVersionInventory> getInventories() { | ||
return inventories; | ||
} | ||
|
||
public void setInventories(List<AgentVersionInventory> inventories) { | ||
this.inventories = inventories; | ||
} | ||
|
||
public static APIQueryAgentVersionReply __example__() { | ||
APIQueryAgentVersionReply reply = new APIQueryAgentVersionReply(); | ||
|
||
return reply; | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
core/src/main/java/org/zstack/core/upgrade/APIQueryAgentVersionReplyDoc_zh_cn.groovy
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,33 @@ | ||
package org.zstack.core.upgrade | ||
|
||
|
||
import org.zstack.core.upgrade.AgentVersionVO | ||
import org.zstack.header.errorcode.ErrorCode | ||
|
||
doc { | ||
|
||
title "查询 Agent 版本信息返回" | ||
|
||
ref { | ||
name "inventories" | ||
path "org.zstack.core.upgrade.APIQueryAgentVersionReply.inventories" | ||
desc "null" | ||
type "List" | ||
since "5.0.0" | ||
clz AgentVersionVO.class | ||
} | ||
field { | ||
name "success" | ||
desc "" | ||
type "boolean" | ||
since "5.0.0" | ||
} | ||
ref { | ||
name "error" | ||
path "org.zstack.core.upgrade.APIQueryAgentVersionReply.error" | ||
desc "错误码,若不为null,则表示操作失败, 操作成功时该字段为null",false | ||
type "ErrorCode" | ||
since "5.0.0" | ||
clz ErrorCode.class | ||
} | ||
} |
Oops, something went wrong.