Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
ed94cc1
move alert manager configurations out of the deprecated Config enum
Aug 13, 2026
0e0bb6e
move storage configuration items from deprecated Config enum to services
Aug 14, 2026
097c38f
move snapshot and usage configuration items from deprecated Config en…
Aug 14, 2026
2785714
move more network configuration items from deprecated Config enum to …
Aug 14, 2026
cac91d9
move remote access related configuration items from deprecated Config…
Aug 14, 2026
afcd41d
move account and domain related configuration items from deprecated C…
Aug 15, 2026
8d389cc
move project related configuration items from deprecated Config enum …
Aug 15, 2026
a97e9ff
move SSOKey configuration item from deprecated Config enum to services
Aug 15, 2026
1cd182c
move non-MS hidden configuration items from deprecated Config enum to…
Aug 15, 2026
f12d9b3
move and restructure ManagementServer config items
Aug 15, 2026
633207b
move AgentManager configuration items from deprecated Config enum to …
Aug 15, 2026
4ea4664
move SecondaryStorage configuration items from deprecated Config enum…
Aug 15, 2026
265e6e9
move virtual router configuration items from deprecated Config enum t…
Aug 15, 2026
e3b493f
move network related configuration items from deprecated Config enum …
Aug 15, 2026
6a5ac96
move statscollector related configuration items from deprecated Confi…
Aug 15, 2026
5cad4fd
move storage related configuration items from deprecated Config enum …
Aug 15, 2026
c295ab3
move user vm related configuration items from deprecated Config enum …
Aug 15, 2026
4dabe2c
move AccountManager related configuration items from deprecated Confi…
Aug 15, 2026
f4caaf3
move VpcManager related configuration items from deprecated Config en…
Aug 15, 2026
fde5d1c
move VMSnapshotManager related configuration items from deprecated Co…
Aug 15, 2026
3ce958b
move deployment planning related configuration items from deprecated …
Aug 15, 2026
76f89f6
move ElasticLoadBalancer related configuration items from deprecated …
Aug 15, 2026
de73e41
move ApiRateLimit related configuration items from deprecated Config …
Aug 15, 2026
15bff5a
move loadbalancer and firewall related configuration items from depre…
Aug 15, 2026
5007257
move event-bus related configuration items from deprecated Config enu…
Aug 15, 2026
8d9768a
move high availability related configuration items from deprecated Co…
Aug 15, 2026
e9512da
move UCS related configuration items from deprecated Config enum to s…
Aug 15, 2026
fc7f43e
move assorted management server related configuration items from depr…
Aug 15, 2026
bfc49a7
move vmware related configuration items from deprecated Config enum t…
Aug 15, 2026
0dd992b
move xen related configuration items from deprecated Config enum to s…
Aug 15, 2026
85e52c4
move ovm3 related configuration items from deprecated Config enum to …
Aug 15, 2026
e9d4e81
move baremetal related configuration items from deprecated Config enu…
Aug 15, 2026
cc3217c
replace key lookups with value() calls in ManagementServer
Aug 16, 2026
df4b015
replace key lookups with value() calls in AgentManager
Aug 16, 2026
428a1bb
replace key lookups with value() calls in SecondaryStorageVmManager
Aug 16, 2026
05097e2
replace key lookups with value() calls in UserVmManager
Aug 16, 2026
605a3a7
replace key lookups with value() calls in VmwareManager
Aug 16, 2026
0889f2d
replace key lookups with value() calls in VirtualNetworkApplianceManager
Aug 16, 2026
ef0c07d
replace key lookups with value() calls in DeploymentClusterPlanner
Aug 16, 2026
3edde3e
replace key lookups with value() calls in BaremetalManager
Aug 16, 2026
a3e650c
replace key lookups with value() calls in remaining small groups
Aug 16, 2026
e16e423
add ConfigKey wiring tests for ManagementServer alert-purge scheduling
Aug 17, 2026
19669e0
add ConfigKey wiring test for DiscovererBase.buildConfigParams
Aug 17, 2026
5601295
add ConfigKey wiring tests for ApiRateLimitServiceImpl
Aug 17, 2026
317611d
add ConfigKey wiring tests for ApiResponseSerializer version-exposure…
Aug 17, 2026
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
12 changes: 12 additions & 0 deletions api/src/main/java/com/cloud/deploy/DeploymentClusterPlanner.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,18 @@ public interface DeploymentClusterPlanner extends DeploymentPlanner {
ConfigKey.Kind.Select,
"random,firstfit,userdispersing,firstfitleastconsumed");

