|
31 | 31 | import javax.naming.ConfigurationException; |
32 | 32 |
|
33 | 33 | import com.cloud.vm.VirtualMachine; |
| 34 | + |
34 | 35 | import org.apache.cloudstack.api.ApiConstants; |
35 | 36 | import org.apache.cloudstack.api.command.admin.cluster.AddClusterCmd; |
36 | 37 | import org.apache.cloudstack.api.command.admin.cluster.DeleteClusterCmd; |
|
93 | 94 | import com.cloud.deploy.PlannerHostReservationVO; |
94 | 95 | import com.cloud.deploy.dao.PlannerHostReservationDao; |
95 | 96 | import com.cloud.event.ActionEvent; |
| 97 | +import com.cloud.event.ActionEventUtils; |
96 | 98 | import com.cloud.event.EventTypes; |
| 99 | +import com.cloud.event.EventVO; |
97 | 100 | import com.cloud.exception.AgentUnavailableException; |
98 | 101 | import com.cloud.exception.DiscoveryException; |
99 | 102 | import com.cloud.exception.InvalidParameterValueException; |
@@ -1188,6 +1191,7 @@ private boolean doMaintain(final long hostId) { |
1188 | 1191 | throw new CloudRuntimeException(err + e.getMessage()); |
1189 | 1192 | } |
1190 | 1193 |
|
| 1194 | + ActionEventUtils.onStartedActionEvent(CallContext.current().getCallingUserId(), CallContext.current().getCallingAccountId(), EventTypes.EVENT_MAINTENANCE_PREPARE, "starting maintenance for host " + hostId, true, 0); |
1191 | 1195 | _agentMgr.pullAgentToMaintenance(hostId); |
1192 | 1196 |
|
1193 | 1197 | /* TODO: move below to listener */ |
@@ -1270,6 +1274,7 @@ public boolean checkAndMaintain(final long hostId) { |
1270 | 1274 | if (vos.isEmpty() && vosMigrating.isEmpty()) { |
1271 | 1275 | resourceStateTransitTo(host, ResourceState.Event.InternalEnterMaintenance, _nodeId); |
1272 | 1276 | hostInMaintenance = true; |
| 1277 | + ActionEventUtils.onCompletedActionEvent(CallContext.current().getCallingUserId(), CallContext.current().getCallingAccountId(), EventVO.LEVEL_INFO, EventTypes.EVENT_MAINTENANCE_PREPARE, "completed maintenance for host " + hostId, 0); |
1273 | 1278 | } |
1274 | 1279 | } |
1275 | 1280 | } catch (NoTransitionException e) { |
|
0 commit comments