|
19 | 19 |
|
20 | 20 | package org.apache.cloudstack.backup; |
21 | 21 |
|
| 22 | +import com.cloud.event.ActionEvent; |
| 23 | +import com.cloud.event.EventTypes; |
22 | 24 | import com.cloud.user.AccountManager; |
23 | 25 | import com.cloud.utils.Pair; |
24 | 26 | import com.cloud.utils.component.ManagerBase; |
@@ -52,13 +54,15 @@ public class BackupRepositoryServiceImpl extends ManagerBase implements BackupRe |
52 | 54 | private AccountManager accountManager; |
53 | 55 |
|
54 | 56 | @Override |
| 57 | + @ActionEvent(eventType = EventTypes.EVENT_BACKUP_REPOSITORY_ADD, eventDescription = "add backup repository") |
55 | 58 | public BackupRepository addBackupRepository(AddBackupRepositoryCmd cmd) { |
56 | 59 | BackupRepositoryVO repository = new BackupRepositoryVO(cmd.getZoneId(), cmd.getProvider(), cmd.getName(), |
57 | 60 | cmd.getType(), cmd.getAddress(), cmd.getMountOptions(), cmd.getCapacityBytes(), cmd.isDraasEnabled()); |
58 | 61 | return repositoryDao.persist(repository); |
59 | 62 | } |
60 | 63 |
|
61 | 64 | @Override |
| 65 | + @ActionEvent(eventType = EventTypes.EVENT_BACKUP_REPOSITORY_UPDATE, eventDescription = "update backup repository") |
62 | 66 | public BackupRepository updateBackupRepository(UpdateBackupRepositoryCmd cmd) { |
63 | 67 | Long id = cmd.getId(); |
64 | 68 | String name = cmd.getName(); |
@@ -99,7 +103,7 @@ public BackupRepository updateBackupRepository(UpdateBackupRepositoryCmd cmd) { |
99 | 103 |
|
100 | 104 | BackupRepositoryVO repositoryVO = repositoryDao.findById(id); |
101 | 105 | CallContext.current().setEventDetails(String.format("Backup Repository updated [%s].", |
102 | | - ReflectionToStringBuilderUtils.reflectOnlySelectedFields(repositoryVO, "id", "name", "description", "userDrivenBackupAllowed", "externalId"))); |
| 106 | + ReflectionToStringBuilderUtils.reflectOnlySelectedFields(repositoryVO, "id", "name", "description", "userDrivenBackupAllowed", "externalId", "draasEnabled"))); |
103 | 107 | return repositoryVO; |
104 | 108 | } |
105 | 109 |
|
|
0 commit comments