ConfigKey<Boolean> ApplyAllocationAlgorithmToPods = new ConfigKey<>("Advanced", Boolean.class, "apply.allocation.algorithm.to.pods", "false",
"If true, deployment planner applies the allocation heuristics at pods first in the given datacenter during VM resource allocation", true);

ConfigKey<String> HostCapacityTypeToOrderClusters = new ConfigKey<>("Advanced", String.class, "host.capacityType.to.order.clusters", "CPU",
"The host capacity type (CPU, RAM, COMBINED) is used by deployment planner to order clusters during VM resource allocation", true);

ConfigKey<Float> VmUserDispersionWeight = new ConfigKey<>("Advanced", Float.class, "vm.user.dispersion.weight", "1",
"Weight for user dispersion heuristic (as a value between 0 and 1) applied to resource allocation during vm deployment. Weight for capacity heuristic will be (1 - weight of user dispersion)", true);

ConfigKey<String> ImplicitHostTags = new ConfigKey<>("Advanced", String.class, "implicit.host.tags", "GPU",
"Tag hosts at the time of host discovery based on the host properties/capabilities", true);

/**
* This is called to determine list of possible clusters where a virtual
* machine can be deployed.
Expand Down
19 changes: 19 additions & 0 deletions api/src/main/java/com/cloud/network/NetworkModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,31 @@
List<String> metadataFileNames = new ArrayList<>(Arrays.asList(SERVICE_OFFERING_FILE, AVAILABILITY_ZONE_FILE, LOCAL_HOSTNAME_FILE, LOCAL_IPV4_FILE, PUBLIC_HOSTNAME_FILE, PUBLIC_IPV4_FILE,
INSTANCE_ID_FILE, VM_ID_FILE, PUBLIC_KEYS_FILE, CLOUD_IDENTIFIER_FILE, CLOUD_NAME_FILE, HYPERVISOR_HOST_NAME_FILE));

static final ConfigKey<Integer> MACIdentifier = new ConfigKey<>("Advanced",Integer.class, "mac.identifier", "0",

Check failure on line 94 in api/src/main/java/com/cloud/network/NetworkModel.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Define a constant instead of duplicating this literal "Advanced" 5 times.

See more on https://sonarcloud.io/project/issues?id=apache_cloudstack&issues=AaAHMT_5H6sOtJrG0c_Y&open=AaAHMT_5H6sOtJrG0c_Y&pullRequest=13884
"This value will be used while generating the mac addresses for isolated and shared networks. The hexadecimal equivalent value will be present at the 2nd octet of the mac address. Default value is zero (0) which means that the DB id of the zone will be used.", true, ConfigKey.Scope.Zone);

static final ConfigKey<Boolean> AdminIsAllowedToDeployAnywhere = new ConfigKey<>("Advanced",Boolean.class, "admin.is.allowed.to.deploy.anywhere", "false",
"This will determine if the root admin is allowed to deploy in networks in subdomains.", true, ConfigKey.Scope.Global);

ConfigKey<Boolean> SecurityGroupDefaultAdding = new ConfigKey<>("Network", Boolean.class, "network.securitygroups.defaultadding", "true",
"If true, the user VM would be added to the default security group by default", true);

ConfigKey<String> CloudIdentifier = new ConfigKey<>("Hidden", String.class, "cloud.identifier", null,
"A unique identifier for the cloud.", true);

ConfigKey<Boolean> SubDomainNetworkAccess = new ConfigKey<>("Advanced", Boolean.class, "allow.subdomain.network.access", "true",
"Allow subdomains to use networks dedicated to their parent domain(s)", true);

ConfigKey<Boolean> ExecuteInSequenceNetworkElementCommands = new ConfigKey<>("Advanced", Boolean.class, "execute.in.sequence.network.element.commands", "false",
"If set to true, DhcpEntryCommand, SavePasswordCommand, VmDataCommand will be synchronized on the agent side."
+ " If set to false, these commands become asynchronous. Default value is false.", true);

ConfigKey<Integer> ExternalNetworkStatsInterval = new ConfigKey<>("Advanced", Integer.class, "external.network.stats.interval", "300",
"Interval (in seconds) to report external network statistics.", true);

ConfigKey<Integer> NetworkIPv6SearchRetryMax = new ConfigKey<>("Network", Integer.class, "network.ipv6.search.retry.max", "10000",
"The maximum number of retrying times to search for an available IPv6 address in the table", true);

/**
* Lists IP addresses that belong to VirtualNetwork VLANs
*
Expand Down
30 changes: 30 additions & 0 deletions api/src/main/java/com/cloud/network/NetworkService.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,36 @@
"allow.end.users.to.specify.vr.mtu", "false", "Allow end Users to specify VR MTU",
true, ConfigKey.Scope.Zone);

ConfigKey<Integer> GuestVlanBits = new ConfigKey<>("Network", Integer.class, "guest.vlan.bits", "12",

Check failure on line 87 in api/src/main/java/com/cloud/network/NetworkService.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Define a constant instead of duplicating this literal "Network" 3 times.

See more on https://sonarcloud.io/project/issues?id=apache_cloudstack&issues=AaAHMUAhH6sOtJrG0c_Z&open=AaAHMUAhH6sOtJrG0c_Z&pullRequest=13884
"The number of bits to reserve for the VLAN identifier in the guest subnet.", true);

ConfigKey<Integer> MaxNumberOfSecondaryIPsPerNIC = new ConfigKey<>("Network", Integer.class,
"vm.network.nic.max.secondary.ipaddresses", "10",
"Specify the number of secondary ip addresses per nic per vm. Default value 10 is used, if not specified.", true);

ConfigKey<Integer> NetworkGuestCidrLimit = new ConfigKey<>("Network", Integer.class, "network.guest.cidr.limit", "22",
"size limit for guest cidr; can't be less than this value", true);

ConfigKey<String> XenServerPublicNetwork = new ConfigKey<>("Hidden", String.class,

Check failure on line 97 in api/src/main/java/com/cloud/network/NetworkService.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Define a constant instead of duplicating this literal "Hidden" 5 times.

See more on https://sonarcloud.io/project/issues?id=apache_cloudstack&issues=AaAFdVvZqJXQQ7HDE9R6&open=AaAFdVvZqJXQQ7HDE9R6&pullRequest=13884
"xenserver.public.network.device", null,
"[ONLY IF THE PUBLIC NETWORK IS ON A DEDICATED NIC]:The network name label of the physical device dedicated to the public network on a XenServer host", true);

ConfigKey<String> XenServerGuestNetwork = new ConfigKey<>("Hidden", String.class,
"xenserver.guest.network.device", null,
"Specify for guest network name label", true);

ConfigKey<String> XenServerStorageNetwork1 = new ConfigKey<>("Hidden", String.class,
"xenserver.storage.network.device1", null,
"Specify when there are storage networks", true);

ConfigKey<String> XenServerStorageNetwork2 = new ConfigKey<>("Hidden", String.class,
"xenserver.storage.network.device2", null,
"Specify when there are storage networks", true);

ConfigKey<String> XenServerPrivateNetwork = new ConfigKey<>("Hidden", String.class,
"xenserver.private.network.device", null,
"Specify when the private network name is different", true);

List<? extends Network> getIsolatedNetworksOwnedByAccountInZone(long zoneId, Account owner);

IpAddress allocateIP(Account ipOwner, long zoneId, Long networkId, Boolean displayIp, String ipaddress) throws ResourceAllocationException, InsufficientAddressCapacityException,
Expand Down
10 changes: 10 additions & 0 deletions api/src/main/java/com/cloud/network/NetworkUsageService.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,22 @@
import org.apache.cloudstack.api.command.admin.usage.AddTrafficMonitorCmd;
import org.apache.cloudstack.api.command.admin.usage.DeleteTrafficMonitorCmd;
import org.apache.cloudstack.api.command.admin.usage.ListTrafficMonitorsCmd;
import org.apache.cloudstack.framework.config.ConfigKey;

import com.cloud.host.Host;
import com.cloud.utils.component.Manager;

public interface NetworkUsageService extends Manager {

ConfigKey<Integer> DirectNetworkStatsInterval = new ConfigKey<>("Usage", Integer.class, "direct.network.stats.interval", "86400",
"Interval (in seconds) to collect stats from Traffic Monitor", true);

ConfigKey<String> TrafficSentinelIncludeZones = new ConfigKey<>("Usage", String.class, "traffic.sentinel.include.zones", "EXTERNAL",
"Traffic going into specified list of zones is metered. For metering all traffic leave this parameter empty", true);

ConfigKey<String> TrafficSentinelExcludeZones = new ConfigKey<>("Usage", String.class, "traffic.sentinel.exclude.zones", "",
"Traffic going into specified list of zones is not metered.", true);

Host addTrafficMonitor(AddTrafficMonitorCmd cmd);

boolean deleteTrafficMonitor(DeleteTrafficMonitorCmd cmd);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import org.apache.cloudstack.api.command.user.vpn.ListRemoteAccessVpnsCmd;
import org.apache.cloudstack.api.command.user.vpn.ListVpnUsersCmd;
import org.apache.cloudstack.framework.config.ConfigKey;

import com.cloud.exception.NetworkRuleConflictException;
import com.cloud.exception.ResourceUnavailableException;
Expand All @@ -31,6 +32,12 @@
public interface RemoteAccessVpnService {
static final String RemoteAccessVpnClientIpRangeCK = "remote.access.vpn.client.iprange";

ConfigKey<Integer> RemoteAccessVpnPskLength = new ConfigKey<>("Network", Integer.class, "remote.access.vpn.psk.length", "24",
"The length of the ipsec preshared key (minimum 8, maximum 256)", true);

ConfigKey<Integer> RemoteAccessVpnUserLimit = new ConfigKey<>("Network", Integer.class, "remote.access.vpn.user.limit", "8",
"The maximum number of VPN users that can be created per account", true);

RemoteAccessVpn createRemoteAccessVpn(long vpnServerAddressId, String ipRange, boolean openFirewall, Boolean forDisplay) throws NetworkRuleConflictException;

boolean destroyRemoteAccessVpnForIp(long ipId, Account caller, boolean forceCleanup) throws ResourceUnavailableException;
Expand Down
12 changes: 12 additions & 0 deletions api/src/main/java/com/cloud/storage/VolumeApiService.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,18 @@ public interface VolumeApiService {
true,
ConfigKey.Scope.Zone);

ConfigKey<Integer> CopyVolumeWait = new ConfigKey<>("Storage", Integer.class, "copy.volume.wait", "10800",
"In second, timeout for copy volume command", true);

ConfigKey<Integer> CreateVolumeFromSnapshotWait = new ConfigKey<>("Storage", Integer.class, "create.volume.from.snapshot.wait", "10800",
"In second, timeout for creating volume from snapshot", true);

ConfigKey<Long> MaxUploadVolumeSize = new ConfigKey<>("Storage", Long.class, "storage.max.volume.upload.size", "500",
"The maximum size for a uploaded volume(in GB).", true);

ConfigKey<Integer> StoragePoolMaxWaitSeconds = new ConfigKey<>("Storage", Integer.class, "storage.pool.max.waitseconds", "3600",
"Timeout (in seconds) to synchronize storage pool operations.", true);

/**
* Creates the database object for a volume based on the given criteria
*
Expand Down
65 changes: 65 additions & 0 deletions api/src/main/java/com/cloud/user/ResourceLimitService.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

static final ConfigKey<Long> MaxAccountSecondaryStorage = new ConfigKey<>("Account Defaults", Long.class, "max.account.secondary.storage", "400",
"The default maximum secondary storage space (in GiB) that can be used for an Account", false);
static final ConfigKey<Long> MaxProjectSecondaryStorage = new ConfigKey<>("Project Defaults", Long.class, "max.project.secondary.storage", "400",

Check failure on line 39 in api/src/main/java/com/cloud/user/ResourceLimitService.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Define a constant instead of duplicating this literal "Project Defaults" 12 times.

See more on https://sonarcloud.io/project/issues?id=apache_cloudstack&issues=AaAFdVv5qJXQQ7HDE9R8&open=AaAFdVv5qJXQQ7HDE9R8&pullRequest=13884
"The default maximum secondary storage space (in GiB) that can be used for a project", false);
static final ConfigKey<Long> ResourceCountCheckInterval = new ConfigKey<>("Advanced", Long.class, "resourcecount.check.interval", "300",
"Time (in seconds) to wait before running resource recalculation and fixing tasks like stale resource reservation cleanup" +
Expand All @@ -49,7 +49,7 @@
"A comma-separated list of tags for storage resource limits", true);
static final ConfigKey<Long> DefaultMaxAccountProjects = new ConfigKey<>("Account Defaults",Long.class,"max.account.projects","10",
"The default maximum number of projects that can be created for an account",false);
static final ConfigKey<Long> DefaultMaxDomainProjects = new ConfigKey<>("Domain Defaults",Long.class,"max.domain.projects","50",

Check failure on line 52 in api/src/main/java/com/cloud/user/ResourceLimitService.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Define a constant instead of duplicating this literal "Domain Defaults" 13 times.

See more on https://sonarcloud.io/project/issues?id=apache_cloudstack&issues=AaAFdVv5qJXQQ7HDE9R7&open=AaAFdVv5qJXQQ7HDE9R7&pullRequest=13884
"The default maximum number of projects that can be created for a domain",false);
static final ConfigKey<Long> DefaultMaxAccountGpus = new ConfigKey<>("Account Defaults",Long.class,"max.account.gpus","20",
"The default maximum number of GPU devices that can be used for an account", false);
Expand All @@ -58,6 +58,71 @@
static final ConfigKey<Long> DefaultMaxProjectGpus = new ConfigKey<>("Project Defaults",Long.class,"max.project.gpus","20",
"The default maximum number of GPU devices that can be used for a project", false);

static final ConfigKey<Long> DefaultMaxAccountUserVms = new ConfigKey<>("Account Defaults", Long.class, "max.account.user.vms", "20",
"The default maximum number of user VMs that can be deployed for an account", false);
static final ConfigKey<Long> DefaultMaxAccountPublicIPs = new ConfigKey<>("Account Defaults", Long.class, "max.account.public.ips", "20",
"The default maximum number of public IPs that can be consumed by an account", false);
static final ConfigKey<Long> DefaultMaxAccountTemplates = new ConfigKey<>("Account Defaults", Long.class, "max.account.templates", "20",
"The default maximum number of Templates that can be deployed for an account", false);
static final ConfigKey<Long> DefaultMaxAccountSnapshots = new ConfigKey<>("Account Defaults", Long.class, "max.account.snapshots", "20",
"The default maximum number of snapshots that can be created for an account", false);
static final ConfigKey<Long> DefaultMaxAccountVolumes = new ConfigKey<>("Account Defaults", Long.class, "max.account.volumes", "20",
"The default maximum number of volumes that can be created for an account", false);
static final ConfigKey<Long> DefaultMaxAccountNetworks = new ConfigKey<>("Account Defaults", Long.class, "max.account.networks", "20",
"The default maximum number of networks that can be created for an account", false);
static final ConfigKey<Long> DefaultMaxAccountVpcs = new ConfigKey<>("Account Defaults", Long.class, "max.account.vpcs", "20",
"The default maximum number of vpcs that can be created for an account", false);
static final ConfigKey<Long> DefaultMaxAccountCpus = new ConfigKey<>("Account Defaults", Long.class, "max.account.cpus", "40",
"The default maximum number of cpu cores that can be used for an account", false);
static final ConfigKey<Long> DefaultMaxAccountMemory = new ConfigKey<>("Account Defaults", Long.class, "max.account.memory", "40960",
"The default maximum memory (in MB) that can be used for an account", false);
static final ConfigKey<Long> DefaultMaxAccountPrimaryStorage = new ConfigKey<>("Account Defaults", Long.class, "max.account.primary.storage", "200",
"The default maximum primary storage space (in GiB) that can be used for an account", false);

static final ConfigKey<Long> DefaultMaxDomainUserVms = new ConfigKey<>("Domain Defaults", Long.class, "max.domain.user.vms", "40",
"The default maximum number of user Instances that can be deployed for a domain", false);
static final ConfigKey<Long> DefaultMaxDomainPublicIPs = new ConfigKey<>("Domain Defaults", Long.class, "max.domain.public.ips", "40",
"The default maximum number of public IPs that can be consumed by a domain", false);
static final ConfigKey<Long> DefaultMaxDomainTemplates = new ConfigKey<>("Domain Defaults", Long.class, "max.domain.templates", "40",
"The default maximum number of Templates that can be deployed for a domain", false);
static final ConfigKey<Long> DefaultMaxDomainSnapshots = new ConfigKey<>("Domain Defaults", Long.class, "max.domain.snapshots", "40",
"The default maximum number of Snapshots that can be created for a domain", false);
static final ConfigKey<Long> DefaultMaxDomainVolumes = new ConfigKey<>("Domain Defaults", Long.class, "max.domain.volumes", "40",
"The default maximum number of Volumes that can be created for a domain", false);
static final ConfigKey<Long> DefaultMaxDomainNetworks = new ConfigKey<>("Domain Defaults", Long.class, "max.domain.networks", "40",
"The default maximum number of Networks that can be created for a domain", false);
static final ConfigKey<Long> DefaultMaxDomainVpcs = new ConfigKey<>("Domain Defaults", Long.class, "max.domain.vpcs", "40",
"The default maximum number of VPCs that can be created for a domain", false);
static final ConfigKey<Long> DefaultMaxDomainCpus = new ConfigKey<>("Domain Defaults", Long.class, "max.domain.cpus", "80",
"The default maximum number of CPU cores that can be used for a domain", false);
static final ConfigKey<Long> DefaultMaxDomainMemory = new ConfigKey<>("Domain Defaults", Long.class, "max.domain.memory", "81920",
"The default maximum memory (in MB) that can be used for a domain", false);
static final ConfigKey<Long> DefaultMaxDomainPrimaryStorage = new ConfigKey<>("Domain Defaults", Long.class, "max.domain.primary.storage", "400",
"The default maximum primary storage space (in GiB) that can be used for a domain", false);
static final ConfigKey<Long> DefaultMaxDomainSecondaryStorage = new ConfigKey<>("Domain Defaults", Long.class, "max.domain.secondary.storage", "800",
"The default maximum secondary storage space (in GiB) that can be used for a domain", false);

static final ConfigKey<Long> DefaultMaxProjectUserVms = new ConfigKey<>("Project Defaults", Long.class, "max.project.user.vms", "20",
"The default maximum number of user VMs that can be deployed for a project", false);
static final ConfigKey<Long> DefaultMaxProjectPublicIPs = new ConfigKey<>("Project Defaults", Long.class, "max.project.public.ips", "20",
"The default maximum number of public IPs that can be consumed by a project", false);
static final ConfigKey<Long> DefaultMaxProjectTemplates = new ConfigKey<>("Project Defaults", Long.class, "max.project.templates", "20",
"The default maximum number of Templates that can be deployed for a project", false);
static final ConfigKey<Long> DefaultMaxProjectSnapshots = new ConfigKey<>("Project Defaults", Long.class, "max.project.snapshots", "20",
"The default maximum number of snapshots that can be created for a project", false);
static final ConfigKey<Long> DefaultMaxProjectVolumes = new ConfigKey<>("Project Defaults", Long.class, "max.project.volumes", "20",
"The default maximum number of volumes that can be created for a project", false);
static final ConfigKey<Long> DefaultMaxProjectNetworks = new ConfigKey<>("Project Defaults", Long.class, "max.project.networks", "20",
"The default maximum number of networks that can be created for a project", false);
static final ConfigKey<Long> DefaultMaxProjectVpcs = new ConfigKey<>("Project Defaults", Long.class, "max.project.vpcs", "20",
"The default maximum number of vpcs that can be created for a project", false);
static final ConfigKey<Long> DefaultMaxProjectCpus = new ConfigKey<>("Project Defaults", Long.class, "max.project.cpus", "40",
"The default maximum number of cpu cores that can be used for a project", false);
static final ConfigKey<Long> DefaultMaxProjectMemory = new ConfigKey<>("Project Defaults", Long.class, "max.project.memory", "40960",
"The default maximum memory (in MB) that can be used for a project", false);
static final ConfigKey<Long> DefaultMaxProjectPrimaryStorage = new ConfigKey<>("Project Defaults", Long.class, "max.project.primary.storage", "200",
"The default maximum primary storage space (in GiB) that can be used for a project", false);

static final List<ResourceType> HostTagsSupportingTypes = List.of(ResourceType.user_vm, ResourceType.cpu, ResourceType.memory, ResourceType.gpu);
static final List<ResourceType> StorageTagsSupportingTypes = List.of(ResourceType.volume, ResourceType.primary_storage);

Expand Down
20 changes: 20 additions & 0 deletions api/src/main/java/org/apache/cloudstack/usage/UsageService.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,31 @@
import org.apache.cloudstack.api.command.admin.usage.GenerateUsageRecordsCmd;
import org.apache.cloudstack.api.command.admin.usage.ListUsageRecordsCmd;
import org.apache.cloudstack.api.command.admin.usage.RemoveRawUsageRecordsCmd;
import org.apache.cloudstack.framework.config.ConfigKey;

import java.util.List;
import java.util.TimeZone;

public interface UsageService {

ConfigKey<String> UsageAggregationTimezone = new ConfigKey<>("Usage", String.class, "usage.aggregation.timezone", "GMT",

Check failure on line 30 in api/src/main/java/org/apache/cloudstack/usage/UsageService.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Define a constant instead of duplicating this literal "Usage" 6 times.

See more on https://sonarcloud.io/project/issues?id=apache_cloudstack&issues=AaAFdVtkqJXQQ7HDE9R3&open=AaAFdVtkqJXQQ7HDE9R3&pullRequest=13884
"The timezone to use for usage stats aggregation", true);

ConfigKey<String> UsageExecutionTimezone = new ConfigKey<>("Usage", String.class, "usage.execution.timezone", null,
"The timezone to use for usage job execution time", true);

ConfigKey<Integer> UsageSanityCheckInterval = new ConfigKey<>("Usage", Integer.class, "usage.sanity.check.interval", null,
"Interval (in days) to check sanity of usage data. To disable set it to 0 or negative.", true);

ConfigKey<Integer> UsageStatsJobAggregationRange = new ConfigKey<>("Usage", Integer.class, "usage.stats.job.aggregation.range", "1440",
"The range of time for aggregating the user statistics specified in minutes (e.g. 1440 for daily, 60 for hourly.", true);

ConfigKey<String> UsageStatsJobExecTime = new ConfigKey<>("Usage", String.class, "usage.stats.job.exec.time", "00:15",
"The time at which the usage statistics aggregation job will run as an HH24:MM time, e.g. 00:30 to run at 12:30am.", true);

ConfigKey<Boolean> EnableUsageServer = new ConfigKey<>("Usage", Boolean.class, "enable.usage.server", "true",
"Flag for enabling usage", true);

/**
* Generate Billing Records from the last time it was generated to the
* time specified.
Expand Down
Loading
Loading