This is an automated email from the ASF dual-hosted git repository.
dahn pushed a commit to branch 4.19
in repository https://gitbox.apache.org/repos/asf/cloudstack.git
The following commit(s) were added to refs/heads/4.19 by this push:
new 29e58e906f9 plugin/shutdown: use mgmt server uuid in the shutdown
response (#10717)
29e58e906f9 is described below
commit 29e58e906f9714dd882bcdf65856549796c6335c
Author: Rohit Yadav <[email protected]>
AuthorDate: Fri Apr 18 14:38:53 2025 +0530
plugin/shutdown: use mgmt server uuid in the shutdown response (#10717)
---
.../cloudstack/api/response/ReadyForShutdownResponse.java | 14 +++-----------
.../apache/cloudstack/shutdown/ShutdownManagerImpl.java | 4 +++-
2 files changed, 6 insertions(+), 12 deletions(-)
diff --git
a/plugins/shutdown/src/main/java/org/apache/cloudstack/api/response/ReadyForShutdownResponse.java
b/plugins/shutdown/src/main/java/org/apache/cloudstack/api/response/ReadyForShutdownResponse.java
index d1b2353d2a3..9b2728d9d6e 100644
---
a/plugins/shutdown/src/main/java/org/apache/cloudstack/api/response/ReadyForShutdownResponse.java
+++
b/plugins/shutdown/src/main/java/org/apache/cloudstack/api/response/ReadyForShutdownResponse.java
@@ -38,10 +38,10 @@ public class ReadyForShutdownResponse extends BaseResponse {
@SerializedName(ApiConstants.MANAGEMENT_SERVER_ID)
@Param(description = "The id of the management server")
- private Long msId;
+ private String msUuid;
- public ReadyForShutdownResponse(Long msId, Boolean shutdownTriggered,
Boolean readyForShutdown, long pendingJobsCount) {
- this.msId = msId;
+ public ReadyForShutdownResponse(String msUuid, Boolean shutdownTriggered,
Boolean readyForShutdown, long pendingJobsCount) {
+ this.msUuid = msUuid;
this.shutdownTriggered = shutdownTriggered;
this.readyForShutdown = readyForShutdown;
this.pendingJobsCount = pendingJobsCount;
@@ -70,12 +70,4 @@ public class ReadyForShutdownResponse extends BaseResponse {
public void setPendingJobsCount(Long pendingJobsCount) {
this.pendingJobsCount = pendingJobsCount;
}
-
- public Long getMsId() {
- return msId;
- }
-
- public void setMsId(Long msId) {
- this.msId = msId;
- }
}
diff --git
a/plugins/shutdown/src/main/java/org/apache/cloudstack/shutdown/ShutdownManagerImpl.java
b/plugins/shutdown/src/main/java/org/apache/cloudstack/shutdown/ShutdownManagerImpl.java
index da3bba54bdc..e08b23f6c6a 100644
---
a/plugins/shutdown/src/main/java/org/apache/cloudstack/shutdown/ShutdownManagerImpl.java
+++
b/plugins/shutdown/src/main/java/org/apache/cloudstack/shutdown/ShutdownManagerImpl.java
@@ -137,6 +137,7 @@ public class ShutdownManagerImpl extends ManagerBase
implements ShutdownManager,
public ReadyForShutdownResponse readyForShutdown(Long managementserverid) {
Long[] msIds = null;
boolean shutdownTriggeredAnywhere = false;
+ String msUuid = null;
State[] shutdownTriggeredStates = {State.ShuttingDown,
State.PreparingToShutDown, State.ReadyToShutDown};
if (managementserverid == null) {
List<ManagementServerHostVO> msHosts =
msHostDao.listBy(shutdownTriggeredStates);
@@ -149,11 +150,12 @@ public class ShutdownManagerImpl extends ManagerBase
implements ShutdownManager,
}
} else {
ManagementServerHostVO msHost =
msHostDao.findById(managementserverid);
+ msUuid = msHost.getUuid();
msIds = new Long[]{msHost.getMsid()};
shutdownTriggeredAnywhere =
Arrays.asList(shutdownTriggeredStates).contains(msHost.getState());
}
long pendingJobCount = countPendingJobs(msIds);
- return new ReadyForShutdownResponse(managementserverid,
shutdownTriggeredAnywhere, pendingJobCount == 0, pendingJobCount);
+ return new ReadyForShutdownResponse(msUuid, shutdownTriggeredAnywhere,
pendingJobCount == 0, pendingJobCount);
}
@Override