diff --git a/server/src/com/cloud/api/ApiConstants.java b/server/src/com/cloud/api/ApiConstants.java index 0169a724393..b28e586802b 100644 --- a/server/src/com/cloud/api/ApiConstants.java +++ b/server/src/com/cloud/api/ApiConstants.java @@ -1,5 +1,161 @@ +/** + * Copyright (C) 2010 Cloud.com, Inc. All rights reserved. + * + * This software is licensed under the GNU General Public License v3 or later. + * + * It is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ package com.cloud.api; public class ApiConstants { + public static final String ACCOUNT = "account"; + public static final String ACCOUNTS = "accounts"; + public static final String ACCOUNT_TYPE = "accounttype"; + public static final String ALGORITHM = "algorithm"; + public static final String ALLOCATED_ONLY = "allocatedonly"; + public static final String API_KEY = "apikey"; + public static final String APPLIED = "applied"; + public static final String AVAILABLE = "available"; + public static final String BITS = "bits"; + public static final String BOOTABLE = "bootable"; + public static final String CATEGORY = "category"; + public static final String CIDR = "cidr"; + public static final String CIDR_LIST = "cidrlist"; + public static final String CLEANUP = "cleanup"; + public static final String CLUSTER_ID = "clusterid"; + public static final String CLUSTER_NAME = "clustername"; + public static final String COMPONENT = "component"; + public static final String CPU_NUMBER = "cpunumber"; + public static final String CPU_SPEED = "cpuspeed"; + public static final String CREATED = "created"; + public static final String DESCRIPTION = "description"; + public static final String DESTINATION_ZONE_ID = "destzoneid"; + public static final String DETAILS = "details"; + public static final String DEVICE_ID = "deviceid"; + public static final String DISK_OFFERING_ID = "diskofferingid"; + public static final String DISK_SIZE = "disksize"; + public static final String DISPLAY_NAME = "displayname"; + public static final String DISPLAY_TEXT = "displaytext"; + public static final String DNS1 = "dns1"; + public static final String DNS2 = "dns2"; + public static final String DOMAIN = "domain"; + public static final String DOMAIN_ID = "domainid"; + public static final String DURATION = "duration"; + public static final String EMAIL = "email"; + public static final String END_DATE = "enddate"; + public static final String END_IP = "endip"; + public static final String END_PORT = "endport"; + public static final String ENTRY_TIME = "entrytime"; + public static final String FIRSTNAME = "firstname"; + public static final String FORMAT = "format"; + public static final String FOR_VIRTUAL_NETWORK = "forvirtualnetwork"; + public static final String GATEWAY = "gateway"; + public static final String GROUP = "group"; + public static final String GROUP_ID = "groupid"; + public static final String GUEST_CIDR_ADDRESS = "guestcidraddress"; + public static final String HA_ENABLE = "haenable"; + public static final String HOST_ID = "hostid"; + public static final String HYPERVISOR = "hypervisor"; + public static final String INSTANCE = "instance"; + public static final String ICMP_CODE = "icmpcode"; + public static final String ICMP_TYPE = "icmptype"; public static final String ID = "id"; + public static final String IDS = "ids"; + public static final String INTERNAL_DNS1 = "internaldns1"; + public static final String INTERNAL_DNS2 = "internaldns2"; + public static final String INTERVAL_TYPE = "intervaltype"; + public static final String IP_ADDRESS = "ipaddress"; + public static final String IP_AVAILABLE = "ipavailable"; + public static final String IP_LIMIT = "iplimit"; + public static final String IP_TOTAL = "iptotal"; + public static final String IS_CLEANUP_REQUIRED = "iscleanuprequired"; + public static final String IS_FEATURED = "isfeatured"; + public static final String IS_PUBLIC = "ispublic"; + public static final String IS_READY = "isready"; + public static final String IS_RECURSIVE = "isrecursive"; + public static final String ISO_FILTER = "isofilter"; + public static final String JOB_ID = "jobid"; + public static final String LASTNAME = "lastname"; + public static final String LEVEL = "level"; + public static final String LUN = "lun"; + public static final String MAX = "max"; + public static final String MAX_SNAPS = "maxsnaps"; + public static final String MEMORY = "memory"; + public static final String MODE = "mode"; + public static final String NAME = "name"; + public static final String NETWORK_DOMAIN = "networkdomain"; + public static final String NETWORK_GROUP_LIST = "networkgrouplist"; + public static final String NETWORK_GROUP_NAME = "networkgroupname"; + public static final String NETMASK = "netmask"; + public static final String NEW_NAME = "newname"; + public static final String OFFER_HA = "offerha"; + public static final String OP = "op"; + public static final String OS_CATEGORY_ID = "oscategoryid"; + public static final String OS_TYPE_ID = "ostypeid"; + public static final String PARENT_DOMAIN_ID = "parentdomainid"; + public static final String PASSWORD = "password"; + public static final String PASSWORD_ENABLED = "passwordenabled"; + public static final String PATH = "path"; + public static final String POD_ID = "podid"; + public static final String POLICY_ID = "policyid"; + public static final String PORTAL = "portal"; + public static final String PORT_FORWARDING_SERVICE_ID = "portforwardingserviceid"; + public static final String PRIVATE_IP = "privateip"; + public static final String PRIVATE_PORT = "privateport"; + public static final String PROTOCOL = "protocol"; + public static final String PUBLIC_IP = "publicip"; + public static final String PUBLIC_PORT = "publicport"; + public static final String RECEIVED_BYTES = "receivedbytes"; + public static final String REQUIRES_HVM = "requireshvm"; + public static final String RESOURCE_TYPE = "resourcetype"; + public static final String SCHEDULE = "schedule"; + public static final String SCOPE = "scope"; + public static final String SECRET_KEY = "secretkey"; + public static final String SENT = "sent"; + public static final String SENT_BYTES = "sentbytes"; + public static final String SERVICE_OFFERING_ID = "serviceofferingid"; + public static final String SIZE = "size"; + public static final String SNAPSHOT_ID = "snapshotid"; + public static final String SNAPSHOT_POLICY_ID = "snapshotpolicyid"; + public static final String SNAPSHOT_TYPE = "snapshottype"; + public static final String SOURCE_ZONE_ID = "sourcezoneid"; + public static final String START_DATE = "startdate"; + public static final String START_IP = "startip"; + public static final String START_PORT = "startport"; + public static final String STATE = "state"; + public static final String STORAGE_TYPE = "storagetype"; + public static final String SYSTEM_VM_TYPE = "systemvmtype"; + public static final String TAGS = "tags"; + public static final String TARGET_IQN = "targetiqn"; + public static final String TEMPLATE_FILTER = "templatefilter"; + public static final String TEMPLATE_ID = "templateid"; + public static final String TIMEZONE = "timezone"; + public static final String TYPE = "type"; + public static final String URL = "url"; + public static final String USER_DATA = "userdata"; + public static final String USER_ID = "userid"; + public static final String USERNAME = "username"; + public static final String USER_NETWORK_GROUP_LIST = "usernetworkgrouplist"; + public static final String USE_VIRTUAL_NETWORK = "usevirtualnetwork"; + public static final String VALUE = "value"; + public static final String VIRTUAL_MACHINE_ID = "virtualmachineid"; + public static final String VIRTUAL_MACHINE_IDS = "virtualmachineids"; + public static final String VLAN = "vlan"; + public static final String VLAN_ID = "vlanid"; + public static final String VM_AVAILABLE = "vmavailable"; + public static final String VM_LIMIT = "vmlimit"; + public static final String VM_TOTAL = "vmtotal"; + public static final String VNET = "vnet"; + public static final String VOLUME_ID = "volumeid"; + public static final String ZONE_ID = "zoneid"; } diff --git a/server/src/com/cloud/api/commands/AddConfigCmd.java b/server/src/com/cloud/api/commands/AddConfigCmd.java index 8b4236ee4ae..9697520f499 100644 --- a/server/src/com/cloud/api/commands/AddConfigCmd.java +++ b/server/src/com/cloud/api/commands/AddConfigCmd.java @@ -19,6 +19,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.BaseCmd; import com.cloud.api.Implementation; import com.cloud.api.Parameter; @@ -36,23 +37,23 @@ public class AddConfigCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="category", type=CommandType.STRING, required=true, description="component's category") + @Parameter(name=ApiConstants.CATEGORY, type=CommandType.STRING, required=true, description="component's category") private String category; - @Parameter(name="component", type=CommandType.STRING, required=true, description="the component of the configuration") + @Parameter(name=ApiConstants.COMPONENT, type=CommandType.STRING, required=true, description="the component of the configuration") private String component; - @Parameter(name="description", type=CommandType.STRING, description="the description of the configuration") + @Parameter(name=ApiConstants.DESCRIPTION, type=CommandType.STRING, description="the description of the configuration") private String description; //FIXME - add description - @Parameter(name="instance", type=CommandType.STRING, required=true) + @Parameter(name=ApiConstants.INSTANCE, type=CommandType.STRING, required=true) private String instance; - @Parameter(name="name", type=CommandType.STRING, required=true, description="the name of the configuration") + @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, required=true, description="the name of the configuration") private String name; - @Parameter(name="value", type=CommandType.STRING, description="the value of the configuration") + @Parameter(name=ApiConstants.VALUE, type=CommandType.STRING, description="the value of the configuration") private String value; diff --git a/server/src/com/cloud/api/commands/AddHostCmd.java b/server/src/com/cloud/api/commands/AddHostCmd.java index af64c0b4781..f0950dcc6ac 100644 --- a/server/src/com/cloud/api/commands/AddHostCmd.java +++ b/server/src/com/cloud/api/commands/AddHostCmd.java @@ -27,6 +27,7 @@ import java.util.Set; import org.apache.log4j.Logger; import com.cloud.agent.AgentManager; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseCmd; import com.cloud.api.Implementation; @@ -53,25 +54,25 @@ public class AddHostCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="clusterid", type=CommandType.LONG, description="the cluster ID for the host") + @Parameter(name=ApiConstants.CLUSTER_ID, type=CommandType.LONG, description="the cluster ID for the host") private Long clusterId; - @Parameter(name="clustername", type=CommandType.STRING, description="the cluster name for the host") + @Parameter(name=ApiConstants.CLUSTER_NAME, type=CommandType.STRING, description="the cluster name for the host") private String clusterName; - @Parameter(name="password", type=CommandType.STRING, required=true, description="the password for the host") + @Parameter(name=ApiConstants.PASSWORD, type=CommandType.STRING, required=true, description="the password for the host") private String password; - @Parameter(name="podid", type=CommandType.LONG, description="the Pod ID for the host") + @Parameter(name=ApiConstants.POD_ID, type=CommandType.LONG, description="the Pod ID for the host") private Long podId; - @Parameter(name="url", type=CommandType.STRING, required=true, description="the host URL") + @Parameter(name=ApiConstants.URL, type=CommandType.STRING, required=true, description="the host URL") private String url; - @Parameter(name="username", type=CommandType.STRING, required=true, description="the username for the host") + @Parameter(name=ApiConstants.USERNAME, type=CommandType.STRING, required=true, description="the username for the host") private String username; - @Parameter(name="zoneid", type=CommandType.LONG, required=true, description="the Zone ID for the host") + @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, required=true, description="the Zone ID for the host") private Long zoneId; diff --git a/server/src/com/cloud/api/commands/AddSecondaryStorageCmd.java b/server/src/com/cloud/api/commands/AddSecondaryStorageCmd.java index 74dcb32a9ea..6a0c4b69bf1 100644 --- a/server/src/com/cloud/api/commands/AddSecondaryStorageCmd.java +++ b/server/src/com/cloud/api/commands/AddSecondaryStorageCmd.java @@ -27,6 +27,7 @@ import java.util.Set; import org.apache.log4j.Logger; import com.cloud.agent.AgentManager; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseCmd; import com.cloud.api.Implementation; @@ -48,10 +49,10 @@ public class AddSecondaryStorageCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="url", type=CommandType.STRING, required=true, description="the URL for the secondary storage") + @Parameter(name=ApiConstants.URL, type=CommandType.STRING, required=true, description="the URL for the secondary storage") private String url; - @Parameter(name="zoneid", type=CommandType.LONG, description="the Zone ID for the secondary storage") + @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, description="the Zone ID for the secondary storage") private Long zoneId; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/AssignPortForwardingServiceCmd.java b/server/src/com/cloud/api/commands/AssignPortForwardingServiceCmd.java index e10bde45313..4f3c598c1d0 100644 --- a/server/src/com/cloud/api/commands/AssignPortForwardingServiceCmd.java +++ b/server/src/com/cloud/api/commands/AssignPortForwardingServiceCmd.java @@ -21,6 +21,7 @@ import java.util.List; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseAsyncCmd; import com.cloud.api.Implementation; @@ -41,16 +42,16 @@ public class AssignPortForwardingServiceCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, description="the ID of the port forwarding service to assign to the virtual machine/public IP") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, description="the ID of the port forwarding service to assign to the virtual machine/public IP") private Long id; - @Parameter(name="ids", type=CommandType.LIST, collectionType=CommandType.LONG, description="a comma delimited list of port forwarding service IDs to assign to the virtual machine/public IP") + @Parameter(name=ApiConstants.IDS, type=CommandType.LIST, collectionType=CommandType.LONG, description="a comma delimited list of port forwarding service IDs to assign to the virtual machine/public IP") private List ids; - @Parameter(name="publicip", type=CommandType.STRING, required=true, description="the public IP address to associate to the port forwarding service") + @Parameter(name=ApiConstants.PUBLIC_IP, type=CommandType.STRING, required=true, description="the public IP address to associate to the port forwarding service") private String publicIp; - @Parameter(name="virtualmachineid", type=CommandType.LONG, required=true, description="the ID of the virtual machine to assign to the port forwarding service") + @Parameter(name=ApiConstants.VIRTUAL_MACHINE_ID, type=CommandType.LONG, required=true, description="the ID of the virtual machine to assign to the port forwarding service") private Long virtualMachineId; diff --git a/server/src/com/cloud/api/commands/AssignToLoadBalancerRuleCmd.java b/server/src/com/cloud/api/commands/AssignToLoadBalancerRuleCmd.java index 75a6963de5f..250e34b70fd 100644 --- a/server/src/com/cloud/api/commands/AssignToLoadBalancerRuleCmd.java +++ b/server/src/com/cloud/api/commands/AssignToLoadBalancerRuleCmd.java @@ -21,6 +21,7 @@ import java.util.List; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseAsyncCmd; import com.cloud.api.Implementation; @@ -41,13 +42,13 @@ public class AssignToLoadBalancerRuleCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true, description="the ID of the load balancer rule") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="the ID of the load balancer rule") private Long id; - @Parameter(name="virtualmachineid", type=CommandType.LONG, required=false, description="the ID of the virtual machine that is being assigned to the load balancer rule") + @Parameter(name=ApiConstants.VIRTUAL_MACHINE_ID, type=CommandType.LONG, required=false, description="the ID of the virtual machine that is being assigned to the load balancer rule") private Long virtualMachineId; - @Parameter(name="virtualmachineids", type=CommandType.LIST, collectionType=CommandType.LONG, required=false, description="the list of IDs of the virtual machine that are being assigned to the load balancer rule(i.e. virtualMachineIds=1,2,3)") + @Parameter(name=ApiConstants.VIRTUAL_MACHINE_IDS, type=CommandType.LIST, collectionType=CommandType.LONG, required=false, description="the list of IDs of the virtual machine that are being assigned to the load balancer rule(i.e. virtualMachineIds=1,2,3)") private List virtualMachineIds; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/AssociateIPAddrCmd.java b/server/src/com/cloud/api/commands/AssociateIPAddrCmd.java index 82082f3e544..5e7f39795e6 100644 --- a/server/src/com/cloud/api/commands/AssociateIPAddrCmd.java +++ b/server/src/com/cloud/api/commands/AssociateIPAddrCmd.java @@ -19,6 +19,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseCmd; import com.cloud.api.Implementation; @@ -40,13 +41,13 @@ public class AssociateIPAddrCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="account", type=CommandType.STRING, description="the account to associate with this IP address") + @Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, description="the account to associate with this IP address") private String accountName; - @Parameter(name="domainid", type=CommandType.LONG, description="the ID of the domain to associate with this IP address") + @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, description="the ID of the domain to associate with this IP address") private Long domainId; - @Parameter(name="zoneid", type=CommandType.LONG, required=true, description="the ID of the availability zone you want to acquire an public IP address from") + @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, required=true, description="the ID of the availability zone you want to acquire an public IP address from") private Long zoneId; diff --git a/server/src/com/cloud/api/commands/AttachIsoCmd.java b/server/src/com/cloud/api/commands/AttachIsoCmd.java index 81394579f32..2e4dbb765ef 100755 --- a/server/src/com/cloud/api/commands/AttachIsoCmd.java +++ b/server/src/com/cloud/api/commands/AttachIsoCmd.java @@ -19,6 +19,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseAsyncCmd; import com.cloud.api.BaseCmd; @@ -42,10 +43,10 @@ public class AttachIsoCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true, description="the ID of the ISO file") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="the ID of the ISO file") private Long id; - @Parameter(name="virtualmachineid", type=CommandType.LONG, required=true, description="the ID of the virtual machine") + @Parameter(name=ApiConstants.VIRTUAL_MACHINE_ID, type=CommandType.LONG, required=true, description="the ID of the virtual machine") private Long virtualMachineId; diff --git a/server/src/com/cloud/api/commands/AttachVolumeCmd.java b/server/src/com/cloud/api/commands/AttachVolumeCmd.java index 4d368243f05..48f1c1a473f 100755 --- a/server/src/com/cloud/api/commands/AttachVolumeCmd.java +++ b/server/src/com/cloud/api/commands/AttachVolumeCmd.java @@ -20,6 +20,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseAsyncCmd; import com.cloud.api.Implementation; @@ -40,7 +41,7 @@ public class AttachVolumeCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="deviceid", type=CommandType.LONG, description="the ID of the device to map the volume to within the guest OS. " + + @Parameter(name=ApiConstants.DEVICE_ID, type=CommandType.LONG, description="the ID of the device to map the volume to within the guest OS. " + "If no deviceId is passed in, the next available deviceId will be chosen. " + "Possible values for a Linux OS are:" + "* 1 - /dev/xvdb" + @@ -53,10 +54,10 @@ public class AttachVolumeCmd extends BaseAsyncCmd { "* 9 - /dev/xvdj") private Long deviceId; - @Parameter(name="id", type=CommandType.LONG, required=true, description="the ID of the disk volume") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="the ID of the disk volume") private Long id; - @Parameter(name="virtualmachineid", type=CommandType.LONG, required=true, description=" the ID of the virtual machine") + @Parameter(name=ApiConstants.VIRTUAL_MACHINE_ID, type=CommandType.LONG, required=true, description=" the ID of the virtual machine") private Long virtualMachineId; diff --git a/server/src/com/cloud/api/commands/AuthorizeNetworkGroupIngressCmd.java b/server/src/com/cloud/api/commands/AuthorizeNetworkGroupIngressCmd.java index b2138614220..e1a1247fb7b 100644 --- a/server/src/com/cloud/api/commands/AuthorizeNetworkGroupIngressCmd.java +++ b/server/src/com/cloud/api/commands/AuthorizeNetworkGroupIngressCmd.java @@ -27,6 +27,7 @@ import java.util.Map; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseAsyncCmd; import com.cloud.api.Implementation; @@ -50,43 +51,43 @@ public class AuthorizeNetworkGroupIngressCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="protocol", type=CommandType.STRING, description="TCP is default. UDP is the other supported protocol") + @Parameter(name=ApiConstants.PROTOCOL, type=CommandType.STRING, description="TCP is default. UDP is the other supported protocol") private String protocol; //FIXME - add description - @Parameter(name="startport", type=CommandType.INTEGER) + @Parameter(name=ApiConstants.START_PORT, type=CommandType.INTEGER) private Integer startPort; //FIXME - add description - @Parameter(name="endport", type=CommandType.INTEGER) + @Parameter(name=ApiConstants.END_PORT, type=CommandType.INTEGER) private Integer endPort; //FIXME - add description - @Parameter(name="icmptype", type=CommandType.INTEGER) + @Parameter(name=ApiConstants.ICMP_TYPE, type=CommandType.INTEGER) private Integer icmpType; //FIXME - add description - @Parameter(name="icmpcode", type=CommandType.INTEGER) + @Parameter(name=ApiConstants.ICMP_CODE, type=CommandType.INTEGER) private Integer icmpCode; //FIXME - add description - @Parameter(name="networkgroupname", type=CommandType.STRING, required=true) + @Parameter(name=ApiConstants.NETWORK_GROUP_NAME, type=CommandType.STRING, required=true) private String networkGroupName; //FIXME - add description - @Parameter(name="cidrlist", type=CommandType.LIST, collectionType=CommandType.STRING) + @Parameter(name=ApiConstants.CIDR_LIST, type=CommandType.LIST, collectionType=CommandType.STRING) private List cidrList; //FIXME - add description - @Parameter(name="usernetworkgrouplist", type=CommandType.MAP) + @Parameter(name=ApiConstants.USER_NETWORK_GROUP_LIST, type=CommandType.MAP) private Map userNetworkGroupList; //FIXME - add description - @Parameter(name="account", type=CommandType.STRING) + @Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING) private String accountName; //FIXME - add description - @Parameter(name="domainid", type=CommandType.LONG) + @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG) private Long domainId; diff --git a/server/src/com/cloud/api/commands/CancelMaintenanceCmd.java b/server/src/com/cloud/api/commands/CancelMaintenanceCmd.java index 8eaffb21ab5..746bb753051 100644 --- a/server/src/com/cloud/api/commands/CancelMaintenanceCmd.java +++ b/server/src/com/cloud/api/commands/CancelMaintenanceCmd.java @@ -27,6 +27,7 @@ import java.util.Set; import org.apache.log4j.Logger; import com.cloud.agent.AgentManager; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseAsyncCmd; import com.cloud.api.Implementation; @@ -54,7 +55,7 @@ public class CancelMaintenanceCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true, description="the host ID") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="the host ID") private Long id; diff --git a/server/src/com/cloud/api/commands/CancelPrimaryStorageMaintenanceCmd.java b/server/src/com/cloud/api/commands/CancelPrimaryStorageMaintenanceCmd.java index a1acbf44533..3d59b085ab4 100644 --- a/server/src/com/cloud/api/commands/CancelPrimaryStorageMaintenanceCmd.java +++ b/server/src/com/cloud/api/commands/CancelPrimaryStorageMaintenanceCmd.java @@ -20,6 +20,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseAsyncCmd; import com.cloud.api.Implementation; @@ -43,7 +44,7 @@ public class CancelPrimaryStorageMaintenanceCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true, description="the primary storage ID") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="the primary storage ID") private Long id; diff --git a/server/src/com/cloud/api/commands/CopyIsoCmd.java b/server/src/com/cloud/api/commands/CopyIsoCmd.java index 4957ce011c3..6bfda59c2db 100644 --- a/server/src/com/cloud/api/commands/CopyIsoCmd.java +++ b/server/src/com/cloud/api/commands/CopyIsoCmd.java @@ -20,6 +20,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseAsyncCmd; import com.cloud.api.BaseCmd; @@ -48,7 +49,7 @@ public class CopyIsoCmd extends BaseAsyncCmd { @Parameter(name="destzoneid", type=CommandType.LONG, required=true, description="the ID of the destination zone to which the ISO file will be copied") private Long destZoneId; - @Parameter(name="id", type=CommandType.LONG, required=true, description="the ID of the ISO file") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="the ID of the ISO file") private Long id; @Parameter(name="sourcezoneid", type=CommandType.LONG, required=true, description="the ID of the source zone from which the ISO file will be copied") diff --git a/server/src/com/cloud/api/commands/CopyTemplateCmd.java b/server/src/com/cloud/api/commands/CopyTemplateCmd.java index c7dda7a404a..d01f3793ceb 100644 --- a/server/src/com/cloud/api/commands/CopyTemplateCmd.java +++ b/server/src/com/cloud/api/commands/CopyTemplateCmd.java @@ -20,6 +20,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseAsyncCmd; import com.cloud.api.BaseCmd; @@ -45,13 +46,13 @@ public class CopyTemplateCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="destzoneid", type=CommandType.LONG, required=true, description="ID of the zone the template is being copied to.") + @Parameter(name=ApiConstants.DESTINATION_ZONE_ID, type=CommandType.LONG, required=true, description="ID of the zone the template is being copied to.") private Long destZoneId; - @Parameter(name="id", type=CommandType.LONG, required=true, description="Template ID.") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="Template ID.") private Long id; - @Parameter(name="sourcezoneid", type=CommandType.LONG, required=true, description="ID of the zone the template is currently hosted on.") + @Parameter(name=ApiConstants.SOURCE_ZONE_ID, type=CommandType.LONG, required=true, description="ID of the zone the template is currently hosted on.") private Long sourceZoneId; diff --git a/server/src/com/cloud/api/commands/CreateDiskOfferingCmd.java b/server/src/com/cloud/api/commands/CreateDiskOfferingCmd.java index de8f9ce253b..66d7a5172f3 100755 --- a/server/src/com/cloud/api/commands/CreateDiskOfferingCmd.java +++ b/server/src/com/cloud/api/commands/CreateDiskOfferingCmd.java @@ -19,6 +19,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseCmd; import com.cloud.api.Implementation; @@ -38,19 +39,19 @@ public class CreateDiskOfferingCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="disksize", type=CommandType.LONG, required=true, description="disk size of the disk offering in GB") + @Parameter(name=ApiConstants.DISK_SIZE, type=CommandType.LONG, required=true, description="disk size of the disk offering in GB") private Long diskSize; - @Parameter(name="displaytext", type=CommandType.STRING, required=true, description="alternate display text of the disk offering") + @Parameter(name=ApiConstants.DISPLAY_TEXT, type=CommandType.STRING, required=true, description="alternate display text of the disk offering") private String displayText; - @Parameter(name="domainid", type=CommandType.LONG, description="domain ID where disk offering is going to be created") + @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, description="domain ID where disk offering is going to be created") private Long domainId; - @Parameter(name="name", type=CommandType.STRING, required=true, description="name of the disk offering") + @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, required=true, description="name of the disk offering") private String offeringName; - @Parameter(name="tags", type=CommandType.STRING, description="tags for the disk offering") + @Parameter(name=ApiConstants.TAGS, type=CommandType.STRING, description="tags for the disk offering") private String tags; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/CreateDomainCmd.java b/server/src/com/cloud/api/commands/CreateDomainCmd.java index 90aca37ff97..6fdaee816b3 100644 --- a/server/src/com/cloud/api/commands/CreateDomainCmd.java +++ b/server/src/com/cloud/api/commands/CreateDomainCmd.java @@ -19,6 +19,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseCmd; import com.cloud.api.Implementation; @@ -37,10 +38,10 @@ public class CreateDomainCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="name", type=CommandType.STRING, required=true, description="creates domain with this name") + @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, required=true, description="creates domain with this name") private String domainName; - @Parameter(name="parentdomainid", type=CommandType.LONG, description="assigns new domain a parent domain by domain ID of the parent. If no parent domain is specied, the ROOT domain is assumed.") + @Parameter(name=ApiConstants.PARENT_DOMAIN_ID, type=CommandType.LONG, description="assigns new domain a parent domain by domain ID of the parent. If no parent domain is specied, the ROOT domain is assumed.") private Long parentDomainId; diff --git a/server/src/com/cloud/api/commands/CreateIPForwardingRuleCmd.java b/server/src/com/cloud/api/commands/CreateIPForwardingRuleCmd.java index 6a55d46cada..87b37f98df5 100644 --- a/server/src/com/cloud/api/commands/CreateIPForwardingRuleCmd.java +++ b/server/src/com/cloud/api/commands/CreateIPForwardingRuleCmd.java @@ -20,6 +20,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseCmd; import com.cloud.api.Implementation; @@ -40,19 +41,19 @@ public class CreateIPForwardingRuleCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="ipaddress", type=CommandType.STRING, required=true, description="the IP address of the port forwarding rule") + @Parameter(name=ApiConstants.IP_ADDRESS, type=CommandType.STRING, required=true, description="the IP address of the port forwarding rule") private String ipAddress; - @Parameter(name="privateport", type=CommandType.STRING, required=true, description="the private port of the port forwarding rule") + @Parameter(name=ApiConstants.PRIVATE_PORT, type=CommandType.STRING, required=true, description="the private port of the port forwarding rule") private String privatePort; - @Parameter(name="protocol", type=CommandType.STRING, required=true, description="the protocol for the port fowarding rule. Valid values are TCP or UDP.") + @Parameter(name=ApiConstants.PROTOCOL, type=CommandType.STRING, required=true, description="the protocol for the port fowarding rule. Valid values are TCP or UDP.") private String protocol; - @Parameter(name="publicport", type=CommandType.STRING, required=true, description=" the public port of the port forwarding rule") + @Parameter(name=ApiConstants.PUBLIC_PORT, type=CommandType.STRING, required=true, description=" the public port of the port forwarding rule") private String publicPort; - @Parameter(name="virtualmachineid", type=CommandType.LONG, required=true, description="the ID of the virtual machine for the port forwarding rule") + @Parameter(name=ApiConstants.VIRTUAL_MACHINE_ID, type=CommandType.LONG, required=true, description="the ID of the virtual machine for the port forwarding rule") private Long virtualMachineId; diff --git a/server/src/com/cloud/api/commands/CreateLoadBalancerRuleCmd.java b/server/src/com/cloud/api/commands/CreateLoadBalancerRuleCmd.java index d254df36cc8..036378c4408 100644 --- a/server/src/com/cloud/api/commands/CreateLoadBalancerRuleCmd.java +++ b/server/src/com/cloud/api/commands/CreateLoadBalancerRuleCmd.java @@ -20,6 +20,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseCmd; import com.cloud.api.Implementation; @@ -38,22 +39,22 @@ public class CreateLoadBalancerRuleCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="algorithm", type=CommandType.STRING, required=true, description="load balancer algorithm (source, roundrobin, leastconn)") + @Parameter(name=ApiConstants.ALGORITHM, type=CommandType.STRING, required=true, description="load balancer algorithm (source, roundrobin, leastconn)") private String algorithm; - @Parameter(name="description", type=CommandType.STRING, description="the description of the load balancer rule") + @Parameter(name=ApiConstants.DESCRIPTION, type=CommandType.STRING, description="the description of the load balancer rule") private String description; - @Parameter(name="name", type=CommandType.STRING, required=true, description="name of the load balancer rule") + @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, required=true, description="name of the load balancer rule") private String loadBalancerRuleName; - @Parameter(name="privateport", type=CommandType.STRING, required=true, description="the private port of the private ip address/virtual machine where the network traffic will be load balanced to") + @Parameter(name=ApiConstants.PRIVATE_PORT, type=CommandType.STRING, required=true, description="the private port of the private ip address/virtual machine where the network traffic will be load balanced to") private String privatePort; - @Parameter(name="publicip", type=CommandType.STRING, required=true, description="public ip address from where the network traffic will be load balanced from") + @Parameter(name=ApiConstants.PUBLIC_IP, type=CommandType.STRING, required=true, description="public ip address from where the network traffic will be load balanced from") private String publicIp; - @Parameter(name="publicport", type=CommandType.STRING, required=true, description="the public port from where the network traffic will be load balanced from") + @Parameter(name=ApiConstants.PUBLIC_PORT, type=CommandType.STRING, required=true, description="the public port from where the network traffic will be load balanced from") private String publicPort; diff --git a/server/src/com/cloud/api/commands/CreateNetworkGroupCmd.java b/server/src/com/cloud/api/commands/CreateNetworkGroupCmd.java index 45324a5498d..566158d7a99 100644 --- a/server/src/com/cloud/api/commands/CreateNetworkGroupCmd.java +++ b/server/src/com/cloud/api/commands/CreateNetworkGroupCmd.java @@ -19,6 +19,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseCmd; import com.cloud.api.Implementation; @@ -37,16 +38,16 @@ public class CreateNetworkGroupCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="account", type=CommandType.STRING, description="an optional account for the network group. Must be used with domainId.") + @Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, description="an optional account for the network group. Must be used with domainId.") private String accountName; - @Parameter(name="description", type=CommandType.STRING, description="the description of the network group") + @Parameter(name=ApiConstants.DESCRIPTION, type=CommandType.STRING, description="the description of the network group") private String description; - @Parameter(name="domainid", type=CommandType.LONG, description="an optional domainId for the network group. If the account parameter is used, domainId must also be used.") + @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, description="an optional domainId for the network group. If the account parameter is used, domainId must also be used.") private Long domainId; - @Parameter(name="name", type=CommandType.STRING, required=true, description="name of the network group") + @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, required=true, description="name of the network group") private String networkGroupName; diff --git a/server/src/com/cloud/api/commands/CreatePodCmd.java b/server/src/com/cloud/api/commands/CreatePodCmd.java index 73266dd1e89..a79255670c2 100644 --- a/server/src/com/cloud/api/commands/CreatePodCmd.java +++ b/server/src/com/cloud/api/commands/CreatePodCmd.java @@ -20,6 +20,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseCmd; import com.cloud.api.Implementation; @@ -38,22 +39,22 @@ public class CreatePodCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="cidr", type=CommandType.STRING, required=true, description="the CIDR notation for the base IP address of the Pod") + @Parameter(name=ApiConstants.CIDR, type=CommandType.STRING, required=true, description="the CIDR notation for the base IP address of the Pod") private String cidr; - @Parameter(name="endip", type=CommandType.STRING, description="the ending IP address for the Pod") + @Parameter(name=ApiConstants.END_IP, type=CommandType.STRING, description="the ending IP address for the Pod") private String endIp; - @Parameter(name="gateway", type=CommandType.STRING, required=true, description="the gateway for the Pod") + @Parameter(name=ApiConstants.GATEWAY, type=CommandType.STRING, required=true, description="the gateway for the Pod") private String gateway; - @Parameter(name="name", type=CommandType.STRING, required=true, description="the name of the Pod") + @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, required=true, description="the name of the Pod") private String podName; - @Parameter(name="startip", type=CommandType.STRING, required=true, description="the starting IP address for the Pod") + @Parameter(name=ApiConstants.START_IP, type=CommandType.STRING, required=true, description="the starting IP address for the Pod") private String startIp; - @Parameter(name="zoneid", type=CommandType.LONG, required=true, description="the Zone ID in which the Pod will be created ") + @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, required=true, description="the Zone ID in which the Pod will be created ") private Long zoneId; diff --git a/server/src/com/cloud/api/commands/CreatePortForwardingServiceCmd.java b/server/src/com/cloud/api/commands/CreatePortForwardingServiceCmd.java index 4362fd4eda5..acda23194ef 100644 --- a/server/src/com/cloud/api/commands/CreatePortForwardingServiceCmd.java +++ b/server/src/com/cloud/api/commands/CreatePortForwardingServiceCmd.java @@ -20,6 +20,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseCmd; import com.cloud.api.Implementation; @@ -37,16 +38,16 @@ public class CreatePortForwardingServiceCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="account", type=CommandType.STRING, description="the account associated with the port forwarding service. Must be used with the domainId parameter.") + @Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, description="the account associated with the port forwarding service. Must be used with the domainId parameter.") private String accountName; - @Parameter(name="description", type=CommandType.STRING, description="an optional user generated description for the port forwarding service") + @Parameter(name=ApiConstants.DESCRIPTION, type=CommandType.STRING, description="an optional user generated description for the port forwarding service") private String description; - @Parameter(name="domainid", type=CommandType.LONG, description="the domain ID associated with the port forwarding service. If used with the account parameter, creates a new port forwarding service for the account in the specified domain ID.") + @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, description="the domain ID associated with the port forwarding service. If used with the account parameter, creates a new port forwarding service for the account in the specified domain ID.") private Long domainId; - @Parameter(name="name", type=CommandType.STRING, required=true, description="name of the port forwarding service") + @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, required=true, description="name of the port forwarding service") private String portForwardingServiceName; diff --git a/server/src/com/cloud/api/commands/CreatePortForwardingServiceRuleCmd.java b/server/src/com/cloud/api/commands/CreatePortForwardingServiceRuleCmd.java index c4786710ae0..d8d80d68ffd 100644 --- a/server/src/com/cloud/api/commands/CreatePortForwardingServiceRuleCmd.java +++ b/server/src/com/cloud/api/commands/CreatePortForwardingServiceRuleCmd.java @@ -20,6 +20,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseAsyncCreateCmd; import com.cloud.api.Implementation; @@ -40,16 +41,16 @@ public class CreatePortForwardingServiceRuleCmd extends BaseAsyncCreateCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="portforwardingserviceid", type=CommandType.LONG, required=true, description="the ID of the port forwarding service the rule is being created for") + @Parameter(name=ApiConstants.PORT_FORWARDING_SERVICE_ID, type=CommandType.LONG, required=true, description="the ID of the port forwarding service the rule is being created for") private Long portForwardingServiceId; - @Parameter(name="privateport", type=CommandType.STRING, required=true, description="the port of the private ip address/virtual machine to forward traffic to") + @Parameter(name=ApiConstants.PRIVATE_PORT, type=CommandType.STRING, required=true, description="the port of the private ip address/virtual machine to forward traffic to") private String privatePort; - @Parameter(name="protocol", type=CommandType.STRING, description="TCP is default. UDP is the other supported protocol") + @Parameter(name=ApiConstants.PROTOCOL, type=CommandType.STRING, description="TCP is default. UDP is the other supported protocol") private String protocol; - @Parameter(name="publicport", type=CommandType.STRING, required=true, description="the port of the public ip address to forward traffic from") + @Parameter(name=ApiConstants.PUBLIC_PORT, type=CommandType.STRING, required=true, description="the port of the public ip address to forward traffic from") private String publicPort; diff --git a/server/src/com/cloud/api/commands/CreateServiceOfferingCmd.java b/server/src/com/cloud/api/commands/CreateServiceOfferingCmd.java index 73dda4f700f..020178d4308 100644 --- a/server/src/com/cloud/api/commands/CreateServiceOfferingCmd.java +++ b/server/src/com/cloud/api/commands/CreateServiceOfferingCmd.java @@ -20,6 +20,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.BaseCmd; import com.cloud.api.Implementation; import com.cloud.api.Parameter; @@ -37,31 +38,31 @@ public class CreateServiceOfferingCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="cpunumber", type=CommandType.LONG, required=true, description="the CPU number of the service offering") + @Parameter(name=ApiConstants.CPU_NUMBER, type=CommandType.LONG, required=true, description="the CPU number of the service offering") private Long cpuNumber; - @Parameter(name="cpuspeed", type=CommandType.LONG, required=true, description="the CPU speed of the service offering in MHz.") + @Parameter(name=ApiConstants.CPU_SPEED, type=CommandType.LONG, required=true, description="the CPU speed of the service offering in MHz.") private Long cpuSpeed; - @Parameter(name="displaytext", type=CommandType.STRING, required=true, description="the display text of the service offering") + @Parameter(name=ApiConstants.DISPLAY_TEXT, type=CommandType.STRING, required=true, description="the display text of the service offering") private String displayText; - @Parameter(name="memory", type=CommandType.LONG, required=true, description="the total memory of the service offering in MB") + @Parameter(name=ApiConstants.MEMORY, type=CommandType.LONG, required=true, description="the total memory of the service offering in MB") private Long memory; - @Parameter(name="name", type=CommandType.STRING, required=true, description="the name of the service offering") + @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, required=true, description="the name of the service offering") private String serviceOfferingName; - @Parameter(name="offerha", type=CommandType.BOOLEAN, description="the HA for the service offering") + @Parameter(name=ApiConstants.OFFER_HA, type=CommandType.BOOLEAN, description="the HA for the service offering") private Boolean offerHa; - @Parameter(name="storagetype", type=CommandType.STRING, description="the storage type of the service offering. Values are local and shared.") + @Parameter(name=ApiConstants.STORAGE_TYPE, type=CommandType.STRING, description="the storage type of the service offering. Values are local and shared.") private String storageType; - @Parameter(name="tags", type=CommandType.STRING, description="the tags for this service offering.") + @Parameter(name=ApiConstants.TAGS, type=CommandType.STRING, description="the tags for this service offering.") private String tags; - @Parameter(name="usevirtualnetwork", type=CommandType.BOOLEAN, description="if true, the VM created will use default virtual networking. If false, the VM created will use a direct attached networking model. The default value is true.") + @Parameter(name=ApiConstants.USE_VIRTUAL_NETWORK, type=CommandType.BOOLEAN, description="if true, the VM created will use default virtual networking. If false, the VM created will use a direct attached networking model. The default value is true.") private Boolean useVirtualNetwork; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/CreateSnapshotCmd.java b/server/src/com/cloud/api/commands/CreateSnapshotCmd.java index 2996c266617..648cacc4e7d 100644 --- a/server/src/com/cloud/api/commands/CreateSnapshotCmd.java +++ b/server/src/com/cloud/api/commands/CreateSnapshotCmd.java @@ -20,6 +20,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseAsyncCreateCmd; import com.cloud.api.BaseCmd; @@ -43,13 +44,13 @@ public class CreateSnapshotCmd extends BaseAsyncCreateCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="account", type=CommandType.STRING, description="The account of the snapshot. The account parameter must be used with the domainId parameter.") + @Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, description="The account of the snapshot. The account parameter must be used with the domainId parameter.") private String accountName; - @Parameter(name="domainid", type=CommandType.LONG, description="The domain ID of the snapshot. If used with the account parameter, specifies a domain for the account associated with the disk volume.") + @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, description="The domain ID of the snapshot. If used with the account parameter, specifies a domain for the account associated with the disk volume.") private Long domainId; - @Parameter(name="volumeid", type=CommandType.LONG, required=true, description="The ID of the disk volume") + @Parameter(name=ApiConstants.VOLUME_ID, type=CommandType.LONG, required=true, description="The ID of the disk volume") private Long volumeId; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/CreateSnapshotInternalCmd.java b/server/src/com/cloud/api/commands/CreateSnapshotInternalCmd.java index 8dc46983d4c..c46c9544764 100644 --- a/server/src/com/cloud/api/commands/CreateSnapshotInternalCmd.java +++ b/server/src/com/cloud/api/commands/CreateSnapshotInternalCmd.java @@ -19,6 +19,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseAsyncCmd; import com.cloud.api.Implementation; @@ -40,10 +41,10 @@ public class CreateSnapshotInternalCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="policyid", type=CommandType.LONG) + @Parameter(name=ApiConstants.POLICY_ID, type=CommandType.LONG) private Long policyId; - @Parameter(name="volumeid", type=CommandType.LONG, required=true) + @Parameter(name=ApiConstants.VOLUME_ID, type=CommandType.LONG, required=true) private Long volumeId; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/CreateSnapshotPolicyCmd.java b/server/src/com/cloud/api/commands/CreateSnapshotPolicyCmd.java index 824dc248f22..8e8075f5a88 100644 --- a/server/src/com/cloud/api/commands/CreateSnapshotPolicyCmd.java +++ b/server/src/com/cloud/api/commands/CreateSnapshotPolicyCmd.java @@ -20,6 +20,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.BaseCmd; import com.cloud.api.Implementation; import com.cloud.api.Parameter; @@ -37,19 +38,19 @@ public class CreateSnapshotPolicyCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="account", type=CommandType.STRING, description="The account of the snapshot policy. The account parameter must be used with the domainId parameter.") + @Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, description="The account of the snapshot policy. The account parameter must be used with the domainId parameter.") private String accountName; - @Parameter(name="domainid", type=CommandType.LONG, description="The domain ID of the snapshot. If used with the account parameter, specifies a domain for the account associated with the snapshot policy.") + @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, description="The domain ID of the snapshot. If used with the account parameter, specifies a domain for the account associated with the snapshot policy.") private Long domainId; - @Parameter(name="intervaltype", type=CommandType.STRING, required=true, description="valid values are HOURLY, DAILY, WEEKLY, and MONTHLY") + @Parameter(name=ApiConstants.INTERVAL_TYPE, type=CommandType.STRING, required=true, description="valid values are HOURLY, DAILY, WEEKLY, and MONTHLY") private String intervalType; - @Parameter(name="maxsnaps", type=CommandType.INTEGER, required=true, description="maximum number of snapshots to retain") + @Parameter(name=ApiConstants.MAX_SNAPS, type=CommandType.INTEGER, required=true, description="maximum number of snapshots to retain") private Integer maxSnaps; - @Parameter(name="schedule", type=CommandType.STRING, required=true, description="time the snapshot is scheduled to be taken. " + + @Parameter(name=ApiConstants.SCHEDULE, type=CommandType.STRING, required=true, description="time the snapshot is scheduled to be taken. " + "Format is:" + "* if HOURLY, MM" + "* if DAILY, MM:HH" + @@ -57,10 +58,10 @@ public class CreateSnapshotPolicyCmd extends BaseCmd { "* if MONTHLY, MM:HH:DD (1-28)") private String schedule; - @Parameter(name="timezone", type=CommandType.STRING, required=true, description="Specifies a timezone for this command. For more information on the timezone parameter, see Time Zone Format.") + @Parameter(name=ApiConstants.TIMEZONE, type=CommandType.STRING, required=true, description="Specifies a timezone for this command. For more information on the timezone parameter, see Time Zone Format.") private String timezone; - @Parameter(name="volumeid", type=CommandType.LONG, required=true, description="the ID of the disk volume") + @Parameter(name=ApiConstants.VOLUME_ID, type=CommandType.LONG, required=true, description="the ID of the disk volume") private Long volumeId; diff --git a/server/src/com/cloud/api/commands/CreateStoragePoolCmd.java b/server/src/com/cloud/api/commands/CreateStoragePoolCmd.java index 98d70e40407..59d63218acd 100644 --- a/server/src/com/cloud/api/commands/CreateStoragePoolCmd.java +++ b/server/src/com/cloud/api/commands/CreateStoragePoolCmd.java @@ -22,6 +22,7 @@ import java.util.Map; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseCmd; import com.cloud.api.Implementation; @@ -43,25 +44,25 @@ public class CreateStoragePoolCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="clusterid", type=CommandType.LONG, description="the cluster ID for the storage pool") + @Parameter(name=ApiConstants.CLUSTER_ID, type=CommandType.LONG, description="the cluster ID for the storage pool") private Long clusterId; - @Parameter(name="details", type=CommandType.MAP, description="the details for the storage pool") + @Parameter(name=ApiConstants.DETAILS, type=CommandType.MAP, description="the details for the storage pool") private Map details; - @Parameter(name="name", type=CommandType.STRING, required=true, description="the name for the storage pool") + @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, required=true, description="the name for the storage pool") private String storagePoolName; - @Parameter(name="podid", type=CommandType.LONG, description="the Pod ID for the storage pool") + @Parameter(name=ApiConstants.POD_ID, type=CommandType.LONG, description="the Pod ID for the storage pool") private Long podId; - @Parameter(name="tags", type=CommandType.STRING, description="the tags for the storage pool") + @Parameter(name=ApiConstants.TAGS, type=CommandType.STRING, description="the tags for the storage pool") private String tags; - @Parameter(name="url", type=CommandType.STRING, required=true, description="the URL of the storage pool") + @Parameter(name=ApiConstants.URL, type=CommandType.STRING, required=true, description="the URL of the storage pool") private String url; - @Parameter(name="zoneid", type=CommandType.LONG, required=true, description="the Zone ID for the storage pool") + @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, required=true, description="the Zone ID for the storage pool") private Long zoneId; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/CreateTemplateCmd.java b/server/src/com/cloud/api/commands/CreateTemplateCmd.java index 08737488236..b4f9c03fc2a 100644 --- a/server/src/com/cloud/api/commands/CreateTemplateCmd.java +++ b/server/src/com/cloud/api/commands/CreateTemplateCmd.java @@ -20,6 +20,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseAsyncCreateCmd; import com.cloud.api.Implementation; @@ -47,34 +48,34 @@ public class CreateTemplateCmd extends BaseAsyncCreateCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="bits", type=CommandType.INTEGER) + @Parameter(name=ApiConstants.BITS, type=CommandType.INTEGER) private Integer bits; - @Parameter(name="displaytext", type=CommandType.STRING, required=true, description="the display text of the template. This is usually used for display purposes.") + @Parameter(name=ApiConstants.DISPLAY_TEXT, type=CommandType.STRING, required=true, description="the display text of the template. This is usually used for display purposes.") private String displayText; - @Parameter(name="isfeatured", type=CommandType.BOOLEAN, description="true if this template is a featured template, false otherwise") + @Parameter(name=ApiConstants.IS_FEATURED, type=CommandType.BOOLEAN, description="true if this template is a featured template, false otherwise") private Boolean featured; - @Parameter(name="ispublic", type=CommandType.BOOLEAN, description="true if this template is a public template, false otherwise") + @Parameter(name=ApiConstants.IS_PUBLIC, type=CommandType.BOOLEAN, description="true if this template is a public template, false otherwise") private Boolean publicTemplate; - @Parameter(name="name", type=CommandType.STRING, required=true, description="the name of the template") + @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, required=true, description="the name of the template") private String templateName; - @Parameter(name="ostypeid", type=CommandType.LONG, required=true, description=" the ID of the OS Type that best represents the OS of this template.") + @Parameter(name=ApiConstants.OS_TYPE_ID, type=CommandType.LONG, required=true, description=" the ID of the OS Type that best represents the OS of this template.") private Long osTypeId; - @Parameter(name="passwordenabled", type=CommandType.BOOLEAN, description="true if the template supports the password reset feature; default is false") + @Parameter(name=ApiConstants.PASSWORD_ENABLED, type=CommandType.BOOLEAN, description="true if the template supports the password reset feature; default is false") private Boolean passwordEnabled; - @Parameter(name="requireshvm", type=CommandType.BOOLEAN, description="true if the template requres HVM, false otherwise") + @Parameter(name=ApiConstants.REQUIRES_HVM, type=CommandType.BOOLEAN, description="true if the template requres HVM, false otherwise") private Boolean requiresHvm; - @Parameter(name="snapshotid", type=CommandType.LONG, description="the ID of the snapshot the template is being created from") + @Parameter(name=ApiConstants.SNAPSHOT_ID, type=CommandType.LONG, description="the ID of the snapshot the template is being created from") private Long snapshotId; - @Parameter(name="volumeid", type=CommandType.LONG, description="the ID of the disk volume the template is being created from") + @Parameter(name=ApiConstants.VOLUME_ID, type=CommandType.LONG, description="the ID of the disk volume the template is being created from") private Long volumeId; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/CreateUserCmd.java b/server/src/com/cloud/api/commands/CreateUserCmd.java index 5979fa2169b..c0fefc766d5 100644 --- a/server/src/com/cloud/api/commands/CreateUserCmd.java +++ b/server/src/com/cloud/api/commands/CreateUserCmd.java @@ -20,6 +20,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseCmd; import com.cloud.api.Implementation; @@ -37,34 +38,34 @@ public class CreateUserCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="account", type=CommandType.STRING, description="Creates the user under the specified account. If no account is specified, the username will be used as the account name.") + @Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, description="Creates the user under the specified account. If no account is specified, the username will be used as the account name.") private String accountName; - @Parameter(name="accounttype", type=CommandType.LONG, required=true, description="Type of the account. Specify 0 for user, 1 for root admin, and 2 for domain admin") + @Parameter(name=ApiConstants.ACCOUNT_TYPE, type=CommandType.LONG, required=true, description="Type of the account. Specify 0 for user, 1 for root admin, and 2 for domain admin") private Long accountType; - @Parameter(name="domainid", type=CommandType.LONG, description="Creates the user under the specified domain.") + @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, description="Creates the user under the specified domain.") private Long domainId; - @Parameter(name="email", type=CommandType.STRING, required=true, description="email") + @Parameter(name=ApiConstants.EMAIL, type=CommandType.STRING, required=true, description="email") private String email; - @Parameter(name="firstname", type=CommandType.STRING, required=true, description="firstname") + @Parameter(name=ApiConstants.FIRSTNAME, type=CommandType.STRING, required=true, description="firstname") private String firstname; - @Parameter(name="lastname", type=CommandType.STRING, required=true, description="lastname") + @Parameter(name=ApiConstants.LASTNAME, type=CommandType.STRING, required=true, description="lastname") private String lastname; - @Parameter(name="password", type=CommandType.STRING, required=true, description="Hashed password (Default is MD5). If you wish to use any other hashing algorithm, you would need to write a custom authentication adapter See Docs section.") + @Parameter(name=ApiConstants.PASSWORD, type=CommandType.STRING, required=true, description="Hashed password (Default is MD5). If you wish to use any other hashing algorithm, you would need to write a custom authentication adapter See Docs section.") private String password; - @Parameter(name="timezone", type=CommandType.STRING, description="Specifies a timezone for this command. For more information on the timezone parameter, see Time Zone Format.") + @Parameter(name=ApiConstants.TIMEZONE, type=CommandType.STRING, description="Specifies a timezone for this command. For more information on the timezone parameter, see Time Zone Format.") private String timezone; - @Parameter(name="username", type=CommandType.STRING, required=true, description="Unique username.") + @Parameter(name=ApiConstants.USERNAME, type=CommandType.STRING, required=true, description="Unique username.") private String username; - @Parameter(name="networkdomain", type=CommandType.STRING, description="Network domain name of the Vms that belong to the domain") + @Parameter(name=ApiConstants.NETWORK_DOMAIN, type=CommandType.STRING, description="Network domain name of the Vms that belong to the domain") private String networkdomain; diff --git a/server/src/com/cloud/api/commands/CreateVMGroupCmd.java b/server/src/com/cloud/api/commands/CreateVMGroupCmd.java index 3caaaba444d..bfb134d53c6 100644 --- a/server/src/com/cloud/api/commands/CreateVMGroupCmd.java +++ b/server/src/com/cloud/api/commands/CreateVMGroupCmd.java @@ -19,6 +19,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseCmd; import com.cloud.api.Implementation; @@ -38,13 +39,13 @@ public class CreateVMGroupCmd extends BaseCmd{ //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="name", type=CommandType.STRING, required=true, description="the name of the instance group") + @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, required=true, description="the name of the instance group") private String groupName; - @Parameter(name="account", type=CommandType.STRING, description="the account of the instance group. The account parameter must be used with the domainId parameter.") + @Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, description="the account of the instance group. The account parameter must be used with the domainId parameter.") private String accountName; - @Parameter(name="domainid", type=CommandType.LONG, description="the domain ID of account owning the instance group") + @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, description="the domain ID of account owning the instance group") private Long domainId; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/CreateVlanIpRangeCmd.java b/server/src/com/cloud/api/commands/CreateVlanIpRangeCmd.java index 0df8beff618..2cc951aee41 100644 --- a/server/src/com/cloud/api/commands/CreateVlanIpRangeCmd.java +++ b/server/src/com/cloud/api/commands/CreateVlanIpRangeCmd.java @@ -20,6 +20,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseCmd; import com.cloud.api.Implementation; @@ -38,37 +39,36 @@ public class CreateVlanIpRangeCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="account", type=CommandType.STRING, description="account who will own the VLAN. If VLAN is Zone wide, this parameter should be ommited") + @Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, description="account who will own the VLAN. If VLAN is Zone wide, this parameter should be ommited") private String accountName; - @Parameter(name="domainid", type=CommandType.LONG, description="domain ID of the account owning a VLAN") + @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, description="domain ID of the account owning a VLAN") private Long domainId; - @Parameter(name="endip", type=CommandType.STRING, description="the ending IP address in the VLAN IP range") + @Parameter(name=ApiConstants.END_IP, type=CommandType.STRING, description="the ending IP address in the VLAN IP range") private String endIp; - @Parameter(name="forvirtualnetwork", type=CommandType.BOOLEAN, description="true if VLAN is of Virtual type, false if Direct") + @Parameter(name=ApiConstants.FOR_VIRTUAL_NETWORK, type=CommandType.BOOLEAN, description="true if VLAN is of Virtual type, false if Direct") private Boolean forVirtualNetwork; - @Parameter(name="gateway", type=CommandType.STRING, required=true, description="the gateway of the VLAN IP range") + @Parameter(name=ApiConstants.GATEWAY, type=CommandType.STRING, required=true, description="the gateway of the VLAN IP range") private String gateway; - @Parameter(name="netmask", type=CommandType.STRING, required=true, description="the netmask of the VLAN IP range") + @Parameter(name=ApiConstants.NETMASK, type=CommandType.STRING, required=true, description="the netmask of the VLAN IP range") private String netmask; - @Parameter(name="podid", type=CommandType.LONG, description="optional parameter. Have to be specified for Direct Untagged vlan only.") + @Parameter(name=ApiConstants.POD_ID, type=CommandType.LONG, description="optional parameter. Have to be specified for Direct Untagged vlan only.") private Long podId; - @Parameter(name="startip", type=CommandType.STRING, required=true, description="the beginning IP address in the VLAN IP range") + @Parameter(name=ApiConstants.START_IP, type=CommandType.STRING, required=true, description="the beginning IP address in the VLAN IP range") private String startIp; - @Parameter(name="vlan", type=CommandType.STRING, description="the ID or VID of the VLAN. Default is an \"untagged\" VLAN.") + @Parameter(name=ApiConstants.VLAN, type=CommandType.STRING, description="the ID or VID of the VLAN. Default is an \"untagged\" VLAN.") private String vlan; - @Parameter(name="zoneid", type=CommandType.LONG, required=true, description=" the Zone ID of the VLAN IP range") + @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, required=true, description=" the Zone ID of the VLAN IP range") private Long zoneId; - ///////////////////////////////////////////////////// /////////////////// Accessors /////////////////////// ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/CreateVolumeCmd.java b/server/src/com/cloud/api/commands/CreateVolumeCmd.java index 7d712c4e74b..8d260258649 100644 --- a/server/src/com/cloud/api/commands/CreateVolumeCmd.java +++ b/server/src/com/cloud/api/commands/CreateVolumeCmd.java @@ -20,6 +20,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseAsyncCreateCmd; import com.cloud.api.Implementation; @@ -42,25 +43,25 @@ public class CreateVolumeCmd extends BaseAsyncCreateCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="account", type=CommandType.STRING, description="the account associated with the disk volume. Must be used with the domainId parameter.") + @Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, description="the account associated with the disk volume. Must be used with the domainId parameter.") private String accountName; - @Parameter(name="diskofferingid", type=CommandType.LONG, description="the ID of the disk offering. Either diskOfferingId or snapshotId must be passed in.") + @Parameter(name=ApiConstants.DISK_OFFERING_ID, type=CommandType.LONG, description="the ID of the disk offering. Either diskOfferingId or snapshotId must be passed in.") private Long diskOfferingId; - @Parameter(name="domainid", type=CommandType.LONG, description="the domain ID associated with the disk offering. If used with the account parameter returns the disk volume associated with the account for the specified domain.") + @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, description="the domain ID associated with the disk offering. If used with the account parameter returns the disk volume associated with the account for the specified domain.") private Long domainId; - @Parameter(name="name", type=CommandType.STRING, required=true, description="the name of the disk volume") + @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, required=true, description="the name of the disk volume") private String volumeName; - @Parameter(name="size", type=CommandType.LONG, description="Arbitrary volume size. Mutually exclusive with diskOfferingId") + @Parameter(name=ApiConstants.SIZE, type=CommandType.LONG, description="Arbitrary volume size. Mutually exclusive with diskOfferingId") private Long size; - @Parameter(name="snapshotid", type=CommandType.LONG, description="the snapshot ID for the disk volume. Either diskOfferingId or snapshotId must be passed in.") + @Parameter(name=ApiConstants.SNAPSHOT_ID, type=CommandType.LONG, description="the snapshot ID for the disk volume. Either diskOfferingId or snapshotId must be passed in.") private Long snapshotId; - @Parameter(name="zoneid", type=CommandType.LONG, description="the ID of the availability zone") + @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, description="the ID of the availability zone") private Long zoneId; diff --git a/server/src/com/cloud/api/commands/CreateZoneCmd.java b/server/src/com/cloud/api/commands/CreateZoneCmd.java index ea3a2208c0b..51d8fd3f55e 100644 --- a/server/src/com/cloud/api/commands/CreateZoneCmd.java +++ b/server/src/com/cloud/api/commands/CreateZoneCmd.java @@ -20,6 +20,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.BaseCmd; import com.cloud.api.Implementation; import com.cloud.api.Parameter; @@ -36,33 +37,35 @@ public class CreateZoneCmd extends BaseCmd { ///////////////////////////////////////////////////// //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="dns1", type=CommandType.STRING, required=true, description="the first DNS for the Zone") + + @Parameter(name=ApiConstants.DNS1, type=CommandType.STRING, required=true, description="the first DNS for the Zone") private String dns1; - @Parameter(name="dns2", type=CommandType.STRING, description="the second DNS for the Zone") + @Parameter(name=ApiConstants.DNS2, type=CommandType.STRING, description="the second DNS for the Zone") private String dns2; - @Parameter(name="guestcidraddress", type=CommandType.STRING, required=true, description="the guest CIDR address for the Zone") + @Parameter(name=ApiConstants.GUEST_CIDR_ADDRESS, type=CommandType.STRING, required=true, description="the guest CIDR address for the Zone") private String guestCidrAddress; - @Parameter(name="internaldns1", type=CommandType.STRING, required=true, description="the first internal DNS for the Zone") + @Parameter(name=ApiConstants.INTERNAL_DNS1, type=CommandType.STRING, required=true, description="the first internal DNS for the Zone") private String internalDns1; - @Parameter(name="internaldns2", type=CommandType.STRING, description="the second internal DNS for the Zone") + @Parameter(name=ApiConstants.INTERNAL_DNS2, type=CommandType.STRING, description="the second internal DNS for the Zone") private String internalDns2; - @Parameter(name="name", type=CommandType.STRING, required=true, description="the name of the Zone") + @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, required=true, description="the name of the Zone") private String zoneName; //FIXME - this parameter is called "vnet" in updateZone. Have to figure out which one is right - @Parameter(name="vlan", type=CommandType.STRING, description="the VNET for the Zone") + @Parameter(name=ApiConstants.VLAN, type=CommandType.STRING, description="the VNET for the Zone") private String vlan; - @Parameter(name="domain", type=CommandType.STRING, description="Domain name for the Vms in the zone") + @Parameter(name=ApiConstants.DOMAIN, type=CommandType.STRING, description="Domain name for the Vms in the zone") private String domain; - @Parameter(name="domainid", type=CommandType.LONG, description="the ID of the containing domain, null for public zones") + @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, description="the ID of the containing domain, null for public zones") private Long domainId; + ///////////////////////////////////////////////////// /////////////////// Accessors /////////////////////// ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/DeleteDiskOfferingCmd.java b/server/src/com/cloud/api/commands/DeleteDiskOfferingCmd.java index 29949338b09..3bfb59696a3 100644 --- a/server/src/com/cloud/api/commands/DeleteDiskOfferingCmd.java +++ b/server/src/com/cloud/api/commands/DeleteDiskOfferingCmd.java @@ -19,6 +19,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.BaseCmd; import com.cloud.api.Implementation; import com.cloud.api.Parameter; @@ -35,7 +36,7 @@ public class DeleteDiskOfferingCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true, description="ID of the disk offering") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="ID of the disk offering") private Long id; diff --git a/server/src/com/cloud/api/commands/DeleteDomainCmd.java b/server/src/com/cloud/api/commands/DeleteDomainCmd.java index fa39e2e4942..cddaa169105 100644 --- a/server/src/com/cloud/api/commands/DeleteDomainCmd.java +++ b/server/src/com/cloud/api/commands/DeleteDomainCmd.java @@ -19,6 +19,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseAsyncCmd; import com.cloud.api.BaseCmd; @@ -39,10 +40,10 @@ public class DeleteDomainCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true, description="ID of domain to delete") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="ID of domain to delete") private Long id; - @Parameter(name="cleanup", type=CommandType.BOOLEAN) + @Parameter(name=ApiConstants.CLEANUP, type=CommandType.BOOLEAN) private Boolean cleanup; diff --git a/server/src/com/cloud/api/commands/DeleteHostCmd.java b/server/src/com/cloud/api/commands/DeleteHostCmd.java index 5cf3028c831..6d3a9c8e5b7 100644 --- a/server/src/com/cloud/api/commands/DeleteHostCmd.java +++ b/server/src/com/cloud/api/commands/DeleteHostCmd.java @@ -21,6 +21,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; import com.cloud.agent.AgentManager; +import com.cloud.api.ApiConstants; import com.cloud.api.BaseCmd; import com.cloud.api.Implementation; import com.cloud.api.Parameter; @@ -38,7 +39,7 @@ public class DeleteHostCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true, description="the host ID") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="the host ID") private Long id; diff --git a/server/src/com/cloud/api/commands/DeleteIPForwardingRuleCmd.java b/server/src/com/cloud/api/commands/DeleteIPForwardingRuleCmd.java index 84fbd862759..5324366308f 100644 --- a/server/src/com/cloud/api/commands/DeleteIPForwardingRuleCmd.java +++ b/server/src/com/cloud/api/commands/DeleteIPForwardingRuleCmd.java @@ -19,6 +19,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.BaseCmd; import com.cloud.api.Implementation; import com.cloud.api.Parameter; @@ -34,7 +35,7 @@ public class DeleteIPForwardingRuleCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true, description="the ID of the port forwarding rule") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="the ID of the port forwarding rule") private Long id; diff --git a/server/src/com/cloud/api/commands/DeleteIsoCmd.java b/server/src/com/cloud/api/commands/DeleteIsoCmd.java index d7f59d17b51..ba360ca58da 100644 --- a/server/src/com/cloud/api/commands/DeleteIsoCmd.java +++ b/server/src/com/cloud/api/commands/DeleteIsoCmd.java @@ -19,6 +19,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseAsyncCmd; import com.cloud.api.BaseCmd; @@ -40,10 +41,10 @@ public class DeleteIsoCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true, description="the ID of the ISO file") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="the ID of the ISO file") private Long id; - @Parameter(name="zoneid", type=CommandType.LONG, description="the ID of the zone of the ISO file. If not specified, the ISO will be deleted from all the zones") + @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, description="the ID of the zone of the ISO file. If not specified, the ISO will be deleted from all the zones") private Long zoneId; diff --git a/server/src/com/cloud/api/commands/DeleteLoadBalancerRuleCmd.java b/server/src/com/cloud/api/commands/DeleteLoadBalancerRuleCmd.java index 62ccaa419d7..8d0ed39cda8 100644 --- a/server/src/com/cloud/api/commands/DeleteLoadBalancerRuleCmd.java +++ b/server/src/com/cloud/api/commands/DeleteLoadBalancerRuleCmd.java @@ -19,6 +19,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseAsyncCmd; import com.cloud.api.Implementation; @@ -37,7 +38,7 @@ public class DeleteLoadBalancerRuleCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true, description="the ID of the load balancer rule") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="the ID of the load balancer rule") private Long id; diff --git a/server/src/com/cloud/api/commands/DeleteNetworkGroupCmd.java b/server/src/com/cloud/api/commands/DeleteNetworkGroupCmd.java index e3a676254dc..b15b095dcf4 100644 --- a/server/src/com/cloud/api/commands/DeleteNetworkGroupCmd.java +++ b/server/src/com/cloud/api/commands/DeleteNetworkGroupCmd.java @@ -2,6 +2,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.BaseCmd; import com.cloud.api.Implementation; import com.cloud.api.Parameter; @@ -17,13 +18,13 @@ public class DeleteNetworkGroupCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="account", type=CommandType.STRING, description="the account of the network group. Must be specified with domain ID") + @Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, description="the account of the network group. Must be specified with domain ID") private String accountName; - @Parameter(name="domainid", type=CommandType.LONG, description="the domain ID of account owning the network group") + @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, description="the domain ID of account owning the network group") private Long domainId; - @Parameter(name="name", type=CommandType.STRING, required=true, description="the network group name") + @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, required=true, description="the network group name") private String networkGroupName; diff --git a/server/src/com/cloud/api/commands/DeletePodCmd.java b/server/src/com/cloud/api/commands/DeletePodCmd.java index 9ec4276f548..6a971239940 100644 --- a/server/src/com/cloud/api/commands/DeletePodCmd.java +++ b/server/src/com/cloud/api/commands/DeletePodCmd.java @@ -20,6 +20,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.BaseCmd; import com.cloud.api.Implementation; import com.cloud.api.Parameter; @@ -37,7 +38,7 @@ public class DeletePodCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true, description="the ID of the Pod") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="the ID of the Pod") private Long id; diff --git a/server/src/com/cloud/api/commands/DeletePoolCmd.java b/server/src/com/cloud/api/commands/DeletePoolCmd.java index 69c3a3410c8..07ed1c3a801 100644 --- a/server/src/com/cloud/api/commands/DeletePoolCmd.java +++ b/server/src/com/cloud/api/commands/DeletePoolCmd.java @@ -2,6 +2,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.BaseCmd; import com.cloud.api.Implementation; import com.cloud.api.Parameter; @@ -18,7 +19,7 @@ public class DeletePoolCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true, description="Storage pool id") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="Storage pool id") private Long id; diff --git a/server/src/com/cloud/api/commands/DeletePortForwardingServiceCmd.java b/server/src/com/cloud/api/commands/DeletePortForwardingServiceCmd.java index 9b9023b3cfa..16fe150ba64 100644 --- a/server/src/com/cloud/api/commands/DeletePortForwardingServiceCmd.java +++ b/server/src/com/cloud/api/commands/DeletePortForwardingServiceCmd.java @@ -20,6 +20,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseAsyncCmd; import com.cloud.api.BaseCmd; @@ -41,7 +42,7 @@ public class DeletePortForwardingServiceCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true, description="ID of the port forwarding service") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="ID of the port forwarding service") private Long id; diff --git a/server/src/com/cloud/api/commands/DeletePortForwardingServiceRuleCmd.java b/server/src/com/cloud/api/commands/DeletePortForwardingServiceRuleCmd.java index c823bde2d2b..8b0b873bb66 100644 --- a/server/src/com/cloud/api/commands/DeletePortForwardingServiceRuleCmd.java +++ b/server/src/com/cloud/api/commands/DeletePortForwardingServiceRuleCmd.java @@ -20,6 +20,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseAsyncCmd; import com.cloud.api.Implementation; @@ -41,7 +42,7 @@ public class DeletePortForwardingServiceRuleCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true, description="The ID of the port forwarding service rule") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="The ID of the port forwarding service rule") private Long id; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/DeletePreallocatedLunCmd.java b/server/src/com/cloud/api/commands/DeletePreallocatedLunCmd.java index 885eba60221..46990347470 100644 --- a/server/src/com/cloud/api/commands/DeletePreallocatedLunCmd.java +++ b/server/src/com/cloud/api/commands/DeletePreallocatedLunCmd.java @@ -17,6 +17,7 @@ */ package com.cloud.api.commands; +import com.cloud.api.ApiConstants; import com.cloud.api.BaseCmd; import com.cloud.api.Implementation; import com.cloud.api.Parameter; @@ -30,7 +31,7 @@ public class DeletePreallocatedLunCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true, description="preallocated LUN ID") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="preallocated LUN ID") private Long id; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/DeleteServiceOfferingCmd.java b/server/src/com/cloud/api/commands/DeleteServiceOfferingCmd.java index 49af19a1ed9..e200ed334ff 100644 --- a/server/src/com/cloud/api/commands/DeleteServiceOfferingCmd.java +++ b/server/src/com/cloud/api/commands/DeleteServiceOfferingCmd.java @@ -20,6 +20,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.BaseCmd; import com.cloud.api.Implementation; import com.cloud.api.Parameter; @@ -35,7 +36,7 @@ public class DeleteServiceOfferingCmd extends BaseCmd{ //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true, description="the ID of the service offering") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="the ID of the service offering") private Long id; diff --git a/server/src/com/cloud/api/commands/DeleteSnapshotCmd.java b/server/src/com/cloud/api/commands/DeleteSnapshotCmd.java index 8b0e0e7c176..5ee5fb87eab 100644 --- a/server/src/com/cloud/api/commands/DeleteSnapshotCmd.java +++ b/server/src/com/cloud/api/commands/DeleteSnapshotCmd.java @@ -20,6 +20,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseAsyncCmd; import com.cloud.api.Implementation; @@ -39,13 +40,13 @@ public class DeleteSnapshotCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="account", type=CommandType.STRING) + @Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING) private String accountName; - @Parameter(name="domainid", type=CommandType.LONG) + @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG) private Long domainId; - @Parameter(name="id", type=CommandType.LONG, required=true, description="The ID of the snapshot") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="The ID of the snapshot") private Long id; diff --git a/server/src/com/cloud/api/commands/DeleteSnapshotPoliciesCmd.java b/server/src/com/cloud/api/commands/DeleteSnapshotPoliciesCmd.java index 373a120fcec..c55712145f3 100644 --- a/server/src/com/cloud/api/commands/DeleteSnapshotPoliciesCmd.java +++ b/server/src/com/cloud/api/commands/DeleteSnapshotPoliciesCmd.java @@ -22,6 +22,7 @@ import java.util.List; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.BaseCmd; import com.cloud.api.Implementation; import com.cloud.api.Parameter; @@ -38,16 +39,16 @@ public class DeleteSnapshotPoliciesCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="account", type=CommandType.STRING) + @Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING) private String accountName; - @Parameter(name="domainid", type=CommandType.LONG) + @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG) private Long domainId; - @Parameter(name="id", type=CommandType.LONG, description="the Id of the snapshot") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, description="the Id of the snapshot") private Long id; - @Parameter(name="ids", type=CommandType.LIST, collectionType=CommandType.LONG, description="list of snapshots IDs separated by comma") + @Parameter(name=ApiConstants.IDS, type=CommandType.LIST, collectionType=CommandType.LONG, description="list of snapshots IDs separated by comma") private List ids; diff --git a/server/src/com/cloud/api/commands/DeleteTemplateCmd.java b/server/src/com/cloud/api/commands/DeleteTemplateCmd.java index b7649b466aa..6d454d46da8 100644 --- a/server/src/com/cloud/api/commands/DeleteTemplateCmd.java +++ b/server/src/com/cloud/api/commands/DeleteTemplateCmd.java @@ -20,6 +20,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseAsyncCmd; import com.cloud.api.Implementation; @@ -39,10 +40,10 @@ public class DeleteTemplateCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true, description="the ID of the template") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="the ID of the template") private Long id; - @Parameter(name="zoneid", type=CommandType.LONG, description="the ID of zone of the template") + @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, description="the ID of zone of the template") private Long zoneId; diff --git a/server/src/com/cloud/api/commands/DeleteUserCmd.java b/server/src/com/cloud/api/commands/DeleteUserCmd.java index c7a9a0d9d9d..a2470157183 100644 --- a/server/src/com/cloud/api/commands/DeleteUserCmd.java +++ b/server/src/com/cloud/api/commands/DeleteUserCmd.java @@ -20,6 +20,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseAsyncCmd; import com.cloud.api.Implementation; @@ -40,7 +41,7 @@ public class DeleteUserCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true, description="User id") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="User id") private Long id; diff --git a/server/src/com/cloud/api/commands/DeleteVMGroupCmd.java b/server/src/com/cloud/api/commands/DeleteVMGroupCmd.java index 2419098cd48..fbbe3814cc1 100644 --- a/server/src/com/cloud/api/commands/DeleteVMGroupCmd.java +++ b/server/src/com/cloud/api/commands/DeleteVMGroupCmd.java @@ -19,6 +19,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.BaseCmd; import com.cloud.api.Implementation; import com.cloud.api.Parameter; @@ -34,7 +35,7 @@ public class DeleteVMGroupCmd extends BaseCmd{ //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true, description="the ID of the instance group") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="the ID of the instance group") private Long id; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/DeleteVlanIpRangeCmd.java b/server/src/com/cloud/api/commands/DeleteVlanIpRangeCmd.java index daa6ea40cf9..49d4ee382a2 100644 --- a/server/src/com/cloud/api/commands/DeleteVlanIpRangeCmd.java +++ b/server/src/com/cloud/api/commands/DeleteVlanIpRangeCmd.java @@ -20,6 +20,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.BaseCmd; import com.cloud.api.Implementation; import com.cloud.api.Parameter; @@ -36,7 +37,7 @@ public class DeleteVlanIpRangeCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true, description="the id of the VLAN IP range") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="the id of the VLAN IP range") private Long id; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/DeleteVolumeCmd.java b/server/src/com/cloud/api/commands/DeleteVolumeCmd.java index eb3cad2cfdf..3b091bb0b99 100644 --- a/server/src/com/cloud/api/commands/DeleteVolumeCmd.java +++ b/server/src/com/cloud/api/commands/DeleteVolumeCmd.java @@ -20,6 +20,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.BaseCmd; import com.cloud.api.Implementation; import com.cloud.api.Parameter; @@ -35,7 +36,7 @@ public class DeleteVolumeCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true, description="The ID of the disk volume") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="The ID of the disk volume") private Long id; diff --git a/server/src/com/cloud/api/commands/DeleteZoneCmd.java b/server/src/com/cloud/api/commands/DeleteZoneCmd.java index 01c4d8e86eb..9e928980282 100644 --- a/server/src/com/cloud/api/commands/DeleteZoneCmd.java +++ b/server/src/com/cloud/api/commands/DeleteZoneCmd.java @@ -20,6 +20,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.BaseCmd; import com.cloud.api.Implementation; import com.cloud.api.Parameter; @@ -36,7 +37,7 @@ public class DeleteZoneCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true, description="the ID of the Zone") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="the ID of the Zone") private Long id; diff --git a/server/src/com/cloud/api/commands/DeployVMCmd.java b/server/src/com/cloud/api/commands/DeployVMCmd.java index 4251c380a3f..52cd448a207 100644 --- a/server/src/com/cloud/api/commands/DeployVMCmd.java +++ b/server/src/com/cloud/api/commands/DeployVMCmd.java @@ -22,6 +22,7 @@ import java.util.List; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseAsyncCmd; import com.cloud.api.BaseCmd; @@ -49,44 +50,44 @@ public class DeployVMCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="account", type=CommandType.STRING, description="an optional account for the virtual machine. Must be used with domainId.") + @Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, description="an optional account for the virtual machine. Must be used with domainId.") private String accountName; - @Parameter(name="diskofferingid", type=CommandType.LONG, description="the ID of the disk offering for the virtual machine. If the template is of ISO format, the diskOfferingId is for the root disk volume. Otherwise this parameter is used to dinidcate the offering for the data disk volume. If the templateId parameter passed is from a Template object, the diskOfferingId refers to a DATA Disk Volume created. If the templateId parameter passed is from an ISO object, the diskOfferingId refers to a ROOT Disk Volume created.") + @Parameter(name=ApiConstants.DISK_OFFERING_ID, type=CommandType.LONG, description="the ID of the disk offering for the virtual machine. If the template is of ISO format, the diskOfferingId is for the root disk volume. Otherwise this parameter is used to dinidcate the offering for the data disk volume. If the templateId parameter passed is from a Template object, the diskOfferingId refers to a DATA Disk Volume created. If the templateId parameter passed is from an ISO object, the diskOfferingId refers to a ROOT Disk Volume created.") private Long diskOfferingId; - @Parameter(name="displayname", type=CommandType.STRING, description="an optional user generated name for the virtual machine") + @Parameter(name=ApiConstants.DISPLAY_NAME, type=CommandType.STRING, description="an optional user generated name for the virtual machine") private String displayName; - @Parameter(name="domainid", type=CommandType.LONG, description="an optional domainId for the virtual machine. If the account parameter is used, domainId must also be used.") + @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, description="an optional domainId for the virtual machine. If the account parameter is used, domainId must also be used.") private Long domainId; - @Parameter(name="group", type=CommandType.STRING, description="an optional group for the virtual machine") + @Parameter(name=ApiConstants.GROUP, type=CommandType.STRING, description="an optional group for the virtual machine") private String group; - @Parameter(name="hypervisor", type=CommandType.STRING, description="the hypervisor on which to deploy the virtual machine") + @Parameter(name=ApiConstants.HYPERVISOR, type=CommandType.STRING, description="the hypervisor on which to deploy the virtual machine") private String hypervisor; - @Parameter(name="networkgrouplist", type=CommandType.LIST, collectionType=CommandType.STRING, description="comma separated list of network groups that going to be applied to the virtual machine. Should be passed only when vm is created from service offering with Direct Attach Network support") + @Parameter(name=ApiConstants.NETWORK_GROUP_LIST, type=CommandType.LIST, collectionType=CommandType.STRING, description="comma separated list of network groups that going to be applied to the virtual machine. Should be passed only when vm is created from service offering with Direct Attach Network support") private List networkGroupList; - @Parameter(name="serviceofferingid", type=CommandType.LONG, required=true, description="the ID of the service offering for the virtual machine") + @Parameter(name=ApiConstants.SERVICE_OFFERING_ID, type=CommandType.LONG, required=true, description="the ID of the service offering for the virtual machine") private Long serviceOfferingId; - @Parameter(name="size", type=CommandType.LONG, description="the arbitrary size for the DATADISK volume. Mutually exclusive with diskOfferingId") + @Parameter(name=ApiConstants.SIZE, type=CommandType.LONG, description="the arbitrary size for the DATADISK volume. Mutually exclusive with diskOfferingId") private Long size; - @Parameter(name="templateid", type=CommandType.LONG, required=true, description="the ID of the template for the virtual machine") + @Parameter(name=ApiConstants.TEMPLATE_ID, type=CommandType.LONG, required=true, description="the ID of the template for the virtual machine") private Long templateId; - @Parameter(name="userdata", type=CommandType.STRING, description="an optional binary data that can be sent to the virtual machine upon a successful deployment. This binary data must be base64 encoded before adding it to the request. Currently only HTTP GET is supported. Using HTTP GET (via querystring), you can send up to 2KB of data after base64 encoding.") + @Parameter(name=ApiConstants.USER_DATA, type=CommandType.STRING, description="an optional binary data that can be sent to the virtual machine upon a successful deployment. This binary data must be base64 encoded before adding it to the request. Currently only HTTP GET is supported. Using HTTP GET (via querystring), you can send up to 2KB of data after base64 encoding.") private String userData; - @Parameter(name="zoneid", type=CommandType.LONG, required=true, description="availability zone for the virtual machine") + @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, required=true, description="availability zone for the virtual machine") private Long zoneId; // unexposed parameter needed for serializing/deserializing the command - @Parameter(name="password", type=CommandType.STRING, expose=false) + @Parameter(name=ApiConstants.PASSWORD, type=CommandType.STRING, expose=false) private String password; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/DeployVm2Cmd.java b/server/src/com/cloud/api/commands/DeployVm2Cmd.java index bc1e56edce3..a0c74f5d6a7 100644 --- a/server/src/com/cloud/api/commands/DeployVm2Cmd.java +++ b/server/src/com/cloud/api/commands/DeployVm2Cmd.java @@ -22,6 +22,7 @@ import java.util.List; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseAsyncCreateCmd; import com.cloud.api.BaseCmd; @@ -48,44 +49,44 @@ public class DeployVm2Cmd extends BaseAsyncCreateCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="account", type=CommandType.STRING, description="an optional account for the virtual machine. Must be used with domainId.") + @Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, description="an optional account for the virtual machine. Must be used with domainId.") private String accountName; - @Parameter(name="diskofferingid", type=CommandType.LONG, description="the ID of the disk offering for the virtual machine. If the template is of ISO format, the diskOfferingId is for the root disk volume. Otherwise this parameter is used to dinidcate the offering for the data disk volume. If the templateId parameter passed is from a Template object, the diskOfferingId refers to a DATA Disk Volume created. If the templateId parameter passed is from an ISO object, the diskOfferingId refers to a ROOT Disk Volume created.") + @Parameter(name=ApiConstants.DISK_OFFERING_ID, type=CommandType.LONG, description="the ID of the disk offering for the virtual machine. If the template is of ISO format, the diskOfferingId is for the root disk volume. Otherwise this parameter is used to dinidcate the offering for the data disk volume. If the templateId parameter passed is from a Template object, the diskOfferingId refers to a DATA Disk Volume created. If the templateId parameter passed is from an ISO object, the diskOfferingId refers to a ROOT Disk Volume created.") private Long diskOfferingId; - @Parameter(name="displayname", type=CommandType.STRING, description="an optional user generated name for the virtual machine") + @Parameter(name=ApiConstants.DISPLAY_NAME, type=CommandType.STRING, description="an optional user generated name for the virtual machine") private String displayName; - @Parameter(name="domainid", type=CommandType.LONG, description="an optional domainId for the virtual machine. If the account parameter is used, domainId must also be used.") + @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, description="an optional domainId for the virtual machine. If the account parameter is used, domainId must also be used.") private Long domainId; - @Parameter(name="group", type=CommandType.STRING, description="an optional group for the virtual machine") + @Parameter(name=ApiConstants.GROUP, type=CommandType.STRING, description="an optional group for the virtual machine") private String group; - @Parameter(name="hypervisor", type=CommandType.STRING, description="the hypervisor on which to deploy the virtual machine") + @Parameter(name=ApiConstants.HYPERVISOR, type=CommandType.STRING, description="the hypervisor on which to deploy the virtual machine") private String hypervisor; - @Parameter(name="networkgrouplist", type=CommandType.LIST, collectionType=CommandType.STRING, description="comma separated list of network groups that going to be applied to the virtual machine. Should be passed only when vm is created from service offering with Direct Attach Network support") + @Parameter(name=ApiConstants.NETWORK_GROUP_LIST, type=CommandType.LIST, collectionType=CommandType.STRING, description="comma separated list of network groups that going to be applied to the virtual machine. Should be passed only when vm is created from service offering with Direct Attach Network support") private List networkGroupList; - @Parameter(name="serviceofferingid", type=CommandType.LONG, required=true, description="the ID of the service offering for the virtual machine") + @Parameter(name=ApiConstants.SERVICE_OFFERING_ID, type=CommandType.LONG, required=true, description="the ID of the service offering for the virtual machine") private Long serviceOfferingId; - @Parameter(name="size", type=CommandType.LONG, description="the arbitrary size for the DATADISK volume. Mutually exclusive with diskOfferingId") + @Parameter(name=ApiConstants.SIZE, type=CommandType.LONG, description="the arbitrary size for the DATADISK volume. Mutually exclusive with diskOfferingId") private Long size; - @Parameter(name="templateid", type=CommandType.LONG, required=true, description="the ID of the template for the virtual machine") + @Parameter(name=ApiConstants.TEMPLATE_ID, type=CommandType.LONG, required=true, description="the ID of the template for the virtual machine") private Long templateId; - @Parameter(name="userdata", type=CommandType.STRING, description="an optional binary data that can be sent to the virtual machine upon a successful deployment. This binary data must be base64 encoded before adding it to the request. Currently only HTTP GET is supported. Using HTTP GET (via querystring), you can send up to 2KB of data after base64 encoding.") + @Parameter(name=ApiConstants.USER_DATA, type=CommandType.STRING, description="an optional binary data that can be sent to the virtual machine upon a successful deployment. This binary data must be base64 encoded before adding it to the request. Currently only HTTP GET is supported. Using HTTP GET (via querystring), you can send up to 2KB of data after base64 encoding.") private String userData; - @Parameter(name="zoneid", type=CommandType.LONG, required=true, description="availability zone for the virtual machine") + @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, required=true, description="availability zone for the virtual machine") private Long zoneId; // unexposed parameter needed for serializing/deserializing the command - @Parameter(name="password", type=CommandType.STRING, expose=false) + @Parameter(name=ApiConstants.PASSWORD, type=CommandType.STRING, expose=false) private String password; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/DestroyConsoleProxyCmd.java b/server/src/com/cloud/api/commands/DestroyConsoleProxyCmd.java index 4cbe03a4a98..039d921d660 100644 --- a/server/src/com/cloud/api/commands/DestroyConsoleProxyCmd.java +++ b/server/src/com/cloud/api/commands/DestroyConsoleProxyCmd.java @@ -20,6 +20,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.BaseAsyncCmd; import com.cloud.api.Implementation; import com.cloud.api.Parameter; @@ -39,7 +40,7 @@ public class DestroyConsoleProxyCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true, description="console proxy ID") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="console proxy ID") private Long id; diff --git a/server/src/com/cloud/api/commands/DestroyVMCmd.java b/server/src/com/cloud/api/commands/DestroyVMCmd.java index a9985282830..87521a970ae 100644 --- a/server/src/com/cloud/api/commands/DestroyVMCmd.java +++ b/server/src/com/cloud/api/commands/DestroyVMCmd.java @@ -19,6 +19,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseAsyncCmd; import com.cloud.api.BaseCmd; @@ -43,7 +44,7 @@ public class DestroyVMCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true, description="The ID of the virtual machine") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="The ID of the virtual machine") private Long id; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/DetachIsoCmd.java b/server/src/com/cloud/api/commands/DetachIsoCmd.java index 7538bac9de7..8c4a8beb4e3 100644 --- a/server/src/com/cloud/api/commands/DetachIsoCmd.java +++ b/server/src/com/cloud/api/commands/DetachIsoCmd.java @@ -19,6 +19,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseAsyncCmd; import com.cloud.api.Implementation; @@ -39,7 +40,7 @@ public class DetachIsoCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="virtualmachineid", type=CommandType.LONG, required=true, description=" The ID of the virtual machine") + @Parameter(name=ApiConstants.VIRTUAL_MACHINE_ID, type=CommandType.LONG, required=true, description=" The ID of the virtual machine") private Long virtualMachineId; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/DetachVolumeCmd.java b/server/src/com/cloud/api/commands/DetachVolumeCmd.java index 4e239b588d2..6f58b7675ba 100755 --- a/server/src/com/cloud/api/commands/DetachVolumeCmd.java +++ b/server/src/com/cloud/api/commands/DetachVolumeCmd.java @@ -19,6 +19,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseAsyncCmd; import com.cloud.api.Implementation; @@ -39,13 +40,13 @@ public class DetachVolumeCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, description="the ID of the disk volume") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, description="the ID of the disk volume") private Long id; - @Parameter(name="deviceid", type=CommandType.LONG, description="the device ID on the virtual machine where volume is detached from") + @Parameter(name=ApiConstants.DEVICE_ID, type=CommandType.LONG, description="the device ID on the virtual machine where volume is detached from") private Long deviceId; - @Parameter(name="virtualmachineid", type=CommandType.LONG, description="the ID of the virtual machine where the volume is detached from") + @Parameter(name=ApiConstants.VIRTUAL_MACHINE_ID, type=CommandType.LONG, description="the ID of the virtual machine where the volume is detached from") private Long virtualMachineId; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/DisableAccountCmd.java b/server/src/com/cloud/api/commands/DisableAccountCmd.java index cdc1d3c6c23..5e7cdb14af4 100644 --- a/server/src/com/cloud/api/commands/DisableAccountCmd.java +++ b/server/src/com/cloud/api/commands/DisableAccountCmd.java @@ -19,6 +19,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.BaseAsyncCmd; import com.cloud.api.Implementation; import com.cloud.api.Parameter; @@ -37,10 +38,10 @@ public class DisableAccountCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="account", type=CommandType.STRING, required=true, description="Disables specified account.") + @Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, required=true, description="Disables specified account.") private String accountName; - @Parameter(name="domainid", type=CommandType.LONG, required=true, description="Disables specified account in this domain.") + @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, required=true, description="Disables specified account in this domain.") private Long domainId; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/DisableUserCmd.java b/server/src/com/cloud/api/commands/DisableUserCmd.java index b5321b7051c..a9a9df331a9 100644 --- a/server/src/com/cloud/api/commands/DisableUserCmd.java +++ b/server/src/com/cloud/api/commands/DisableUserCmd.java @@ -19,6 +19,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.BaseAsyncCmd; import com.cloud.api.Implementation; import com.cloud.api.Parameter; @@ -36,7 +37,7 @@ public class DisableUserCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true, description="Disables user by user ID.") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="Disables user by user ID.") private Long id; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/DisassociateIPAddrCmd.java b/server/src/com/cloud/api/commands/DisassociateIPAddrCmd.java index 931becaa4eb..5b7f5f8edcf 100644 --- a/server/src/com/cloud/api/commands/DisassociateIPAddrCmd.java +++ b/server/src/com/cloud/api/commands/DisassociateIPAddrCmd.java @@ -19,6 +19,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.BaseCmd; import com.cloud.api.Implementation; import com.cloud.api.Parameter; @@ -35,7 +36,7 @@ public class DisassociateIPAddrCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="ipaddress", type=CommandType.STRING, required=true, description="the public ip address to disassociate") + @Parameter(name=ApiConstants.IP_ADDRESS, type=CommandType.STRING, required=true, description="the public ip address to disassociate") private String ipAddress; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/EnableAccountCmd.java b/server/src/com/cloud/api/commands/EnableAccountCmd.java index ee67753df67..2bdc3fcd444 100644 --- a/server/src/com/cloud/api/commands/EnableAccountCmd.java +++ b/server/src/com/cloud/api/commands/EnableAccountCmd.java @@ -19,6 +19,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.BaseCmd; import com.cloud.api.Implementation; import com.cloud.api.Parameter; @@ -35,10 +36,10 @@ public class EnableAccountCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="account", type=CommandType.STRING, description="Enables specified account.") + @Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, description="Enables specified account.") private String accountName; - @Parameter(name="domainid", type=CommandType.LONG, description="Enables specified account in this domain.") + @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, description="Enables specified account in this domain.") private Long domainId; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/EnableUserCmd.java b/server/src/com/cloud/api/commands/EnableUserCmd.java index 810d0b41a03..85664a5b532 100644 --- a/server/src/com/cloud/api/commands/EnableUserCmd.java +++ b/server/src/com/cloud/api/commands/EnableUserCmd.java @@ -20,6 +20,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.BaseCmd; import com.cloud.api.Implementation; import com.cloud.api.Parameter; @@ -36,7 +37,7 @@ public class EnableUserCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true, description="Enables user by user ID.") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="Enables user by user ID.") private Long id; diff --git a/server/src/com/cloud/api/commands/ExtractIsoCmd.java b/server/src/com/cloud/api/commands/ExtractIsoCmd.java index f35ca5354e2..3e0095a5c1e 100755 --- a/server/src/com/cloud/api/commands/ExtractIsoCmd.java +++ b/server/src/com/cloud/api/commands/ExtractIsoCmd.java @@ -19,6 +19,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseAsyncCmd; import com.cloud.api.Implementation; @@ -40,16 +41,16 @@ public class ExtractIsoCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true, description="the ID of the ISO file") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="the ID of the ISO file") private Long id; - @Parameter(name="url", type=CommandType.STRING, required=false, description="the url to which the ISO would be extracted") + @Parameter(name=ApiConstants.URL, type=CommandType.STRING, required=false, description="the url to which the ISO would be extracted") private String url; - @Parameter(name="zoneid", type=CommandType.LONG, required=true, description="the ID of the zone where the ISO is originally located") + @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, required=true, description="the ID of the zone where the ISO is originally located") private Long zoneId; - @Parameter(name="mode", type=CommandType.STRING, required=true, description="the mode of extraction - HTTP_DOWNLOAD or FTP_UPLOAD") + @Parameter(name=ApiConstants.MODE, type=CommandType.STRING, required=true, description="the mode of extraction - HTTP_DOWNLOAD or FTP_UPLOAD") private String mode; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/ExtractTemplateCmd.java b/server/src/com/cloud/api/commands/ExtractTemplateCmd.java index 7a745421b50..1765869cd79 100755 --- a/server/src/com/cloud/api/commands/ExtractTemplateCmd.java +++ b/server/src/com/cloud/api/commands/ExtractTemplateCmd.java @@ -19,6 +19,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseAsyncCmd; import com.cloud.api.Implementation; @@ -40,16 +41,16 @@ public class ExtractTemplateCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true, description="the ID of the template") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="the ID of the template") private Long id; - @Parameter(name="url", type=CommandType.STRING, required=false, description="the url to which the ISO would be extracted") + @Parameter(name=ApiConstants.URL, type=CommandType.STRING, required=false, description="the url to which the ISO would be extracted") private String url; - @Parameter(name="zoneid", type=CommandType.LONG, required=true, description="the ID of the zone where the ISO is originally located" ) + @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, required=true, description="the ID of the zone where the ISO is originally located" ) private Long zoneId; - @Parameter(name="mode", type=CommandType.STRING, required=true, description="the mode of extraction - HTTP_DOWNLOAD or FTP_UPLOAD") + @Parameter(name=ApiConstants.MODE, type=CommandType.STRING, required=true, description="the mode of extraction - HTTP_DOWNLOAD or FTP_UPLOAD") private String mode; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/ExtractVolumeCmd.java b/server/src/com/cloud/api/commands/ExtractVolumeCmd.java index f19aa843e43..94558f46bd7 100755 --- a/server/src/com/cloud/api/commands/ExtractVolumeCmd.java +++ b/server/src/com/cloud/api/commands/ExtractVolumeCmd.java @@ -19,6 +19,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseAsyncCmd; import com.cloud.api.Implementation; @@ -40,18 +41,18 @@ public class ExtractVolumeCmd extends BaseAsyncCmd { ///////////////////////////////////////////////////// //FIXME - add description - @Parameter(name="id", type=CommandType.LONG, required=true, description="the ID of the volume") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="the ID of the volume") private Long id; //FIXME - add description - @Parameter(name="url", type=CommandType.STRING, required=false, description="the url to which the volume would be extracted") + @Parameter(name=ApiConstants.URL, type=CommandType.STRING, required=false, description="the url to which the volume would be extracted") private String url; //FIXME - add description - @Parameter(name="zoneid", type=CommandType.LONG, required=true, description="the ID of the zone where the volume is located") + @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, required=true, description="the ID of the zone where the volume is located") private Long zoneId; - @Parameter(name="mode", type=CommandType.STRING, required=true, description="the mode of extraction - HTTP_DOWNLOAD or FTP_UPLOAD") + @Parameter(name=ApiConstants.MODE, type=CommandType.STRING, required=true, description="the mode of extraction - HTTP_DOWNLOAD or FTP_UPLOAD") private String mode; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/GetCloudIdentifierCmd.java b/server/src/com/cloud/api/commands/GetCloudIdentifierCmd.java index 9803d7422b1..ab9a42e0189 100644 --- a/server/src/com/cloud/api/commands/GetCloudIdentifierCmd.java +++ b/server/src/com/cloud/api/commands/GetCloudIdentifierCmd.java @@ -22,6 +22,7 @@ import java.util.ArrayList; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.BaseCmd; import com.cloud.api.Implementation; import com.cloud.api.Parameter; @@ -38,7 +39,7 @@ public class GetCloudIdentifierCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="userid", type=CommandType.LONG, required=true, description="the user ID for the cloud identifier") + @Parameter(name=ApiConstants.USER_ID, type=CommandType.LONG, required=true, description="the user ID for the cloud identifier") private Long userid; diff --git a/server/src/com/cloud/api/commands/ListAccountsCmd.java b/server/src/com/cloud/api/commands/ListAccountsCmd.java index fd660be7f55..4fc19da84dd 100644 --- a/server/src/com/cloud/api/commands/ListAccountsCmd.java +++ b/server/src/com/cloud/api/commands/ListAccountsCmd.java @@ -23,6 +23,7 @@ import java.util.List; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseCmd; import com.cloud.api.BaseListCmd; @@ -49,25 +50,25 @@ public class ListAccountsCmd extends BaseListCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="account", type=CommandType.STRING, description="list account for a specified account. Must be used with the domainId parameter.") + @Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, description="list account for a specified account. Must be used with the domainId parameter.") private String accountName; - @Parameter(name="accounttype", type=CommandType.LONG, description="list accounts by account type. Valid account types are 1 (admin), 2 (domain-admin), and 0 (user).") + @Parameter(name=ApiConstants.ACCOUNT_TYPE, type=CommandType.LONG, description="list accounts by account type. Valid account types are 1 (admin), 2 (domain-admin), and 0 (user).") private Long accountType; - @Parameter(name="domainid", type=CommandType.LONG, description="list all accounts in specified domain. If used with the account parameter, retrieves account information for specified account in specified domain.") + @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, description="list all accounts in specified domain. If used with the account parameter, retrieves account information for specified account in specified domain.") private Long domainId; - @Parameter(name="id", type=CommandType.LONG, description="list account by account ID") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, description="list account by account ID") private Long id; - @Parameter(name="iscleanuprequired", type=CommandType.BOOLEAN, description="list accounts by cleanuprequred attribute (values are true or false)") + @Parameter(name=ApiConstants.IS_CLEANUP_REQUIRED, type=CommandType.BOOLEAN, description="list accounts by cleanuprequred attribute (values are true or false)") private Boolean cleanupRequired; - @Parameter(name="name", type=CommandType.STRING, description="list account by account name") + @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="list account by account name") private String searchName; - @Parameter(name="state", type=CommandType.STRING, description="list accounts by state. Valid states are enabled, disabled, and locked.") + @Parameter(name=ApiConstants.STATE, type=CommandType.STRING, description="list accounts by state. Valid states are enabled, disabled, and locked.") private String state; diff --git a/server/src/com/cloud/api/commands/ListAlertsCmd.java b/server/src/com/cloud/api/commands/ListAlertsCmd.java index 80674de3ffe..da341b554dc 100644 --- a/server/src/com/cloud/api/commands/ListAlertsCmd.java +++ b/server/src/com/cloud/api/commands/ListAlertsCmd.java @@ -23,6 +23,7 @@ import java.util.List; import org.apache.log4j.Logger; import com.cloud.alert.AlertVO; +import com.cloud.api.ApiConstants; import com.cloud.api.BaseListCmd; import com.cloud.api.Implementation; import com.cloud.api.Parameter; @@ -40,7 +41,7 @@ public class ListAlertsCmd extends BaseListCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="type", type=CommandType.STRING, description="list by alert type") + @Parameter(name=ApiConstants.TYPE, type=CommandType.STRING, description="list by alert type") private String type; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/ListAsyncJobsCmd.java b/server/src/com/cloud/api/commands/ListAsyncJobsCmd.java index 53ebd75a195..13b0a19a4c2 100644 --- a/server/src/com/cloud/api/commands/ListAsyncJobsCmd.java +++ b/server/src/com/cloud/api/commands/ListAsyncJobsCmd.java @@ -21,6 +21,7 @@ import java.util.ArrayList; import java.util.Date; import java.util.List; +import com.cloud.api.ApiConstants; import com.cloud.api.BaseListCmd; import com.cloud.api.Implementation; import com.cloud.api.Parameter; @@ -38,13 +39,13 @@ public class ListAsyncJobsCmd extends BaseListCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="account", type=CommandType.STRING, description="the account associated with the async job. Must be used with the domainId parameter.") + @Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, description="the account associated with the async job. Must be used with the domainId parameter.") private String accountName; - @Parameter(name="domainid", type=CommandType.LONG, description="the domain ID associated with the async job. If used with the account parameter, returns async jobs for the account in the specified domain.") + @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, description="the domain ID associated with the async job. If used with the account parameter, returns async jobs for the account in the specified domain.") private Long domainId; - @Parameter(name="startdate", type=CommandType.TZDATE, description="the start date of the async job") + @Parameter(name=ApiConstants.START_DATE, type=CommandType.TZDATE, description="the start date of the async job") private Date startDate; diff --git a/server/src/com/cloud/api/commands/ListCapacityCmd.java b/server/src/com/cloud/api/commands/ListCapacityCmd.java index 348318ad3ab..13064a0cb64 100644 --- a/server/src/com/cloud/api/commands/ListCapacityCmd.java +++ b/server/src/com/cloud/api/commands/ListCapacityCmd.java @@ -29,6 +29,7 @@ import java.util.StringTokenizer; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseListCmd; import com.cloud.api.Implementation; @@ -52,16 +53,16 @@ public class ListCapacityCmd extends BaseListCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="hostid", type=CommandType.LONG, description="lists capacity by the Host ID") + @Parameter(name=ApiConstants.HOST_ID, type=CommandType.LONG, description="lists capacity by the Host ID") private Long hostId; - @Parameter(name="podid", type=CommandType.LONG, description="lists capacity by the Pod ID") + @Parameter(name=ApiConstants.POD_ID, type=CommandType.LONG, description="lists capacity by the Pod ID") private Long podId; - @Parameter(name="type", type=CommandType.STRING, description="lists capacity by type") + @Parameter(name=ApiConstants.TYPE, type=CommandType.STRING, description="lists capacity by type") private String type; - @Parameter(name="zoneid", type=CommandType.LONG, description="lists capacity by the Zone ID") + @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, description="lists capacity by the Zone ID") private Long zoneId; diff --git a/server/src/com/cloud/api/commands/ListCfgsByCmd.java b/server/src/com/cloud/api/commands/ListCfgsByCmd.java index 472b32f99f3..282f35e7882 100644 --- a/server/src/com/cloud/api/commands/ListCfgsByCmd.java +++ b/server/src/com/cloud/api/commands/ListCfgsByCmd.java @@ -23,6 +23,7 @@ import java.util.List; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.BaseListCmd; import com.cloud.api.Implementation; import com.cloud.api.Parameter; @@ -40,10 +41,10 @@ public class ListCfgsByCmd extends BaseListCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="category", type=CommandType.STRING, description="lists configurations by category") + @Parameter(name=ApiConstants.CATEGORY, type=CommandType.STRING, description="lists configurations by category") private String category; - @Parameter(name="name", type=CommandType.STRING, description="lists configuration by name") + @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="lists configuration by name") private String configName; diff --git a/server/src/com/cloud/api/commands/ListClustersCmd.java b/server/src/com/cloud/api/commands/ListClustersCmd.java index eab8d4984b5..80b9ecff10a 100644 --- a/server/src/com/cloud/api/commands/ListClustersCmd.java +++ b/server/src/com/cloud/api/commands/ListClustersCmd.java @@ -23,6 +23,7 @@ import java.util.List; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseListCmd; import com.cloud.api.Implementation; @@ -43,16 +44,16 @@ public class ListClustersCmd extends BaseListCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, description="lists clusters by the cluster ID") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, description="lists clusters by the cluster ID") private Long id; - @Parameter(name="name", type=CommandType.STRING, description="lists clusters by the cluster name") + @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="lists clusters by the cluster name") private String clusterName; - @Parameter(name="podid", type=CommandType.LONG, description="lists clusters by Pod ID") + @Parameter(name=ApiConstants.POD_ID, type=CommandType.LONG, description="lists clusters by Pod ID") private Long podId; - @Parameter(name="zoneid", type=CommandType.LONG, description="lists clusters by Zone ID") + @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, description="lists clusters by Zone ID") private Long zoneId; diff --git a/server/src/com/cloud/api/commands/ListDiskOfferingsCmd.java b/server/src/com/cloud/api/commands/ListDiskOfferingsCmd.java index 9f3e9daf22c..4956ed99998 100644 --- a/server/src/com/cloud/api/commands/ListDiskOfferingsCmd.java +++ b/server/src/com/cloud/api/commands/ListDiskOfferingsCmd.java @@ -22,6 +22,7 @@ import java.util.List; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseListCmd; import com.cloud.api.Implementation; @@ -41,13 +42,13 @@ public class ListDiskOfferingsCmd extends BaseListCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="domainid", type=CommandType.LONG, description="the ID of the domain of the disk offering. This information is not currently applicable, and should not be used as a parameter.") + @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, description="the ID of the domain of the disk offering. This information is not currently applicable, and should not be used as a parameter.") private Long domainId; - @Parameter(name="id", type=CommandType.LONG, description="ID of the disk offering") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, description="ID of the disk offering") private Long id; - @Parameter(name="name", type=CommandType.STRING, description="name of the disk offering") + @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="name of the disk offering") private String diskOfferingName; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/ListDomainChildrenCmd.java b/server/src/com/cloud/api/commands/ListDomainChildrenCmd.java index 8657a536058..7d97d75daa3 100644 --- a/server/src/com/cloud/api/commands/ListDomainChildrenCmd.java +++ b/server/src/com/cloud/api/commands/ListDomainChildrenCmd.java @@ -22,6 +22,7 @@ import java.util.List; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseListCmd; import com.cloud.api.Implementation; @@ -40,13 +41,13 @@ public class ListDomainChildrenCmd extends BaseListCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, description="list children domain by parent domain ID.") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, description="list children domain by parent domain ID.") private Long id; - @Parameter(name="isrecursive", type=CommandType.BOOLEAN, description="to return the entire tree, use the value \"true\". To return the first level children, use the value \"false\".") + @Parameter(name=ApiConstants.IS_RECURSIVE, type=CommandType.BOOLEAN, description="to return the entire tree, use the value \"true\". To return the first level children, use the value \"false\".") private Boolean recursive; - @Parameter(name="name", type=CommandType.STRING, description="list children domain by parent domain name.") + @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="list children domain by parent domain name.") private String domainName; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/ListDomainsCmd.java b/server/src/com/cloud/api/commands/ListDomainsCmd.java index ca49e587762..573597c75f5 100644 --- a/server/src/com/cloud/api/commands/ListDomainsCmd.java +++ b/server/src/com/cloud/api/commands/ListDomainsCmd.java @@ -22,6 +22,7 @@ import java.util.List; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseListCmd; import com.cloud.api.Implementation; @@ -40,13 +41,13 @@ public class ListDomainsCmd extends BaseListCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, description="List domain by domain ID.") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, description="List domain by domain ID.") private Long id; - @Parameter(name="level", type=CommandType.INTEGER, description="List domains by domain level.") + @Parameter(name=ApiConstants.LEVEL, type=CommandType.INTEGER, description="List domains by domain level.") private Integer level; - @Parameter(name="name", type=CommandType.STRING, description="List domain by domain name.") + @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="List domain by domain name.") private String domainName; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/ListEventsCmd.java b/server/src/com/cloud/api/commands/ListEventsCmd.java index 6d8ee45ab80..6b9c464d0c7 100644 --- a/server/src/com/cloud/api/commands/ListEventsCmd.java +++ b/server/src/com/cloud/api/commands/ListEventsCmd.java @@ -23,6 +23,7 @@ import java.util.List; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseListCmd; import com.cloud.api.Implementation; @@ -42,28 +43,28 @@ public class ListEventsCmd extends BaseListCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="account", type=CommandType.STRING, description="the account for the event. Must be used with the domainId parameter.") + @Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, description="the account for the event. Must be used with the domainId parameter.") private String accountName; - @Parameter(name="domainid", type=CommandType.LONG, description="the domain ID for the event. If used with the account parameter, returns all events for an account in the specified domain ID.") + @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, description="the domain ID for the event. If used with the account parameter, returns all events for an account in the specified domain ID.") private Long domainId; - @Parameter(name="duration", type=CommandType.INTEGER, description="the duration of the event") + @Parameter(name=ApiConstants.DURATION, type=CommandType.INTEGER, description="the duration of the event") private Integer duration; - @Parameter(name="enddate", type=CommandType.DATE, description="the end date range of the list you want to retrieve (use format \"yyyy-MM-dd\")") + @Parameter(name=ApiConstants.END_DATE, type=CommandType.DATE, description="the end date range of the list you want to retrieve (use format \"yyyy-MM-dd\")") private Date endDate; - @Parameter(name="entrytime", type=CommandType.INTEGER, description="the time the event was entered") + @Parameter(name=ApiConstants.ENTRY_TIME, type=CommandType.INTEGER, description="the time the event was entered") private Integer entryTime; - @Parameter(name="level", type=CommandType.STRING, description="the event level (INFO, WARN, ERROR)") + @Parameter(name=ApiConstants.LEVEL, type=CommandType.STRING, description="the event level (INFO, WARN, ERROR)") private String level; - @Parameter(name="startdate", type=CommandType.DATE, description="the start date range of the list you want to retrieve (use format \"yyyy-MM-dd\")") + @Parameter(name=ApiConstants.START_DATE, type=CommandType.DATE, description="the start date range of the list you want to retrieve (use format \"yyyy-MM-dd\")") private Date startDate; - @Parameter(name="type", type=CommandType.STRING, description="the event type (see event types)") + @Parameter(name=ApiConstants.TYPE, type=CommandType.STRING, description="the event type (see event types)") private String type; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/ListGuestOsCategoriesCmd.java b/server/src/com/cloud/api/commands/ListGuestOsCategoriesCmd.java index ef8e6b81aef..a2ec785191d 100644 --- a/server/src/com/cloud/api/commands/ListGuestOsCategoriesCmd.java +++ b/server/src/com/cloud/api/commands/ListGuestOsCategoriesCmd.java @@ -23,6 +23,7 @@ import java.util.List; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.BaseListCmd; import com.cloud.api.Implementation; import com.cloud.api.Parameter; @@ -40,7 +41,7 @@ public class ListGuestOsCategoriesCmd extends BaseListCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, description="list Os category by id") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, description="list Os category by id") private Long id; diff --git a/server/src/com/cloud/api/commands/ListGuestOsCmd.java b/server/src/com/cloud/api/commands/ListGuestOsCmd.java index f913dd5d3d4..33840d54dd4 100644 --- a/server/src/com/cloud/api/commands/ListGuestOsCmd.java +++ b/server/src/com/cloud/api/commands/ListGuestOsCmd.java @@ -23,6 +23,7 @@ import java.util.List; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.BaseListCmd; import com.cloud.api.Implementation; import com.cloud.api.Parameter; @@ -40,10 +41,10 @@ public class ListGuestOsCmd extends BaseListCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, description="list by Os type Id") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, description="list by Os type Id") private Long id; - @Parameter(name="oscategoryid", type=CommandType.LONG, description="list by Os Category id") + @Parameter(name=ApiConstants.OS_CATEGORY_ID, type=CommandType.LONG, description="list by Os Category id") private Long osCategoryId; diff --git a/server/src/com/cloud/api/commands/ListHostsCmd.java b/server/src/com/cloud/api/commands/ListHostsCmd.java index d9746f95770..7438051e084 100644 --- a/server/src/com/cloud/api/commands/ListHostsCmd.java +++ b/server/src/com/cloud/api/commands/ListHostsCmd.java @@ -27,6 +27,7 @@ import java.util.Set; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseListCmd; import com.cloud.api.Implementation; @@ -52,25 +53,25 @@ public class ListHostsCmd extends BaseListCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="clusterid", type=CommandType.LONG, description="lists hosts existing in particular cluster") + @Parameter(name=ApiConstants.CLUSTER_ID, type=CommandType.LONG, description="lists hosts existing in particular cluster") private Long clusterId; - @Parameter(name="id", type=CommandType.LONG, description="the id of the host") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, description="the id of the host") private Long id; - @Parameter(name="name", type=CommandType.STRING, description="the name of the host") + @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="the name of the host") private String hostName; - @Parameter(name="podid", type=CommandType.LONG, description="the Pod ID for the host") + @Parameter(name=ApiConstants.POD_ID, type=CommandType.LONG, description="the Pod ID for the host") private Long podId; - @Parameter(name="state", type=CommandType.STRING, description="the state of the host") + @Parameter(name=ApiConstants.STATE, type=CommandType.STRING, description="the state of the host") private String state; - @Parameter(name="type", type=CommandType.STRING, description="the host type") + @Parameter(name=ApiConstants.TYPE, type=CommandType.STRING, description="the host type") private String type; - @Parameter(name="zoneid", type=CommandType.LONG, description="the Zone ID for the host") + @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, description="the Zone ID for the host") private Long zoneId; diff --git a/server/src/com/cloud/api/commands/ListIsosCmd.java b/server/src/com/cloud/api/commands/ListIsosCmd.java index 116fbab6480..11dc72e2aa8 100644 --- a/server/src/com/cloud/api/commands/ListIsosCmd.java +++ b/server/src/com/cloud/api/commands/ListIsosCmd.java @@ -25,6 +25,7 @@ import java.util.Map; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseListCmd; import com.cloud.api.Implementation; @@ -52,41 +53,40 @@ public class ListIsosCmd extends BaseListCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="account", type=CommandType.STRING, description="the account of the ISO file. Must be used with the domainId parameter.") + @Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, description="the account of the ISO file. Must be used with the domainId parameter.") private String accountName; - @Parameter(name="bootable", type=CommandType.BOOLEAN, description="true if the ISO is bootable, false otherwise") + @Parameter(name=ApiConstants.BOOTABLE, type=CommandType.BOOLEAN, description="true if the ISO is bootable, false otherwise") private Boolean bootable; - @Parameter(name="domainid", type=CommandType.LONG, description="lists all available ISO files by ID of a domain. If used with the account parameter, lists all available ISO files for the account in the ID of a domain.") + @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, description="lists all available ISO files by ID of a domain. If used with the account parameter, lists all available ISO files for the account in the ID of a domain.") private Long domainId; - @Parameter(name="hypervisor", type=CommandType.STRING, description="the hypervisor for which to restrict the search") + @Parameter(name=ApiConstants.HYPERVISOR, type=CommandType.STRING, description="the hypervisor for which to restrict the search") private String hypervisor; - @Parameter(name="id", type=CommandType.LONG, description="list all isos by id") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, description="list all isos by id") private Long id; - @Parameter(name="ispublic", type=CommandType.BOOLEAN, description="true if the ISO is publicly available to all users, false otherwise.") + @Parameter(name=ApiConstants.IS_PUBLIC, type=CommandType.BOOLEAN, description="true if the ISO is publicly available to all users, false otherwise.") private Boolean publicIso; - @Parameter(name="isready", type=CommandType.BOOLEAN, description="true if this ISO is ready to be deployed") + @Parameter(name=ApiConstants.IS_READY, type=CommandType.BOOLEAN, description="true if this ISO is ready to be deployed") private Boolean ready; - @Parameter(name="isofilter", type=CommandType.STRING, description="possible values are \"featured\", \"self\", \"self-executable\",\"executable\", and \"community\". " + + @Parameter(name=ApiConstants.ISO_FILTER, type=CommandType.STRING, description="possible values are \"featured\", \"self\", \"self-executable\",\"executable\", and \"community\". " + "* featured-ISOs that are featured and are publicself-ISOs that have been registered/created by the owner. " + "* selfexecutable-ISOs that have been registered/created by the owner that can be used to deploy a new VM. " + "* executable-all ISOs that can be used to deploy a new VM " + "* community-ISOs that are public.") private String isoFilter = TemplateFilter.selfexecutable.toString(); - @Parameter(name="name", type=CommandType.STRING, description="list all isos by name") + @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="list all isos by name") private String isoName; - @Parameter(name="zoneid", type=CommandType.LONG, description="the ID of the zone") + @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, description="the ID of the zone") private Long zoneId; - ///////////////////////////////////////////////////// /////////////////// Accessors /////////////////////// ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/ListLoadBalancerRuleInstancesCmd.java b/server/src/com/cloud/api/commands/ListLoadBalancerRuleInstancesCmd.java index 19b00b1230b..1d1324ffe32 100644 --- a/server/src/com/cloud/api/commands/ListLoadBalancerRuleInstancesCmd.java +++ b/server/src/com/cloud/api/commands/ListLoadBalancerRuleInstancesCmd.java @@ -22,6 +22,7 @@ import java.util.List; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseListCmd; import com.cloud.api.Implementation; @@ -41,10 +42,10 @@ public class ListLoadBalancerRuleInstancesCmd extends BaseListCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="applied", type=CommandType.BOOLEAN, description="true if listing all virtual machines currently applied to the load balancer rule; default is true") + @Parameter(name=ApiConstants.APPLIED, type=CommandType.BOOLEAN, description="true if listing all virtual machines currently applied to the load balancer rule; default is true") private Boolean applied; - @Parameter(name="id", type=CommandType.LONG, required=true, description="the ID of the load balancer rule") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="the ID of the load balancer rule") private Long id; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/ListLoadBalancerRulesCmd.java b/server/src/com/cloud/api/commands/ListLoadBalancerRulesCmd.java index 49bfc32110a..80c6a7a44cb 100644 --- a/server/src/com/cloud/api/commands/ListLoadBalancerRulesCmd.java +++ b/server/src/com/cloud/api/commands/ListLoadBalancerRulesCmd.java @@ -23,6 +23,7 @@ import java.util.List; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseListCmd; import com.cloud.api.Implementation; @@ -42,25 +43,24 @@ public class ListLoadBalancerRulesCmd extends BaseListCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="account", type=CommandType.STRING, description="the account of the load balancer rule. Must be used with the domainId parameter.") + @Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, description="the account of the load balancer rule. Must be used with the domainId parameter.") private String accountName; - @Parameter(name="domainid", type=CommandType.LONG, description="the domain ID of the load balancer rule. If used with the account parameter, lists load balancer rules for the account in the specified domain.") + @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, description="the domain ID of the load balancer rule. If used with the account parameter, lists load balancer rules for the account in the specified domain.") private Long domainId; - @Parameter(name="id", type=CommandType.LONG, description="the ID of the load balancer rule") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, description="the ID of the load balancer rule") private Long id; - @Parameter(name="name", type=CommandType.STRING, description="the name of the load balancer rule") + @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="the name of the load balancer rule") private String loadBalancerRuleName; - @Parameter(name="publicip", type=CommandType.STRING, description="the public IP address of the load balancer rule ") + @Parameter(name=ApiConstants.PUBLIC_IP, type=CommandType.STRING, description="the public IP address of the load balancer rule ") private String publicIp; - @Parameter(name="virtualmachineid", type=CommandType.LONG, description="the ID of the virtual machine of the load balancer rule") + @Parameter(name=ApiConstants.VIRTUAL_MACHINE_ID, type=CommandType.LONG, description="the ID of the virtual machine of the load balancer rule") private Long virtualMachineId; - ///////////////////////////////////////////////////// /////////////////// Accessors /////////////////////// ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/ListNetworkGroupsCmd.java b/server/src/com/cloud/api/commands/ListNetworkGroupsCmd.java index 179a993f469..d80b00408ce 100644 --- a/server/src/com/cloud/api/commands/ListNetworkGroupsCmd.java +++ b/server/src/com/cloud/api/commands/ListNetworkGroupsCmd.java @@ -22,6 +22,7 @@ import java.util.List; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseListCmd; import com.cloud.api.Implementation; @@ -44,16 +45,16 @@ public class ListNetworkGroupsCmd extends BaseListCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="account", type=CommandType.STRING, description="lists all available port network groups for the account. Must be used with domainID parameter") + @Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, description="lists all available port network groups for the account. Must be used with domainID parameter") private String accountName; - @Parameter(name="domainid", type=CommandType.LONG, description="lists all available network groups for the domain ID. If used with the account parameter, lists all available network groups for the account in the specified domain ID.") + @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, description="lists all available network groups for the domain ID. If used with the account parameter, lists all available network groups for the account in the specified domain ID.") private Long domainId; - @Parameter(name="networkgroupname", type=CommandType.STRING, description="lists network groups by name") + @Parameter(name=ApiConstants.NETWORK_GROUP_NAME, type=CommandType.STRING, description="lists network groups by name") private String networkGroupName; - @Parameter(name="virtualmachineid", type=CommandType.LONG, description="lists network groups by virtual machine id") + @Parameter(name=ApiConstants.VIRTUAL_MACHINE_ID, type=CommandType.LONG, description="lists network groups by virtual machine id") private Long virtualMachineId; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/ListPodsByCmd.java b/server/src/com/cloud/api/commands/ListPodsByCmd.java index e0f337c9f7a..de822d73e39 100644 --- a/server/src/com/cloud/api/commands/ListPodsByCmd.java +++ b/server/src/com/cloud/api/commands/ListPodsByCmd.java @@ -23,6 +23,7 @@ import java.util.List; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.BaseListCmd; import com.cloud.api.Implementation; import com.cloud.api.Parameter; @@ -41,13 +42,13 @@ public class ListPodsByCmd extends BaseListCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, description="list Pods by ID") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, description="list Pods by ID") private Long id; - @Parameter(name="name", type=CommandType.STRING, description="list Pods by name") + @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="list Pods by name") private String podName; - @Parameter(name="zoneid", type=CommandType.LONG, description="list Pods by Zone ID") + @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, description="list Pods by Zone ID") private Long zoneId; diff --git a/server/src/com/cloud/api/commands/ListPortForwardingRulesCmd.java b/server/src/com/cloud/api/commands/ListPortForwardingRulesCmd.java index b72b42d8e29..f6c9bb173cd 100644 --- a/server/src/com/cloud/api/commands/ListPortForwardingRulesCmd.java +++ b/server/src/com/cloud/api/commands/ListPortForwardingRulesCmd.java @@ -24,6 +24,7 @@ import java.util.Map; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseListCmd; import com.cloud.api.Implementation; @@ -46,7 +47,7 @@ public class ListPortForwardingRulesCmd extends BaseListCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="ipaddress", type=CommandType.STRING, required=true, description="the IP address of the port forwarding services") + @Parameter(name=ApiConstants.IP_ADDRESS, type=CommandType.STRING, required=true, description="the IP address of the port forwarding services") private String ipAddress; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/ListPortForwardingServiceRulesCmd.java b/server/src/com/cloud/api/commands/ListPortForwardingServiceRulesCmd.java index 9ab025bc804..528fb5695b5 100644 --- a/server/src/com/cloud/api/commands/ListPortForwardingServiceRulesCmd.java +++ b/server/src/com/cloud/api/commands/ListPortForwardingServiceRulesCmd.java @@ -22,6 +22,7 @@ import java.util.List; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseListCmd; import com.cloud.api.Implementation; @@ -41,16 +42,16 @@ public class ListPortForwardingServiceRulesCmd extends BaseListCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="account", type=CommandType.STRING, description="the account associated with the port forwarding service rule. Must be used with the domainId parameter.") + @Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, description="the account associated with the port forwarding service rule. Must be used with the domainId parameter.") private String accountName; - @Parameter(name="domainid", type=CommandType.LONG, description="the domainId associated with the port forwarding service rule. If used with the account parameter, returns a list of port forwarding service rules for an account for the specified domain ID.") + @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, description="the domainId associated with the port forwarding service rule. If used with the account parameter, returns a list of port forwarding service rules for an account for the specified domain ID.") private Long domainId; - @Parameter(name="id", type=CommandType.LONG, description="the ID of the port forwarding service rule") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, description="the ID of the port forwarding service rule") private Long id; - @Parameter(name="portforwardingserviceid", type=CommandType.LONG, description="the ID of the port forwarding service the rule is being created for") + @Parameter(name=ApiConstants.PORT_FORWARDING_SERVICE_ID, type=CommandType.LONG, description="the ID of the port forwarding service the rule is being created for") private Long portForwardingServiceId; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/ListPortForwardingServicesByVmCmd.java b/server/src/com/cloud/api/commands/ListPortForwardingServicesByVmCmd.java index 12a39aa4cc5..f5a7c1ab9aa 100644 --- a/server/src/com/cloud/api/commands/ListPortForwardingServicesByVmCmd.java +++ b/server/src/com/cloud/api/commands/ListPortForwardingServicesByVmCmd.java @@ -24,6 +24,7 @@ import java.util.Map; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseListCmd; import com.cloud.api.Implementation; @@ -43,16 +44,16 @@ public class ListPortForwardingServicesByVmCmd extends BaseListCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="account", type=CommandType.STRING, description="the account associated with the port forwarding services. Must be used with the domainId parameter.") + @Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, description="the account associated with the port forwarding services. Must be used with the domainId parameter.") private String accountName; - @Parameter(name="domainid", type=CommandType.LONG, description="the domain ID associated with the port forwarding services. If used with the account parameter, returns a list of all port forwarding services for an account in the specified domain ID.") + @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, description="the domain ID associated with the port forwarding services. If used with the account parameter, returns a list of all port forwarding services for an account in the specified domain ID.") private Long domainId; - @Parameter(name="ipaddress", type=CommandType.STRING, description="public ip address") + @Parameter(name=ApiConstants.IP_ADDRESS, type=CommandType.STRING, description="public ip address") private String ipAddress; - @Parameter(name="virtualmachineid", type=CommandType.LONG, description="ID of the virtual machine") + @Parameter(name=ApiConstants.VIRTUAL_MACHINE_ID, type=CommandType.LONG, description="ID of the virtual machine") private Long virtualMachineId; diff --git a/server/src/com/cloud/api/commands/ListPortForwardingServicesCmd.java b/server/src/com/cloud/api/commands/ListPortForwardingServicesCmd.java index b18c2c31d59..04404430a95 100644 --- a/server/src/com/cloud/api/commands/ListPortForwardingServicesCmd.java +++ b/server/src/com/cloud/api/commands/ListPortForwardingServicesCmd.java @@ -23,6 +23,7 @@ import java.util.List; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseListCmd; import com.cloud.api.Implementation; @@ -42,16 +43,16 @@ public class ListPortForwardingServicesCmd extends BaseListCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="account", type=CommandType.STRING, description="lists all available port forwarding services for the account. Must be used with the domainId parameter.") + @Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, description="lists all available port forwarding services for the account. Must be used with the domainId parameter.") private String accountName; - @Parameter(name="domainid", type=CommandType.LONG, description="lists all available port forwarding services for the domain ID. If used with the account parameter, lists all available port forwarding services for the account in the specified domain ID.") + @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, description="lists all available port forwarding services for the domain ID. If used with the account parameter, lists all available port forwarding services for the account in the specified domain ID.") private Long domainId; - @Parameter(name="id", type=CommandType.LONG, description="the ID of the port forwarding service") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, description="the ID of the port forwarding service") private Long id; - @Parameter(name="name", type=CommandType.STRING, description="the name of the port forwarding service") + @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="the name of the port forwarding service") private String portForwardingServiceName; diff --git a/server/src/com/cloud/api/commands/ListPreallocatedLunsCmd.java b/server/src/com/cloud/api/commands/ListPreallocatedLunsCmd.java index a1884a5e3a8..d55e2307eaf 100644 --- a/server/src/com/cloud/api/commands/ListPreallocatedLunsCmd.java +++ b/server/src/com/cloud/api/commands/ListPreallocatedLunsCmd.java @@ -23,6 +23,7 @@ import java.util.List; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.BaseListCmd; import com.cloud.api.Implementation; import com.cloud.api.Parameter; @@ -41,11 +42,11 @@ public class ListPreallocatedLunsCmd extends BaseListCmd { ///////////////////////////////////////////////////// //FIXME - add description - @Parameter(name="scope", type=CommandType.STRING) + @Parameter(name=ApiConstants.SCOPE, type=CommandType.STRING) private String scope; //FIXME - add description - @Parameter(name="targetiqn", type=CommandType.STRING) + @Parameter(name=ApiConstants.TARGET_IQN, type=CommandType.STRING) private String targetIqn; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/ListPublicIpAddressesCmd.java b/server/src/com/cloud/api/commands/ListPublicIpAddressesCmd.java index 5f9a5c9634d..858210005d4 100644 --- a/server/src/com/cloud/api/commands/ListPublicIpAddressesCmd.java +++ b/server/src/com/cloud/api/commands/ListPublicIpAddressesCmd.java @@ -23,6 +23,7 @@ import java.util.List; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseListCmd; import com.cloud.api.Implementation; @@ -45,25 +46,25 @@ public class ListPublicIpAddressesCmd extends BaseListCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="account", type=CommandType.STRING, description="lists all public IP addresses by account. Must be used with the domainId parameter.") + @Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, description="lists all public IP addresses by account. Must be used with the domainId parameter.") private String accountName; - @Parameter(name="allocatedonly", type=CommandType.BOOLEAN, description="limits search results to allocated public IP addresses") + @Parameter(name=ApiConstants.ALLOCATED_ONLY, type=CommandType.BOOLEAN, description="limits search results to allocated public IP addresses") private Boolean allocatedOnly; - @Parameter(name="domainid", type=CommandType.LONG, description="lists all public IP addresses by domain ID. If used with the account parameter, lists all public IP addresses by account for specified domain.") + @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, description="lists all public IP addresses by domain ID. If used with the account parameter, lists all public IP addresses by account for specified domain.") private Long domainId; - @Parameter(name="forvirtualnetwork", type=CommandType.BOOLEAN, description="the virtual network for the IP address") + @Parameter(name=ApiConstants.FOR_VIRTUAL_NETWORK, type=CommandType.BOOLEAN, description="the virtual network for the IP address") private Boolean forVirtualNetwork; - @Parameter(name="ipaddress", type=CommandType.STRING, description="lists the specified IP address") + @Parameter(name=ApiConstants.IP_ADDRESS, type=CommandType.STRING, description="lists the specified IP address") private String ipAddress; - @Parameter(name="vlanid", type=CommandType.LONG, description="lists all public IP addresses by VLAN ID") + @Parameter(name=ApiConstants.VLAN_ID, type=CommandType.LONG, description="lists all public IP addresses by VLAN ID") private Long vlanId; - @Parameter(name="zoneid", type=CommandType.LONG, description="lists all public IP addresses by Zone ID") + @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, description="lists all public IP addresses by Zone ID") private Long zoneId; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/ListRecurringSnapshotScheduleCmd.java b/server/src/com/cloud/api/commands/ListRecurringSnapshotScheduleCmd.java index e1df0b828c4..e00cd976907 100644 --- a/server/src/com/cloud/api/commands/ListRecurringSnapshotScheduleCmd.java +++ b/server/src/com/cloud/api/commands/ListRecurringSnapshotScheduleCmd.java @@ -20,6 +20,7 @@ package com.cloud.api.commands; import java.util.ArrayList; import java.util.List; +import com.cloud.api.ApiConstants; import com.cloud.api.BaseListCmd; import com.cloud.api.Implementation; import com.cloud.api.Parameter; @@ -37,10 +38,10 @@ public class ListRecurringSnapshotScheduleCmd extends BaseListCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="snapshotpolicyid", type=CommandType.LONG, description="lists recurring snapshots by snapshot policy ID") + @Parameter(name=ApiConstants.SNAPSHOT_POLICY_ID, type=CommandType.LONG, description="lists recurring snapshots by snapshot policy ID") private Long snapshotPolicyId; - @Parameter(name="volumeid", type=CommandType.LONG, required=true, description="list recurring snapshots by volume ID") + @Parameter(name=ApiConstants.VOLUME_ID, type=CommandType.LONG, required=true, description="list recurring snapshots by volume ID") private Long volumeId; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/ListResourceLimitsCmd.java b/server/src/com/cloud/api/commands/ListResourceLimitsCmd.java index db40786ee29..6958471b263 100644 --- a/server/src/com/cloud/api/commands/ListResourceLimitsCmd.java +++ b/server/src/com/cloud/api/commands/ListResourceLimitsCmd.java @@ -23,6 +23,7 @@ import java.util.List; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseListCmd; import com.cloud.api.Implementation; @@ -43,16 +44,16 @@ public class ListResourceLimitsCmd extends BaseListCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="account", type=CommandType.STRING, description="Lists resource limits by account. Must be used with the domainId parameter.") + @Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, description="Lists resource limits by account. Must be used with the domainId parameter.") private String accountName; - @Parameter(name="domainid", type=CommandType.LONG, description="Lists resource limits by domain ID. If used with the account parameter, lists resource limits for a specified account in a specified domain.") + @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, description="Lists resource limits by domain ID. If used with the account parameter, lists resource limits for a specified account in a specified domain.") private Long domainId; - @Parameter(name="id", type=CommandType.LONG, description="Lists resource limits by ID.") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, description="Lists resource limits by ID.") private Long id; - @Parameter(name="resourcetype", type=CommandType.INTEGER, description="Type of resource to update. Values are 0, 1, 2, 3, and 4. 0 - Instance. Number of instances a user can create. " + + @Parameter(name=ApiConstants.RESOURCE_TYPE, type=CommandType.INTEGER, description="Type of resource to update. Values are 0, 1, 2, 3, and 4. 0 - Instance. Number of instances a user can create. " + "1 - IP. Number of public IP addresses a user can own. " + "2 - Volume. Number of disk volumes a user can create." + "3 - Snapshot. Number of snapshots a user can create." + diff --git a/server/src/com/cloud/api/commands/ListRoutersCmd.java b/server/src/com/cloud/api/commands/ListRoutersCmd.java index 00b2ce8978c..164df49d2d4 100644 --- a/server/src/com/cloud/api/commands/ListRoutersCmd.java +++ b/server/src/com/cloud/api/commands/ListRoutersCmd.java @@ -23,6 +23,7 @@ import java.util.List; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseListCmd; import com.cloud.api.Implementation; @@ -43,25 +44,25 @@ public class ListRoutersCmd extends BaseListCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="account", type=CommandType.STRING, description="the name of the account associated with the router. Must be used with the domainId parameter.") + @Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, description="the name of the account associated with the router. Must be used with the domainId parameter.") private String accountName; - @Parameter(name="domainid", type=CommandType.LONG, description="the domain ID associated with the router. If used with the account parameter, lists all routers associated with an account in the specified domain.") + @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, description="the domain ID associated with the router. If used with the account parameter, lists all routers associated with an account in the specified domain.") private Long domainId; - @Parameter(name="hostid", type=CommandType.LONG, description="the host ID of the router") + @Parameter(name=ApiConstants.HOST_ID, type=CommandType.LONG, description="the host ID of the router") private Long hostId; - @Parameter(name="name", type=CommandType.STRING, description="the name of the router") + @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="the name of the router") private String routerName; - @Parameter(name="podid", type=CommandType.LONG, description="the Pod ID of the router") + @Parameter(name=ApiConstants.POD_ID, type=CommandType.LONG, description="the Pod ID of the router") private Long podId; - @Parameter(name="state", type=CommandType.STRING, description="the state of the router") + @Parameter(name=ApiConstants.STATE, type=CommandType.STRING, description="the state of the router") private String state; - @Parameter(name="zoneid", type=CommandType.LONG, description="the Zone ID of the router") + @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, description="the Zone ID of the router") private Long zoneId; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/ListServiceOfferingsCmd.java b/server/src/com/cloud/api/commands/ListServiceOfferingsCmd.java index 28f54d7db2f..ff09dddd63f 100644 --- a/server/src/com/cloud/api/commands/ListServiceOfferingsCmd.java +++ b/server/src/com/cloud/api/commands/ListServiceOfferingsCmd.java @@ -22,6 +22,7 @@ import java.util.List; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.BaseListCmd; import com.cloud.api.Implementation; import com.cloud.api.Parameter; @@ -40,13 +41,13 @@ public class ListServiceOfferingsCmd extends BaseListCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, description="ID of the service offering") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, description="ID of the service offering") private Long id; - @Parameter(name="name", type=CommandType.STRING, description="name of the service offering") + @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="name of the service offering") private String serviceOfferingName; - @Parameter(name="virtualmachineid", type=CommandType.LONG, description="the ID of the virtual machine. Pass this in if you want to see the available service offering that a virtual machine can be changed to.") + @Parameter(name=ApiConstants.VIRTUAL_MACHINE_ID, type=CommandType.LONG, description="the ID of the virtual machine. Pass this in if you want to see the available service offering that a virtual machine can be changed to.") private Long virtualMachineId; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/ListSnapshotPoliciesCmd.java b/server/src/com/cloud/api/commands/ListSnapshotPoliciesCmd.java index 0cfd41ee658..b07809c303a 100644 --- a/server/src/com/cloud/api/commands/ListSnapshotPoliciesCmd.java +++ b/server/src/com/cloud/api/commands/ListSnapshotPoliciesCmd.java @@ -23,6 +23,7 @@ import java.util.List; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.BaseListCmd; import com.cloud.api.Implementation; import com.cloud.api.Parameter; @@ -41,13 +42,13 @@ public class ListSnapshotPoliciesCmd extends BaseListCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="account", type=CommandType.STRING, description="lists snapshot policies for the specified account. Must be used with domainid parameter.") + @Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, description="lists snapshot policies for the specified account. Must be used with domainid parameter.") private String accountName; - @Parameter(name="domainid", type=CommandType.LONG, description="the domain ID. If used with the account parameter, lists snapshot policies for the specified account in this domain.") + @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, description="the domain ID. If used with the account parameter, lists snapshot policies for the specified account in this domain.") private Long domainId; - @Parameter(name="volumeid", type=CommandType.LONG, required=true, description="the ID of the disk volume") + @Parameter(name=ApiConstants.VOLUME_ID, type=CommandType.LONG, required=true, description="the ID of the disk volume") private Long volumeId; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/ListSnapshotsCmd.java b/server/src/com/cloud/api/commands/ListSnapshotsCmd.java index 52d00546cca..4d3c123db45 100644 --- a/server/src/com/cloud/api/commands/ListSnapshotsCmd.java +++ b/server/src/com/cloud/api/commands/ListSnapshotsCmd.java @@ -22,6 +22,7 @@ import java.util.List; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseListCmd; import com.cloud.api.Implementation; @@ -45,25 +46,25 @@ public class ListSnapshotsCmd extends BaseListCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="account", type=CommandType.STRING, description="lists snapshot belongig to the specified account. Must be used with the domainId parameter.") + @Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, description="lists snapshot belongig to the specified account. Must be used with the domainId parameter.") private String accountName; - @Parameter(name="domainid", type=CommandType.LONG, description="the domain ID. If used with the account parameter, lists snapshots for the specified account in this domain.") + @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, description="the domain ID. If used with the account parameter, lists snapshots for the specified account in this domain.") private Long domainId; - @Parameter(name="id", type=CommandType.LONG, description="lists snapshot by snapshot ID") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, description="lists snapshot by snapshot ID") private Long id; - @Parameter(name="intervalType", type=CommandType.STRING, description="valid values are HOURLY, DAILY, WEEKLY, and MONTHLY.") + @Parameter(name=ApiConstants.INTERVAL_TYPE, type=CommandType.STRING, description="valid values are HOURLY, DAILY, WEEKLY, and MONTHLY.") private String intervalType; - @Parameter(name="name", type=CommandType.STRING, description="lists snapshot by snapshot name") + @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="lists snapshot by snapshot name") private String snapshotName; - @Parameter(name="snapshottype", type=CommandType.STRING, description="valid values are MANUAL or RECURRING.") + @Parameter(name=ApiConstants.SNAPSHOT_TYPE, type=CommandType.STRING, description="valid values are MANUAL or RECURRING.") private String snapshotType; - @Parameter(name="volumeid", type=CommandType.LONG, description="the ID of the disk volume") + @Parameter(name=ApiConstants.VOLUME_ID, type=CommandType.LONG, description="the ID of the disk volume") private Long volumeId; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/ListStoragePoolsCmd.java b/server/src/com/cloud/api/commands/ListStoragePoolsCmd.java index 7543df73292..ba68c2ba7ca 100644 --- a/server/src/com/cloud/api/commands/ListStoragePoolsCmd.java +++ b/server/src/com/cloud/api/commands/ListStoragePoolsCmd.java @@ -23,6 +23,7 @@ import java.util.List; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseListCmd; import com.cloud.api.Implementation; @@ -43,22 +44,22 @@ public class ListStoragePoolsCmd extends BaseListCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="clusterid", type=CommandType.LONG, description="list storage pools belongig to the specific cluster") + @Parameter(name=ApiConstants.CLUSTER_ID, type=CommandType.LONG, description="list storage pools belongig to the specific cluster") private Long clusterId; - @Parameter(name="ipaddress", type=CommandType.STRING, description="the IP address for the storage pool") + @Parameter(name=ApiConstants.IP_ADDRESS, type=CommandType.STRING, description="the IP address for the storage pool") private String ipAddress; - @Parameter(name="name", type=CommandType.STRING, description="the name of the storage pool") + @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="the name of the storage pool") private String storagePoolName; - @Parameter(name="path", type=CommandType.STRING, description="the storage pool path") + @Parameter(name=ApiConstants.PATH, type=CommandType.STRING, description="the storage pool path") private String path; - @Parameter(name="podid", type=CommandType.LONG, description="the Pod ID for the storage pool") + @Parameter(name=ApiConstants.POD_ID, type=CommandType.LONG, description="the Pod ID for the storage pool") private Long podId; - @Parameter(name="zoneid", type=CommandType.LONG, description="the Zone ID for the storage pool") + @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, description="the Zone ID for the storage pool") private Long zoneId; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/ListSystemVMsCmd.java b/server/src/com/cloud/api/commands/ListSystemVMsCmd.java index 77cca3802f2..15d85d93db8 100644 --- a/server/src/com/cloud/api/commands/ListSystemVMsCmd.java +++ b/server/src/com/cloud/api/commands/ListSystemVMsCmd.java @@ -22,6 +22,7 @@ import java.util.List; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseListCmd; import com.cloud.api.Implementation; @@ -44,25 +45,25 @@ public class ListSystemVMsCmd extends BaseListCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="hostid", type=CommandType.LONG, description="the host ID of the system VM") + @Parameter(name=ApiConstants.HOST_ID, type=CommandType.LONG, description="the host ID of the system VM") private Long hostId; - @Parameter(name="id", type=CommandType.LONG, description="the ID of the system VM") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, description="the ID of the system VM") private Long id; - @Parameter(name="name", type=CommandType.STRING, description="the name of the system VM") + @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="the name of the system VM") private String systemVmName; - @Parameter(name="podid", type=CommandType.LONG, description="the Pod ID of the system VM") + @Parameter(name=ApiConstants.POD_ID, type=CommandType.LONG, description="the Pod ID of the system VM") private Long podId; - @Parameter(name="state", type=CommandType.STRING, description="the state of the system VM") + @Parameter(name=ApiConstants.STATE, type=CommandType.STRING, description="the state of the system VM") private String state; - @Parameter(name="systemvmtype", type=CommandType.STRING, description="the system VM type. Possible types are \"consoleproxy\" and \"secondarystoragevm\".") + @Parameter(name=ApiConstants.SYSTEM_VM_TYPE, type=CommandType.STRING, description="the system VM type. Possible types are \"consoleproxy\" and \"secondarystoragevm\".") private String systemVmType; - @Parameter(name="zoneid", type=CommandType.LONG, description="the Zone ID of the system VM") + @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, description="the Zone ID of the system VM") private Long zoneId; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/ListTemplateOrIsoPermissionsCmd.java b/server/src/com/cloud/api/commands/ListTemplateOrIsoPermissionsCmd.java index 772b388625f..3addabc8c5a 100644 --- a/server/src/com/cloud/api/commands/ListTemplateOrIsoPermissionsCmd.java +++ b/server/src/com/cloud/api/commands/ListTemplateOrIsoPermissionsCmd.java @@ -21,6 +21,7 @@ import java.util.List; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseListCmd; import com.cloud.api.Implementation; @@ -39,13 +40,13 @@ public class ListTemplateOrIsoPermissionsCmd extends BaseListCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="account", type=CommandType.STRING, description="List template visibility and permissions for the specified account. Must be used with the domainId parameter.") + @Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, description="List template visibility and permissions for the specified account. Must be used with the domainId parameter.") private String accountName; - @Parameter(name="domainid", type=CommandType.LONG, description="List template visibility and permissions by domain. If used with the account parameter, specifies in which domain the specified account exists.") + @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, description="List template visibility and permissions by domain. If used with the account parameter, specifies in which domain the specified account exists.") private Long domainId; - @Parameter(name="id", type=CommandType.LONG, required=true, description="the template ID") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="the template ID") private Long id; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/ListTemplatesCmd.java b/server/src/com/cloud/api/commands/ListTemplatesCmd.java index 65fe5c875a3..3ba2ca5e9fc 100644 --- a/server/src/com/cloud/api/commands/ListTemplatesCmd.java +++ b/server/src/com/cloud/api/commands/ListTemplatesCmd.java @@ -23,6 +23,7 @@ import java.util.List; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseListCmd; import com.cloud.api.Implementation; @@ -38,9 +39,7 @@ import com.cloud.storage.VMTemplateHostVO; import com.cloud.storage.VMTemplateStorageResourceAssoc.Status; import com.cloud.storage.VMTemplateVO; import com.cloud.storage.dao.VMTemplateDao.TemplateFilter; -import com.cloud.storage.template.TemplateConstants; import com.cloud.user.Account; -import com.cloud.user.AccountVO; import com.cloud.user.UserContext; @Implementation(method="listTemplates", description="List all public, private, and privileged templates.") @@ -53,29 +52,29 @@ public class ListTemplatesCmd extends BaseListCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="account", type=CommandType.STRING, description="list template by account. Must be used with the domainId parameter.") + @Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, description="list template by account. Must be used with the domainId parameter.") private String accountName; - @Parameter(name="domainid", type=CommandType.LONG, description="list all templates in specified domain. If used with the account parameter, lists all templates for an account in the specified domain.") + @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, description="list all templates in specified domain. If used with the account parameter, lists all templates for an account in the specified domain.") private Long domainId; - @Parameter(name="hypervisor", type=CommandType.STRING, description="the hypervisor for which to restrict the search") + @Parameter(name=ApiConstants.HYPERVISOR, type=CommandType.STRING, description="the hypervisor for which to restrict the search") private String hypervisor; - @Parameter(name="id", type=CommandType.LONG, description="the template ID") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, description="the template ID") private Long id; - @Parameter(name="name", type=CommandType.STRING, description="the template name") + @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="the template name") private String templateName; - @Parameter(name="templatefilter", type=CommandType.STRING, required=true, description="possible values are \"featured\", \"self\", \"self-executable\", \"executable\", and \"community\"." + + @Parameter(name=ApiConstants.TEMPLATE_FILTER, type=CommandType.STRING, required=true, description="possible values are \"featured\", \"self\", \"self-executable\", \"executable\", and \"community\"." + "* featured-templates that are featured and are public" + "* self-templates that have been registered/created by the owner" + "* selfexecutable-templates that have been registered/created by the owner that can be used to deploy a new VM" + "* executable-all templates that can be used to deploy a new VM* community-templates that are public.") private String templateFilter; - @Parameter(name="zoneid", type=CommandType.LONG, description="list templates by zoneId") + @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, description="list templates by zoneId") private Long zoneId; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/ListUsersCmd.java b/server/src/com/cloud/api/commands/ListUsersCmd.java index 89787faf229..daa17dc834a 100644 --- a/server/src/com/cloud/api/commands/ListUsersCmd.java +++ b/server/src/com/cloud/api/commands/ListUsersCmd.java @@ -23,6 +23,7 @@ import java.util.List; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseListCmd; import com.cloud.api.Implementation; @@ -41,22 +42,22 @@ public class ListUsersCmd extends BaseListCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="account", type=CommandType.STRING, description="List user by account. Must be used with the domainId parameter.") + @Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, description="List user by account. Must be used with the domainId parameter.") private String accountName; - @Parameter(name="accounttype", type=CommandType.LONG, description="List users by account type. Valid types include admin, domain-admin, read-only-admin, or user.") + @Parameter(name=ApiConstants.ACCOUNT_TYPE, type=CommandType.LONG, description="List users by account type. Valid types include admin, domain-admin, read-only-admin, or user.") private Long accountType; - @Parameter(name="domainid", type=CommandType.LONG, description="List all users in a domain. If used with the account parameter, lists an account in a specific domain.") + @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, description="List all users in a domain. If used with the account parameter, lists an account in a specific domain.") private Long domainId; - @Parameter(name="id", type=CommandType.LONG, description="List user by ID.") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, description="List user by ID.") private Long id; - @Parameter(name="state", type=CommandType.STRING, description="List users by state of the user account.") + @Parameter(name=ApiConstants.STATE, type=CommandType.STRING, description="List users by state of the user account.") private String state; - @Parameter(name="username", type=CommandType.STRING, description="List user by the username") + @Parameter(name=ApiConstants.USERNAME, type=CommandType.STRING, description="List user by the username") private String username; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/ListVMGroupsCmd.java b/server/src/com/cloud/api/commands/ListVMGroupsCmd.java index ef9872bdfd1..a5f00e0b65c 100644 --- a/server/src/com/cloud/api/commands/ListVMGroupsCmd.java +++ b/server/src/com/cloud/api/commands/ListVMGroupsCmd.java @@ -22,6 +22,7 @@ import java.util.List; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseListCmd; import com.cloud.api.Implementation; @@ -41,16 +42,16 @@ public class ListVMGroupsCmd extends BaseListCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, description="list instance groups by ID") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, description="list instance groups by ID") private Long id; - @Parameter(name="name", type=CommandType.STRING, description="list instance groups by name") + @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="list instance groups by name") private String groupName; - @Parameter(name="account", type=CommandType.STRING, description="list instance group belonging to the specified account. Must be used with domainid parameter") + @Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, description="list instance group belonging to the specified account. Must be used with domainid parameter") private String accountName; - @Parameter(name="domainid", type=CommandType.LONG, description="the domain ID. If used with the account parameter, lists virtual machines for the specified account in this domain.") + @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, description="the domain ID. If used with the account parameter, lists virtual machines for the specified account in this domain.") private Long domainId; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/ListVMsCmd.java b/server/src/com/cloud/api/commands/ListVMsCmd.java index 508171af9b0..09cdc81f598 100644 --- a/server/src/com/cloud/api/commands/ListVMsCmd.java +++ b/server/src/com/cloud/api/commands/ListVMsCmd.java @@ -23,6 +23,7 @@ import java.util.List; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseListCmd; import com.cloud.api.Implementation; @@ -50,31 +51,31 @@ public class ListVMsCmd extends BaseListCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="account", type=CommandType.STRING, description="account. Must be used with the domainId parameter.") + @Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, description="account. Must be used with the domainId parameter.") private String accountName; - @Parameter(name="domainid", type=CommandType.LONG, description="the domain ID. If used with the account parameter, lists virtual machines for the specified account in this domain.") + @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, description="the domain ID. If used with the account parameter, lists virtual machines for the specified account in this domain.") private Long domainId; - @Parameter(name="groupid", type=CommandType.LONG, description="the group ID") + @Parameter(name=ApiConstants.GROUP_ID, type=CommandType.LONG, description="the group ID") private Long groupId; - @Parameter(name="hostid", type=CommandType.LONG, description="the host ID") + @Parameter(name=ApiConstants.HOST_ID, type=CommandType.LONG, description="the host ID") private Long hostId; - @Parameter(name="id", type=CommandType.LONG, description="the ID of the virtual machine") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, description="the ID of the virtual machine") private Long id; - @Parameter(name="name", type=CommandType.STRING, description="name of the virtual machine") + @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="name of the virtual machine") private String instanceName; - @Parameter(name="podid", type=CommandType.LONG, description="the pod ID") + @Parameter(name=ApiConstants.POD_ID, type=CommandType.LONG, description="the pod ID") private Long podId; - @Parameter(name="state", type=CommandType.STRING, description="state of the virtual machine") + @Parameter(name=ApiConstants.STATE, type=CommandType.STRING, description="state of the virtual machine") private String state; - @Parameter(name="zoneid", type=CommandType.LONG, description="the availability zone ID") + @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, description="the availability zone ID") private Long zoneId; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/ListVlanIpRangesCmd.java b/server/src/com/cloud/api/commands/ListVlanIpRangesCmd.java index bcc12489928..5429bc91005 100644 --- a/server/src/com/cloud/api/commands/ListVlanIpRangesCmd.java +++ b/server/src/com/cloud/api/commands/ListVlanIpRangesCmd.java @@ -22,6 +22,7 @@ import java.util.List; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseListCmd; import com.cloud.api.Implementation; @@ -43,22 +44,22 @@ public class ListVlanIpRangesCmd extends BaseListCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="account", type=CommandType.STRING, description="the account with which the VLAN IP range is associated. Must be used with the domainId parameter.") + @Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, description="the account with which the VLAN IP range is associated. Must be used with the domainId parameter.") private String accountName; - @Parameter(name="domainid", type=CommandType.LONG, description="the domain ID with which the VLAN IP range is associated. If used with the account parameter, returns all VLAN IP ranges for that account in the specified domain.") + @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, description="the domain ID with which the VLAN IP range is associated. If used with the account parameter, returns all VLAN IP ranges for that account in the specified domain.") private Long domainId; - @Parameter(name="id", type=CommandType.LONG, required=false, description="the ID of the VLAN IP range") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=false, description="the ID of the VLAN IP range") private Long id; - @Parameter(name="podid", type=CommandType.LONG, description="the Pod ID of the VLAN IP range") + @Parameter(name=ApiConstants.POD_ID, type=CommandType.LONG, description="the Pod ID of the VLAN IP range") private Long podId; - @Parameter(name="vlan", type=CommandType.STRING, description="the ID or VID of the VLAN. Default is an \"untagged\" VLAN.") + @Parameter(name=ApiConstants.VLAN, type=CommandType.STRING, description="the ID or VID of the VLAN. Default is an \"untagged\" VLAN.") private String vlan; - @Parameter(name="zoneid", type=CommandType.LONG, description="the Zone ID of the VLAN IP range") + @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, description="the Zone ID of the VLAN IP range") private Long zoneId; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/ListVolumesCmd.java b/server/src/com/cloud/api/commands/ListVolumesCmd.java index 44f55c1c21f..a5e17981111 100755 --- a/server/src/com/cloud/api/commands/ListVolumesCmd.java +++ b/server/src/com/cloud/api/commands/ListVolumesCmd.java @@ -22,6 +22,7 @@ import java.util.List; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseCmd; import com.cloud.api.BaseListCmd; @@ -48,31 +49,31 @@ public class ListVolumesCmd extends BaseListCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="account", type=CommandType.STRING, description="the account associated with the disk volume. Must be used with the domainId parameter.") + @Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, description="the account associated with the disk volume. Must be used with the domainId parameter.") private String accountName; - @Parameter(name="domainid", type=CommandType.LONG, description="Lists all disk volumes for the specified domain ID. If used with the account parameter, returns all disk volumes for an account in the specified domain ID.") + @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, description="Lists all disk volumes for the specified domain ID. If used with the account parameter, returns all disk volumes for an account in the specified domain ID.") private Long domainId; - @Parameter(name="hostid", type=CommandType.LONG, description="list volumes on specified host") + @Parameter(name=ApiConstants.HOST_ID, type=CommandType.LONG, description="list volumes on specified host") private Long hostId; - @Parameter(name="id", type=CommandType.LONG, description="the ID of the disk volume") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, description="the ID of the disk volume") private Long id; - @Parameter(name="name", type=CommandType.STRING, description="the name of the disk volume") + @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="the name of the disk volume") private String volumeName; - @Parameter(name="podid", type=CommandType.LONG) + @Parameter(name=ApiConstants.POD_ID, type=CommandType.LONG) private Long podId; - @Parameter(name="type", type=CommandType.STRING, description="the type of disk volume") + @Parameter(name=ApiConstants.TYPE, type=CommandType.STRING, description="the type of disk volume") private String type; - @Parameter(name="virtualmachineid", type=CommandType.LONG, description="the ID of the virtual machine") + @Parameter(name=ApiConstants.VIRTUAL_MACHINE_ID, type=CommandType.LONG, description="the ID of the virtual machine") private Long virtualMachineId; - @Parameter(name="zoneid", type=CommandType.LONG, description="the ID of the availability zone") + @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, description="the ID of the availability zone") private Long zoneId; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/ListZonesByCmd.java b/server/src/com/cloud/api/commands/ListZonesByCmd.java index 96004580fdc..fb5e2139d02 100644 --- a/server/src/com/cloud/api/commands/ListZonesByCmd.java +++ b/server/src/com/cloud/api/commands/ListZonesByCmd.java @@ -22,6 +22,7 @@ import java.util.List; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.BaseListCmd; import com.cloud.api.Implementation; import com.cloud.api.Parameter; @@ -41,7 +42,7 @@ public class ListZonesByCmd extends BaseListCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="available", type=CommandType.BOOLEAN, description="true if you want to retrieve all available Zones. False if you only want to return the Zones from which you have at least one VM. Default is false.") + @Parameter(name=ApiConstants.AVAILABLE, type=CommandType.BOOLEAN, description="true if you want to retrieve all available Zones. False if you only want to return the Zones from which you have at least one VM. Default is false.") private Boolean available; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/LockAccountCmd.java b/server/src/com/cloud/api/commands/LockAccountCmd.java index 995e95ed081..242c40faf63 100644 --- a/server/src/com/cloud/api/commands/LockAccountCmd.java +++ b/server/src/com/cloud/api/commands/LockAccountCmd.java @@ -19,6 +19,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.BaseCmd; import com.cloud.api.Implementation; import com.cloud.api.Parameter; @@ -35,10 +36,10 @@ public class LockAccountCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="account", type=CommandType.STRING, required=true, description="Locks the specified account.") + @Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, required=true, description="Locks the specified account.") private String accountName; - @Parameter(name="domainid", type=CommandType.LONG, required=true, description="Locks the specified account on this domain.") + @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, required=true, description="Locks the specified account on this domain.") private Long domainId; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/LockUserCmd.java b/server/src/com/cloud/api/commands/LockUserCmd.java index 72f27a255f6..36e77caa4d4 100644 --- a/server/src/com/cloud/api/commands/LockUserCmd.java +++ b/server/src/com/cloud/api/commands/LockUserCmd.java @@ -19,6 +19,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.BaseCmd; import com.cloud.api.Implementation; import com.cloud.api.Parameter; @@ -35,7 +36,7 @@ public class LockUserCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true, description="Locks user by user ID.") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="Locks user by user ID.") private Long id; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/PrepareForMaintenanceCmd.java b/server/src/com/cloud/api/commands/PrepareForMaintenanceCmd.java index 841fbecaab4..1b35fc78a9a 100644 --- a/server/src/com/cloud/api/commands/PrepareForMaintenanceCmd.java +++ b/server/src/com/cloud/api/commands/PrepareForMaintenanceCmd.java @@ -20,6 +20,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; import com.cloud.agent.AgentManager; +import com.cloud.api.ApiConstants; import com.cloud.api.BaseAsyncCmd; import com.cloud.api.Implementation; import com.cloud.api.Parameter; @@ -38,7 +39,7 @@ public class PrepareForMaintenanceCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true, description="the host ID") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="the host ID") private Long id; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/PreparePrimaryStorageForMaintenanceCmd.java b/server/src/com/cloud/api/commands/PreparePrimaryStorageForMaintenanceCmd.java index 6b933414b58..6c2a6e817a7 100644 --- a/server/src/com/cloud/api/commands/PreparePrimaryStorageForMaintenanceCmd.java +++ b/server/src/com/cloud/api/commands/PreparePrimaryStorageForMaintenanceCmd.java @@ -19,6 +19,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.BaseAsyncCmd; import com.cloud.api.Implementation; import com.cloud.api.Parameter; @@ -37,7 +38,7 @@ public class PreparePrimaryStorageForMaintenanceCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true, description="Primary storage ID") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="Primary storage ID") private Long id; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/QueryAsyncJobResultCmd.java b/server/src/com/cloud/api/commands/QueryAsyncJobResultCmd.java index fb8a3d5026e..c8f34b8acaa 100644 --- a/server/src/com/cloud/api/commands/QueryAsyncJobResultCmd.java +++ b/server/src/com/cloud/api/commands/QueryAsyncJobResultCmd.java @@ -22,6 +22,7 @@ import java.util.Date; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.BaseCmd; import com.cloud.api.Implementation; import com.cloud.api.Parameter; @@ -40,7 +41,7 @@ public class QueryAsyncJobResultCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="jobid", type=CommandType.LONG, required=true, description="the ID of the asychronous job") + @Parameter(name=ApiConstants.JOB_ID, type=CommandType.LONG, required=true, description="the ID of the asychronous job") private Long id; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/RebootRouterCmd.java b/server/src/com/cloud/api/commands/RebootRouterCmd.java index 7da5b37decd..94f7016a12d 100644 --- a/server/src/com/cloud/api/commands/RebootRouterCmd.java +++ b/server/src/com/cloud/api/commands/RebootRouterCmd.java @@ -20,6 +20,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseAsyncCmd; import com.cloud.api.Implementation; @@ -39,7 +40,7 @@ public class RebootRouterCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true, description="the ID of the router") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="the ID of the router") private Long id; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/RebootSystemVmCmd.java b/server/src/com/cloud/api/commands/RebootSystemVmCmd.java index e937c4a88f4..69b505cbc04 100644 --- a/server/src/com/cloud/api/commands/RebootSystemVmCmd.java +++ b/server/src/com/cloud/api/commands/RebootSystemVmCmd.java @@ -20,6 +20,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseAsyncCmd; import com.cloud.api.Implementation; @@ -43,7 +44,7 @@ public class RebootSystemVmCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true, description="The ID of the system virtual machine") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="The ID of the system virtual machine") private Long id; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/RebootVMCmd.java b/server/src/com/cloud/api/commands/RebootVMCmd.java index d1d7ad61c02..b7fe1e04e43 100644 --- a/server/src/com/cloud/api/commands/RebootVMCmd.java +++ b/server/src/com/cloud/api/commands/RebootVMCmd.java @@ -19,6 +19,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseAsyncCmd; import com.cloud.api.BaseCmd; @@ -44,7 +45,7 @@ public class RebootVMCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true, description="The ID of the virtual machine") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="The ID of the virtual machine") private Long id; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/ReconnectHostCmd.java b/server/src/com/cloud/api/commands/ReconnectHostCmd.java index c9c25694fbe..b0d07689177 100644 --- a/server/src/com/cloud/api/commands/ReconnectHostCmd.java +++ b/server/src/com/cloud/api/commands/ReconnectHostCmd.java @@ -27,6 +27,7 @@ import java.util.Set; import org.apache.log4j.Logger; import com.cloud.agent.AgentManager; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseAsyncCmd; import com.cloud.api.Implementation; @@ -54,7 +55,7 @@ public class ReconnectHostCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true, description="the host ID") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="the host ID") private Long id; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/RecoverVMCmd.java b/server/src/com/cloud/api/commands/RecoverVMCmd.java index 0408adb3021..11ec5d63fa0 100644 --- a/server/src/com/cloud/api/commands/RecoverVMCmd.java +++ b/server/src/com/cloud/api/commands/RecoverVMCmd.java @@ -20,6 +20,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseCmd; import com.cloud.api.Implementation; @@ -42,7 +43,7 @@ public class RecoverVMCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true, description="The ID of the virtual machine") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="The ID of the virtual machine") private Long id; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/RegisterCmd.java b/server/src/com/cloud/api/commands/RegisterCmd.java index f1fc99a0a41..5e07d02e0b0 100644 --- a/server/src/com/cloud/api/commands/RegisterCmd.java +++ b/server/src/com/cloud/api/commands/RegisterCmd.java @@ -20,6 +20,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.BaseCmd; import com.cloud.api.Implementation; import com.cloud.api.Parameter; @@ -36,7 +37,7 @@ public class RegisterCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true, description="User id") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="User id") private Long id; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/RegisterIsoCmd.java b/server/src/com/cloud/api/commands/RegisterIsoCmd.java index 5fe8693e6eb..14e03a49ce0 100755 --- a/server/src/com/cloud/api/commands/RegisterIsoCmd.java +++ b/server/src/com/cloud/api/commands/RegisterIsoCmd.java @@ -22,6 +22,7 @@ import java.util.List; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseCmd; import com.cloud.api.Implementation; @@ -45,28 +46,28 @@ public class RegisterIsoCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="bootable", type=CommandType.BOOLEAN, description="true if this ISO is bootable") + @Parameter(name=ApiConstants.BOOTABLE, type=CommandType.BOOLEAN, description="true if this ISO is bootable") private Boolean bootable; - @Parameter(name="displaytext", type=CommandType.STRING, required=true, description="the display text of the ISO. This is usually used for display purposes.") + @Parameter(name=ApiConstants.DISPLAY_TEXT, type=CommandType.STRING, required=true, description="the display text of the ISO. This is usually used for display purposes.") private String displayText; - @Parameter(name="isfeatured", type=CommandType.BOOLEAN, description="true if you want this ISO to be featured") + @Parameter(name=ApiConstants.IS_FEATURED, type=CommandType.BOOLEAN, description="true if you want this ISO to be featured") private Boolean featured; - @Parameter(name="ispublic", type=CommandType.BOOLEAN, description="true if you want to register the ISO to be publicly available to all users, false otherwise.") + @Parameter(name=ApiConstants.IS_PUBLIC, type=CommandType.BOOLEAN, description="true if you want to register the ISO to be publicly available to all users, false otherwise.") private Boolean publicIso; - @Parameter(name="name", type=CommandType.STRING, required=true, description="the name of the ISO") + @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, required=true, description="the name of the ISO") private String isoName; - @Parameter(name="ostypeid", type=CommandType.LONG, required=true, description="the ID of the OS Type that best represents the OS of this ISO") + @Parameter(name=ApiConstants.OS_TYPE_ID, type=CommandType.LONG, required=true, description="the ID of the OS Type that best represents the OS of this ISO") private Long osTypeId; - @Parameter(name="url", type=CommandType.STRING, required=true, description="the URL to where the ISO is currently being hosted") + @Parameter(name=ApiConstants.URL, type=CommandType.STRING, required=true, description="the URL to where the ISO is currently being hosted") private String url; - @Parameter(name="zoneid", type=CommandType.LONG, required=true, description="the ID of the zone you wish to register the ISO to.") + @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, required=true, description="the ID of the zone you wish to register the ISO to.") private Long zoneId; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/RegisterPreallocatedLunCmd.java b/server/src/com/cloud/api/commands/RegisterPreallocatedLunCmd.java index c07e20bb746..60237a7957e 100644 --- a/server/src/com/cloud/api/commands/RegisterPreallocatedLunCmd.java +++ b/server/src/com/cloud/api/commands/RegisterPreallocatedLunCmd.java @@ -17,6 +17,7 @@ */ package com.cloud.api.commands; +import com.cloud.api.ApiConstants; import com.cloud.api.BaseCmd; import com.cloud.api.Implementation; import com.cloud.api.Parameter; @@ -32,25 +33,25 @@ public class RegisterPreallocatedLunCmd extends BaseCmd { ///////////////////////////////////////////////////// //FIXME - add description - @Parameter(name="disksize", type=CommandType.LONG, required=true) + @Parameter(name=ApiConstants.DISK_SIZE, type=CommandType.LONG, required=true) private Long diskSize; //FIXME - add description - @Parameter(name="lun", type=CommandType.INTEGER, required=true) + @Parameter(name=ApiConstants.LUN, type=CommandType.INTEGER, required=true) private Integer lun; //FIXME - add description - @Parameter(name="portal", type=CommandType.STRING, required=true) + @Parameter(name=ApiConstants.PORTAL, type=CommandType.STRING, required=true) private String portal; //FIXME - add description - @Parameter(name="tags", type=CommandType.STRING) + @Parameter(name=ApiConstants.TAGS, type=CommandType.STRING) private String tags; - @Parameter(name="targetiqn", type=CommandType.STRING, required=true, description="the target IQN on the storage host where LUN is created") + @Parameter(name=ApiConstants.TARGET_IQN, type=CommandType.STRING, required=true, description="the target IQN on the storage host where LUN is created") private String targetIqn; - @Parameter(name="zoneid", type=CommandType.LONG, required=true, description="zone ID where LUN is going to be created") + @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, required=true, description="zone ID where LUN is going to be created") private Long zoneId; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/RegisterTemplateCmd.java b/server/src/com/cloud/api/commands/RegisterTemplateCmd.java index 37247ae8916..5d2b51de46e 100755 --- a/server/src/com/cloud/api/commands/RegisterTemplateCmd.java +++ b/server/src/com/cloud/api/commands/RegisterTemplateCmd.java @@ -22,6 +22,7 @@ import java.util.List; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseCmd; import com.cloud.api.Implementation; @@ -46,40 +47,40 @@ public class RegisterTemplateCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="bits", type=CommandType.INTEGER, description="32 or 64 bits support. 64 by default") + @Parameter(name=ApiConstants.BITS, type=CommandType.INTEGER, description="32 or 64 bits support. 64 by default") private Integer bits; - @Parameter(name="displaytext", type=CommandType.STRING, required=true, description="the display text of the template. This is usually used for display purposes.") + @Parameter(name=ApiConstants.DISPLAY_TEXT, type=CommandType.STRING, required=true, description="the display text of the template. This is usually used for display purposes.") private String displayText; - @Parameter(name="format", type=CommandType.STRING, required=true, description="the format for the template. Possible values include QCOW2, RAW, and VHD.") + @Parameter(name=ApiConstants.FORMAT, type=CommandType.STRING, required=true, description="the format for the template. Possible values include QCOW2, RAW, and VHD.") private String format; - @Parameter(name="hypervisor", type=CommandType.STRING, required=true, description="the target hypervisor for the template") + @Parameter(name=ApiConstants.HYPERVISOR, type=CommandType.STRING, required=true, description="the target hypervisor for the template") private String hypervisor; - @Parameter(name="isfeatured", type=CommandType.BOOLEAN, description="true if this template is a featured template, false otherwise") + @Parameter(name=ApiConstants.IS_FEATURED, type=CommandType.BOOLEAN, description="true if this template is a featured template, false otherwise") private Boolean featured; - @Parameter(name="ispublic", type=CommandType.BOOLEAN, description="true if the template is available to all accounts; default is true") + @Parameter(name=ApiConstants.IS_PUBLIC, type=CommandType.BOOLEAN, description="true if the template is available to all accounts; default is true") private Boolean publicTemplate; - @Parameter(name="name", type=CommandType.STRING, required=true, description="the name of the template") + @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, required=true, description="the name of the template") private String templateName; - @Parameter(name="ostypeid", type=CommandType.LONG, required=true, description="the ID of the OS Type that best represents the OS of this template.") + @Parameter(name=ApiConstants.OS_TYPE_ID, type=CommandType.LONG, required=true, description="the ID of the OS Type that best represents the OS of this template.") private Long osTypeId; - @Parameter(name="passwordenabled", type=CommandType.BOOLEAN, description="true if the template supports the password reset feature; default is false") + @Parameter(name=ApiConstants.PASSWORD_ENABLED, type=CommandType.BOOLEAN, description="true if the template supports the password reset feature; default is false") private Boolean passwordEnabled; - @Parameter(name="requireshvm", type=CommandType.BOOLEAN, description="true if this template requires HVM") + @Parameter(name=ApiConstants.REQUIRES_HVM, type=CommandType.BOOLEAN, description="true if this template requires HVM") private Boolean requiresHvm; - @Parameter(name="url", type=CommandType.STRING, required=true, description="the URL of where the template is hosted. Possible URL include http:// and https://") + @Parameter(name=ApiConstants.URL, type=CommandType.STRING, required=true, description="the URL of where the template is hosted. Possible URL include http:// and https://") private String url; - @Parameter(name="zoneid", type=CommandType.LONG, required=true, description="the ID of the zone the template is to be hosted on") + @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, required=true, description="the ID of the zone the template is to be hosted on") private Long zoneId; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/RemoveFromLoadBalancerRuleCmd.java b/server/src/com/cloud/api/commands/RemoveFromLoadBalancerRuleCmd.java index cae3a92dfdb..f4a20e14dac 100644 --- a/server/src/com/cloud/api/commands/RemoveFromLoadBalancerRuleCmd.java +++ b/server/src/com/cloud/api/commands/RemoveFromLoadBalancerRuleCmd.java @@ -22,6 +22,7 @@ import java.util.List; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseAsyncCmd; import com.cloud.api.Implementation; @@ -43,13 +44,13 @@ public class RemoveFromLoadBalancerRuleCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true, description="The ID of the load balancer rule") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="The ID of the load balancer rule") private Long id; - @Parameter(name="virtualmachineid", type=CommandType.LONG, description="the ID of the virtual machine that is being removed from the load balancer rule") + @Parameter(name=ApiConstants.VIRTUAL_MACHINE_ID, type=CommandType.LONG, description="the ID of the virtual machine that is being removed from the load balancer rule") private Long virtualMachineId; - @Parameter(name="virtualmachineids", type=CommandType.LIST, collectionType=CommandType.LONG, description="the list of IDs of the virtual machines that are being removed from the load balancer rule (i.e. virtualMachineIds=1,2,3)") + @Parameter(name=ApiConstants.VIRTUAL_MACHINE_IDS, type=CommandType.LIST, collectionType=CommandType.LONG, description="the list of IDs of the virtual machines that are being removed from the load balancer rule (i.e. virtualMachineIds=1,2,3)") private List virtualMachineIds; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/RemovePortForwardingServiceCmd.java b/server/src/com/cloud/api/commands/RemovePortForwardingServiceCmd.java index 0279c7f895f..0c6227cfd67 100644 --- a/server/src/com/cloud/api/commands/RemovePortForwardingServiceCmd.java +++ b/server/src/com/cloud/api/commands/RemovePortForwardingServiceCmd.java @@ -19,6 +19,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseAsyncCmd; import com.cloud.api.Implementation; @@ -39,13 +40,13 @@ public class RemovePortForwardingServiceCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true, description="the ID of the port forwarding service to remove from the virtual machine/publicIp") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="the ID of the port forwarding service to remove from the virtual machine/publicIp") private Long id; - @Parameter(name="publicip", type=CommandType.STRING, required=true, description="the public IP address associated with the port forwarding service") + @Parameter(name=ApiConstants.PUBLIC_IP, type=CommandType.STRING, required=true, description="the public IP address associated with the port forwarding service") private String publicIp; - @Parameter(name="virtualmachineid", type=CommandType.LONG, required=true, description="the virtual machine currently assigned to the port forwarding service") + @Parameter(name=ApiConstants.VIRTUAL_MACHINE_ID, type=CommandType.LONG, required=true, description="the virtual machine currently assigned to the port forwarding service") private Long virtualMachineId; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/ResetVMPasswordCmd.java b/server/src/com/cloud/api/commands/ResetVMPasswordCmd.java index b475ef7dbda..51c81748fee 100644 --- a/server/src/com/cloud/api/commands/ResetVMPasswordCmd.java +++ b/server/src/com/cloud/api/commands/ResetVMPasswordCmd.java @@ -19,6 +19,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseAsyncCmd; import com.cloud.api.BaseCmd; @@ -47,11 +48,11 @@ public class ResetVMPasswordCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true, description="The ID of the virtual machine") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="The ID of the virtual machine") private Long id; // unexposed parameter needed for serializing/deserializing the command - @Parameter(name="password", type=CommandType.STRING, expose=false) + @Parameter(name=ApiConstants.PASSWORD, type=CommandType.STRING, expose=false) private String password; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/RevokeNetworkGroupIngressCmd.java b/server/src/com/cloud/api/commands/RevokeNetworkGroupIngressCmd.java index 6fc6e434c3b..a50433c1144 100644 --- a/server/src/com/cloud/api/commands/RevokeNetworkGroupIngressCmd.java +++ b/server/src/com/cloud/api/commands/RevokeNetworkGroupIngressCmd.java @@ -7,6 +7,7 @@ import java.util.Map; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseAsyncCmd; import com.cloud.api.Implementation; @@ -29,43 +30,43 @@ public class RevokeNetworkGroupIngressCmd extends BaseAsyncCmd { ///////////////////////////////////////////////////// //FIXME - add description - @Parameter(name="account", type=CommandType.STRING) + @Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING) private String accountName; //FIXME - add description - @Parameter(name="cidrlist", type=CommandType.STRING) + @Parameter(name=ApiConstants.CIDR_LIST, type=CommandType.STRING) private String cidrList; //FIXME - add description - @Parameter(name="domainid", type=CommandType.LONG) + @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG) private Long domainId; //FIXME - add description - @Parameter(name="endport", type=CommandType.INTEGER) + @Parameter(name=ApiConstants.END_PORT, type=CommandType.INTEGER) private Integer endPort; //FIXME - add description - @Parameter(name="icmpcode", type=CommandType.INTEGER) + @Parameter(name=ApiConstants.ICMP_CODE, type=CommandType.INTEGER) private Integer icmpCode; //FIXME - add description - @Parameter(name="icmptype", type=CommandType.INTEGER) + @Parameter(name=ApiConstants.ICMP_TYPE, type=CommandType.INTEGER) private Integer icmpType; //FIXME - add description - @Parameter(name="networkgroupname", type=CommandType.STRING, required=true) + @Parameter(name=ApiConstants.NETWORK_GROUP_NAME, type=CommandType.STRING, required=true) private String networkGroupName; //FIXME - add description - @Parameter(name="protocol", type=CommandType.STRING) + @Parameter(name=ApiConstants.PROTOCOL, type=CommandType.STRING) private String protocol; //FIXME - add description - @Parameter(name="startport", type=CommandType.INTEGER) + @Parameter(name=ApiConstants.START_PORT, type=CommandType.INTEGER) private Integer startPort; //FIXME - add description - @Parameter(name="usernetworkgrouplist", type=CommandType.MAP) + @Parameter(name=ApiConstants.USER_NETWORK_GROUP_LIST, type=CommandType.MAP) private Map userNetworkGroupList; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/StartRouterCmd.java b/server/src/com/cloud/api/commands/StartRouterCmd.java index 0f6cd0a95cb..2b25a3d0ef6 100644 --- a/server/src/com/cloud/api/commands/StartRouterCmd.java +++ b/server/src/com/cloud/api/commands/StartRouterCmd.java @@ -20,6 +20,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseAsyncCmd; import com.cloud.api.Implementation; @@ -42,7 +43,7 @@ public class StartRouterCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true, description="the ID of the router") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="the ID of the router") private Long id; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/StartSystemVMCmd.java b/server/src/com/cloud/api/commands/StartSystemVMCmd.java index 84f04962721..381d613744c 100644 --- a/server/src/com/cloud/api/commands/StartSystemVMCmd.java +++ b/server/src/com/cloud/api/commands/StartSystemVMCmd.java @@ -20,6 +20,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseAsyncCmd; import com.cloud.api.Implementation; @@ -43,7 +44,7 @@ public class StartSystemVMCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true, description="The ID of the system virtual machine") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="The ID of the system virtual machine") private Long id; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/StopRouterCmd.java b/server/src/com/cloud/api/commands/StopRouterCmd.java index a531a5f3561..3c8b3f8ed0e 100644 --- a/server/src/com/cloud/api/commands/StopRouterCmd.java +++ b/server/src/com/cloud/api/commands/StopRouterCmd.java @@ -20,6 +20,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseAsyncCmd; import com.cloud.api.Implementation; @@ -41,7 +42,7 @@ public class StopRouterCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true, description="the ID of the router") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="the ID of the router") private Long id; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/StopSystemVmCmd.java b/server/src/com/cloud/api/commands/StopSystemVmCmd.java index a8f1a0bc70f..615abb7a20c 100644 --- a/server/src/com/cloud/api/commands/StopSystemVmCmd.java +++ b/server/src/com/cloud/api/commands/StopSystemVmCmd.java @@ -20,6 +20,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseAsyncCmd; import com.cloud.api.Implementation; @@ -43,7 +44,7 @@ public class StopSystemVmCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true, description="The ID of the system virtual machine") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="The ID of the system virtual machine") private Long id; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/StopVMCmd.java b/server/src/com/cloud/api/commands/StopVMCmd.java index 91e9eaa09b2..4d8953b45e0 100644 --- a/server/src/com/cloud/api/commands/StopVMCmd.java +++ b/server/src/com/cloud/api/commands/StopVMCmd.java @@ -19,6 +19,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseAsyncCmd; import com.cloud.api.BaseCmd; @@ -45,7 +46,7 @@ public class StopVMCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true, description="The ID of the virtual machine") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="The ID of the virtual machine") private Long id; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/UpdateAccountCmd.java b/server/src/com/cloud/api/commands/UpdateAccountCmd.java index ec5f1ed6ec2..f1a6ab213c2 100644 --- a/server/src/com/cloud/api/commands/UpdateAccountCmd.java +++ b/server/src/com/cloud/api/commands/UpdateAccountCmd.java @@ -19,6 +19,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.BaseCmd; import com.cloud.api.Implementation; import com.cloud.api.Parameter; @@ -35,13 +36,13 @@ public class UpdateAccountCmd extends BaseCmd{ //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="account", type=CommandType.STRING, required=true, description="the current account name") + @Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, required=true, description="the current account name") private String accountName; - @Parameter(name="domainid", type=CommandType.LONG, required=true, description="the ID of the domain where the account exists") + @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, required=true, description="the ID of the domain where the account exists") private Long domainId; - @Parameter(name="newname", type=CommandType.STRING, required=true, description="new name for the account") + @Parameter(name=ApiConstants.NEW_NAME, type=CommandType.STRING, required=true, description="new name for the account") private String newName; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/UpdateCfgCmd.java b/server/src/com/cloud/api/commands/UpdateCfgCmd.java index b51a316f8ea..4b5c10a9ff4 100644 --- a/server/src/com/cloud/api/commands/UpdateCfgCmd.java +++ b/server/src/com/cloud/api/commands/UpdateCfgCmd.java @@ -20,6 +20,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.BaseCmd; import com.cloud.api.Implementation; import com.cloud.api.Parameter; @@ -36,10 +37,10 @@ public class UpdateCfgCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="name", type=CommandType.STRING, required=true, description="the name of the configuration") + @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, required=true, description="the name of the configuration") private String cfgName; - @Parameter(name="value", type=CommandType.STRING, description="the value of the configuration") + @Parameter(name=ApiConstants.VALUE, type=CommandType.STRING, description="the value of the configuration") private String value; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/UpdateDiskOfferingCmd.java b/server/src/com/cloud/api/commands/UpdateDiskOfferingCmd.java index 73b3aae0c84..c9255342af5 100644 --- a/server/src/com/cloud/api/commands/UpdateDiskOfferingCmd.java +++ b/server/src/com/cloud/api/commands/UpdateDiskOfferingCmd.java @@ -19,6 +19,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.BaseCmd; import com.cloud.api.Implementation; import com.cloud.api.Parameter; @@ -35,18 +36,17 @@ public class UpdateDiskOfferingCmd extends BaseCmd{ ///////////////////////////////////////////////////// //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - - @Parameter(name="displaytext", type=CommandType.STRING, description="updates alternate display text of the disk offering with this value") + @Parameter(name=ApiConstants.DISPLAY_TEXT, type=CommandType.STRING, description="updates alternate display text of the disk offering with this value") private String displayText; - @Parameter(name="id", type=CommandType.LONG, required=true, description="ID of the disk offering") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="ID of the disk offering") private Long id; - @Parameter(name="name", type=CommandType.STRING, description="updates name of the disk offering with this value") + @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="updates name of the disk offering with this value") private String diskOfferingName; - @Parameter(name="tags", type=CommandType.STRING, description="update tags of the disk offering with this value") + @Parameter(name=ApiConstants.TAGS, type=CommandType.STRING, description="update tags of the disk offering with this value") private String tags; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/UpdateDomainCmd.java b/server/src/com/cloud/api/commands/UpdateDomainCmd.java index dcb790346b3..ba3dfb7405e 100644 --- a/server/src/com/cloud/api/commands/UpdateDomainCmd.java +++ b/server/src/com/cloud/api/commands/UpdateDomainCmd.java @@ -19,6 +19,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.BaseCmd; import com.cloud.api.Implementation; import com.cloud.api.Parameter; @@ -35,10 +36,10 @@ public class UpdateDomainCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true, description="ID of domain to update") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="ID of domain to update") private Long id; - @Parameter(name="name", type=CommandType.STRING, description="updates domain with this name") + @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="updates domain with this name") private String domainName; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/UpdateHostCmd.java b/server/src/com/cloud/api/commands/UpdateHostCmd.java index 41086021e5b..b305a62b548 100644 --- a/server/src/com/cloud/api/commands/UpdateHostCmd.java +++ b/server/src/com/cloud/api/commands/UpdateHostCmd.java @@ -27,6 +27,7 @@ import java.util.Set; import org.apache.log4j.Logger; import com.cloud.agent.AgentManager; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseCmd; import com.cloud.api.Implementation; @@ -51,10 +52,10 @@ public class UpdateHostCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true, description="the ID of the host to update") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="the ID of the host to update") private Long id; - @Parameter(name="oscategoryid", type=CommandType.LONG) + @Parameter(name=ApiConstants.OS_CATEGORY_ID, type=CommandType.LONG) private Long osCategoryId; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/UpdateIPForwardingRuleCmd.java b/server/src/com/cloud/api/commands/UpdateIPForwardingRuleCmd.java index bed150d8af2..b4617b2e458 100644 --- a/server/src/com/cloud/api/commands/UpdateIPForwardingRuleCmd.java +++ b/server/src/com/cloud/api/commands/UpdateIPForwardingRuleCmd.java @@ -2,6 +2,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseAsyncCmd; import com.cloud.api.Implementation; @@ -23,22 +24,22 @@ public class UpdateIPForwardingRuleCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="privateip", type=CommandType.STRING, description="the private IP address of the port forwarding rule") + @Parameter(name=ApiConstants.PRIVATE_IP, type=CommandType.STRING, description="the private IP address of the port forwarding rule") private String privateIp; - @Parameter(name="privateport", type=CommandType.STRING, required=true, description="the private port of the port forwarding rule") + @Parameter(name=ApiConstants.PRIVATE_PORT, type=CommandType.STRING, required=true, description="the private port of the port forwarding rule") private String privatePort; - @Parameter(name="protocol", type=CommandType.STRING, required=true, description="the protocol for the port fowarding rule. Valid values are TCP or UDP.") + @Parameter(name=ApiConstants.PROTOCOL, type=CommandType.STRING, required=true, description="the protocol for the port fowarding rule. Valid values are TCP or UDP.") private String protocol; - @Parameter(name="publicip", type=CommandType.STRING, required=true, description="the public IP address of the port forwarding rule") + @Parameter(name=ApiConstants.PUBLIC_IP, type=CommandType.STRING, required=true, description="the public IP address of the port forwarding rule") private String publicIp; - @Parameter(name="publicport", type=CommandType.STRING, required=true, description="the public port of the port forwarding rule") + @Parameter(name=ApiConstants.PUBLIC_PORT, type=CommandType.STRING, required=true, description="the public port of the port forwarding rule") private String publicPort; - @Parameter(name="virtualmachineid", type=CommandType.LONG, description="the ID of the virtual machine for the port forwarding rule") + @Parameter(name=ApiConstants.VIRTUAL_MACHINE_ID, type=CommandType.LONG, description="the ID of the virtual machine for the port forwarding rule") private Long virtualMachineId; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/UpdateIsoCmd.java b/server/src/com/cloud/api/commands/UpdateIsoCmd.java index 0acd5d809cc..7dc6146729a 100755 --- a/server/src/com/cloud/api/commands/UpdateIsoCmd.java +++ b/server/src/com/cloud/api/commands/UpdateIsoCmd.java @@ -42,8 +42,7 @@ public class UpdateIsoCmd extends UpdateTemplateOrIsoCmd { public String getFormat() { return null; } - - + ///////////////////////////////////////////////////// /////////////// API Implementation/////////////////// ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/UpdateLoadBalancerRuleCmd.java b/server/src/com/cloud/api/commands/UpdateLoadBalancerRuleCmd.java index b1efdd95308..cc349e87e9c 100644 --- a/server/src/com/cloud/api/commands/UpdateLoadBalancerRuleCmd.java +++ b/server/src/com/cloud/api/commands/UpdateLoadBalancerRuleCmd.java @@ -19,6 +19,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseAsyncCmd; import com.cloud.api.Implementation; @@ -38,19 +39,19 @@ public class UpdateLoadBalancerRuleCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="algorithm", type=CommandType.STRING, description="load balancer algorithm (source, roundrobin, leastconn)") + @Parameter(name=ApiConstants.ALGORITHM, type=CommandType.STRING, description="load balancer algorithm (source, roundrobin, leastconn)") private String algorithm; - @Parameter(name="description", type=CommandType.STRING, description="the description of the load balancer rule") + @Parameter(name=ApiConstants.DESCRIPTION, type=CommandType.STRING, description="the description of the load balancer rule") private String description; - @Parameter(name="id", type=CommandType.LONG, required=true, description="the id of the load balancer rule to update") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="the id of the load balancer rule to update") private Long id; - @Parameter(name="name", type=CommandType.STRING, description="the name of the load balancer rule") + @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="the name of the load balancer rule") private String loadBalancerName; - @Parameter(name="privateport", type=CommandType.STRING, description="the private port of the private ip address/virtual machine where the network traffic will be load balanced to") + @Parameter(name=ApiConstants.PRIVATE_PORT, type=CommandType.STRING, description="the private port of the private ip address/virtual machine where the network traffic will be load balanced to") private String privatePort; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/UpdatePodCmd.java b/server/src/com/cloud/api/commands/UpdatePodCmd.java index 81beba6b0a0..71ac3e1024f 100644 --- a/server/src/com/cloud/api/commands/UpdatePodCmd.java +++ b/server/src/com/cloud/api/commands/UpdatePodCmd.java @@ -20,6 +20,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.BaseCmd; import com.cloud.api.Implementation; import com.cloud.api.Parameter; @@ -36,22 +37,22 @@ public class UpdatePodCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="cidr", type=CommandType.STRING, description="the CIDR notation for the base IP address of the Pod") + @Parameter(name=ApiConstants.CIDR, type=CommandType.STRING, description="the CIDR notation for the base IP address of the Pod") private String cidr; - @Parameter(name="endip", type=CommandType.STRING, description="the ending IP address for the Pod") + @Parameter(name=ApiConstants.END_IP, type=CommandType.STRING, description="the ending IP address for the Pod") private String endIp; - @Parameter(name="gateway", type=CommandType.STRING, description="the gateway for the Pod") + @Parameter(name=ApiConstants.GATEWAY, type=CommandType.STRING, description="the gateway for the Pod") private String gateway; - @Parameter(name="id", type=CommandType.LONG, required=true, description="the ID of the Pod") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="the ID of the Pod") private Long id; - @Parameter(name="name", type=CommandType.STRING, description="the name of the Pod") + @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="the name of the Pod") private String podName; - @Parameter(name="startip", type=CommandType.STRING, description="the starting IP address for the Pod") + @Parameter(name=ApiConstants.START_IP, type=CommandType.STRING, description="the starting IP address for the Pod") private String startIp; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/UpdateResourceLimitCmd.java b/server/src/com/cloud/api/commands/UpdateResourceLimitCmd.java index 1f6085186bd..3b473bb608a 100644 --- a/server/src/com/cloud/api/commands/UpdateResourceLimitCmd.java +++ b/server/src/com/cloud/api/commands/UpdateResourceLimitCmd.java @@ -20,6 +20,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseCmd; import com.cloud.api.Implementation; @@ -40,16 +41,16 @@ public class UpdateResourceLimitCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="account", type=CommandType.STRING, description="Update resource for a specified account. Must be used with the domainId parameter.") + @Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, description="Update resource for a specified account. Must be used with the domainId parameter.") private String accountName; - @Parameter(name="domainid", type=CommandType.LONG, description="Update resource limits for all accounts in specified domain. If used with the account parameter, updates resource limits for a specified account in specified domain.") + @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, description="Update resource limits for all accounts in specified domain. If used with the account parameter, updates resource limits for a specified account in specified domain.") private Long domainId; - @Parameter(name="max", type=CommandType.LONG, description=" Maximum resource limit.") + @Parameter(name=ApiConstants.MAX, type=CommandType.LONG, description=" Maximum resource limit.") private Long max; - @Parameter(name="resourcetype", type=CommandType.INTEGER, required=true, description="Type of resource to update. Values are 0, 1, 2, 3, and 4. 0 - Instance. Number of instances a user can create. " + + @Parameter(name=ApiConstants.RESOURCE_TYPE, type=CommandType.INTEGER, required=true, description="Type of resource to update. Values are 0, 1, 2, 3, and 4. 0 - Instance. Number of instances a user can create. " + "1 - IP. Number of public IP addresses a user can own. " + "2 - Volume. Number of disk volumes a user can create." + "3 - Snapshot. Number of snapshots a user can create." + diff --git a/server/src/com/cloud/api/commands/UpdateServiceOfferingCmd.java b/server/src/com/cloud/api/commands/UpdateServiceOfferingCmd.java index c8821d6644f..57f65597c45 100644 --- a/server/src/com/cloud/api/commands/UpdateServiceOfferingCmd.java +++ b/server/src/com/cloud/api/commands/UpdateServiceOfferingCmd.java @@ -19,6 +19,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.BaseCmd; import com.cloud.api.Implementation; import com.cloud.api.Parameter; @@ -36,22 +37,22 @@ public class UpdateServiceOfferingCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="displaytext", type=CommandType.STRING, description="the display text of the service offering to be updated") + @Parameter(name=ApiConstants.DISPLAY_TEXT, type=CommandType.STRING, description="the display text of the service offering to be updated") private String displayText; - @Parameter(name="id", type=CommandType.LONG, required=true, description="the ID of the service offering to be updated") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="the ID of the service offering to be updated") private Long id; - @Parameter(name="name", type=CommandType.STRING, description="the name of the service offering to be updated") + @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="the name of the service offering to be updated") private String serviceOfferingName; - @Parameter(name="offerha", type=CommandType.BOOLEAN, description="the HA of the service offering to be updated") + @Parameter(name=ApiConstants.OFFER_HA, type=CommandType.BOOLEAN, description="the HA of the service offering to be updated") private Boolean offerHa; - @Parameter(name="tags", type=CommandType.STRING, description="the tags for this service offering.") + @Parameter(name=ApiConstants.TAGS, type=CommandType.STRING, description="the tags for this service offering.") private String tags; - @Parameter(name="usevirtualnetwork", type=CommandType.BOOLEAN, description="if true, the VM created from the offering will use default virtual networking. If false, the VM created will use a direct attached networking model. The default value is true.") + @Parameter(name=ApiConstants.USE_VIRTUAL_NETWORK, type=CommandType.BOOLEAN, description="if true, the VM created from the offering will use default virtual networking. If false, the VM created will use a direct attached networking model. The default value is true.") private Boolean useVirtualNetwork; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/UpdateStoragePoolCmd.java b/server/src/com/cloud/api/commands/UpdateStoragePoolCmd.java index dde937e04c8..c0f4efdac53 100644 --- a/server/src/com/cloud/api/commands/UpdateStoragePoolCmd.java +++ b/server/src/com/cloud/api/commands/UpdateStoragePoolCmd.java @@ -20,6 +20,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseCmd; import com.cloud.api.Implementation; @@ -40,10 +41,10 @@ public class UpdateStoragePoolCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true, description="the Id of the storage pool") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="the Id of the storage pool") private Long id; - @Parameter(name="tags", type=CommandType.STRING, description="the tags for the storage pool") + @Parameter(name=ApiConstants.TAGS, type=CommandType.STRING, description="the tags for the storage pool") private String tags; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/UpdateTemplateOrIsoCmd.java b/server/src/com/cloud/api/commands/UpdateTemplateOrIsoCmd.java index c1f1fdab7ba..5c5537af58c 100644 --- a/server/src/com/cloud/api/commands/UpdateTemplateOrIsoCmd.java +++ b/server/src/com/cloud/api/commands/UpdateTemplateOrIsoCmd.java @@ -20,6 +20,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.BaseCmd; import com.cloud.api.Implementation; import com.cloud.api.Parameter; @@ -33,25 +34,25 @@ public abstract class UpdateTemplateOrIsoCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="bootable", type=CommandType.BOOLEAN, description="true if image is bootable, false otherwise") + @Parameter(name=ApiConstants.BOOTABLE, type=CommandType.BOOLEAN, description="true if image is bootable, false otherwise") private Boolean bootable; - @Parameter(name="displaytext", type=CommandType.STRING, description="the display text of the image") + @Parameter(name=ApiConstants.DISPLAY_TEXT, type=CommandType.STRING, description="the display text of the image") private String displayText; - @Parameter(name="id", type=CommandType.LONG, required=true, description="the ID of the image file") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="the ID of the image file") private Long id; - @Parameter(name="name", type=CommandType.STRING, description="the name of the image file") + @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="the name of the image file") private String templateName; - @Parameter(name="ostypeid", type=CommandType.LONG, description="the ID of the OS type that best represents the OS of this image.") + @Parameter(name=ApiConstants.OS_TYPE_ID, type=CommandType.LONG, description="the ID of the OS type that best represents the OS of this image.") private Long osTypeId; - @Parameter(name="format", type=CommandType.STRING, description="the format for the image") + @Parameter(name=ApiConstants.FORMAT, type=CommandType.STRING, description="the format for the image") private String format; - @Parameter(name="passwordenabled", type=CommandType.BOOLEAN, description="true if the image supports the password reset feature; default is false") + @Parameter(name=ApiConstants.PASSWORD_ENABLED, type=CommandType.BOOLEAN, description="true if the image supports the password reset feature; default is false") private Boolean passwordEnabled; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/UpdateTemplateOrIsoPermissionsCmd.java b/server/src/com/cloud/api/commands/UpdateTemplateOrIsoPermissionsCmd.java index 4cae78a231b..e6a6069ef64 100644 --- a/server/src/com/cloud/api/commands/UpdateTemplateOrIsoPermissionsCmd.java +++ b/server/src/com/cloud/api/commands/UpdateTemplateOrIsoPermissionsCmd.java @@ -4,6 +4,7 @@ import java.util.List; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.BaseCmd; import com.cloud.api.Implementation; import com.cloud.api.Parameter; @@ -21,19 +22,19 @@ public abstract class UpdateTemplateOrIsoPermissionsCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="accounts", type=CommandType.LIST, collectionType=CommandType.STRING, description="a comma delimited list of accounts") + @Parameter(name=ApiConstants.ACCOUNTS, type=CommandType.LIST, collectionType=CommandType.STRING, description="a comma delimited list of accounts") private List accountNames; - @Parameter(name="id", type=CommandType.LONG, required=true, description="the template ID") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="the template ID") private Long id; - @Parameter(name="isfeatured", type=CommandType.BOOLEAN, description="true for featured templates/isos, false otherwise") + @Parameter(name=ApiConstants.IS_FEATURED, type=CommandType.BOOLEAN, description="true for featured templates/isos, false otherwise") private Boolean featured; - @Parameter(name="ispublic", type=CommandType.BOOLEAN, description="true for public templates/isos, false for private templates/isos") + @Parameter(name=ApiConstants.IS_PUBLIC, type=CommandType.BOOLEAN, description="true for public templates/isos, false for private templates/isos") private Boolean isPublic; - @Parameter(name="op", type=CommandType.STRING, description="permission operator (add, remove, reset)") + @Parameter(name=ApiConstants.OP, type=CommandType.STRING, description="permission operator (add, remove, reset)") private String operation; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/UpdateUserCmd.java b/server/src/com/cloud/api/commands/UpdateUserCmd.java index 83a03388b22..1bddc3dde67 100644 --- a/server/src/com/cloud/api/commands/UpdateUserCmd.java +++ b/server/src/com/cloud/api/commands/UpdateUserCmd.java @@ -20,6 +20,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.BaseCmd; import com.cloud.api.Implementation; import com.cloud.api.Parameter; @@ -36,31 +37,31 @@ public class UpdateUserCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="apikey", type=CommandType.STRING, description="The API key for the user.") + @Parameter(name=ApiConstants.API_KEY, type=CommandType.STRING, description="The API key for the user.") private String apiKey; - @Parameter(name="email", type=CommandType.STRING, description="email") + @Parameter(name=ApiConstants.EMAIL, type=CommandType.STRING, description="email") private String email; - @Parameter(name="firstname", type=CommandType.STRING, description="first name") + @Parameter(name=ApiConstants.FIRSTNAME, type=CommandType.STRING, description="first name") private String firstname; - @Parameter(name="id", type=CommandType.LONG, required=true, description="User id") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="User id") private Long id; - @Parameter(name="lastname", type=CommandType.STRING, description="last name") + @Parameter(name=ApiConstants.LASTNAME, type=CommandType.STRING, description="last name") private String lastname; - @Parameter(name="password", type=CommandType.STRING, description="Hashed password (default is MD5). If you wish to use any other hasing algorithm, you would need to write a custom authentication adapter") + @Parameter(name=ApiConstants.PASSWORD, type=CommandType.STRING, description="Hashed password (default is MD5). If you wish to use any other hasing algorithm, you would need to write a custom authentication adapter") private String password; - @Parameter(name="secretkey", type=CommandType.STRING, description="The secret key for the user.") + @Parameter(name=ApiConstants.SECRET_KEY, type=CommandType.STRING, description="The secret key for the user.") private String secretKey; - @Parameter(name="timezone", type=CommandType.STRING, description="Specifies a timezone for this command. For more information on the timezone parameter, see Time Zone Format.") + @Parameter(name=ApiConstants.TIMEZONE, type=CommandType.STRING, description="Specifies a timezone for this command. For more information on the timezone parameter, see Time Zone Format.") private String timezone; - @Parameter(name="username", type=CommandType.STRING, description="Unique username") + @Parameter(name=ApiConstants.USERNAME, type=CommandType.STRING, description="Unique username") private String username; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/UpdateVMCmd.java b/server/src/com/cloud/api/commands/UpdateVMCmd.java index 94686651d1f..687b6376603 100644 --- a/server/src/com/cloud/api/commands/UpdateVMCmd.java +++ b/server/src/com/cloud/api/commands/UpdateVMCmd.java @@ -19,6 +19,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.BaseCmd; import com.cloud.api.Implementation; import com.cloud.api.Parameter; @@ -34,16 +35,16 @@ public class UpdateVMCmd extends BaseCmd{ //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="displayname", type=CommandType.STRING, description="user generated name") + @Parameter(name=ApiConstants.DISPLAY_NAME, type=CommandType.STRING, description="user generated name") private String displayName; - @Parameter(name="group", type=CommandType.STRING, description="group of the virtual machine") + @Parameter(name=ApiConstants.GROUP, type=CommandType.STRING, description="group of the virtual machine") private String group; - @Parameter(name="haenable", type=CommandType.BOOLEAN, description="true if high-availability is enabled for the virtual machine, false otherwise") + @Parameter(name=ApiConstants.HA_ENABLE, type=CommandType.BOOLEAN, description="true if high-availability is enabled for the virtual machine, false otherwise") private Boolean haEnable; - @Parameter(name="id", type=CommandType.LONG, required=true, description="The ID of the virtual machine") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="The ID of the virtual machine") private Long id; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/UpdateVMGroupCmd.java b/server/src/com/cloud/api/commands/UpdateVMGroupCmd.java index f00e18cb5e7..c02b1bbfe5f 100644 --- a/server/src/com/cloud/api/commands/UpdateVMGroupCmd.java +++ b/server/src/com/cloud/api/commands/UpdateVMGroupCmd.java @@ -19,6 +19,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseCmd; import com.cloud.api.Implementation; @@ -37,10 +38,10 @@ public class UpdateVMGroupCmd extends BaseCmd{ //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true, description="Instance group ID") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="Instance group ID") private Long id; - @Parameter(name="name", type=CommandType.STRING, description="new instance group name") + @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="new instance group name") private String groupName; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/UpdateZoneCmd.java b/server/src/com/cloud/api/commands/UpdateZoneCmd.java index 4eb4d4f8a12..3ba04b77fde 100644 --- a/server/src/com/cloud/api/commands/UpdateZoneCmd.java +++ b/server/src/com/cloud/api/commands/UpdateZoneCmd.java @@ -20,6 +20,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.BaseCmd; import com.cloud.api.Implementation; import com.cloud.api.Parameter; @@ -38,35 +39,36 @@ public class UpdateZoneCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="dns1", type=CommandType.STRING, description="the first DNS for the Zone") + @Parameter(name=ApiConstants.DNS1, type=CommandType.STRING, description="the first DNS for the Zone") private String dns1; - @Parameter(name="dns2", type=CommandType.STRING, description="the second DNS for the Zone") + @Parameter(name=ApiConstants.DNS2, type=CommandType.STRING, description="the second DNS for the Zone") private String dns2; - @Parameter(name="guestcidraddress", type=CommandType.STRING, description="the guest CIDR address for the Zone") + @Parameter(name=ApiConstants.GUEST_CIDR_ADDRESS, type=CommandType.STRING, description="the guest CIDR address for the Zone") private String guestCidrAddress; - @Parameter(name="id", type=CommandType.LONG, required=true, description="the ID of the Zone") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="the ID of the Zone") private Long id; - @Parameter(name="internaldns1", type=CommandType.STRING, description="the first internal DNS for the Zone") + @Parameter(name=ApiConstants.INTERNAL_DNS1, type=CommandType.STRING, description="the first internal DNS for the Zone") private String internalDns1; - @Parameter(name="internaldns2", type=CommandType.STRING, description="the second internal DNS for the Zone") + @Parameter(name=ApiConstants.INTERNAL_DNS2, type=CommandType.STRING, description="the second internal DNS for the Zone") private String internalDns2; - @Parameter(name="name", type=CommandType.STRING, description="the name of the Zone") + @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="the name of the Zone") private String zoneName; - @Parameter(name="vnet", type=CommandType.STRING, description="the VNET for the Zone") + @Parameter(name=ApiConstants.VNET, type=CommandType.STRING, description="the VNET for the Zone") private String vnet; - @Parameter(name="domain", type=CommandType.STRING, description="Domain name for the Vms in the zone") + @Parameter(name=ApiConstants.DOMAIN, type=CommandType.STRING, description="Domain name for the Vms in the zone") private String domain; - @Parameter(name="domainid", type=CommandType.LONG, description="the ID of the containing domain, null for public zones") + @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, description="the ID of the containing domain, null for public zones") private Long domainId; + ///////////////////////////////////////////////////// /////////////////// Accessors /////////////////////// ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/UpgradeRouterCmd.java b/server/src/com/cloud/api/commands/UpgradeRouterCmd.java index 5e86eae1539..482a773ba1f 100644 --- a/server/src/com/cloud/api/commands/UpgradeRouterCmd.java +++ b/server/src/com/cloud/api/commands/UpgradeRouterCmd.java @@ -19,6 +19,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.BaseCmd; import com.cloud.api.Implementation; import com.cloud.api.Parameter; @@ -34,10 +35,10 @@ public class UpgradeRouterCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true) + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true) private Long id; - @Parameter(name="serviceofferingid", type=CommandType.LONG, required=true) + @Parameter(name=ApiConstants.SERVICE_OFFERING_ID, type=CommandType.LONG, required=true) private Long serviceOfferingId; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/UpgradeVMCmd.java b/server/src/com/cloud/api/commands/UpgradeVMCmd.java index 99b2d53e9a9..8359491f873 100644 --- a/server/src/com/cloud/api/commands/UpgradeVMCmd.java +++ b/server/src/com/cloud/api/commands/UpgradeVMCmd.java @@ -21,6 +21,7 @@ import java.text.DecimalFormat; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseCmd; import com.cloud.api.Implementation; @@ -46,10 +47,10 @@ public class UpgradeVMCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name="id", type=CommandType.LONG, required=true, description="The ID of the virtual machine") + @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="The ID of the virtual machine") private Long id; - @Parameter(name="serviceofferingid", type=CommandType.LONG, required=true, description="the service offering ID to apply to the virtual machine") + @Parameter(name=ApiConstants.SERVICE_OFFERING_ID, type=CommandType.LONG, required=true, description="the service offering ID to apply to the virtual machine") private Long serviceOfferingId; ///////////////////////////////////////////////////// diff --git a/server/src/com/cloud/api/commands/UploadCustomCertificateCmd.java b/server/src/com/cloud/api/commands/UploadCustomCertificateCmd.java index 53f3066f3e9..ded2098874a 100644 --- a/server/src/com/cloud/api/commands/UploadCustomCertificateCmd.java +++ b/server/src/com/cloud/api/commands/UploadCustomCertificateCmd.java @@ -19,6 +19,7 @@ package com.cloud.api.commands; import org.apache.log4j.Logger; +import com.cloud.api.ApiConstants; import com.cloud.api.BaseAsyncCmd; import com.cloud.api.Implementation; import com.cloud.api.Parameter; @@ -32,7 +33,7 @@ public class UploadCustomCertificateCmd extends BaseAsyncCmd { private static final String s_name = "uploadcustomcertificateresponse"; - @Parameter(name="path", type=CommandType.STRING) + @Parameter(name=ApiConstants.PATH, type=CommandType.STRING) private String path; public String getPath() { diff --git a/server/src/com/cloud/api/response/AccountResponse.java b/server/src/com/cloud/api/response/AccountResponse.java index 5cf20e6fa4a..a4ed2931ea8 100644 --- a/server/src/com/cloud/api/response/AccountResponse.java +++ b/server/src/com/cloud/api/response/AccountResponse.java @@ -17,47 +17,48 @@ */ package com.cloud.api.response; +import com.cloud.api.ApiConstants; import com.cloud.serializer.Param; import com.google.gson.annotations.SerializedName; public class AccountResponse extends BaseResponse { - @SerializedName("id") @Param(description="the id of the account") + @SerializedName(ApiConstants.ID) @Param(description="the id of the account") private Long id; - @SerializedName("name") @Param(description="the name of the account") + @SerializedName(ApiConstants.NAME) @Param(description="the name of the account") private String name; - @SerializedName("accounttype") @Param(description="account type (admin, domain-admin, user)") + @SerializedName(ApiConstants.ACCOUNT_TYPE) @Param(description="account type (admin, domain-admin, user)") private Short accountType; - @SerializedName("domainid") @Param(description="id of the Domain the account belongs too") + @SerializedName(ApiConstants.DOMAIN_ID) @Param(description="id of the Domain the account belongs too") private Long domainId; - @SerializedName("domain") @Param(description="name of the Domain the account belongs too") + @SerializedName(ApiConstants.DOMAIN) @Param(description="name of the Domain the account belongs too") private String domainName; - @SerializedName("receivedbytes") @Param(description="the total number of network traffic bytes received") + @SerializedName(ApiConstants.RECEIVED_BYTES) @Param(description="the total number of network traffic bytes received") private Long bytesReceived; - @SerializedName("sentbytes") @Param(description="the total number of network traffic bytes sent") + @SerializedName(ApiConstants.SENT_BYTES) @Param(description="the total number of network traffic bytes sent") private Long bytesSent; - @SerializedName("vmlimit") @Param(description="the total number of virtual machines that can be deployed by this account") + @SerializedName(ApiConstants.VM_LIMIT) @Param(description="the total number of virtual machines that can be deployed by this account") private String vmLimit; - @SerializedName("vmtotal") @Param(description="the total number of virtual machines deployed by this account") + @SerializedName(ApiConstants.VM_TOTAL) @Param(description="the total number of virtual machines deployed by this account") private Long vmTotal; - @SerializedName("vmavailable") @Param(description="the total number of virtual machines available for this account to acquire") + @SerializedName(ApiConstants.VM_AVAILABLE) @Param(description="the total number of virtual machines available for this account to acquire") private String vmAvailable; - @SerializedName("iplimit") @Param(description="the total number of public ip addresses this account can acquire") + @SerializedName(ApiConstants.IP_LIMIT) @Param(description="the total number of public ip addresses this account can acquire") private String ipLimit; - @SerializedName("iptotal") @Param(description="the total number of public ip addresses allocated for this account") + @SerializedName(ApiConstants.IP_TOTAL) @Param(description="the total number of public ip addresses allocated for this account") private Long ipTotal; - @SerializedName("ipavailable") @Param(description="the total number of public ip addresses available for this account to acquire") + @SerializedName(ApiConstants.IP_AVAILABLE) @Param(description="the total number of public ip addresses available for this account to acquire") private String ipAvailable; @SerializedName("volumelimit") @Param(description="the total volume which can be used by this account") @@ -93,10 +94,10 @@ public class AccountResponse extends BaseResponse { @SerializedName("vmrunning") @Param(description="the total number of virtual machines running for this account") private Integer vmRunning; - @SerializedName("state") @Param(description="the state of the account") + @SerializedName(ApiConstants.STATE) @Param(description="the state of the account") private String state; - @SerializedName("iscleanuprequired") @Param(description="true if the account requires cleanup") + @SerializedName(ApiConstants.IS_CLEANUP_REQUIRED) @Param(description="true if the account requires cleanup") private Boolean cleanupRequired; public Long getId() { diff --git a/server/src/com/cloud/api/response/AlertResponse.java b/server/src/com/cloud/api/response/AlertResponse.java index 738367b167f..1d44a7b4da2 100644 --- a/server/src/com/cloud/api/response/AlertResponse.java +++ b/server/src/com/cloud/api/response/AlertResponse.java @@ -19,20 +19,21 @@ package com.cloud.api.response; import java.util.Date; +import com.cloud.api.ApiConstants; import com.cloud.serializer.Param; import com.google.gson.annotations.SerializedName; public class AlertResponse extends BaseResponse { - @SerializedName("id") @Param(description="the id of the alert") + @SerializedName(ApiConstants.ID) @Param(description="the id of the alert") private Long id; - @SerializedName("type") @Param(description="the alert type") + @SerializedName(ApiConstants.TYPE) @Param(description="the alert type") private Short alertType; - @SerializedName("description") @Param(description="description of the alert") + @SerializedName(ApiConstants.DESCRIPTION) @Param(description="description of the alert") private String description; - @SerializedName("sent") @Param(description="the date and time the alert was sent") + @SerializedName(ApiConstants.SENT) @Param(description="the date and time the alert was sent") private Date lastSent; public Long getId() { diff --git a/server/src/com/cloud/api/response/AsyncJobResponse.java b/server/src/com/cloud/api/response/AsyncJobResponse.java index 4f299e325ee..8beac5e14be 100644 --- a/server/src/com/cloud/api/response/AsyncJobResponse.java +++ b/server/src/com/cloud/api/response/AsyncJobResponse.java @@ -19,18 +19,19 @@ package com.cloud.api.response; import java.util.Date; +import com.cloud.api.ApiConstants; import com.cloud.api.ResponseObject; import com.cloud.serializer.Param; import com.google.gson.annotations.SerializedName; public class AsyncJobResponse extends BaseResponse { - @SerializedName("jobid") @Param(description="async job ID") + @SerializedName(ApiConstants.JOB_ID) @Param(description="async job ID") private Long id; @SerializedName("accountid") @Param(description="the account that executed the async command") private Long accountId; - @SerializedName("userid") @Param(description="the user that executed the async command") + @SerializedName(ApiConstants.USER_ID) @Param(description="the user that executed the async command") private Long userId; @SerializedName("cmd") @Param(description="the async command executed") @@ -57,7 +58,7 @@ public class AsyncJobResponse extends BaseResponse { @SerializedName("jobinstanceid") @Param(description="the unique ID of the instance/entity object related to the job") private Long jobInstanceId; - @SerializedName("created") @Param(description=" the created date of the job") + @SerializedName(ApiConstants.CREATED) @Param(description=" the created date of the job") private Date created; public Long getId() { diff --git a/server/src/com/cloud/api/response/CapacityResponse.java b/server/src/com/cloud/api/response/CapacityResponse.java index 4cb5ca5f300..6284551bd79 100644 --- a/server/src/com/cloud/api/response/CapacityResponse.java +++ b/server/src/com/cloud/api/response/CapacityResponse.java @@ -17,20 +17,21 @@ */ package com.cloud.api.response; +import com.cloud.api.ApiConstants; import com.cloud.serializer.Param; import com.google.gson.annotations.SerializedName; public class CapacityResponse extends BaseResponse { - @SerializedName("type") @Param(description="the capacity type") + @SerializedName(ApiConstants.TYPE) @Param(description="the capacity type") private Short capacityType; - @SerializedName("zoneid") @Param(description="the Zone ID") + @SerializedName(ApiConstants.ZONE_ID) @Param(description="the Zone ID") private Long zoneId; @SerializedName("zonename") @Param(description="the Zone name") private String zoneName; - @SerializedName("podid") @Param(description="the Pod ID") + @SerializedName(ApiConstants.POD_ID) @Param(description="the Pod ID") private Long podId; @SerializedName("podname") @Param(description="the Pod name") diff --git a/server/src/com/cloud/api/response/CloudIdentifierResponse.java b/server/src/com/cloud/api/response/CloudIdentifierResponse.java index 12101497a7e..75dab11f37a 100644 --- a/server/src/com/cloud/api/response/CloudIdentifierResponse.java +++ b/server/src/com/cloud/api/response/CloudIdentifierResponse.java @@ -1,11 +1,12 @@ package com.cloud.api.response; +import com.cloud.api.ApiConstants; import com.cloud.serializer.Param; import com.google.gson.annotations.SerializedName; public class CloudIdentifierResponse extends BaseResponse { - @SerializedName("userid") @Param(description="the user ID for the cloud identifier") + @SerializedName(ApiConstants.USER_ID) @Param(description="the user ID for the cloud identifier") private Long userId; @SerializedName("cloudidentifier") @Param(description="the cloud identifier") diff --git a/server/src/com/cloud/api/response/ClusterResponse.java b/server/src/com/cloud/api/response/ClusterResponse.java index 61d2ba24cb6..229acfbcd41 100644 --- a/server/src/com/cloud/api/response/ClusterResponse.java +++ b/server/src/com/cloud/api/response/ClusterResponse.java @@ -17,23 +17,24 @@ */ package com.cloud.api.response; +import com.cloud.api.ApiConstants; import com.cloud.serializer.Param; import com.google.gson.annotations.SerializedName; public class ClusterResponse extends BaseResponse { - @SerializedName("id") @Param(description="the cluster ID") + @SerializedName(ApiConstants.ID) @Param(description="the cluster ID") private Long id; - @SerializedName("name") @Param(description="the cluster name") + @SerializedName(ApiConstants.NAME) @Param(description="the cluster name") private String name; - @SerializedName("podid") @Param(description="the Pod ID of the cluster") + @SerializedName(ApiConstants.POD_ID) @Param(description="the Pod ID of the cluster") private Long podId; @SerializedName("podname") @Param(description="the Pod name of the cluster") private String podName; - @SerializedName("zoneid") @Param(description="the Zone ID of the cluster") + @SerializedName(ApiConstants.ZONE_ID) @Param(description="the Zone ID of the cluster") private Long zoneId; @SerializedName("zonename") @Param(description="the Zone name of the cluster") diff --git a/server/src/com/cloud/api/response/ConfigurationResponse.java b/server/src/com/cloud/api/response/ConfigurationResponse.java index 8d310fab04f..a46af55a9e7 100644 --- a/server/src/com/cloud/api/response/ConfigurationResponse.java +++ b/server/src/com/cloud/api/response/ConfigurationResponse.java @@ -17,20 +17,21 @@ */ package com.cloud.api.response; +import com.cloud.api.ApiConstants; import com.cloud.serializer.Param; import com.google.gson.annotations.SerializedName; public class ConfigurationResponse extends BaseResponse { - @SerializedName("category") @Param(description="the category of the configuration") + @SerializedName(ApiConstants.CATEGORY) @Param(description="the category of the configuration") private String category; - @SerializedName("name") @Param(description="the name of the configuration") + @SerializedName(ApiConstants.NAME) @Param(description="the name of the configuration") private String name; - @SerializedName("value") @Param(description="the value of the configuration") + @SerializedName(ApiConstants.VALUE) @Param(description="the value of the configuration") private String value; - @SerializedName("description") @Param(description="the description of the configuration") + @SerializedName(ApiConstants.DESCRIPTION) @Param(description="the description of the configuration") private String description; public String getCategory() { diff --git a/server/src/com/cloud/api/response/CreateCmdResponse.java b/server/src/com/cloud/api/response/CreateCmdResponse.java index 6330b05265a..c66b8940f91 100644 --- a/server/src/com/cloud/api/response/CreateCmdResponse.java +++ b/server/src/com/cloud/api/response/CreateCmdResponse.java @@ -1,12 +1,13 @@ package com.cloud.api.response; +import com.cloud.api.ApiConstants; import com.google.gson.annotations.SerializedName; public class CreateCmdResponse extends BaseResponse { - @SerializedName("jobid") + @SerializedName(ApiConstants.JOB_ID) private Long jobId; - @SerializedName("id") + @SerializedName(ApiConstants.ID) private Long id; public Long getJobId() { diff --git a/server/src/com/cloud/api/response/DiskOfferingResponse.java b/server/src/com/cloud/api/response/DiskOfferingResponse.java index 1e69d09b80f..c3b8a8b8e83 100644 --- a/server/src/com/cloud/api/response/DiskOfferingResponse.java +++ b/server/src/com/cloud/api/response/DiskOfferingResponse.java @@ -19,36 +19,36 @@ package com.cloud.api.response; import java.util.Date; +import com.cloud.api.ApiConstants; import com.cloud.serializer.Param; import com.google.gson.annotations.SerializedName; public class DiskOfferingResponse extends BaseResponse { - @SerializedName("id") @Param(description="unique ID of the disk offering") + @SerializedName(ApiConstants.ID) @Param(description="unique ID of the disk offering") private Long id; - @SerializedName("domainid") @Param(description="the domain ID this disk offering belongs to. Ignore this information as it is not currently applicable.") + @SerializedName(ApiConstants.DOMAIN_ID) @Param(description="the domain ID this disk offering belongs to. Ignore this information as it is not currently applicable.") private Long domainId; - @SerializedName("domain") @Param(description="the domain name this disk offering belongs to. Ignore this information as it is not currently applicable.") + @SerializedName(ApiConstants.DOMAIN) @Param(description="the domain name this disk offering belongs to. Ignore this information as it is not currently applicable.") private String domain; - @SerializedName("name") @Param(description="the name of the disk offering") + @SerializedName(ApiConstants.NAME) @Param(description="the name of the disk offering") private String name; - @SerializedName("displaytext") @Param(description="an alternate display text of the disk offering.") + @SerializedName(ApiConstants.DISPLAY_TEXT) @Param(description="an alternate display text of the disk offering.") private String displayText; - @SerializedName("disksize") @Param(description="the size of the disk offering in GB") + @SerializedName(ApiConstants.DISK_SIZE) @Param(description="the size of the disk offering in GB") private Long diskSize; - @SerializedName("created") @Param(description="the date this disk offering was created") + @SerializedName(ApiConstants.CREATED) @Param(description="the date this disk offering was created") private Date created; @SerializedName("ismirrored") private Boolean mirrored; - @SerializedName("tags") @Param(description="the tags for the disk offering") - + @SerializedName(ApiConstants.TAGS) @Param(description="the tags for the disk offering") private String tags; public Long getId() { diff --git a/server/src/com/cloud/api/response/DomainResponse.java b/server/src/com/cloud/api/response/DomainResponse.java index cb9537cb64f..a10545cd728 100644 --- a/server/src/com/cloud/api/response/DomainResponse.java +++ b/server/src/com/cloud/api/response/DomainResponse.java @@ -17,17 +17,18 @@ */ package com.cloud.api.response; +import com.cloud.api.ApiConstants; import com.cloud.serializer.Param; import com.google.gson.annotations.SerializedName; public class DomainResponse extends BaseResponse { - @SerializedName("id") @Param(description="the ID of the domain") + @SerializedName(ApiConstants.ID) @Param(description="the ID of the domain") private Long id; - @SerializedName("name") @Param(description="the name of the domain") + @SerializedName(ApiConstants.NAME) @Param(description="the name of the domain") private String domainName; - @SerializedName("level") @Param(description="the level of the domain") + @SerializedName(ApiConstants.LEVEL) @Param(description="the level of the domain") private Integer level; @SerializedName("parentdomainid") @Param(description="the domain ID of the parent domain") diff --git a/server/src/com/cloud/api/response/DomainRouterResponse.java b/server/src/com/cloud/api/response/DomainRouterResponse.java index f2aeedd461a..5eb3db00ac9 100644 --- a/server/src/com/cloud/api/response/DomainRouterResponse.java +++ b/server/src/com/cloud/api/response/DomainRouterResponse.java @@ -19,51 +19,52 @@ package com.cloud.api.response; import java.util.Date; +import com.cloud.api.ApiConstants; import com.cloud.serializer.Param; import com.cloud.vm.State; import com.google.gson.annotations.SerializedName; public class DomainRouterResponse extends BaseResponse { - @SerializedName("id") @Param(description="the id of the router") + @SerializedName(ApiConstants.ID) @Param(description="the id of the router") private Long id; - @SerializedName("jobid") @Param(description="the job ID associated with the router. This is only displayed if the router listed is part of a currently running asynchronous job.") + @SerializedName(ApiConstants.JOB_ID) @Param(description="the job ID associated with the router. This is only displayed if the router listed is part of a currently running asynchronous job.") private Long jobId; @SerializedName("jobstatus") @Param(description="the job status associated with the router. This is only displayed if the router listed is part of a currently running asynchronous job.") private Integer jobStatus; - @SerializedName("zoneid") @Param(description="the Zone ID for the router") + @SerializedName(ApiConstants.ZONE_ID) @Param(description="the Zone ID for the router") private Long zoneId; @SerializedName("zonename") @Param(description="the Zone name for the router") private String zoneName; - @SerializedName("dns1") @Param(description="the first DNS for the router") + @SerializedName(ApiConstants.DNS1) @Param(description="the first DNS for the router") private String dns1; - @SerializedName("dns2") @Param(description="the second DNS for the router") + @SerializedName(ApiConstants.DNS2) @Param(description="the second DNS for the router") private String dns2; @SerializedName("networkdomain") @Param(description="the network domain for the router") private String networkDomain; - @SerializedName("gateway") @Param(description="the gateway for the router") + @SerializedName(ApiConstants.GATEWAY) @Param(description="the gateway for the router") private String gateway; - @SerializedName("name") @Param(description="the name of the router") + @SerializedName(ApiConstants.NAME) @Param(description="the name of the router") private String name; - @SerializedName("podid") @Param(description="the Pod ID for the router") + @SerializedName(ApiConstants.POD_ID) @Param(description="the Pod ID for the router") private Long podId; - @SerializedName("hostid") @Param(description="the host ID for the router") + @SerializedName(ApiConstants.HOST_ID) @Param(description="the host ID for the router") private Long hostId; @SerializedName("hostname") @Param(description="the hostname for the router") private String hostName; - @SerializedName("privateip") @Param(description="the private IP address for the router") + @SerializedName(ApiConstants.PRIVATE_IP) @Param(description="the private IP address for the router") private String privateIp; @SerializedName("privatemacaddress") @Param(description="the private MAC address for the router") @@ -72,7 +73,7 @@ public class DomainRouterResponse extends BaseResponse { @SerializedName("privatenetmask") @Param(description="the private netmask for the router") private String privateNetmask; - @SerializedName("publicip") @Param(description="the public IP address for the router") + @SerializedName(ApiConstants.PUBLIC_IP) @Param(description="the public IP address for the router") private String publicIp; @SerializedName("publicmacaddress") @Param(description="the public MAC address for the router") @@ -93,19 +94,19 @@ public class DomainRouterResponse extends BaseResponse { @SerializedName("templateid") @Param(description="the template ID for the router") private Long templateId; - @SerializedName("created") @Param(description="the date and time the router was created") + @SerializedName(ApiConstants.CREATED) @Param(description="the date and time the router was created") private Date created; - @SerializedName("state") @Param(description="the state of the router") + @SerializedName(ApiConstants.STATE) @Param(description="the state of the router") private State state; - @SerializedName("account") @Param(description="the account associated with the router") + @SerializedName(ApiConstants.ACCOUNT) @Param(description="the account associated with the router") private String accountName; - @SerializedName("domainid") @Param(description="the domain ID associated with the router") + @SerializedName(ApiConstants.DOMAIN_ID) @Param(description="the domain ID associated with the router") private Long domainId; - @SerializedName("domain") @Param(description="the domain associated with the router") + @SerializedName(ApiConstants.DOMAIN) @Param(description="the domain associated with the router") private String domainName; public Long getId() { diff --git a/server/src/com/cloud/api/response/EventResponse.java b/server/src/com/cloud/api/response/EventResponse.java index f1b77d76765..2e070153dc9 100644 --- a/server/src/com/cloud/api/response/EventResponse.java +++ b/server/src/com/cloud/api/response/EventResponse.java @@ -19,39 +19,40 @@ package com.cloud.api.response; import java.util.Date; +import com.cloud.api.ApiConstants; import com.cloud.event.EventState; import com.cloud.serializer.Param; import com.google.gson.annotations.SerializedName; public class EventResponse extends BaseResponse { - @SerializedName("id") @Param(description="the ID of the event") + @SerializedName(ApiConstants.ID) @Param(description="the ID of the event") private Long id; - @SerializedName("username") @Param(description="the name of the user who performed the action (can be different from the account if an admin is performing an action for a user, e.g. starting/stopping a user's virtual machine)") + @SerializedName(ApiConstants.USERNAME) @Param(description="the name of the user who performed the action (can be different from the account if an admin is performing an action for a user, e.g. starting/stopping a user's virtual machine)") private String username; - @SerializedName("type") @Param(description="the type of the event (see event types)") + @SerializedName(ApiConstants.TYPE) @Param(description="the type of the event (see event types)") private String eventType; - @SerializedName("level") @Param(description="the event level (INFO, WARN, ERROR)") + @SerializedName(ApiConstants.LEVEL) @Param(description="the event level (INFO, WARN, ERROR)") private String level; - @SerializedName("description") @Param(description="a brief description of the event") + @SerializedName(ApiConstants.DESCRIPTION) @Param(description="a brief description of the event") private String description; - @SerializedName("account") @Param(description="the account name for the account that owns the object being acted on in the event (e.g. the owner of the virtual machine, ip address, or security group)") + @SerializedName(ApiConstants.ACCOUNT) @Param(description="the account name for the account that owns the object being acted on in the event (e.g. the owner of the virtual machine, ip address, or security group)") private String accountName; - @SerializedName("domainid") @Param(description="the id of the account's domain") + @SerializedName(ApiConstants.DOMAIN_ID) @Param(description="the id of the account's domain") private Long domainId; - @SerializedName("domain") @Param(description="the name of the account's domain") + @SerializedName(ApiConstants.DOMAIN) @Param(description="the name of the account's domain") private String domainName; - @SerializedName("created") @Param(description="the date the event was created") + @SerializedName(ApiConstants.CREATED) @Param(description="the date the event was created") private Date created; - @SerializedName("state") @Param(description="the state of the event") + @SerializedName(ApiConstants.STATE) @Param(description="the state of the event") private EventState state; @SerializedName("parentid") @Param(description="whether the event is parented") diff --git a/server/src/com/cloud/api/response/ExtractResponse.java b/server/src/com/cloud/api/response/ExtractResponse.java index 5ab5e7b48ef..97f2e22a6f6 100755 --- a/server/src/com/cloud/api/response/ExtractResponse.java +++ b/server/src/com/cloud/api/response/ExtractResponse.java @@ -19,14 +19,15 @@ package com.cloud.api.response; import java.util.Date; +import com.cloud.api.ApiConstants; import com.cloud.serializer.Param; import com.google.gson.annotations.SerializedName; public class ExtractResponse extends BaseResponse { - @SerializedName("id") @Param(description="the id of extracted object") + @SerializedName(ApiConstants.ID) @Param(description="the id of extracted object") private Long id; - @SerializedName("name") @Param(description="the name of the extracted object") + @SerializedName(ApiConstants.NAME) @Param(description="the name of the extracted object") private String name; @SerializedName("extractId") @Param(description="the upload id of extracted object") @@ -44,10 +45,10 @@ public class ExtractResponse extends BaseResponse { @SerializedName("resultstring") @Param(description="") private String resultString; - @SerializedName("created") @Param(description="the time and date the object was created") + @SerializedName(ApiConstants.CREATED) @Param(description="the time and date the object was created") private Date createdDate; - @SerializedName("state") @Param(description="the state of the extracted object") + @SerializedName(ApiConstants.STATE) @Param(description="the state of the extracted object") private String state; //FIXME - add description @@ -58,7 +59,7 @@ public class ExtractResponse extends BaseResponse { @SerializedName("storage") private String storage; - @SerializedName("zoneid") @Param(description="zone ID the object was extracted from") + @SerializedName(ApiConstants.ZONE_ID) @Param(description="zone ID the object was extracted from") private Long zoneId; @SerializedName("zonename") @Param(description="zone name the object was extracted from") @@ -67,7 +68,7 @@ public class ExtractResponse extends BaseResponse { @SerializedName("extractMode") @Param(description="the mode of extraction - upload or download") private String mode; - @SerializedName("url") @Param(description="if mode = upload then url of the uploaded entity. if mode = download the url from which the entity can be downloaded") + @SerializedName(ApiConstants.URL) @Param(description="if mode = upload then url of the uploaded entity. if mode = download the url from which the entity can be downloaded") private String url; public ExtractResponse(){ @@ -118,7 +119,7 @@ public class ExtractResponse extends BaseResponse { return status; } - public void setUploadStatus(String Status) { + public void setUploadStatus(String status) { this.status = status; } diff --git a/server/src/com/cloud/api/response/FirewallRuleResponse.java b/server/src/com/cloud/api/response/FirewallRuleResponse.java index 8611af111bf..97ca8c9523f 100644 --- a/server/src/com/cloud/api/response/FirewallRuleResponse.java +++ b/server/src/com/cloud/api/response/FirewallRuleResponse.java @@ -17,23 +17,24 @@ */ package com.cloud.api.response; +import com.cloud.api.ApiConstants; import com.cloud.serializer.Param; import com.google.gson.annotations.SerializedName; public class FirewallRuleResponse extends BaseResponse { - @SerializedName("id") @Param(description="the ID of the port forwarding rule") + @SerializedName(ApiConstants.ID) @Param(description="the ID of the port forwarding rule") private Long id; - @SerializedName("privateport") @Param(description="the private port for the port forwarding rule") + @SerializedName(ApiConstants.PRIVATE_PORT) @Param(description="the private port for the port forwarding rule") private String privatePort; - @SerializedName("protocol") @Param(description="the protocol of the port forwarding rule") + @SerializedName(ApiConstants.PROTOCOL) @Param(description="the protocol of the port forwarding rule") private String protocol; - @SerializedName("publicport") @Param(description="the public port for the port forwarding rule") + @SerializedName(ApiConstants.PUBLIC_PORT) @Param(description="the public port for the port forwarding rule") private String publicPort; - @SerializedName("virtualmachineid") @Param(description="the VM ID for the port forwarding rule") + @SerializedName(ApiConstants.VIRTUAL_MACHINE_ID) @Param(description="the VM ID for the port forwarding rule") private Long virtualMachineId; @SerializedName("vmname") @Param(description="the VM name for the port forwarding rule") diff --git a/server/src/com/cloud/api/response/GuestOSCategoryResponse.java b/server/src/com/cloud/api/response/GuestOSCategoryResponse.java index 337d642fe93..6427f6e20a3 100644 --- a/server/src/com/cloud/api/response/GuestOSCategoryResponse.java +++ b/server/src/com/cloud/api/response/GuestOSCategoryResponse.java @@ -17,14 +17,15 @@ */ package com.cloud.api.response; +import com.cloud.api.ApiConstants; import com.cloud.serializer.Param; import com.google.gson.annotations.SerializedName; public class GuestOSCategoryResponse extends BaseResponse { - @SerializedName("id") @Param(description="the ID of the OS category") + @SerializedName(ApiConstants.ID) @Param(description="the ID of the OS category") private Long id; - @SerializedName("name") @Param(description="the name of the OS category") + @SerializedName(ApiConstants.NAME) @Param(description="the name of the OS category") private String name; public Long getId() { diff --git a/server/src/com/cloud/api/response/GuestOSResponse.java b/server/src/com/cloud/api/response/GuestOSResponse.java index fcaa8e6bf04..c2ab867eb94 100644 --- a/server/src/com/cloud/api/response/GuestOSResponse.java +++ b/server/src/com/cloud/api/response/GuestOSResponse.java @@ -17,17 +17,18 @@ */ package com.cloud.api.response; +import com.cloud.api.ApiConstants; import com.cloud.serializer.Param; import com.google.gson.annotations.SerializedName; public class GuestOSResponse extends BaseResponse { - @SerializedName("id") @Param(description="the ID of the OS type") + @SerializedName(ApiConstants.ID) @Param(description="the ID of the OS type") private Long id; - @SerializedName("oscategoryid") @Param(description="the ID of the OS category") + @SerializedName(ApiConstants.OS_CATEGORY_ID) @Param(description="the ID of the OS category") private Long osCategoryId; - @SerializedName("description") @Param(description="the name/description of the OS type") + @SerializedName(ApiConstants.DESCRIPTION) @Param(description="the name/description of the OS type") private String description; public Long getId() { diff --git a/server/src/com/cloud/api/response/HostResponse.java b/server/src/com/cloud/api/response/HostResponse.java index 0b443b4a498..f5208252a2f 100755 --- a/server/src/com/cloud/api/response/HostResponse.java +++ b/server/src/com/cloud/api/response/HostResponse.java @@ -19,6 +19,7 @@ package com.cloud.api.response; import java.util.Date; +import com.cloud.api.ApiConstants; import com.cloud.host.Host; import com.cloud.host.Status; import com.cloud.hypervisor.Hypervisor.HypervisorType; @@ -26,19 +27,19 @@ import com.cloud.serializer.Param; import com.google.gson.annotations.SerializedName; public class HostResponse extends BaseResponse { - @SerializedName("id") @Param(description="the ID of the host") + @SerializedName(ApiConstants.ID) @Param(description="the ID of the host") private Long id; - @SerializedName("name") @Param(description="the name of the host") + @SerializedName(ApiConstants.NAME) @Param(description="the name of the host") private String name; - @SerializedName("state") @Param(description="the state of the host") + @SerializedName(ApiConstants.STATE) @Param(description="the state of the host") private Status state; @SerializedName("disconnected") @Param(description="true if the host is disconnected. False otherwise.") private Date disconnectedOn; - @SerializedName("type") @Param(description="the host type") + @SerializedName(ApiConstants.TYPE) @Param(description="the host type") private Host.Type hostType; @SerializedName("oscategoryid") @Param(description="the OS category ID of the host") @@ -47,16 +48,16 @@ public class HostResponse extends BaseResponse { @SerializedName("oscategoryname") @Param(description="the OS category name of the host") private String osCategoryName; - @SerializedName("ipaddress") @Param(description="the IP address of the host") + @SerializedName(ApiConstants.IP_ADDRESS) @Param(description="the IP address of the host") private String ipAddress; - @SerializedName("zoneid") @Param(description="the Zone ID of the host") + @SerializedName(ApiConstants.ZONE_ID) @Param(description="the Zone ID of the host") private Long zoneId; @SerializedName("zonename") @Param(description="the Zone name of the host") private String zoneName; - @SerializedName("podid") @Param(description="the Pod ID of the host") + @SerializedName(ApiConstants.POD_ID) @Param(description="the Pod ID of the host") private Long podId; @SerializedName("podname") @Param(description="the Pod name of the host") @@ -65,7 +66,7 @@ public class HostResponse extends BaseResponse { @SerializedName("version") @Param(description="the host version") private String version; - @SerializedName("hypervisor") @Param(description="the host hypervisor") + @SerializedName(ApiConstants.HYPERVISOR) @Param(description="the host hypervisor") private HypervisorType hypervisor; @SerializedName("cpunumber") @Param(description="the CPU number of the host") @@ -122,7 +123,7 @@ public class HostResponse extends BaseResponse { @SerializedName("islocalstorageactive") @Param(description="true if local storage is active, false otherwise") private Boolean localStorageActive; - @SerializedName("created") @Param(description="the date and time the host was created") + @SerializedName(ApiConstants.CREATED) @Param(description="the date and time the host was created") private Date created; @SerializedName("removed") @Param(description="the date and time the host was removed") diff --git a/server/src/com/cloud/api/response/HypervisorResponse.java b/server/src/com/cloud/api/response/HypervisorResponse.java index c1e10b6698b..3fd675e98b2 100644 --- a/server/src/com/cloud/api/response/HypervisorResponse.java +++ b/server/src/com/cloud/api/response/HypervisorResponse.java @@ -1,9 +1,10 @@ package com.cloud.api.response; +import com.cloud.api.ApiConstants; import com.google.gson.annotations.SerializedName; public class HypervisorResponse extends BaseResponse { - @SerializedName("name") + @SerializedName(ApiConstants.NAME) private String name; public String getName() { diff --git a/server/src/com/cloud/api/response/IngressRuleResponse.java b/server/src/com/cloud/api/response/IngressRuleResponse.java index 169024e589e..d4c28ea3c1c 100644 --- a/server/src/com/cloud/api/response/IngressRuleResponse.java +++ b/server/src/com/cloud/api/response/IngressRuleResponse.java @@ -17,6 +17,7 @@ */ package com.cloud.api.response; +import com.cloud.api.ApiConstants; import com.cloud.serializer.Param; import com.google.gson.annotations.SerializedName; @@ -28,26 +29,26 @@ public class IngressRuleResponse extends BaseResponse { private String protocol; //FIXME - add description - @SerializedName("icmptype") + @SerializedName(ApiConstants.ICMP_TYPE) private Integer icmpType; //FIXME - add description - @SerializedName("icmpcode") + @SerializedName(ApiConstants.ICMP_CODE) private Integer icmpCode; - @SerializedName("startport") @Param(description="the starting IP of the ingress rule") + @SerializedName(ApiConstants.START_PORT) @Param(description="the starting IP of the ingress rule") private Integer startPort; - @SerializedName("endport") @Param(description="the ending IP of the ingress rule ") + @SerializedName(ApiConstants.END_PORT) @Param(description="the ending IP of the ingress rule ") private Integer endPort; - @SerializedName("networkgroupname") @Param(description="network group name") + @SerializedName(ApiConstants.NETWORK_GROUP_NAME) @Param(description="network group name") private String networkGroupName; - @SerializedName("account") @Param(description="account owning the ingress rule") + @SerializedName(ApiConstants.ACCOUNT) @Param(description="account owning the ingress rule") private String accountName; - @SerializedName("cidr") @Param(description="the CIDR notation for the base IP address of the ingress rule") + @SerializedName(ApiConstants.CIDR) @Param(description="the CIDR notation for the base IP address of the ingress rule") private String cidr; public Long getRuleId() { diff --git a/server/src/com/cloud/api/response/InstanceGroupResponse.java b/server/src/com/cloud/api/response/InstanceGroupResponse.java index cd344320329..f10ebc4a730 100644 --- a/server/src/com/cloud/api/response/InstanceGroupResponse.java +++ b/server/src/com/cloud/api/response/InstanceGroupResponse.java @@ -2,26 +2,27 @@ package com.cloud.api.response; import java.util.Date; +import com.cloud.api.ApiConstants; import com.cloud.serializer.Param; import com.google.gson.annotations.SerializedName; public class InstanceGroupResponse extends BaseResponse { - @SerializedName("id") @Param(description="the id of the instance group") + @SerializedName(ApiConstants.ID) @Param(description="the id of the instance group") private Long id; - @SerializedName("name") @Param(description="the name of the instance group") + @SerializedName(ApiConstants.NAME) @Param(description="the name of the instance group") private String name; - @SerializedName("created") @Param(description="time and date the instance group was created") + @SerializedName(ApiConstants.CREATED) @Param(description="time and date the instance group was created") private Date created; - @SerializedName("account") @Param(description="the account owning the instance group") + @SerializedName(ApiConstants.ACCOUNT) @Param(description="the account owning the instance group") private String accountName; - @SerializedName("domainid") @Param(description="the domain ID of the instance group") + @SerializedName(ApiConstants.DOMAIN_ID) @Param(description="the domain ID of the instance group") private Long domainId; - @SerializedName("domain") @Param(description="the domain name of the instance group") + @SerializedName(ApiConstants.DOMAIN) @Param(description="the domain name of the instance group") private String domainName; public Long getId() { diff --git a/server/src/com/cloud/api/response/UserVmResponse.java b/server/src/com/cloud/api/response/UserVmResponse.java index e319ced2500..8ae1888785e 100644 --- a/server/src/com/cloud/api/response/UserVmResponse.java +++ b/server/src/com/cloud/api/response/UserVmResponse.java @@ -19,59 +19,60 @@ package com.cloud.api.response; import java.util.Date; +import com.cloud.api.ApiConstants; import com.cloud.serializer.Param; import com.google.gson.annotations.SerializedName; public class UserVmResponse extends BaseResponse { - @SerializedName("id") @Param(description="the ID of the virtual machine") + @SerializedName(ApiConstants.ID) @Param(description="the ID of the virtual machine") private Long id; - @SerializedName("name") @Param(description="the name of the virtual machine") + @SerializedName(ApiConstants.NAME) @Param(description="the name of the virtual machine") private String name; @SerializedName("displayname") @Param(description="user generated name. The name of the virtual machine is returned if no displayname exists.") private String displayName; - @SerializedName("ipaddress") @Param(description="the ip address of the virtual machine") + @SerializedName(ApiConstants.IP_ADDRESS) @Param(description="the ip address of the virtual machine") private String ipAddress; - @SerializedName("account") @Param(description="the account associated with the virtual machine") + @SerializedName(ApiConstants.ACCOUNT) @Param(description="the account associated with the virtual machine") private String accountName; - @SerializedName("domainid") @Param(description="the ID of the domain in which the virtual machine exists") + @SerializedName(ApiConstants.DOMAIN_ID) @Param(description="the ID of the domain in which the virtual machine exists") private Long domainId; - @SerializedName("domain") @Param(description="the name of the domain in which the virtual machine exists") + @SerializedName(ApiConstants.DOMAIN) @Param(description="the name of the domain in which the virtual machine exists") private String domainName; - @SerializedName("created") @Param(description="the date when this virtual machine was created") + @SerializedName(ApiConstants.CREATED) @Param(description="the date when this virtual machine was created") private Date created; - @SerializedName("state") @Param(description="the state of the virtual machine") + @SerializedName(ApiConstants.STATE) @Param(description="the state of the virtual machine") private String state; - @SerializedName("haenable") @Param(description="true if high-availability is enabled, false otherwise") + @SerializedName(ApiConstants.HA_ENABLE) @Param(description="true if high-availability is enabled, false otherwise") private Boolean haEnable; - @SerializedName("groupid") @Param(description="the group ID of the virtual machine") + @SerializedName(ApiConstants.GROUP_ID) @Param(description="the group ID of the virtual machine") private Long groupId; - @SerializedName("group") @Param(description="the group name of the virtual machine") + @SerializedName(ApiConstants.GROUP) @Param(description="the group name of the virtual machine") private String group; - @SerializedName("zoneid") @Param(description="the ID of the availablility zone for the virtual machine") + @SerializedName(ApiConstants.ZONE_ID) @Param(description="the ID of the availablility zone for the virtual machine") private Long zoneId; @SerializedName("zonename") @Param(description="the name of the availability zone for the virtual machine") private String zoneName; - @SerializedName("hostid") @Param(description="the ID of the host for the virtual machine") + @SerializedName(ApiConstants.HOST_ID) @Param(description="the ID of the host for the virtual machine") private Long hostId; @SerializedName("hostname") @Param(description="the name of the host for the virtual machine") private String hostName; - @SerializedName("templateid") @Param(description="the ID of the template for the virtual machine. A -1 is returned if the virtual machine was created from an ISO file.") + @SerializedName(ApiConstants.TEMPLATE_ID) @Param(description="the ID of the template for the virtual machine. A -1 is returned if the virtual machine was created from an ISO file.") private Long templateId; @SerializedName("templatename") @Param(description="the name of the template for the virtual machine") @@ -80,7 +81,7 @@ public class UserVmResponse extends BaseResponse { @SerializedName("templatedisplaytext") @Param(description=" an alternate display text of the template for the virtual machine") private String templateDisplayText; - @SerializedName("passwordenabled") @Param(description="true if the password rest feature is enabled, false otherwise") + @SerializedName(ApiConstants.PASSWORD_ENABLED) @Param(description="true if the password rest feature is enabled, false otherwise") private Boolean passwordEnabled; @SerializedName("isoid") @Param(description="the ID of the ISO attached to the virtual machine") @@ -98,13 +99,13 @@ public class UserVmResponse extends BaseResponse { @SerializedName("serviceofferingname") @Param(description="the name of the service offering of the virtual machine") private String serviceOfferingName; - @SerializedName("cpunumber") @Param(description="the number of cpu this virtual machine is running with") + @SerializedName(ApiConstants.CPU_NUMBER) @Param(description="the number of cpu this virtual machine is running with") private Integer cpuNumber; - @SerializedName("cpuspeed") @Param(description="the speed of each cpu") + @SerializedName(ApiConstants.CPU_SPEED) @Param(description="the speed of each cpu") private Integer cpuSpeed; - @SerializedName("memory") @Param(description="the memory allocated for the virtual machine") + @SerializedName(ApiConstants.MEMORY) @Param(description="the memory allocated for the virtual machine") private Integer memory; @SerializedName("cpuused") @Param(description="the amount of the vm's CPU currently used") @@ -128,10 +129,10 @@ public class UserVmResponse extends BaseResponse { @SerializedName("networkgrouplist") @Param(description="list of network groups associated with the virtual machine") private String networkGroupList; - @SerializedName("password") @Param(description="the password (if exists) of the virtual machine") + @SerializedName(ApiConstants.PASSWORD) @Param(description="the password (if exists) of the virtual machine") private String password; - @SerializedName("jobid") @Param(description="shows the current pending asynchronous job ID. This tag is not returned if no current pending jobs are acting on the virtual machine") + @SerializedName(ApiConstants.JOB_ID) @Param(description="shows the current pending asynchronous job ID. This tag is not returned if no current pending jobs are acting on the virtual machine") private Long jobId; @SerializedName("jobstatus") @Param(description="shows the current pending asynchronous job status") diff --git a/server/src/com/cloud/api/response/VolumeResponse.java b/server/src/com/cloud/api/response/VolumeResponse.java index 36ffd97513a..ca23f0055ba 100644 --- a/server/src/com/cloud/api/response/VolumeResponse.java +++ b/server/src/com/cloud/api/response/VolumeResponse.java @@ -19,35 +19,36 @@ package com.cloud.api.response; import java.util.Date; +import com.cloud.api.ApiConstants; import com.cloud.serializer.Param; import com.google.gson.annotations.SerializedName; public class VolumeResponse extends BaseResponse { - @SerializedName("id") @Param(description="ID of the disk volume") + @SerializedName(ApiConstants.ID) @Param(description="ID of the disk volume") private Long id; - @SerializedName("jobid") @Param(description="shows the current pending asynchronous job ID. This tag is not returned if no current pending jobs are acting on the volume") + @SerializedName(ApiConstants.JOB_ID) @Param(description="shows the current pending asynchronous job ID. This tag is not returned if no current pending jobs are acting on the volume") private Long jobId; @SerializedName("jobstatus") @Param(description="shows the current pending asynchronous job status") private Integer jobStatus; - @SerializedName("name") @Param(description="name of the disk volume") + @SerializedName(ApiConstants.NAME) @Param(description="name of the disk volume") private String name; - @SerializedName("zoneid") @Param(description="ID of the availability zone") + @SerializedName(ApiConstants.ZONE_ID) @Param(description="ID of the availability zone") private Long zoneId; @SerializedName("zonename") @Param(description="name of the availability zone") private String zoneName; - @SerializedName("type") @Param(description="type of the disk volume (ROOT or DATADISK)") + @SerializedName(ApiConstants.TYPE) @Param(description="type of the disk volume (ROOT or DATADISK)") private String volumeType; - @SerializedName("deviceid") @Param(description="the ID of the device on user vm the volume is attahed to. This tag is not returned when the volume is detached.") + @SerializedName(ApiConstants.DEVICE_ID) @Param(description="the ID of the device on user vm the volume is attahed to. This tag is not returned when the volume is detached.") private Long deviceId; - @SerializedName("virtualmachineid") @Param(description="id of the virtual machine") + @SerializedName(ApiConstants.VIRTUAL_MACHINE_ID) @Param(description="id of the virtual machine") private Long virtualMachineId; @SerializedName("vmname") @Param(description="name of the virtual machine") @@ -59,22 +60,22 @@ public class VolumeResponse extends BaseResponse { @SerializedName("vmstate") @Param(description="state of the virtual machine") private String virtualMachineState; - @SerializedName("size") @Param(description="size of the disk volume") + @SerializedName(ApiConstants.SIZE) @Param(description="size of the disk volume") private Long size; - @SerializedName("created") @Param(description="the date the disk volume was created") + @SerializedName(ApiConstants.CREATED) @Param(description="the date the disk volume was created") private Date created; - @SerializedName("state") @Param(description="the state of the disk volume") + @SerializedName(ApiConstants.STATE) @Param(description="the state of the disk volume") private String state; - @SerializedName("account") @Param(description="the account associated with the disk volume") + @SerializedName(ApiConstants.ACCOUNT) @Param(description="the account associated with the disk volume") private String accountName; - @SerializedName("domainid") @Param(description="the ID of the domain associated with the disk volume") + @SerializedName(ApiConstants.DOMAIN_ID) @Param(description="the ID of the domain associated with the disk volume") private Long domainId; - @SerializedName("domain") @Param(description="the domain associated with the disk volume") + @SerializedName(ApiConstants.DOMAIN) @Param(description="the domain associated with the disk volume") private String domainName; @SerializedName("storagetype") @Param(description="shared or local storage") @@ -86,10 +87,10 @@ public class VolumeResponse extends BaseResponse { @SerializedName("sourcetype") private String sourceType; - @SerializedName("hypervisor") + @SerializedName(ApiConstants.HYPERVISOR) private String hypervisor; - @SerializedName("diskofferingid") @Param(description="ID of the disk offering") + @SerializedName(ApiConstants.DISK_OFFERING_ID) @Param(description="ID of the disk offering") private Long diskOfferingId; @SerializedName("diskofferingname") @Param(description="name of the disk offering") @@ -101,7 +102,7 @@ public class VolumeResponse extends BaseResponse { @SerializedName("storage") @Param(description="name of the primary storage hosting the disk volume") private String storagePoolName; - @SerializedName("snapshotid") @Param(description="ID of the snapshot from which this volume was created") + @SerializedName(ApiConstants.SNAPSHOT_ID) @Param(description="ID of the snapshot from which this volume was created") private Long snapshotId; @SerializedName("attached") @Param(description="the date the volume was attached to a VM instance") diff --git a/server/src/com/cloud/api/response/ZoneResponse.java b/server/src/com/cloud/api/response/ZoneResponse.java index 9bf3054a518..ad975b474da 100644 --- a/server/src/com/cloud/api/response/ZoneResponse.java +++ b/server/src/com/cloud/api/response/ZoneResponse.java @@ -17,49 +17,50 @@ */ package com.cloud.api.response; +import com.cloud.api.ApiConstants; import com.cloud.serializer.Param; import com.google.gson.annotations.SerializedName; public class ZoneResponse extends BaseResponse { - @SerializedName("id") @Param(description="Zone id") + @SerializedName(ApiConstants.ID) @Param(description="Zone id") private Long id; - @SerializedName("name") @Param(description="Zone name") + @SerializedName(ApiConstants.NAME) @Param(description="Zone name") private String name; - @SerializedName("description") @Param(description="Zone description") + @SerializedName(ApiConstants.DESCRIPTION) @Param(description="Zone description") private String description; - @SerializedName("dns1") @Param(description="the first DNS for the Zone") + @SerializedName(ApiConstants.DNS1) @Param(description="the first DNS for the Zone") private String dns1; - @SerializedName("dns2") @Param(description="the second DNS for the Zone") + @SerializedName(ApiConstants.DNS2) @Param(description="the second DNS for the Zone") private String dns2; - @SerializedName("internaldns1") @Param(description="the first internal DNS for the Zone") + @SerializedName(ApiConstants.INTERNAL_DNS1) @Param(description="the first internal DNS for the Zone") private String internalDns1; - @SerializedName("internaldns2") @Param(description="the second internal DNS for the Zone") + @SerializedName(ApiConstants.INTERNAL_DNS2) @Param(description="the second internal DNS for the Zone") private String internalDns2; //FIXME - add description. This parameter is called "vnet" in updateZone, and vlan in createZone - figure out which one is right. - @SerializedName("vlan") + @SerializedName(ApiConstants.VLAN) private String vlan; - @SerializedName("guestcidraddress") @Param(description="the guest CIDR address for the Zone") + @SerializedName(ApiConstants.GUEST_CIDR_ADDRESS) @Param(description="the guest CIDR address for the Zone") private String guestCidrAddress; //FIXME - do we need 2 parameters below at all? @SerializedName("status") private String status; - @SerializedName("displaytext") + @SerializedName(ApiConstants.DISPLAY_TEXT) private String displayText; - @SerializedName("domain") @Param(description="Domain name for the Vms in the zone") + @SerializedName(ApiConstants.DOMAIN) @Param(description="Domain name for the Vms in the zone") private String domain; - @SerializedName("domainid") @Param(description="the ID of the containing domain, null for public zones") + @SerializedName(ApiConstants.DOMAIN_ID) @Param(description="the ID of the containing domain, null for public zones") private Long domainId; public Long getId() {