Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
365 commits
Select commit Hold shift + click to select a range
63f9d83
Update CommvaultClient.java
Dajeong-Park Aug 18, 2025
6042881
로그 추가
Dajeong-Park Aug 18, 2025
f2ff085
Update CommvaultClient.java
Dajeong-Park Aug 18, 2025
8da76cf
Update CommvaultClient.java
Dajeong-Park Aug 18, 2025
3aef1d8
백업 오퍼링 편집 시 사용자기반백업 허용 보이지도않도록 수정
Dajeong-Park Aug 18, 2025
8377073
백업 오퍼링 한개만 추가할 수 있도록 변경
Dajeong-Park Aug 19, 2025
2945160
수정
Dajeong-Park Aug 19, 2025
d7fde3c
Update CommvaultClient.java
Dajeong-Park Aug 19, 2025
970a29e
수정
Dajeong-Park Aug 19, 2025
ad617fb
Update CommvaultBackupProvider.java
Dajeong-Park Aug 19, 2025
4836e31
백업 생성 로직 추가
Dajeong-Park Aug 19, 2025
adc44d4
Update CommvaultClient.java
Dajeong-Park Aug 19, 2025
4c0abb8
Update CommvaultBackupProvider.java
Dajeong-Park Aug 19, 2025
7bd4c59
Update CommvaultBackupProvider.java
Dajeong-Park Aug 19, 2025
44deb7e
Update CommvaultBackupProvider.java
Dajeong-Park Aug 19, 2025
682b334
CreateSnapshotBackupCmd 추가
Dajeong-Park Aug 19, 2025
34570d0
테스트
Dajeong-Park Aug 19, 2025
2d91db2
Update VolumeApiServiceImpl.java
Dajeong-Park Aug 19, 2025
c49a212
스냅샷 경로 변경
Dajeong-Park Aug 19, 2025
5201c9a
수정
Dajeong-Park Aug 19, 2025
345625a
Update CommvaultClient.java
Dajeong-Park Aug 19, 2025
63d526c
백업 수정
Dajeong-Park Aug 19, 2025
ef4e581
백업 코드 변경
Dajeong-Park Aug 19, 2025
7c6e93f
Update CommvaultClient.java
Dajeong-Park Aug 19, 2025
fd01aeb
코드 수정
Dajeong-Park Aug 20, 2025
7a124d2
백업 실행 Api 변경
Dajeong-Park Aug 20, 2025
de06062
수정
Dajeong-Park Aug 20, 2025
756efba
Update CommvaultBackupProvider.java
Dajeong-Park Aug 20, 2025
e66c5fc
상세수정
Dajeong-Park Aug 20, 2025
989c8a6
Update CommvaultClient.java
Dajeong-Park Aug 20, 2025
09c3d32
Update CommvaultClient.java
Dajeong-Park Aug 20, 2025
7e9b617
Update CommvaultBackupProvider.java
Dajeong-Park Aug 20, 2025
63fb683
상태 추가
Dajeong-Park Aug 20, 2025
97e5494
코드 변경
Dajeong-Park Aug 20, 2025
cefa5fa
Date 포맷 변경
Dajeong-Park Aug 20, 2025
605a9a1
Full 백업
Dajeong-Park Aug 20, 2025
7c89edf
path 구분자 변경
Dajeong-Park Aug 20, 2025
dfea118
백업 API 변경
Dajeong-Park Aug 20, 2025
448f0a6
Update CommvaultClient.java
Dajeong-Park Aug 20, 2025
b9324dd
방법1실행
Dajeong-Park Aug 20, 2025
2c29a07
Update CommvaultClient.java
Dajeong-Park Aug 20, 2025
aef07b8
백업 실행 API 테스트
Dajeong-Park Aug 20, 2025
d7e1682
백업 코드 확정
Dajeong-Park Aug 20, 2025
72b2a82
쓰지않는 메소드 삭제
Dajeong-Park Aug 20, 2025
d947cbe
로그 추가
Dajeong-Park Aug 21, 2025
dcb2952
backup 핸들러 변경
Dajeong-Park Aug 21, 2025
ec90f22
로그 삭제
Dajeong-Park Aug 21, 2025
e708bd1
Update SnapshotManagerImpl.java
Dajeong-Park Aug 21, 2025
cb5d6fd
deleteBackup 수정
Dajeong-Park Aug 22, 2025
9bec53e
빌드오류수정
Dajeong-Park Aug 22, 2025
a91cf80
Update CommvaultBackupProvider.java
Dajeong-Park Aug 22, 2025
911d362
빌드오류 수정
Dajeong-Park Aug 22, 2025
f2c147c
Update CommvaultClient.java
Dajeong-Park Aug 22, 2025
8295213
Update CommvaultClient.java
Dajeong-Park Aug 22, 2025
595cbc5
Update CommvaultClient.java
Dajeong-Park Aug 22, 2025
4ae605a
Update CommvaultBackupProvider.java
Dajeong-Park Aug 22, 2025
8d4967d
Update DefaultSnapshotStrategy.java
Dajeong-Park Aug 25, 2025
6cba793
로그 추가
Dajeong-Park Aug 25, 2025
80b74a2
Update VolumeApiServiceImpl.java
Dajeong-Park Aug 25, 2025
c1572a5
Update VolumeApiServiceImpl.java
Dajeong-Park Aug 25, 2025
2a38fc0
Update VolumeApiServiceImpl.java
Dajeong-Park Aug 25, 2025
14d5973
Update SnapshotManagerImpl.java
Dajeong-Park Aug 25, 2025
f1e37fa
Update CommvaultBackupProvider.java
Dajeong-Park Aug 25, 2025
baa6f8c
Update CommvaultBackupProvider.java
Dajeong-Park Aug 25, 2025
87d9e97
Update CommvaultBackupProvider.java
Dajeong-Park Aug 25, 2025
37fe6cf
Update CommvaultBackupProvider.java
Dajeong-Park Aug 25, 2025
eb5584d
Update CommvaultBackupProvider.java
Dajeong-Park Aug 25, 2025
945d803
Update SnapshotManagerImpl.java
Dajeong-Park Aug 25, 2025
6318d51
로그 삭제
Dajeong-Park Aug 25, 2025
2856ebc
Update CommvaultBackupProvider.java
Dajeong-Park Aug 25, 2025
73259b1
Update CommvaultClient.java
Dajeong-Park Aug 25, 2025
0bd05a6
Update CommvaultBackupProvider.java
Dajeong-Park Aug 25, 2025
bf0031b
Update CommvaultBackupProvider.java
Dajeong-Park Aug 25, 2025
6687706
Update CommvaultBackupProvider.java
Dajeong-Park Aug 25, 2025
46c746e
Update CommvaultBackupProvider.java
Dajeong-Park Aug 25, 2025
258e4d0
복원 로그 추가
Dajeong-Park Aug 25, 2025
c69be71
Update CommvaultBackupProvider.java
Dajeong-Park Aug 25, 2025
fc510b0
Update CommvaultBackupProvider.java
Dajeong-Park Aug 25, 2025
ca2fce1
Update CommvaultClient.java
Dajeong-Park Aug 25, 2025
7ca6ac6
백업 전용 스냅샷 복원 추가
Dajeong-Park Aug 26, 2025
a52ad52
revertbackup
Dajeong-Park Aug 26, 2025
719dcba
Update SnapshotDataFactory.java
Dajeong-Park Aug 26, 2025
bb1a73b
Update StorPoolSnapshotStrategy.java
Dajeong-Park Aug 26, 2025
aeee2f2
Update ManagementServerImpl.java
Dajeong-Park Aug 26, 2025
38ca361
Merge pull request #350 from ablecloud-team/ablestack-diplo
Dajeong-Park Aug 26, 2025
9cfa84e
Merge pull request #351 from Dajeong-Park/ablestack-diplo
Dajeong-Park Aug 26, 2025
4222900
Update CommvaultBackupProvider.java
Dajeong-Park Aug 26, 2025
6761714
Update SnapshotManagerImpl.java
Dajeong-Park Aug 26, 2025
af3871b
Update SnapshotDataFactoryImpl.java
Dajeong-Park Aug 26, 2025
3a01f3a
수정
Dajeong-Park Aug 26, 2025
51cc81b
revert
Dajeong-Park Aug 26, 2025
abd194e
revert
Dajeong-Park Aug 26, 2025
8dff058
Update StorageStrategyFactory.java
Dajeong-Park Aug 26, 2025
a6f2952
Update DefaultSnapshotStrategy.java
Dajeong-Park Aug 26, 2025
c0445e8
revert
Dajeong-Park Aug 26, 2025
c7764f0
Revert "revert"
Dajeong-Park Aug 26, 2025
a781124
Update SnapshotManagerImpl.java
Dajeong-Park Aug 26, 2025
9e472be
Update DefaultSnapshotStrategy.java
Dajeong-Park Aug 26, 2025
30adb3f
Update CommvaultBackupProvider.java
Dajeong-Park Aug 27, 2025
6457aad
Update DefaultSnapshotStrategy.java
Dajeong-Park Aug 27, 2025
f551857
테스트 로그 추가
Dajeong-Park Aug 27, 2025
2ac72bd
Update LibvirtRevertSnapshotCommandWrapper.java
Dajeong-Park Aug 27, 2025
39fac23
revert 방식 변경
Dajeong-Park Aug 27, 2025
47ff207
Update CommvaultBackupProvider.java
Dajeong-Park Aug 27, 2025
b76d0a4
빌드오류 수정
Dajeong-Park Aug 27, 2025
4a23b72
Update CommvaultBackupProvider.java
Dajeong-Park Aug 27, 2025
b1ccae4
revertbackup 코드 삭제
Dajeong-Park Aug 27, 2025
05d41e6
빌드오류 수정
Dajeong-Park Aug 27, 2025
458d072
Update CommvaultBackupProvider.java
Dajeong-Park Aug 27, 2025
096807e
Update CommvaultBackupProvider.java
Dajeong-Park Aug 27, 2025
1f5cf2d
Update CommvaultBackupProvider.java
Dajeong-Park Aug 28, 2025
bfc9f0c
Update CommvaultBackupProvider.java
Dajeong-Park Aug 28, 2025
bc21cca
Update CommvaultBackupProvider.java
Dajeong-Park Aug 28, 2025
de4f32e
Update CommvaultBackupProvider.java
Dajeong-Park Aug 28, 2025
a3a50ba
Update CommvaultBackupProvider.java
Dajeong-Park Aug 28, 2025
952ec9b
sshExecute 추가
Dajeong-Park Aug 28, 2025
ca63a0b
Update CommvaultBackupProvider.java
Dajeong-Park Aug 28, 2025
b5f34c2
Update CommvaultBackupProvider.java
Dajeong-Park Aug 28, 2025
1a7a3c4
복원 및 연결 추가
Dajeong-Park Aug 28, 2025
7c033f4
Update CommvaultBackupProvider.java
Dajeong-Park Aug 28, 2025
3c8801e
Update CommvaultBackupProvider.java
Dajeong-Park Aug 28, 2025
efba54b
Update CommvaultBackupProvider.java
Dajeong-Park Aug 28, 2025
a10393f
Update CommvaultClient.java
Dajeong-Park Aug 28, 2025
b4295e3
Update CommvaultClient.java
Dajeong-Park Aug 28, 2025
acbe7c9
Update CommvaultBackupProvider.java
Dajeong-Park Aug 28, 2025
16a7f0a
Update CommvaultBackupProvider.java
Dajeong-Park Aug 28, 2025
1d4de6d
Update CommvaultBackupProvider.java
Dajeong-Park Aug 28, 2025
f7052e6
Update CommvaultBackupProvider.java
Dajeong-Park Aug 28, 2025
a6d07aa
Update CommvaultBackupProvider.java
Dajeong-Park Sep 4, 2025
57906eb
Update CommvaultBackupProvider.java
Dajeong-Park Sep 4, 2025
712c7e3
Update CommvaultBackupProvider.java
Dajeong-Park Sep 4, 2025
6800823
Update CommvaultBackupProvider.java
Dajeong-Park Sep 4, 2025
ab71e00
백업 스케줄 구성 삭제시 리스트 refresh 적용
Dajeong-Park Sep 4, 2025
fa908c0
syncBackup 추가
Dajeong-Park Sep 4, 2025
a82e3d2
Update CommvaultBackupProvider.java
Dajeong-Park Sep 4, 2025
6c1c72f
Update CommvaultBackupProvider.java
Dajeong-Park Sep 4, 2025
e821e0f
Update CommvaultBackupProvider.java
Dajeong-Park Sep 4, 2025
7a041a4
Merge pull request #352 from ablecloud-team/ablestack-diplo
Dajeong-Park Sep 4, 2025
947e0bf
Merge pull request #353 from Dajeong-Park/ablestack-diplo
Dajeong-Park Sep 4, 2025
a9d3936
재수정
Dajeong-Park Sep 4, 2025
576099e
Update ApiConstants.java
Dajeong-Park Sep 4, 2025
57c3584
installAgent 로직 추가
Dajeong-Park Sep 4, 2025
d7e5dfc
Update SAML2LogoutAPIAuthenticatorCmd.java
Dajeong-Park Sep 4, 2025
d61c807
Update CommvaultClient.java
Dajeong-Park Sep 4, 2025
6ae8731
Update CommvaultClient.java
Dajeong-Park Sep 5, 2025
c0f8510
불필요부분 삭제
Dajeong-Park Sep 5, 2025
f011023
로그 추가
Dajeong-Park Sep 5, 2025
ace83df
Update CommvaultBackupProvider.java
Dajeong-Park Sep 5, 2025
aa9e5a1
Update CommvaultClient.java
Dajeong-Park Sep 5, 2025
5eb887e
로그 삭제
Dajeong-Park Sep 5, 2025
43e4566
수동 백업 시 실행중인 가상머신의 백업 작업이 있는지 조회하여 예외처리, 스케줄 백업 시 해당 가상머신의 백업 작업이 있는…
Dajeong-Park Sep 8, 2025
564a891
빌드 오류 수정
Dajeong-Park Sep 8, 2025
d3d6463
Update CommvaultClient.java
Dajeong-Park Sep 8, 2025
f345c4a
reset
Dajeong-Park Sep 8, 2025
b8660a1
Update CommvaultBackupProvider.java
Dajeong-Park Sep 8, 2025
f89b366
installAgent 추가
Dajeong-Park Sep 10, 2025
7ae88e6
에이전트 설치 와 상태체크 분리
Dajeong-Park Sep 10, 2025
6057945
Update CommvaultClient.java
Dajeong-Park Sep 10, 2025
6cb9d77
설치 진행중인 호스트 있는지 파악
Dajeong-Park Sep 10, 2025
fe8fc1e
Update CommvaultBackupProvider.java
Dajeong-Park Sep 10, 2025
809bc25
빌드
Dajeong-Park Sep 10, 2025
d62109f
Update CommvaultBackupProvider.java
Dajeong-Park Sep 10, 2025
34e95ab
설치가 정상적으로 안된ㄱ ㅕㅇ우 예외처리 추가
Dajeong-Park Sep 10, 2025
78e9d18
Update CommvaultBackupProvider.java
Dajeong-Park Sep 10, 2025
cee7fe5
Update CommvaultClient.java
Dajeong-Park Sep 10, 2025
2927cd8
수정
Dajeong-Park Sep 10, 2025
0f9302b
Update CommvaultClient.java
Dajeong-Park Sep 10, 2025
2469d99
Update CommvaultClient.java
Dajeong-Park Sep 10, 2025
20a50c2
Update CommvaultClient.java
Dajeong-Park Sep 10, 2025
7f3bb26
Update CommvaultBackupProvider.java
Dajeong-Park Sep 10, 2025
b9e0192
추가
Dajeong-Park Sep 10, 2025
6af9773
에러 메세지 출력하도록 변경
Dajeong-Park Sep 11, 2025
ce3a7c2
소스 변경
Dajeong-Park Sep 11, 2025
634521a
Update CommvaultClient.java
Dajeong-Park Sep 12, 2025
350dbac
Update CommvaultClient.java
Dajeong-Park Sep 12, 2025
89e4e66
Update CommvaultClient.java
Dajeong-Park Sep 12, 2025
fb37b3e
Update CommvaultClient.java
Dajeong-Park Sep 12, 2025
9e1e493
Update CommvaultClient.java
Dajeong-Park Sep 12, 2025
a42f729
Update CommvaultClient.java
Dajeong-Park Sep 12, 2025
4af7736
Update CommvaultClient.java
Dajeong-Park Sep 12, 2025
7bf358d
Update CommvaultClient.java
Dajeong-Park Sep 12, 2025
b1e6773
Merge pull request #354 from ablecloud-team/ablestack-diplo
Dajeong-Park Sep 16, 2025
448e843
Merge branch 'backup' into ablestack-diplo
Dajeong-Park Sep 16, 2025
469640a
Merge pull request #355 from Dajeong-Park/ablestack-diplo
Dajeong-Park Sep 16, 2025
34db10f
Update ko_KR.json
Dajeong-Park Sep 16, 2025
b53cb7e
Update ApiConstants.java
Dajeong-Park Sep 16, 2025
11a5fc0
Update CommvaultClient.java
Dajeong-Park Sep 16, 2025
e084f70
Update CommvaultClient.java
Dajeong-Park Sep 16, 2025
3651d11
Update CommvaultClient.java
Dajeong-Park Sep 16, 2025
6d2da21
Update CommvaultClient.java
Dajeong-Park Sep 16, 2025
a787fba
다중 디스크 백업시 external id 컬럼 길이 수정
Dajeong-Park Sep 17, 2025
8105093
Update BackupVO.java
Dajeong-Park Sep 17, 2025
04a787e
Update CommvaultBackupProvider.java
Dajeong-Park Sep 17, 2025
c071edd
Update BackupVO.java
Dajeong-Park Sep 17, 2025
2d03336
Update BackupVO.java
Dajeong-Park Sep 18, 2025
9eae8aa
Update CommvaultBackupProvider.java
Dajeong-Park Sep 18, 2025
7163697
불필요 로그 삭제
Dajeong-Park Sep 18, 2025
8d0d3eb
deviceId 순으로 sort하여 작업하도록
Dajeong-Park Sep 18, 2025
4158e16
Update CommvaultBackupProvider.java
Dajeong-Park Sep 18, 2025
deb002b
Update CommvaultBackupProvider.java
Dajeong-Park Sep 18, 2025
57d57c0
Update CommvaultBackupProvider.java
Dajeong-Park Sep 18, 2025
ebf2de8
Update CommvaultBackupProvider.java
Dajeong-Park Sep 18, 2025
3be9338
Update CommvaultBackupProvider.java
Dajeong-Park Sep 18, 2025
94a15c8
볼륨 연결 시 로직 추가
Dajeong-Park Sep 18, 2025
44af718
Update CommvaultBackupProvider.java
Dajeong-Park Sep 18, 2025
8751617
Update CommvaultBackupProvider.java
Dajeong-Park Sep 18, 2025
b2763eb
Update CommvaultBackupProvider.java
Dajeong-Park Sep 18, 2025
6ba8aed
로그
Dajeong-Park Sep 18, 2025
1b9f009
Update SshHelper.java
Dajeong-Park Sep 18, 2025
d88a28a
Update CommvaultBackupProvider.java
Dajeong-Park Sep 18, 2025
9382fbd
Update CommvaultBackupProvider.java
Dajeong-Park Sep 22, 2025
f292ff9
추가
Dajeong-Park Sep 23, 2025
c9bd1b5
Update CommvaultBackupProvider.java
Dajeong-Park Sep 23, 2025
b6f6884
Update CommvaultBackupProvider.java
Dajeong-Park Sep 23, 2025
ba1cfbf
Update CommvaultBackupProvider.java
Dajeong-Park Sep 23, 2025
23806a6
Update CommvaultBackupProvider.java
Dajeong-Park Sep 24, 2025
c1b522b
로그 추가
Dajeong-Park Sep 24, 2025
2423aca
backupset 경로 변경 오류 수정
Dajeong-Park Sep 24, 2025
28ee124
에이전트 상태 체크 로직 변경
Dajeong-Park Sep 25, 2025
9966e65
Update BackupManagerImpl.java
Dajeong-Park Sep 25, 2025
76114bf
Update BackupManagerImpl.java
Dajeong-Park Sep 25, 2025
52a5e61
Update BackupManagerImpl.java
Dajeong-Park Sep 25, 2025
050ce01
Update CommvaultClient.java
Dajeong-Park Sep 25, 2025
2c29bea
불필요 로그 삭제
Dajeong-Park Sep 25, 2025
a14b553
예약된 백업 시간 출력 오류로 key 추가
Dajeong-Park Sep 25, 2025
22f27a2
Update ko_KR.json
Dajeong-Park Sep 26, 2025
316fd20
백업 스케줄 삭제 시 항목별로 삭제 가능하도록 변경
Dajeong-Park Sep 26, 2025
33126de
Merge branch 'backup' into test-11
Dajeong-Park Sep 26, 2025
3793d41
Merge pull request #360 from Dajeong-Park/test-11
Dajeong-Park Sep 26, 2025
6f42234
스케줄 구성 삭제 변경
Dajeong-Park Sep 26, 2025
a372995
id추가
Dajeong-Park Sep 26, 2025
a5c003c
Update BackupScheduleDaoImpl.java
Dajeong-Park Sep 26, 2025
03281c1
원복
Dajeong-Park Sep 29, 2025
841c10a
Update SshHelper.java
Dajeong-Park Sep 29, 2025
5e8dc73
Update BackupManagerImpl.java
Dajeong-Park Sep 29, 2025
53c24c4
Update BackupManagerImpl.java
Dajeong-Park Sep 29, 2025
a366089
백업 오퍼링 보존기간 UI 출력
Dajeong-Park Sep 29, 2025
69046f0
백업 오퍼링 편집 시 보존기간 추가
Dajeong-Park Sep 30, 2025
a1dd207
Update UpdateBackupOffering.vue
Dajeong-Park Sep 30, 2025
a197033
백업 오퍼링 편집 수정
Dajeong-Park Sep 30, 2025
7bec82c
Update UpdateBackupOffering.vue
Dajeong-Park Sep 30, 2025
ddada13
Update BackupManagerImpl.java
Dajeong-Park Sep 30, 2025
a8f8740
Update BackupManagerImpl.java
Dajeong-Park Sep 30, 2025
cf817c6
Update UpdateBackupOffering.vue
Dajeong-Park Sep 30, 2025
eb1c87a
Update setup.py
Dajeong-Park Sep 30, 2025
b2b9db1
Delete package-lock.json
Dajeong-Park Sep 30, 2025
1649de9
Merge pull request #361 from ablecloud-team/ablestack-diplo
Dajeong-Park Sep 30, 2025
e0bae03
Merge pull request #362 from Dajeong-Park/ablestack-diplo
Dajeong-Park Sep 30, 2025
8dea5d4
Merge pull request #363 from ablecloud-team/ablestack-diplo
Dajeong-Park Sep 30, 2025
4bda1ba
Merge pull request #364 from Dajeong-Park/ablestack-diplo
Dajeong-Park Sep 30, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions api/src/main/java/com/cloud/storage/VolumeApiService.java
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ public interface VolumeApiService {
Snapshot takeSnapshot(Long volumeId, Long policyId, Long snapshotId, Account account, boolean quiescevm, Snapshot.LocationType locationType, boolean asyncBackup, Map<String, String> tags, List<Long> zoneIds)
throws ResourceAllocationException;

Snapshot takeSnapshot(Long volumeId, Long policyId, Long snapshotId, Account account, boolean quiescevm, Snapshot.LocationType locationType, boolean asyncBackup, Map<String, String> tags, List<Long> zoneIds, boolean backup)
throws ResourceAllocationException;

Snapshot allocSnapshot(Long volumeId, Long policyId, String snapshotName, Snapshot.LocationType locationType, List<Long> zoneIds) throws ResourceAllocationException;

Volume updateVolume(long volumeId, String path, String state, Long storageId, Boolean displayVolume, Boolean deleteProtection, String customId, long owner, String chainInfo, String name, String type);
Expand Down
5 changes: 3 additions & 2 deletions api/src/main/java/org/apache/cloudstack/api/ApiConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public class ApiConstants {
public static final String AVAILABLE = "available";
public static final String AVAILABLE_SUBNETS = "availablesubnets";
public static final String AVAILABLE_VIRTUAL_MACHINE_COUNT = "availablevirtualmachinecount";
public static final String BACKUP = "backup";
public static final String BACKUP_ID = "backupid";
public static final String BACKUP_OFFERING_NAME = "backupofferingname";
public static final String BACKUP_OFFERING_ID = "backupofferingid";
Expand Down Expand Up @@ -836,6 +837,7 @@ public class ApiConstants {
public static final String DEST_NETWORK_UUID = "destnetworkuuid";
public static final String LOGICAL_ROUTER_UUID = "logicalrouteruuid";
public static final String RETRY = "retry";
public static final String RETENTION_PERIOD = "retentionperiod";
public static final String HTTP_METHOD = "httpmethodtype";
public static final String EXPECTED_CODE = "expectedcode";
public static final String URL_PATH = "urlpath";
Expand Down Expand Up @@ -1309,11 +1311,10 @@ public class ApiConstants {
public static final String ISSUED_DATE = "issueddate";
public static final String XML_CONFIG = "xmlconfig";
public static final String CURRENT_VM_ID = "currentvmid";

public static final String RESULT_REDFISH_DATA = "redfishdata";
public static final String EXTERNAL_ENTITY = "externalEntity";
public static final String MIGRATION_IP = "migrationip";

public static final String VM_SNAPSHOT_NONCOPY = "noncopy";

/**
* This enum specifies IO Drivers, each option controls specific policies on I/O.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ public class ImportBackupOfferingCmd extends BaseAsyncCmd {
description = "Whether users are allowed to create adhoc backups and backup schedules", required = true)
private Boolean userDrivenBackups;

@Parameter(name = ApiConstants.RETENTION_PERIOD, type = CommandType.STRING, required = false,
description = "Retention period of backup data")
private String retentionPeriod;

/////////////////////////////////////////////////////
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
Expand All @@ -100,6 +104,10 @@ public Boolean getUserDrivenBackups() {
return userDrivenBackups == null ? false : userDrivenBackups;
}

public String getRetentionPeriod() {
return retentionPeriod;
}

/////////////////////////////////////////////////////
/////////////// API Implementation///////////////////
/////////////////////////////////////////////////////
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ public class UpdateBackupOfferingCmd extends BaseCmd {
@Parameter(name = ApiConstants.ALLOW_USER_DRIVEN_BACKUPS, type = CommandType.BOOLEAN, description = "Whether to allow user driven backups or not")
private Boolean allowUserDrivenBackups;

@Parameter(name = ApiConstants.RETENTION_PERIOD, type = CommandType.STRING, required = false, description = "Retention period of backup data")
private String retentionPeriod;

/////////////////////////////////////////////////////
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
Expand All @@ -76,6 +79,10 @@ public Boolean getAllowUserDrivenBackups() {
return allowUserDrivenBackups;
}

public String getRetentionPeriod() {
return retentionPeriod;
}

/////////////////////////////////////////////////////
/////////////// API Implementation///////////////////
/////////////////////////////////////////////////////
Expand All @@ -91,7 +98,7 @@ public void execute() {

if (result == null) {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, String.format("Failed to update backup offering %s.",
ReflectionToStringBuilderUtils.reflectOnlySelectedFields(this, "id", "name", "description", "allowUserDrivenBackups")));
ReflectionToStringBuilderUtils.reflectOnlySelectedFields(this, "id", "name", "description", "allowUserDrivenBackups", "retentionPeriod")));
}
BackupOfferingResponse response = _responseGenerator.createBackupOfferingResponse(result);
response.setResponseName(getCommandName());
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,297 @@
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
package org.apache.cloudstack.api.command.user.snapshot;

import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandResourceType;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
import org.apache.cloudstack.api.BaseAsyncCmd;
import org.apache.cloudstack.api.BaseAsyncCreateCmd;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.DomainResponse;
import org.apache.cloudstack.api.response.SnapshotPolicyResponse;
import org.apache.cloudstack.api.response.SnapshotResponse;
import org.apache.cloudstack.api.response.VolumeResponse;
import org.apache.cloudstack.api.response.ZoneResponse;
import org.apache.commons.collections.MapUtils;

import com.cloud.event.EventTypes;
import com.cloud.exception.InvalidParameterValueException;
import com.cloud.exception.PermissionDeniedException;
import com.cloud.exception.ResourceAllocationException;
import com.cloud.projects.Project;
import com.cloud.storage.Snapshot;
import com.cloud.storage.Volume;
import com.cloud.user.Account;
import com.cloud.utils.exception.CloudRuntimeException;

@APICommand(name = "createSnapshotBackup", description = "Creates an instant snapshot of a volume for backup.", responseObject = SnapshotResponse.class, entityType = {Snapshot.class},
requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
public class CreateSnapshotBackupCmd extends BaseAsyncCreateCmd {

// ///////////////////////////////////////////////////
// ////////////// API parameters /////////////////////
// ///////////////////////////////////////////////////

@Parameter(name = ApiConstants.ACCOUNT,
type = CommandType.STRING,
description = "The account of the snapshot. The account parameter must be used with the domainId parameter.")
private String accountName;

@Parameter(name = ApiConstants.DOMAIN_ID,
type = CommandType.UUID,
entityType = DomainResponse.class,
description = "The domain ID of the snapshot. If used with the account parameter, specifies a domain for the account associated with the disk volume. If account is NOT provided then snapshot will be assigned to the caller account and domain.")
private Long domainId;

@Parameter(name = ApiConstants.VOLUME_ID, type = CommandType.UUID, entityType = VolumeResponse.class, required = true, description = "The ID of the disk volume")
private Long volumeId;

@Parameter(name = ApiConstants.POLICY_ID,
type = CommandType.UUID,
entityType = SnapshotPolicyResponse.class,
description = "policy id of the snapshot, if this is null, then use MANUAL_POLICY.")
private Long policyId;

@Parameter(name = ApiConstants.SNAPSHOT_QUIESCEVM, type = CommandType.BOOLEAN, required = false, description = "quiesce vm if true")
private Boolean quiescevm;

@Parameter(name = ApiConstants.LOCATION_TYPE, type = CommandType.STRING, required = false, description = "Currently applicable only for managed storage. " +
"Valid location types: 'primary', 'secondary'. Default = 'primary'.")
private String locationType;

@Parameter(name = ApiConstants.NAME, type = CommandType.STRING, description = "the name of the snapshot")
private String snapshotName;

@Parameter(name = ApiConstants.ASYNC_BACKUP, type = CommandType.BOOLEAN, required = false, description = "asynchronous backup if true")
private Boolean asyncBackup;

@Parameter(name = ApiConstants.TAGS, type = CommandType.MAP, description = "Map of tags (key/value pairs)")
private Map tags;

@Parameter(name = ApiConstants.BACKUP, type = CommandType.BOOLEAN, required = true, description = "Skip secondary storage copy for backup solution use")
private Boolean backup;

@Parameter(name = ApiConstants.ZONE_ID_LIST,
type=CommandType.LIST,
collectionType = CommandType.UUID,
entityType = ZoneResponse.class,
description = "A comma-separated list of IDs of the zones in which the snapshot will be made available. " +
"The snapshot will always be made available in the zone in which the volume is present.",
since = "4.19.0")
protected List<Long> zoneIds;

private String syncObjectType = BaseAsyncCmd.snapshotHostSyncObject;

// ///////////////////////////////////////////////////
// ///////////////// Accessors ///////////////////////
// ///////////////////////////////////////////////////

public Boolean getQuiescevm() {
if (quiescevm == null) {
return false;
} else {
return quiescevm;
}
}

public String getAccountName() {
return accountName;
}

public Long getDomainId() {
return domainId;
}

public Long getVolumeId() {
return volumeId;
}

public String getSnapshotName() {
return snapshotName;
}

public Long getPolicyId() {
if (policyId != null) {
return policyId;
} else {
return Snapshot.MANUAL_POLICY_ID;
}
}

public Map<String, String> getTags() {
Map<String, String> tagsMap = new HashMap<>();
if (MapUtils.isNotEmpty(tags)) {
for (Map<String, String> services : (Collection<Map<String, String>>)tags.values()) {
String key = services.get("key");
String value = services.get("value");
tagsMap.put(key, value);
}
}
return tagsMap;
}

public Boolean getBackup() {
return backup;
}

private Long getHostId() {
Volume volume = _entityMgr.findById(Volume.class, getVolumeId());
if (volume == null) {
throw new InvalidParameterValueException("Unable to find volume by id");
}
return _snapshotService.getHostIdForSnapshotOperation(volume);
}

public List<Long> getZoneIds() {
return zoneIds;
}

// ///////////////////////////////////////////////////
// ///////////// API Implementation///////////////////
// ///////////////////////////////////////////////////

public static String getResultObjectName() {
return ApiConstants.SNAPSHOT;
}

@Override
public long getEntityOwnerId() {

Volume volume = _entityMgr.findById(Volume.class, getVolumeId());
if (volume == null) {
throw new InvalidParameterValueException("Unable to find volume by id=" + volumeId);
}

Account account = _accountService.getAccount(volume.getAccountId());
//Can create templates for enabled projects/accounts only
if (account.getType() == Account.Type.PROJECT) {
Project project = _projectService.findByProjectAccountId(volume.getAccountId());
if (project.getState() != Project.State.Active) {
throw new PermissionDeniedException("Can't add resources to the project id=" + project.getId() + " in state=" + project.getState() +
" as it's no longer active");
}
} else if (account.getState() == Account.State.DISABLED) {
throw new PermissionDeniedException("The owner of template is disabled: " + account);
}

return volume.getAccountId();
}

@Override
public String getEventType() {
return EventTypes.EVENT_SNAPSHOT_CREATE;
}

@Override
public String getEventDescription() {
return "creating snapshot for volume: " + getVolumeUuid();
}

@Override
public ApiCommandResourceType getApiResourceType() {
return ApiCommandResourceType.Snapshot;
}

@Override
public void create() throws ResourceAllocationException {
Snapshot snapshot = _volumeService.allocSnapshot(getVolumeId(), getPolicyId(), getSnapshotName(), getLocationType(), getZoneIds());
if (snapshot != null) {
setEntityId(snapshot.getId());
setEntityUuid(snapshot.getUuid());
} else {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to create snapshot for volume" + getVolumeUuid());
}
}

@Override
public void execute() {
Snapshot snapshot;
try {
snapshot =
_volumeService.takeSnapshot(getVolumeId(), getPolicyId(), getEntityId(), _accountService.getAccount(getEntityOwnerId()), getQuiescevm(), getLocationType(), getAsyncBackup(), getTags(), getZoneIds(), getBackup());

if (snapshot != null) {
SnapshotResponse response = _responseGenerator.createSnapshotResponse(snapshot);
response.setResponseName(getCommandName());
setResponseObject(response);
} else {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, String.format("Snapshot from volume [%s] was not found in database.", getVolumeUuid()));
}
} catch (Exception e) {
if (e.getCause() instanceof UnsupportedOperationException) {
throw new ServerApiException(ApiErrorCode.UNSUPPORTED_ACTION_ERROR, String.format("Failed to create snapshot due to unsupported operation: %s", e.getCause().getMessage()));
}

String errorMessage = "Failed to create snapshot due to an internal error creating snapshot for volume " + getVolumeUuid();
logger.error(errorMessage, e);
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, errorMessage);
}
}

private Snapshot.LocationType getLocationType() {

if (Snapshot.LocationType.values() == null || Snapshot.LocationType.values().length == 0 || locationType == null) {
return null;
}

try {
String lType = locationType.trim().toUpperCase();
return Snapshot.LocationType.valueOf(lType);
} catch (IllegalArgumentException e) {
String errMesg = "Invalid locationType " + locationType + "Specified for volume " + getVolumeId()
+ " Valid values are: primary,secondary ";
logger.warn(errMesg);
throw new CloudRuntimeException(errMesg);
}
}

@Override
public String getSyncObjType() {
if (getSyncObjId() != null) {
return syncObjectType;
}
return null;
}

@Override
public Long getSyncObjId() {
if (getHostId() != null) {
return getHostId();
}
return null;
}

public Boolean getAsyncBackup() {
if (asyncBackup == null) {
return false;
} else {
return asyncBackup;
}
}

protected String getVolumeUuid() {
return _uuidMgr.getUuid(Volume.class, getVolumeId());
}
}
Loading
Loading