Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
58 changes: 29 additions & 29 deletions api/src/main/java/com/cloud/capacity/Capacity.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,49 +22,49 @@
import org.apache.cloudstack.api.InternalIdentity;

public interface Capacity extends InternalIdentity, Identity {
public static final short CAPACITY_TYPE_MEMORY = 0;
public static final short CAPACITY_TYPE_CPU = 1;
public static final short CAPACITY_TYPE_STORAGE = 2;
public static final short CAPACITY_TYPE_STORAGE_ALLOCATED = 3;
public static final short CAPACITY_TYPE_VIRTUAL_NETWORK_PUBLIC_IP = 4;
public static final short CAPACITY_TYPE_PRIVATE_IP = 5;
public static final short CAPACITY_TYPE_SECONDARY_STORAGE = 6;
public static final short CAPACITY_TYPE_VLAN = 7;
public static final short CAPACITY_TYPE_DIRECT_ATTACHED_PUBLIC_IP = 8;
public static final short CAPACITY_TYPE_LOCAL_STORAGE = 9;
public static final short CAPACITY_TYPE_VIRTUAL_NETWORK_IPV6_SUBNET = 10;
public static final short CAPACITY_TYPE_GPU = 19;
public static final short CAPACITY_TYPE_OBJECT_STORAGE = 20;
public static final short CAPACITY_TYPE_BACKUP_STORAGE = 21;

public static final short CAPACITY_TYPE_CPU_CORE = 90;

public static final List<Short> STORAGE_CAPACITY_TYPES = List.of(CAPACITY_TYPE_STORAGE,
short CAPACITY_TYPE_MEMORY = 0;
short CAPACITY_TYPE_CPU = 1;
short CAPACITY_TYPE_STORAGE = 2;
short CAPACITY_TYPE_STORAGE_ALLOCATED = 3;
short CAPACITY_TYPE_VIRTUAL_NETWORK_PUBLIC_IP = 4;
short CAPACITY_TYPE_PRIVATE_IP = 5;
short CAPACITY_TYPE_SECONDARY_STORAGE = 6;
short CAPACITY_TYPE_VLAN = 7;
short CAPACITY_TYPE_DIRECT_ATTACHED_PUBLIC_IP = 8;
short CAPACITY_TYPE_LOCAL_STORAGE = 9;
short CAPACITY_TYPE_VIRTUAL_NETWORK_IPV6_SUBNET = 10;
short CAPACITY_TYPE_GPU = 19;
short CAPACITY_TYPE_OBJECT_STORAGE = 20;
short CAPACITY_TYPE_BACKUP_STORAGE = 21;

short CAPACITY_TYPE_CPU_CORE = 90;

List<Short> STORAGE_CAPACITY_TYPES = List.of(CAPACITY_TYPE_STORAGE,
CAPACITY_TYPE_STORAGE_ALLOCATED,
CAPACITY_TYPE_SECONDARY_STORAGE,
CAPACITY_TYPE_LOCAL_STORAGE,
CAPACITY_TYPE_BACKUP_STORAGE,
CAPACITY_TYPE_OBJECT_STORAGE);

public Long getHostOrPoolId();
Long getHostOrPoolId();

public Long getDataCenterId();
Long getDataCenterId();

public Long getPodId();
Long getPodId();

public Long getClusterId();
Long getClusterId();

public long getUsedCapacity();
long getUsedCapacity();

public long getTotalCapacity();
long getTotalCapacity();

public short getCapacityType();
short getCapacityType();

public long getReservedCapacity();
long getReservedCapacity();

public Float getUsedPercentage();
Float getUsedPercentage();

public Long getAllocatedCapacity();
Long getAllocatedCapacity();

public String getTag();
String getTag();
}
30 changes: 15 additions & 15 deletions api/src/main/java/org/apache/cloudstack/alert/AlertService.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,11 @@
import java.util.HashSet;
import java.util.Set;

import com.cloud.capacity.Capacity;
import com.cloud.exception.InvalidParameterValueException;

public interface AlertService {
public static class AlertType {
private static Set<AlertType> defaultAlertTypes = new HashSet<AlertType>();
class AlertType {
private static Set<AlertType> defaultAlertTypes = new HashSet<>();
private final String name;
private final short type;

Expand All @@ -36,15 +35,13 @@ private AlertType(short type, String name, boolean isDefault) {
}
}

public static final AlertType ALERT_TYPE_MEMORY = new AlertType(Capacity.CAPACITY_TYPE_MEMORY, "ALERT.MEMORY", true);
public static final AlertType ALERT_TYPE_CPU = new AlertType(Capacity.CAPACITY_TYPE_CPU, "ALERT.CPU", true);
public static final AlertType ALERT_TYPE_STORAGE = new AlertType(Capacity.CAPACITY_TYPE_STORAGE, "ALERT.STORAGE", true);
public static final AlertType ALERT_TYPE_STORAGE_ALLOCATED = new AlertType(Capacity.CAPACITY_TYPE_STORAGE_ALLOCATED, "ALERT.STORAGE.ALLOCATED", true);
public static final AlertType ALERT_TYPE_VIRTUAL_NETWORK_PUBLIC_IP = new AlertType(Capacity.CAPACITY_TYPE_VIRTUAL_NETWORK_PUBLIC_IP, "ALERT.NETWORK.PUBLICIP",
true);
public static final AlertType ALERT_TYPE_VIRTUAL_NETWORK_IPV6_SUBNET = new AlertType(Capacity.CAPACITY_TYPE_VIRTUAL_NETWORK_IPV6_SUBNET, "ALERT.NETWORK.IPV6SUBNET", true);
public static final AlertType ALERT_TYPE_PRIVATE_IP = new AlertType(Capacity.CAPACITY_TYPE_PRIVATE_IP, "ALERT.NETWORK.PRIVATEIP", true);
public static final AlertType ALERT_TYPE_SECONDARY_STORAGE = new AlertType(Capacity.CAPACITY_TYPE_SECONDARY_STORAGE, "ALERT.STORAGE.SECONDARY", true);
public static final AlertType ALERT_TYPE_MEMORY = new AlertType((short)0, "ALERT.MEMORY", true);
public static final AlertType ALERT_TYPE_CPU = new AlertType((short)1, "ALERT.CPU", true);
public static final AlertType ALERT_TYPE_STORAGE = new AlertType((short)2, "ALERT.STORAGE", true);
public static final AlertType ALERT_TYPE_STORAGE_ALLOCATED = new AlertType((short)3, "ALERT.STORAGE.ALLOCATED", true);
public static final AlertType ALERT_TYPE_VIRTUAL_NETWORK_PUBLIC_IP = new AlertType((short)4, "ALERT.NETWORK.PUBLICIP", true);
public static final AlertType ALERT_TYPE_PRIVATE_IP = new AlertType((short)5, "ALERT.NETWORK.PRIVATEIP", true);
public static final AlertType ALERT_TYPE_SECONDARY_STORAGE = new AlertType((short)6, "ALERT.STORAGE.SECONDARY", true);
public static final AlertType ALERT_TYPE_HOST = new AlertType((short)7, "ALERT.COMPUTE.HOST", true);
public static final AlertType ALERT_TYPE_USERVM = new AlertType((short)8, "ALERT.USERVM", true);
public static final AlertType ALERT_TYPE_DOMAIN_ROUTER = new AlertType((short)9, "ALERT.SERVICE.DOMAINROUTER", true);
Expand Down Expand Up @@ -73,9 +70,12 @@ private AlertType(short type, String name, boolean isDefault) {
public static final AlertType ALERT_TYPE_VM_SNAPSHOT = new AlertType((short)32, "ALERT.VM.SNAPSHOT", true);
public static final AlertType ALERT_TYPE_VR_PUBLIC_IFACE_MTU = new AlertType((short)33, "ALERT.VR.PUBLIC.IFACE.MTU", true);
public static final AlertType ALERT_TYPE_VR_PRIVATE_IFACE_MTU = new AlertType((short)34, "ALERT.VR.PRIVATE.IFACE.MTU", true);
public static final AlertType ALERT_TYPE_EXTENSION_PATH_NOT_READY = new AlertType((short)33, "ALERT.TYPE.EXTENSION.PATH.NOT.READY", true);
public static final AlertType ALERT_TYPE_BACKUP_STORAGE = new AlertType(Capacity.CAPACITY_TYPE_BACKUP_STORAGE, "ALERT.STORAGE.BACKUP", true);
public static final AlertType ALERT_TYPE_OBJECT_STORAGE = new AlertType(Capacity.CAPACITY_TYPE_OBJECT_STORAGE, "ALERT.STORAGE.OBJECT", true);
public static final AlertType ALERT_TYPE_VIRTUAL_NETWORK_IPV6_SUBNET = new AlertType((short)35, "ALERT.NETWORK.IPV6SUBNET", true);
public static final AlertType ALERT_TYPE_EXTENSION_PATH_NOT_READY = new AlertType((short)36, "ALERT.TYPE.EXTENSION.PATH.NOT.READY", true);
public static final AlertType ALERT_TYPE_BACKUP_STORAGE = new AlertType((short)37, "ALERT.STORAGE.BACKUP", true);
public static final AlertType ALERT_TYPE_OBJECT_STORAGE = new AlertType((short)38, "ALERT.STORAGE.OBJECT", true);
// Note: Add next Alert Type before this. Always check the 'main' branch and keep the next number for the Alert Type to avoid conflicts.
// Do not use Capacity Type to define the Alert Type.

public short getType() {
return type;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public class ListCapacityCmd extends BaseListCmd {
@Parameter(name = ApiConstants.TYPE, type = CommandType.INTEGER, description = "Lists capacity by type" + "* CAPACITY_TYPE_MEMORY = 0" + "* CAPACITY_TYPE_CPU = 1"
+ "* CAPACITY_TYPE_STORAGE = 2" + "* CAPACITY_TYPE_STORAGE_ALLOCATED = 3" + "* CAPACITY_TYPE_VIRTUAL_NETWORK_PUBLIC_IP = 4" + "* CAPACITY_TYPE_PRIVATE_IP = 5"
+ "* CAPACITY_TYPE_SECONDARY_STORAGE = 6" + "* CAPACITY_TYPE_VLAN = 7" + "* CAPACITY_TYPE_DIRECT_ATTACHED_PUBLIC_IP = 8" + "* CAPACITY_TYPE_LOCAL_STORAGE = 9"
+ "* CAPACITY_TYPE_GPU = 19" + "* CAPACITY_TYPE_CPU_CORE = 90.")
+ "* CAPACITY_TYPE_GPU = 19" + "* CAPACITY_TYPE_OBJECT_STORAGE = 20" + "* CAPACITY_TYPE_BACKUP_STORAGE = 21" + "* CAPACITY_TYPE_CPU_CORE = 90.")
private Integer type;

@Parameter(name = ApiConstants.SORT_BY, type = CommandType.STRING, since = "3.0.0", description = "Sort the results. Available values: Usage")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ ALTER TABLE `cloud`.`template_store_ref` MODIFY COLUMN `download_url` varchar(20

UPDATE `cloud`.`alert` SET type = 33 WHERE name = 'ALERT.VR.PUBLIC.IFACE.MTU';
UPDATE `cloud`.`alert` SET type = 34 WHERE name = 'ALERT.VR.PRIVATE.IFACE.MTU';
UPDATE `cloud`.`alert` SET type = 35 WHERE name = 'ALERT.NETWORK.IPV6SUBNET';
UPDATE `cloud`.`alert` SET type = 36 WHERE name = 'ALERT.TYPE.EXTENSION.PATH.NOT.READY';
UPDATE `cloud`.`alert` SET type = 37 WHERE name = 'ALERT.STORAGE.BACKUP';
UPDATE `cloud`.`alert` SET type = 38 WHERE name = 'ALERT.STORAGE.OBJECT';

-- Update configuration 'kvm.ssh.to.agent' description and is_dynamic fields
UPDATE `cloud`.`configuration` SET description = 'True if the management server will restart the agent service via SSH into the KVM hosts after or during maintenance operations', is_dynamic = 1 WHERE name = 'kvm.ssh.to.agent';
Loading