forked from zstackio/zstack
-
Notifications
You must be signed in to change notification settings - Fork 0
<feature>[storage]: res sblk #3361
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
MatheMatrix
wants to merge
1
commit into
feature-zsv-5.0.0-vm-registration
Choose a base branch
from
sync/tao.gan/sblk-ZSV-10000@@3
base: feature-zsv-5.0.0-vm-registration
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
29 changes: 29 additions & 0 deletions
29
...c/main/java/org/zstack/header/storage/primary/APICheckPrimaryStorageConsistencyEvent.java
This file contains hidden or 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,29 @@ | ||
| package org.zstack.header.storage.primary; | ||
|
|
||
| import org.zstack.header.message.APIEvent; | ||
| import org.zstack.header.rest.RestResponse; | ||
|
|
||
| @RestResponse(fieldsTo = {"all"}) | ||
| public class APICheckPrimaryStorageConsistencyEvent extends APIEvent { | ||
| private boolean consistent; | ||
|
|
||
| public boolean isConsistent() { | ||
| return consistent; | ||
| } | ||
|
|
||
| public void setConsistent(boolean consistent) { | ||
| this.consistent = consistent; | ||
| } | ||
|
|
||
| public APICheckPrimaryStorageConsistencyEvent() { | ||
| } | ||
|
|
||
| public APICheckPrimaryStorageConsistencyEvent(String apiId) { | ||
| super(apiId); | ||
| } | ||
|
|
||
| public static APICheckPrimaryStorageConsistencyEvent __example__() { | ||
| APICheckPrimaryStorageConsistencyEvent event = new APICheckPrimaryStorageConsistencyEvent(); | ||
| return event; | ||
| } | ||
| } |
29 changes: 29 additions & 0 deletions
29
.../org/zstack/header/storage/primary/APICheckPrimaryStorageConsistencyEventDoc_zh_cn.groovy
This file contains hidden or 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,29 @@ | ||
| package org.zstack.header.storage.primary | ||
|
|
||
| import org.zstack.header.errorcode.ErrorCode | ||
|
|
||
| doc { | ||
|
|
||
| title "检查存储一致性返回" | ||
|
|
||
| field { | ||
| name "consistent" | ||
| desc "是否一直" | ||
| type "boolean" | ||
| since "5.0.0" | ||
| } | ||
| field { | ||
| name "success" | ||
| desc "" | ||
| type "boolean" | ||
| since "5.0.0" | ||
| } | ||
| ref { | ||
| name "error" | ||
| path "org.zstack.header.storage.primary.APICheckPrimaryStorageConsistencyEvent.error" | ||
| desc "错误码,若不为null,则表示操作失败, 操作成功时该字段为null" | ||
| type "ErrorCode" | ||
| since "5.0.0" | ||
| clz ErrorCode.class | ||
| } | ||
| } | ||
36 changes: 36 additions & 0 deletions
36
...src/main/java/org/zstack/header/storage/primary/APICheckPrimaryStorageConsistencyMsg.java
This file contains hidden or 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,36 @@ | ||
| package org.zstack.header.storage.primary; | ||
|
|
||
| import org.springframework.http.HttpMethod; | ||
| import org.zstack.header.message.APIMessage; | ||
| import org.zstack.header.message.APIParam; | ||
| import org.zstack.header.rest.RestRequest; | ||
|
|
||
| @RestRequest( | ||
| path = "/primary-storage/{uuid}/consistency", | ||
| responseClass = APICheckPrimaryStorageConsistencyEvent.class, | ||
| method = HttpMethod.PUT, | ||
| isAction = true | ||
| ) | ||
| public class APICheckPrimaryStorageConsistencyMsg extends APIMessage implements PrimaryStorageMessage { | ||
| @APIParam(resourceType = PrimaryStorageVO.class) | ||
| private String uuid; | ||
|
|
||
| @Override | ||
| public String getPrimaryStorageUuid() { | ||
| return uuid; | ||
| } | ||
|
|
||
| public String getUuid() { | ||
| return uuid; | ||
| } | ||
|
|
||
| public void setUuid(String uuid) { | ||
| this.uuid = uuid; | ||
| } | ||
|
|
||
| public static APICheckPrimaryStorageConsistencyMsg __example__() { | ||
| APICheckPrimaryStorageConsistencyMsg msg = new APICheckPrimaryStorageConsistencyMsg(); | ||
| msg.setUuid(uuid(PrimaryStorageVO.class)); | ||
| return msg; | ||
| } | ||
| } |
58 changes: 58 additions & 0 deletions
58
...va/org/zstack/header/storage/primary/APICheckPrimaryStorageConsistencyMsgDoc_zh_cn.groovy
This file contains hidden or 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,58 @@ | ||
| package org.zstack.header.storage.primary | ||
|
|
||
| import org.zstack.header.storage.primary.APICheckPrimaryStorageConsistencyEvent | ||
|
|
||
| doc { | ||
| title "CheckPrimaryStorageConsistency" | ||
|
|
||
| category "storage.primary" | ||
|
|
||
| desc """检查存储一致性""" | ||
|
|
||
| rest { | ||
| request { | ||
| url "PUT /v1/primary-storage/{uuid}/consistency" | ||
|
|
||
| header (Authorization: 'OAuth the-session-uuid') | ||
|
|
||
| clz APICheckPrimaryStorageConsistencyMsg.class | ||
|
|
||
| desc """""" | ||
|
|
||
| params { | ||
|
|
||
| column { | ||
| name "uuid" | ||
| enclosedIn "checkPrimaryStorageConsistency" | ||
| desc "主存储的UUID" | ||
| location "url" | ||
| type "String" | ||
| optional false | ||
| since "5.0.0" | ||
| } | ||
| column { | ||
| name "systemTags" | ||
| enclosedIn "" | ||
| desc "系统标签" | ||
| location "body" | ||
| type "List" | ||
| optional true | ||
| since "5.0.0" | ||
| } | ||
| column { | ||
| name "userTags" | ||
| enclosedIn "" | ||
| desc "用户标签" | ||
| location "body" | ||
| type "List" | ||
| optional true | ||
| since "5.0.0" | ||
| } | ||
| } | ||
| } | ||
|
|
||
| response { | ||
| clz APICheckPrimaryStorageConsistencyEvent.class | ||
| } | ||
| } | ||
| } |
39 changes: 39 additions & 0 deletions
39
header/src/main/java/org/zstack/header/storage/primary/APITakeoverPrimaryStorageEvent.java
This file contains hidden or 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,39 @@ | ||
| package org.zstack.header.storage.primary; | ||
|
|
||
| import org.zstack.header.message.APIEvent; | ||
| import org.zstack.header.rest.RestResponse; | ||
|
|
||
| import java.util.Collections; | ||
|
|
||
| @RestResponse(allTo = "inventory") | ||
| public class APITakeoverPrimaryStorageEvent extends APIEvent { | ||
| private PrimaryStorageInventory inventory; | ||
|
|
||
| public APITakeoverPrimaryStorageEvent() { | ||
| } | ||
|
|
||
| public APITakeoverPrimaryStorageEvent(String apiId) { | ||
| super(apiId); | ||
| } | ||
|
|
||
| public PrimaryStorageInventory getInventory() { | ||
| return inventory; | ||
| } | ||
|
|
||
| public void setInventory(PrimaryStorageInventory inventory) { | ||
| this.inventory = inventory; | ||
| } | ||
|
|
||
| public static APITakeoverPrimaryStorageEvent __example__() { | ||
| APITakeoverPrimaryStorageEvent event = new APITakeoverPrimaryStorageEvent(); | ||
|
|
||
| PrimaryStorageInventory ps = new PrimaryStorageInventory(); | ||
| ps.setName("PS1"); | ||
| ps.setUrl("/zstack_ps"); | ||
| ps.setType("LocalStorage"); | ||
| ps.setAttachedClusterUuids(Collections.singletonList(uuid())); | ||
|
|
||
| event.setInventory(ps); | ||
| return event; | ||
| } | ||
| } |
32 changes: 32 additions & 0 deletions
32
...ain/java/org/zstack/header/storage/primary/APITakeoverPrimaryStorageEventDoc_zh_cn.groovy
This file contains hidden or 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,32 @@ | ||
| package org.zstack.header.storage.primary | ||
|
|
||
| import org.zstack.header.storage.primary.PrimaryStorageInventory | ||
| import org.zstack.header.errorcode.ErrorCode | ||
|
|
||
| doc { | ||
|
|
||
| title "接管主存储返回" | ||
|
|
||
| ref { | ||
| name "inventory" | ||
| path "org.zstack.header.storage.primary.APITakeoverPrimaryStorageEvent.inventory" | ||
| desc "主存储信息" | ||
| type "PrimaryStorageInventory" | ||
| since "5.0.0" | ||
| clz PrimaryStorageInventory.class | ||
| } | ||
| field { | ||
| name "success" | ||
| desc "" | ||
| type "boolean" | ||
| since "5.0.0" | ||
| } | ||
| ref { | ||
| name "error" | ||
| path "org.zstack.header.storage.primary.APITakeoverPrimaryStorageEvent.error" | ||
| desc "错误码,若不为null,则表示操作失败, 操作成功时该字段为null" | ||
| type "ErrorCode" | ||
| since "5.0.0" | ||
| clz ErrorCode.class | ||
| } | ||
| } |
36 changes: 36 additions & 0 deletions
36
header/src/main/java/org/zstack/header/storage/primary/APITakeoverPrimaryStorageMsg.java
This file contains hidden or 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,36 @@ | ||
| package org.zstack.header.storage.primary; | ||
|
|
||
| import org.springframework.http.HttpMethod; | ||
| import org.zstack.header.message.APIMessage; | ||
| import org.zstack.header.message.APIParam; | ||
| import org.zstack.header.rest.RestRequest; | ||
|
|
||
| @RestRequest( | ||
| path = "/primary-storage/{uuid}/takeover", | ||
| responseClass = APITakeoverPrimaryStorageEvent.class, | ||
| method = HttpMethod.PUT, | ||
| isAction = true | ||
| ) | ||
| public class APITakeoverPrimaryStorageMsg extends APIMessage implements PrimaryStorageMessage { | ||
| @APIParam(resourceType = PrimaryStorageVO.class) | ||
| private String uuid; | ||
|
|
||
| @Override | ||
| public String getPrimaryStorageUuid() { | ||
| return uuid; | ||
| } | ||
|
|
||
| public String getUuid() { | ||
| return uuid; | ||
| } | ||
|
|
||
| public void setUuid(String uuid) { | ||
| this.uuid = uuid; | ||
| } | ||
|
|
||
| public static APITakeoverPrimaryStorageMsg __example__() { | ||
| APITakeoverPrimaryStorageMsg msg = new APITakeoverPrimaryStorageMsg(); | ||
| msg.setUuid(uuid(PrimaryStorageVO.class)); | ||
| return msg; | ||
| } | ||
| } |
58 changes: 58 additions & 0 deletions
58
.../main/java/org/zstack/header/storage/primary/APITakeoverPrimaryStorageMsgDoc_zh_cn.groovy
This file contains hidden or 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,58 @@ | ||
| package org.zstack.header.storage.primary | ||
|
|
||
| import org.zstack.header.storage.primary.APITakeoverPrimaryStorageEvent | ||
|
|
||
| doc { | ||
| title "TakeoverPrimaryStorage" | ||
|
|
||
| category "storage.primary" | ||
|
|
||
| desc """接管主存储""" | ||
|
|
||
| rest { | ||
| request { | ||
| url "PUT /v1/primary-storage/{uuid}/takeover" | ||
|
|
||
| header (Authorization: 'OAuth the-session-uuid') | ||
|
|
||
| clz APITakeoverPrimaryStorageMsg.class | ||
|
|
||
| desc """""" | ||
|
|
||
| params { | ||
|
|
||
| column { | ||
| name "uuid" | ||
| enclosedIn "takeoverPrimaryStorage" | ||
| desc "主存储的UUID" | ||
| location "url" | ||
| type "String" | ||
| optional false | ||
| since "5.0.0" | ||
| } | ||
| column { | ||
| name "systemTags" | ||
| enclosedIn "" | ||
| desc "系统标签" | ||
| location "body" | ||
| type "List" | ||
| optional true | ||
| since "5.0.0" | ||
| } | ||
| column { | ||
| name "userTags" | ||
| enclosedIn "" | ||
| desc "用户标签" | ||
| location "body" | ||
| type "List" | ||
| optional true | ||
| since "5.0.0" | ||
| } | ||
| } | ||
| } | ||
|
|
||
| response { | ||
| clz APITakeoverPrimaryStorageEvent.class | ||
| } | ||
| } | ||
| } |
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
字段描述疑似笔误
“是否一直”建议改为“是否一致”,避免歧义。
✅ 建议修改
📝 Committable suggestion
🤖 Prompt for AI Agents