Skip to content

Commit 3aba1ce

Browse files
Add mountopts to backup repository response
1 parent 7ff76cb commit 3aba1ce

File tree

4 files changed

+17
-2
lines changed

4 files changed

+17
-2
lines changed

api/src/main/java/org/apache/cloudstack/api/command/user/backup/repository/AddBackupRepositoryCmd.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
package org.apache.cloudstack.api.command.user.backup.repository;
1919

20+
import com.cloud.utils.StringUtils;
2021
import org.apache.cloudstack.acl.RoleType;
2122
import org.apache.cloudstack.api.APICommand;
2223
import org.apache.cloudstack.api.ApiConstants;
@@ -100,7 +101,7 @@ public String getProvider() {
100101
}
101102

102103
public String getMountOptions() {
103-
return mountOptions == null ? "" : mountOptions;
104+
return StringUtils.isBlank(mountOptions) ? "" : mountOptions;
104105
}
105106

106107
public Long getZoneId() {

api/src/main/java/org/apache/cloudstack/api/response/BackupRepositoryResponse.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ public class BackupRepositoryResponse extends BaseResponse {
5757
@Param(description = "backup type")
5858
private String type;
5959

60+
@SerializedName(ApiConstants.MOUNT_OPTIONS)
61+
@Param(description = "mount options", since = "4.22.1")
62+
private String mountOptions;
63+
6064
@SerializedName(ApiConstants.CAPACITY_BYTES)
6165
@Param(description = "capacity of the backup repository")
6266
private Long capacityBytes;
@@ -128,6 +132,14 @@ public void setType(String type) {
128132
this.type = type;
129133
}
130134

135+
public String getMountOptions() {
136+
return mountOptions;
137+
}
138+
139+
public void setMountOptions(String mountOptions) {
140+
this.mountOptions = mountOptions;
141+
}
142+
131143
public Long getCapacityBytes() {
132144
return capacityBytes;
133145
}

api/src/main/java/org/apache/cloudstack/backup/BackupRepositoryService.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,4 @@ public interface BackupRepositoryService {
3232
BackupRepository updateBackupRepository(UpdateBackupRepositoryCmd cmd);
3333
boolean deleteBackupRepository(DeleteBackupRepositoryCmd cmd);
3434
Pair<List<BackupRepository>, Integer> listBackupRepositories(ListBackupRepositoriesCmd cmd);
35-
3635
}

server/src/main/java/com/cloud/api/ApiResponseHelper.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5526,6 +5526,9 @@ public BackupRepositoryResponse createBackupRepositoryResponse(BackupRepository
55265526
response.setAddress(backupRepository.getAddress());
55275527
response.setProviderName(backupRepository.getProvider());
55285528
response.setType(backupRepository.getType());
5529+
if (StringUtils.isNotBlank(backupRepository.getMountOptions())) {
5530+
response.setMountOptions(backupRepository.getMountOptions());
5531+
}
55295532
response.setCapacityBytes(backupRepository.getCapacityBytes());
55305533
response.setCrossZoneInstanceCreation(backupRepository.crossZoneInstanceCreationEnabled());
55315534
response.setObjectName("backuprepository");

0 commit comments

Comments
 (0)