Skip to content

Commit 28518e7

Browse files
committed
Move new configs to the respective service classes.
1 parent bfd1e8b commit 28518e7

File tree

6 files changed

+128
-86
lines changed

6 files changed

+128
-86
lines changed

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

Lines changed: 52 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,38 +57,86 @@ public interface BackupManager extends BackupService, Configurable, PluggableSer
5757
"false",
5858
"Enable volume attach/detach operations for VMs that are assigned to Backup Offerings.", true);
5959

60-
static final ConfigKey<Integer> BackupHourlyMax = new ConfigKey<Integer>("Advanced", Integer.class,
60+
ConfigKey<Integer> BackupHourlyMax = new ConfigKey<Integer>("Advanced", Integer.class,
6161
"backup.max.hourly",
6262
"8",
6363
"Maximum recurring hourly backups to be retained for an instance. If the limit is reached, early backups from the start of the hour are deleted so that newer ones can be saved. This limit does not apply to manual backups. If set to 0, recurring hourly backups can not be scheduled.",
6464
false,
6565
ConfigKey.Scope.Global,
6666
null);
6767

68-
static final ConfigKey<Integer> BackupDailyMax = new ConfigKey<Integer>("Advanced", Integer.class,
68+
ConfigKey<Integer> BackupDailyMax = new ConfigKey<Integer>("Advanced", Integer.class,
6969
"backup.max.daily",
7070
"8",
7171
"Maximum recurring daily backups to be retained for an instance. If the limit is reached, backups from the start of the day are deleted so that newer ones can be saved. This limit does not apply to manual backups. If set to 0, recurring daily backups can not be scheduled.",
7272
false,
7373
ConfigKey.Scope.Global,
7474
null);
7575

76-
static final ConfigKey<Integer> BackupWeeklyMax = new ConfigKey<Integer>("Advanced", Integer.class,
76+
ConfigKey<Integer> BackupWeeklyMax = new ConfigKey<Integer>("Advanced", Integer.class,
7777
"backup.max.weekly",
7878
"8",
7979
"Maximum recurring weekly backups to be retained for an instance. If the limit is reached, backups from the beginning of the week are deleted so that newer ones can be saved. This limit does not apply to manual backups. If set to 0, recurring weekly backups can not be scheduled.",
8080
false,
8181
ConfigKey.Scope.Global,
8282
null);
8383

84-
static final ConfigKey<Integer> BackupMonthlyMax = new ConfigKey<Integer>("Advanced", Integer.class,
84+
ConfigKey<Integer> BackupMonthlyMax = new ConfigKey<Integer>("Advanced", Integer.class,
8585
"backup.max.monthly",
8686
"8",
8787
"Maximum recurring monthly backups to be retained for an instance. If the limit is reached, backups from the beginning of the month are deleted so that newer ones can be saved. This limit does not apply to manual backups. If set to 0, recurring monthly backups can not be scheduled.",
8888
false,
8989
ConfigKey.Scope.Global,
9090
null);
9191

92+
ConfigKey<Long> DefaultMaxAccountBackups = new ConfigKey<Long>("Account Defaults", Long.class,
93+
"max.account.backups",
94+
"20",
95+
"The default maximum number of backups that can be created for an account",
96+
false,
97+
ConfigKey.Scope.Global,
98+
null);
99+
100+
ConfigKey<Long> DefaultMaxAccountBackupStorage = new ConfigKey<Long>("Account Defaults", Long.class,
101+
"max.account.backup.storage",
102+
"400",
103+
"The default maximum backup storage space (in GiB) that can be used for an account",
104+
false,
105+
ConfigKey.Scope.Global,
106+
null);
107+
108+
ConfigKey<Long> DefaultMaxProjectBackups = new ConfigKey<Long>("Project Defaults", Long.class,
109+
"max.project.backups",
110+
"20",
111+
"The default maximum number of backups that can be created for a project",
112+
false,
113+
ConfigKey.Scope.Global,
114+
null);
115+
116+
ConfigKey<Long> DefaultMaxProjectBackupStorage = new ConfigKey<Long>("Project Defaults", Long.class,
117+
"max.project.backup.storage",
118+
"400",
119+
"The default maximum backup storage space (in GiB) that can be used for a project",
120+
false,
121+
ConfigKey.Scope.Global,
122+
null);
123+
124+
ConfigKey<Long> DefaultMaxDomainBackups = new ConfigKey<Long>("Domain Defaults", Long.class,
125+
"max.domain.backups",
126+
"40",
127+
"The default maximum number of backups that can be created for a domain",
128+
false,
129+
ConfigKey.Scope.Global,
130+
null);
131+
132+
ConfigKey<Long> DefaultMaxDomainBackupStorage = new ConfigKey<Long>("Domain Defaults", Long.class,
133+
"max.domain.backup.storage",
134+
"800",
135+
"The default maximum backup storage space (in GiB) that can be used for a domain",
136+
false,
137+
ConfigKey.Scope.Global,
138+
null);
139+
92140
/**
93141
* List backup provider offerings
94142
* @param zoneId zone id

api/src/main/java/org/apache/cloudstack/storage/object/BucketApiService.java

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,59 @@
2222
import com.cloud.user.Account;
2323
import org.apache.cloudstack.api.command.user.bucket.CreateBucketCmd;
2424
import org.apache.cloudstack.api.command.user.bucket.UpdateBucketCmd;
25+
import org.apache.cloudstack.framework.config.ConfigKey;
2526

2627
public interface BucketApiService {
2728

2829

30+
ConfigKey<Long> DefaultMaxAccountBuckets = new ConfigKey<Long>("Account Defaults", Long.class,
31+
"max.account.buckets",
32+
"20",
33+
"The default maximum number of buckets that can be created for an account",
34+
false,
35+
ConfigKey.Scope.Global,
36+
null);
37+
38+
ConfigKey<Long> DefaultMaxAccountObjectStorage = new ConfigKey<Long>("Account Defaults", Long.class,
39+
"max.account.object.storage",
40+
"400",
41+
"The default maximum object storage space (in GiB) that can be used for an account",
42+
false,
43+
ConfigKey.Scope.Global,
44+
null);
45+
46+
ConfigKey<Long> DefaultMaxProjectBuckets = new ConfigKey<Long>("Project Defaults", Long.class,
47+
"max.project.buckets",
48+
"20",
49+
"The default maximum number of buckets that can be created for a project",
50+
false,
51+
ConfigKey.Scope.Global,
52+
null);
53+
54+
ConfigKey<Long> DefaultMaxProjectObjectStorage = new ConfigKey<Long>("Project Defaults", Long.class,
55+
"max.project.object.storage",
56+
"400",
57+
"The default maximum object storage space (in GiB) that can be used for a project",
58+
false,
59+
ConfigKey.Scope.Global,
60+
null);
61+
62+
ConfigKey<Long> DefaultMaxDomainBuckets = new ConfigKey<Long>("Domain Defaults", Long.class,
63+
"max.domain.buckets",
64+
"20",
65+
"The default maximum number of buckets that can be created for a domain",
66+
false,
67+
ConfigKey.Scope.Global,
68+
null);
69+
70+
ConfigKey<Long> DefaultMaxDomainObjectStorage = new ConfigKey<Long>("Domain Defaults", Long.class,
71+
"max.domain.object.storage",
72+
"400",
73+
"The default maximum object storage space (in GiB) that can be used for a domain",
74+
false,
75+
ConfigKey.Scope.Global,
76+
null);
77+
2978
/**
3079
* Creates the database object for a Bucket based on the given criteria
3180
*

server/src/main/java/com/cloud/configuration/Config.java

Lines changed: 0 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1317,22 +1317,6 @@ public enum Config {
13171317
"20",
13181318
"The default maximum number of snapshots that can be created for an account",
13191319
null),
1320-
DefaultMaxAccountBackups(
1321-
"Account Defaults",
1322-
ManagementServer.class,
1323-
Long.class,
1324-
"max.account.backups",
1325-
"20",
1326-
"The default maximum number of backups that can be created for an account",
1327-
null),
1328-
DefaultMaxAccountBackupStorage(
1329-
"Account Defaults",
1330-
ManagementServer.class,
1331-
Long.class,
1332-
"max.account.backup.storage",
1333-
"400",
1334-
"The default maximum backup storage space (in GiB) that can be used for an account",
1335-
null),
13361320
DefaultMaxAccountVolumes(
13371321
"Account Defaults",
13381322
ManagementServer.class,
@@ -1389,22 +1373,6 @@ public enum Config {
13891373
"10",
13901374
"The default maximum number of projects that can be created for an account",
13911375
null),
1392-
DefaultMaxAccountBuckets(
1393-
"Account Defaults",
1394-
ManagementServer.class,
1395-
Long.class,
1396-
"max.account.buckets",
1397-
"20",
1398-
"The default maximum number of buckets that can be created for an account",
1399-
null),
1400-
DefaultMaxAccountObjectStorage(
1401-
"Account Defaults",
1402-
ManagementServer.class,
1403-
Long.class,
1404-
"max.account.object.storage",
1405-
"400",
1406-
"The default maximum object storage space (in GiB) that can be used for an account",
1407-
null),
14081376

14091377
//disabling lb as cluster sync does not work with distributed cluster
14101378
SubDomainNetworkAccess(
@@ -1447,8 +1415,6 @@ public enum Config {
14471415
DefaultMaxDomainPublicIPs("Domain Defaults", ManagementServer.class, Long.class, "max.domain.public.ips", "40", "The default maximum number of public IPs that can be consumed by a domain", null),
14481416
DefaultMaxDomainTemplates("Domain Defaults", ManagementServer.class, Long.class, "max.domain.templates", "40", "The default maximum number of templates that can be deployed for a domain", null),
14491417
DefaultMaxDomainSnapshots("Domain Defaults", ManagementServer.class, Long.class, "max.domain.snapshots", "40", "The default maximum number of snapshots that can be created for a domain", null),
1450-
DefaultMaxDomainBackups("Domain Defaults", ManagementServer.class, Long.class, "max.domain.backups", "40", "The default maximum number of backups that can be created for a domain", null),
1451-
DefaultMaxDomainBackupStorage("Domain Defaults", ManagementServer.class, Long.class, "max.domain.backup.storage", "800", "The default maximum backup storage space (in GiB) that can be used for a domain", null),
14521418
DefaultMaxDomainVolumes("Domain Defaults", ManagementServer.class, Long.class, "max.domain.volumes", "40", "The default maximum number of volumes that can be created for a domain", null),
14531419
DefaultMaxDomainNetworks("Domain Defaults", ManagementServer.class, Long.class, "max.domain.networks", "40", "The default maximum number of networks that can be created for a domain", null),
14541420
DefaultMaxDomainVpcs("Domain Defaults", ManagementServer.class, Long.class, "max.domain.vpcs", "40", "The default maximum number of vpcs that can be created for a domain", null),
@@ -1457,8 +1423,6 @@ public enum Config {
14571423
DefaultMaxDomainPrimaryStorage("Domain Defaults", ManagementServer.class, Long.class, "max.domain.primary.storage", "400", "The default maximum primary storage space (in GiB) that can be used for a domain", null),
14581424
DefaultMaxDomainSecondaryStorage("Domain Defaults", ManagementServer.class, Long.class, "max.domain.secondary.storage", "800", "The default maximum secondary storage space (in GiB) that can be used for a domain", null),
14591425
DefaultMaxDomainProjects("Domain Defaults",ManagementServer.class,Long.class,"max.domain.projects","50","The default maximum number of projects that can be created for a domain",null),
1460-
DefaultMaxDomainBuckets("Domain Defaults", ManagementServer.class, Long.class, "max.domain.buckets", "40", "The default maximum number of buckets that can be created for a domain", null),
1461-
DefaultMaxDomainObjectStorage("Domain Defaults", ManagementServer.class, Long.class, "max.domain.object.storage", "800", "The default maximum object storage space (in GiB) that can be used for a domain", null),
14621426

14631427
DefaultMaxProjectUserVms(
14641428
"Project Defaults",
@@ -1492,23 +1456,6 @@ public enum Config {
14921456
"20",
14931457
"The default maximum number of snapshots that can be created for a project",
14941458
null),
1495-
// Move to configkey?
1496-
DefaultMaxProjectBackups(
1497-
"Project Defaults",
1498-
ManagementServer.class,
1499-
Long.class,
1500-
"max.project.backups",
1501-
"20",
1502-
"The default maximum number of backups that can be created for a project",
1503-
null),
1504-
DefaultMaxProjectBackupStorage(
1505-
"Project Defaults",
1506-
ManagementServer.class,
1507-
Long.class,
1508-
"max.project.backup.storage",
1509-
"400",
1510-
"The default maximum backup storage space (in GiB) that can be used for a project",
1511-
null),
15121459
DefaultMaxProjectVolumes(
15131460
"Project Defaults",
15141461
ManagementServer.class,
@@ -1557,22 +1504,6 @@ public enum Config {
15571504
"200",
15581505
"The default maximum primary storage space (in GiB) that can be used for an project",
15591506
null),
1560-
DefaultMaxProjectBuckets(
1561-
"Project Defaults",
1562-
ManagementServer.class,
1563-
Long.class,
1564-
"max.project.buckets",
1565-
"20",
1566-
"The default maximum number of buckets that can be created for a project",
1567-
null),
1568-
DefaultMaxProjectObjectStorage(
1569-
"Project Defaults",
1570-
ManagementServer.class,
1571-
Long.class,
1572-
"max.project.object.storage",
1573-
"400",
1574-
"The default maximum object storage space (in GiB) that can be used for a project",
1575-
null),
15761507

15771508
ProjectInviteRequired(
15781509
"Project Defaults",

0 commit comments

Comments
 (0)