diff --git a/api/src/com/cloud/api/commands/CreateZoneCmd.java b/api/src/com/cloud/api/commands/CreateZoneCmd.java index 5494441d9b0..755a25599fe 100755 --- a/api/src/com/cloud/api/commands/CreateZoneCmd.java +++ b/api/src/com/cloud/api/commands/CreateZoneCmd.java @@ -29,6 +29,7 @@ import com.cloud.api.ServerApiException; import com.cloud.api.response.ZoneResponse; import com.cloud.dc.DataCenter; import com.cloud.user.Account; +import com.cloud.user.UserContext; @Implementation(description="Creates a Zone.", responseObject=ZoneResponse.class) public class CreateZoneCmd extends BaseCmd { @@ -140,7 +141,8 @@ public class CreateZoneCmd extends BaseCmd { @Override public void execute(){ - DataCenter result = _configService.createZone(this); + UserContext.current().setEventDetails("Zone Name: "+getZoneName()); + DataCenter result = _configService.createZone(this); if (result != null){ ZoneResponse response = _responseGenerator.createZoneResponse(result,false); response.setResponseName(getCommandName()); diff --git a/api/src/com/cloud/api/commands/DeleteZoneCmd.java b/api/src/com/cloud/api/commands/DeleteZoneCmd.java index a892a90d51f..67528f5b10b 100644 --- a/api/src/com/cloud/api/commands/DeleteZoneCmd.java +++ b/api/src/com/cloud/api/commands/DeleteZoneCmd.java @@ -28,6 +28,7 @@ import com.cloud.api.Parameter; import com.cloud.api.ServerApiException; import com.cloud.api.response.SuccessResponse; import com.cloud.user.Account; +import com.cloud.user.UserContext; @Implementation(description="Deletes a Zone.", responseObject=SuccessResponse.class) public class DeleteZoneCmd extends BaseCmd { @@ -69,7 +70,8 @@ public class DeleteZoneCmd extends BaseCmd { @Override public void execute(){ - boolean result = _configService.deleteZone(this); + UserContext.current().setEventDetails("Zone Id: "+getId()); + boolean result = _configService.deleteZone(this); if (result) { SuccessResponse response = new SuccessResponse(getCommandName()); this.setResponseObject(response); diff --git a/api/src/com/cloud/api/commands/UpdateZoneCmd.java b/api/src/com/cloud/api/commands/UpdateZoneCmd.java index 07564ce8d12..132b5bbd10b 100755 --- a/api/src/com/cloud/api/commands/UpdateZoneCmd.java +++ b/api/src/com/cloud/api/commands/UpdateZoneCmd.java @@ -32,6 +32,7 @@ import com.cloud.api.ServerApiException; import com.cloud.api.response.ZoneResponse; import com.cloud.dc.DataCenter; import com.cloud.user.Account; +import com.cloud.user.UserContext; @Implementation(description="Updates a Zone.", responseObject=ZoneResponse.class) public class UpdateZoneCmd extends BaseCmd { @@ -154,7 +155,8 @@ public class UpdateZoneCmd extends BaseCmd { @Override public void execute(){ - DataCenter result = _configService.editZone(this); + UserContext.current().setEventDetails("Zone Id: "+getId()); + DataCenter result = _configService.editZone(this); if (result != null) { ZoneResponse response = _responseGenerator.createZoneResponse(result, false); response.setResponseName(getCommandName()); diff --git a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java index b9a64a895b1..d5eb2d6d81a 100755 --- a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java +++ b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java @@ -1151,6 +1151,7 @@ public class ConfigurationManagerImpl implements ConfigurationManager, Configura @Override @DB + @ActionEvent(eventType = EventTypes.EVENT_ZONE_DELETE, eventDescription = "deleting zone", async = false) public boolean deleteZone(DeleteZoneCmd cmd) { Transaction txn = Transaction.currentTxn(); @@ -1269,6 +1270,7 @@ public class ConfigurationManagerImpl implements ConfigurationManager, Configura @Override @DB + @ActionEvent(eventType = EventTypes.EVENT_ZONE_EDIT, eventDescription = "editing zone", async = false) public DataCenter editZone(UpdateZoneCmd cmd) { // Parameter validation as from execute() method in V1 Long zoneId = cmd.getId(); @@ -1543,6 +1545,7 @@ public class ConfigurationManagerImpl implements ConfigurationManager, Configura } @Override + @ActionEvent(eventType = EventTypes.EVENT_ZONE_CREATE, eventDescription = "creating zone", async = false) public DataCenter createZone(CreateZoneCmd cmd) { // grab parameters from the command Long userId = UserContext.current().getCallerUserId();