|
23 | 23 | import com.cloud.storage.Snapshot;
|
24 | 24 | import com.cloud.storage.Storage.ProvisioningType;
|
25 | 25 | import com.cloud.vm.snapshot.VMSnapshot;
|
| 26 | +import org.apache.cloudstack.quota.constant.QuotaTypes; |
26 | 27 |
|
27 | 28 | public class Value extends GenericPresetVariable {
|
| 29 | + |
| 30 | + @PresetVariableDefinition(description = "ID of the resource.", supportedTypes = {QuotaTypes.ALLOCATED_VM, QuotaTypes.RUNNING_VM, QuotaTypes.VOLUME, QuotaTypes.TEMPLATE, |
| 31 | + QuotaTypes.ISO, QuotaTypes.SNAPSHOT, QuotaTypes.NETWORK_OFFERING, QuotaTypes.VM_SNAPSHOT}) |
| 32 | + private String id; |
| 33 | + |
| 34 | + @PresetVariableDefinition(description = "Name of the resource.", supportedTypes = {QuotaTypes.ALLOCATED_VM, QuotaTypes.RUNNING_VM, QuotaTypes.VOLUME, QuotaTypes.TEMPLATE, |
| 35 | + QuotaTypes.ISO, QuotaTypes.SNAPSHOT, QuotaTypes.NETWORK_OFFERING, QuotaTypes.VM_SNAPSHOT}) |
| 36 | + private String name; |
| 37 | + |
| 38 | + @PresetVariableDefinition(description = "Host where the VM is running.", supportedTypes = {QuotaTypes.RUNNING_VM}) |
28 | 39 | private Host host;
|
| 40 | + |
| 41 | + @PresetVariableDefinition(description = "OS of the VM/template.", supportedTypes = {QuotaTypes.RUNNING_VM, QuotaTypes.ALLOCATED_VM, QuotaTypes.TEMPLATE, QuotaTypes.ISO}) |
29 | 42 | private String osName;
|
| 43 | + |
| 44 | + @PresetVariableDefinition(description = "A list of resources of the account between the start and end date of the usage record being calculated " + |
| 45 | + "(i.e.: [{zoneId: ..., domainId:...}]).") |
30 | 46 | private List<Resource> accountResources;
|
| 47 | + |
| 48 | + @PresetVariableDefinition(supportedTypes = {QuotaTypes.ALLOCATED_VM, QuotaTypes.RUNNING_VM, QuotaTypes.VOLUME, QuotaTypes.TEMPLATE, QuotaTypes.ISO, QuotaTypes.SNAPSHOT, |
| 49 | + QuotaTypes.VM_SNAPSHOT}, description = "List of tags of the resource in the format key:value (i.e.: {\"a\":\"b\", \"c\":\"d\"}).") |
31 | 50 | private Map<String, String> tags;
|
| 51 | + |
| 52 | + @PresetVariableDefinition(description = "Tag of the network offering.", supportedTypes = {QuotaTypes.NETWORK_OFFERING}) |
32 | 53 | private String tag;
|
| 54 | + |
| 55 | + @PresetVariableDefinition(description = "Size of the resource (in MiB).", supportedTypes = {QuotaTypes.TEMPLATE, QuotaTypes.ISO, QuotaTypes.VOLUME, QuotaTypes.SNAPSHOT, |
| 56 | + QuotaTypes.BACKUP}) |
33 | 57 | private Long size;
|
| 58 | + |
| 59 | + @PresetVariableDefinition(description = "Virtual size of the backup.", supportedTypes = {QuotaTypes.BACKUP}) |
34 | 60 | private Long virtualSize;
|
| 61 | + |
| 62 | + @PresetVariableDefinition(description = "Provisioning type of the resource. Values can be: thin, sparse or fat.", supportedTypes = {QuotaTypes.VOLUME}) |
35 | 63 | private ProvisioningType provisioningType;
|
| 64 | + |
| 65 | + @PresetVariableDefinition(description = "Type of the snapshot. Values can be: MANUAL, RECURRING, HOURLY, DAILY, WEEKLY and MONTHLY.", supportedTypes = {QuotaTypes.SNAPSHOT}) |
36 | 66 | private Snapshot.Type snapshotType;
|
| 67 | + |
| 68 | + @PresetVariableDefinition(description = "Type of the VM snapshot. Values can be: Disk or DiskAndMemory.", supportedTypes = {QuotaTypes.VM_SNAPSHOT}) |
37 | 69 | private VMSnapshot.Type vmSnapshotType;
|
| 70 | + |
| 71 | + @PresetVariableDefinition(description = "Computing offering of the VM.", supportedTypes = {QuotaTypes.RUNNING_VM, QuotaTypes.ALLOCATED_VM}) |
38 | 72 | private ComputeOffering computeOffering;
|
| 73 | + |
| 74 | + @PresetVariableDefinition(description = "Template/ISO with which the VM was created.", supportedTypes = {QuotaTypes.RUNNING_VM, QuotaTypes.ALLOCATED_VM}) |
39 | 75 | private GenericPresetVariable template;
|
| 76 | + |
| 77 | + @PresetVariableDefinition(description = "Disk offering of the volume.", supportedTypes = {QuotaTypes.VOLUME}) |
40 | 78 | private GenericPresetVariable diskOffering;
|
| 79 | + |
| 80 | + @PresetVariableDefinition(description = "Storage where the volume or snapshot is. While handling with snapshots, this value can be from the primary storage if the global " + |
| 81 | + "setting 'snapshot.backup.to.secondary' is false, otherwise it will be from secondary storage.", supportedTypes = {QuotaTypes.VOLUME, QuotaTypes.SNAPSHOT}) |
41 | 82 | private Storage storage;
|
| 83 | + |
| 84 | + @PresetVariableDefinition(description = "Computing resources consumed by the VM.", supportedTypes = {QuotaTypes.RUNNING_VM}) |
42 | 85 | private ComputingResources computingResources;
|
| 86 | + |
| 87 | + @PresetVariableDefinition(description = "Backup offering of the backup.", supportedTypes = {QuotaTypes.BACKUP}) |
43 | 88 | private BackupOffering backupOffering;
|
| 89 | + |
| 90 | + @PresetVariableDefinition(description = "The hypervisor where the resource was deployed. Values can be: XenServer, KVM, VMware, Hyperv, BareMetal, Ovm, Ovm3 and LXC.", |
| 91 | + supportedTypes = {QuotaTypes.RUNNING_VM, QuotaTypes.ALLOCATED_VM, QuotaTypes.VM_SNAPSHOT, QuotaTypes.SNAPSHOT}) |
44 | 92 | private String hypervisorType;
|
| 93 | + |
| 94 | + @PresetVariableDefinition(description = "The volume format. Values can be: RAW, VHD, VHDX, OVA and QCOW2.", supportedTypes = {QuotaTypes.VOLUME, QuotaTypes.VOLUME_SECONDARY}) |
45 | 95 | private String volumeFormat;
|
46 | 96 | private String state;
|
47 | 97 |
|
|
0 commit comments