You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by bh...@apache.org on 2012/12/24 01:57:37 UTC
[4/50] [abbrv] Merge branch 'master' into test-merge-api
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/296b49c2/api/src/org/apache/cloudstack/api/ApiConstants.java
----------------------------------------------------------------------
diff --cc api/src/org/apache/cloudstack/api/ApiConstants.java
index 8b05f1d,0000000..6d8400a
mode 100644,000000..100644
--- a/api/src/org/apache/cloudstack/api/ApiConstants.java
+++ b/api/src/org/apache/cloudstack/api/ApiConstants.java
@@@ -1,431 -1,0 +1,442 @@@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package org.apache.cloudstack.api;
+
++import org.omg.CORBA.PUBLIC_MEMBER;
++
+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 ACCOUNT_ID = "accountid";
+ public static final String ALGORITHM = "algorithm";
+ public static final String ALLOCATED_ONLY = "allocatedonly";
+ public static final String API_KEY = "userapikey";
+ 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 BIND_DN = "binddn";
+ public static final String BIND_PASSWORD = "bindpass";
+ public static final String CATEGORY = "category";
+ public static final String CERTIFICATE = "certificate";
+ public static final String PRIVATE_KEY = "privatekey";
+ public static final String DOMAIN_SUFFIX = "domainsuffix";
+ public static final String DNS_SEARCH_ORDER = "dnssearchorder";
+ 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 CLUSTER_TYPE = "clustertype";
+ 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 CUSTOMIZED = "customized";
+ 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 FETCH_LATEST = "fetchlatest";
+ public static final String FIRSTNAME = "firstname";
+ public static final String FORCED = "forced";
+ public static final String FORCED_DESTROY_LOCAL_STORAGE = "forcedestroylocalstorage";
+ 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 HOST_NAME = "hostname";
+ public static final String HYPERVISOR = "hypervisor";
+ public static final String INLINE = "inline";
+ 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_ADDRESS_ID = "ipaddressid";
+ 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_EXTRACTABLE = "isextractable";
+ 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 ISO_GUEST_OS_NONE = "None";
+ public static final String JOB_ID = "jobid";
+ public static final String JOB_STATUS = "jobstatus";
+ public static final String LASTNAME = "lastname";
+ public static final String LEVEL = "level";
+ public static final String LIMIT_CPU_USE = "limitcpuuse";
+ public static final String LOCK = "lock";
+ public static final String LUN = "lun";
+ public static final String LBID = "lbruleid";
+ 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 METHOD_NAME = "methodname";
+ public static final String NETWORK_DOMAIN = "networkdomain";
+ public static final String NETMASK = "netmask";
+ public static final String NEW_NAME = "newname";
+ public static final String NUM_RETRIES = "numretries";
+ public static final String OFFER_HA = "offerha";
+ public static final String IS_SYSTEM_OFFERING = "issystem";
+ public static final String IS_DEFAULT_USE = "defaultuse";
+ 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 NEW_PASSWORD = "new_password";
+ public static final String PASSWORD_ENABLED = "passwordenabled";
+ public static final String SSHKEY_ENABLED = "sshkeyenabled";
+ public static final String PATH = "path";
+ public static final String POD_ID = "podid";
+ public static final String POD_IDS = "podids";
+ public static final String POLICY_ID = "policyid";
+ public static final String PORT = "port";
+ public static final String PORTAL = "portal";
+ public static final String PORT_FORWARDING_SERVICE_ID = "portforwardingserviceid";
+ public static final String PRIVATE_INTERFACE = "privateinterface";
+ public static final String PRIVATE_IP = "privateip";
+ public static final String PRIVATE_PORT = "privateport";
+ public static final String PRIVATE_START_PORT = "privateport";
+ public static final String PRIVATE_END_PORT = "privateendport";
+ public static final String PRIVATE_ZONE = "privatezone";
+ public static final String PROTOCOL = "protocol";
+ public static final String PUBLIC_INTERFACE = "publicinterface";
+ public static final String PUBLIC_IP_ID = "publicipid";
+ public static final String PUBLIC_IP = "publicip";
+ public static final String PUBLIC_PORT = "publicport";
+ public static final String PUBLIC_START_PORT = "publicport";
+ public static final String PUBLIC_END_PORT = "publicendport";
+ public static final String PUBLIC_ZONE = "publiczone";
+ 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 QUERY_FILTER = "queryfilter";
+ public static final String SCHEDULE = "schedule";
+ public static final String SCOPE = "scope";
+ public static final String SECRET_KEY = "usersecretkey";
+ public static final String KEY = "key";
+ public static final String SEARCH_BASE = "searchbase";
+ public static final String SECURITY_GROUP_IDS = "securitygroupids";
+ public static final String SECURITY_GROUP_NAMES = "securitygroupnames";
+ public static final String SECURITY_GROUP_NAME = "securitygroupname";
+ public static final String SECURITY_GROUP_ID = "securitygroupid";
+ 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 SHOW_CAPACITIES = "showcapacities";
+ 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 STATUS = "status";
+ 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 ISO_ID = "isoid";
+ public static final String TIMEOUT = "timeout";
+ public static final String TIMEZONE = "timezone";
+ public static final String TYPE = "type";
+ public static final String TRUST_STORE = "truststore";
+ public static final String TRUST_STORE_PASSWORD = "truststorepass";
+ public static final String URL = "url";
+ public static final String USAGE_INTERFACE = "usageinterface";
+ public static final String USER_DATA = "userdata";
+ public static final String USER_ID = "userid";
+ public static final String USE_SSL = "ssl";
+ public static final String USERNAME = "username";
+ public static final String USER_SECURITY_GROUP_LIST = "usersecuritygrouplist";
+ 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";
+ public static final String ZONE_NAME = "zonename";
+ public static final String NETWORK_TYPE = "networktype";
+ public static final String PAGE = "page";
+ public static final String PAGE_SIZE = "pagesize";
+ public static final String COUNT = "count";
+ public static final String TRAFFIC_TYPE = "traffictype";
+ public static final String NETWORK_OFFERING_ID = "networkofferingid";
+ public static final String NETWORK_IDS = "networkids";
+ public static final String NETWORK_ID = "networkid";
+ public static final String SPECIFY_VLAN = "specifyvlan";
+ public static final String IS_DEFAULT = "isdefault";
+ public static final String IS_SYSTEM = "issystem";
+ public static final String AVAILABILITY = "availability";
+ public static final String NETWORKRATE = "networkrate";
+ public static final String HOST_TAGS = "hosttags";
+ public static final String SSH_KEYPAIR = "keypair";
+ public static final String HOST_CPU_CAPACITY = "hostcpucapacity";
+ public static final String HOST_CPU_NUM = "hostcpunum";
+ public static final String HOST_MEM_CAPACITY = "hostmemcapacity";
+ public static final String HOST_MAC = "hostmac";
+ public static final String HOST_TAG = "hosttag";
+ public static final String PXE_SERVER_TYPE = "pxeservertype";
+ public static final String LINMIN_USERNAME = "linminusername";
+ public static final String LINMIN_PASSWORD = "linminpassword";
+ public static final String LINMIN_APID = "linminapid";
+ public static final String DHCP_SERVER_TYPE = "dhcpservertype";
+ public static final String LINK_LOCAL_IP = "linklocalip";
+ public static final String LINK_LOCAL_MAC_ADDRESS = "linklocalmacaddress";
+ public static final String LINK_LOCAL_MAC_NETMASK = "linklocalnetmask";
+ public static final String LINK_LOCAL_NETWORK_ID = "linklocalnetworkid";
+ public static final String PRIVATE_MAC_ADDRESS = "privatemacaddress";
+ public static final String PRIVATE_NETMASK = "privatenetmask";
+ public static final String PRIVATE_NETWORK_ID = "privatenetworkid";
+ public static final String ALLOCATION_STATE = "allocationstate";
+ public static final String MANAGED_STATE = "managedstate";
+ public static final String STORAGE_ID = "storageid";
+ public static final String PING_STORAGE_SERVER_IP = "pingstorageserverip";
+ public static final String PING_DIR = "pingdir";
+ public static final String TFTP_DIR = "tftpdir";
+ public static final String PING_CIFS_USERNAME = "pingcifsusername";
+ public static final String PING_CIFS_PASSWORD = "pingcifspassword";
+ public static final String CHECKSUM = "checksum";
+ public static final String NETWORK_DEVICE_TYPE = "networkdevicetype";
+ public static final String NETWORK_DEVICE_PARAMETER_LIST = "networkdeviceparameterlist";
+ public static final String ZONE_TOKEN = "zonetoken";
+ public static final String DHCP_PROVIDER = "dhcpprovider";
+ public static final String RESULT = "success";
+ public static final String LUN_ID = "lunId";
+ public static final String IQN = "iqn";
+ public static final String AGGREGATE_NAME = "aggregatename";
+ public static final String POOL_NAME = "poolname";
+ public static final String VOLUME_NAME = "volumename";
+ public static final String SNAPSHOT_POLICY = "snapshotpolicy";
+ public static final String SNAPSHOT_RESERVATION = "snapshotreservation";
+ public static final String IP_NETWORK_LIST = "iptonetworklist";
+ public static final String PARAM_LIST = "param";
+ public static final String FOR_LOAD_BALANCING = "forloadbalancing";
+ public static final String KEYBOARD = "keyboard";
+ public static final String OPEN_FIREWALL = "openfirewall";
+ public static final String TEMPLATE_TAG = "templatetag";
+ public static final String HYPERVISOR_VERSION = "hypervisorversion";
+ public static final String MAX_GUESTS_LIMIT = "maxguestslimit";
+ public static final String PROJECT_ID = "projectid";
+ public static final String PROJECT_IDS = "projectids";
+ public static final String PROJECT = "project";
+ public static final String ROLE = "role";
+ public static final String USER = "user";
+ public static final String ACTIVE_ONLY = "activeonly";
+ public static final String TOKEN = "token";
+ public static final String ACCEPT = "accept";
+ public static final String SORT_KEY = "sortkey";
+ public static final String ACCOUNT_DETAILS = "accountdetails";
+ public static final String SERVICE_PROVIDER_LIST = "serviceproviderlist";
+ public static final String SERVICE_CAPABILITY_LIST = "servicecapabilitylist";
+ public static final String CAN_CHOOSE_SERVICE_CAPABILITY = "canchooseservicecapability";
+ public static final String PROVIDER = "provider";
+ public static final String NETWORK_SPEED = "networkspeed";
+ public static final String BROADCAST_DOMAIN_RANGE = "broadcastdomainrange";
+ public static final String ISOLATION_METHODS = "isolationmethods";
+ public static final String PHYSICAL_NETWORK_ID = "physicalnetworkid";
+ public static final String DEST_PHYSICAL_NETWORK_ID = "destinationphysicalnetworkid";
+ public static final String ENABLED = "enabled";
+ public static final String SERVICE_NAME = "servicename";
+ public static final String DHCP_RANGE = "dhcprange";
+ public static final String UUID = "uuid";
+ public static final String SECURITY_GROUP_EANBLED = "securitygroupenabled";
+ public static final String LOCAL_STORAGE_ENABLED = "localstorageenabled";
+ public static final String GUEST_IP_TYPE = "guestiptype";
+ public static final String XEN_NETWORK_LABEL = "xennetworklabel";
+ public static final String KVM_NETWORK_LABEL = "kvmnetworklabel";
+ public static final String VMWARE_NETWORK_LABEL = "vmwarenetworklabel";
+ public static final String NETWORK_SERVICE_PROVIDER_ID = "nspid";
+ public static final String SERVICE_LIST = "servicelist";
+ public static final String CAN_ENABLE_INDIVIDUAL_SERVICE = "canenableindividualservice";
+ public static final String SUPPORTED_SERVICES = "supportedservices";
+ public static final String NSP_ID = "nspid";
+ public static final String ACL_TYPE = "acltype";
+ public static final String SUBDOMAIN_ACCESS = "subdomainaccess";
+ public static final String LOAD_BALANCER_DEVICE_ID = "lbdeviceid";
+ public static final String LOAD_BALANCER_DEVICE_NAME = "lbdevicename";
+ public static final String LOAD_BALANCER_DEVICE_STATE = "lbdevicestate";
+ public static final String LOAD_BALANCER_DEVICE_CAPACITY = "lbdevicecapacity";
+ public static final String LOAD_BALANCER_DEVICE_DEDICATED = "lbdevicededicated";
+ public static final String FIREWALL_DEVICE_ID = "fwdeviceid";
+ public static final String FIREWALL_DEVICE_NAME = "fwdevicename";
+ public static final String FIREWALL_DEVICE_STATE = "fwdevicestate";
+ public static final String FIREWALL_DEVICE_CAPACITY = "fwdevicecapacity";
+ public static final String FIREWALL_DEVICE_DEDICATED = "fwdevicededicated";
+ public static final String SERVICE = "service";
+ public static final String ASSOCIATED_NETWORK_ID = "associatednetworkid";
+ public static final String ASSOCIATED_NETWORK_NAME = "associatednetworkname";
+ public static final String SOURCE_NAT_SUPPORTED = "sourcenatsupported";
+ public static final String RESOURCE_STATE = "resourcestate";
+ public static final String PROJECT_INVITE_REQUIRED = "projectinviterequired";
+ public static final String RESTART_REQUIRED = "restartrequired";
+ public static final String ALLOW_USER_CREATE_PROJECTS = "allowusercreateprojects";
+ public static final String CONSERVE_MODE = "conservemode";
+ public static final String TRAFFIC_TYPE_IMPLEMENTOR = "traffictypeimplementor";
+ public static final String KEYWORD = "keyword";
+ public static final String LIST_ALL = "listall";
+ public static final String SPECIFY_IP_RANGES = "specifyipranges";
+ public static final String IS_SOURCE_NAT = "issourcenat";
+ public static final String IS_STATIC_NAT = "isstaticnat";
+ public static final String SORT_BY = "sortby";
+ public static final String CHANGE_CIDR = "changecidr";
+ public static final String PURPOSE = "purpose";
+ public static final String IS_TAGGED = "istagged";
+ public static final String INSTANCE_NAME = "instancename";
+ public static final String START_VM = "startvm";
+ public static final String HA_HOST = "hahost";
+ public static final String CUSTOM_DISK_OFF_MAX_SIZE = "customdiskofferingmaxsize";
+ public static final String DEFAULT_ZONE_ID = "defaultzoneid";
+ public static final String GUID = "guid";
+
+ public static final String EXTERNAL_SWITCH_MGMT_DEVICE_ID = "vsmdeviceid";
+ public static final String EXTERNAL_SWITCH_MGMT_DEVICE_NAME = "vsmdevicename";
+ public static final String EXTERNAL_SWITCH_MGMT_DEVICE_STATE = "vsmdevicestate";
+ // Would we need to have a capacity field for Cisco N1KV VSM? Max hosts managed by it perhaps? May remove this later.
+ public static final String EXTERNAL_SWITCH_MGMT_DEVICE_CAPACITY = "vsmdevicecapacity";
+ public static final String CISCO_NEXUS_VSM_NAME = "vsmname";
+ public static final String VSM_USERNAME = "vsmusername";
+ public static final String VSM_PASSWORD = "vsmpassword";
+ public static final String VSM_IPADDRESS = "vsmipaddress";
+ public static final String VSM_MGMT_VLAN_ID = "vsmmgmtvlanid";
+ public static final String VSM_PKT_VLAN_ID = "vsmpktvlanid";
+ public static final String VSM_CTRL_VLAN_ID = "vsmctrlvlanid";
+ public static final String VSM_STORAGE_VLAN_ID = "vsmstoragevlanid";
+ public static final String VSM_DOMAIN_ID = "vsmdomainid";
+ public static final String VSM_CONFIG_MODE = "vsmconfigmode";
+ public static final String VSM_CONFIG_STATE = "vsmconfigstate";
+ public static final String VSM_DEVICE_STATE = "vsmdevicestate";
+ public static final String ADD_VSM_FLAG = "addvsmflag";
+ public static final String VPC_OFF_ID = "vpcofferingid";
+ public static final String NETWORK = "network";
+ public static final String VPC_ID = "vpcid";
+ public static final String GATEWAY_ID = "gatewayid";
+ public static final String CAN_USE_FOR_DEPLOY = "canusefordeploy";
+ public static final String RESOURCE_IDS = "resourceids";
+ public static final String RESOURCE_ID = "resourceid";
+ public static final String CUSTOMER = "customer";
+ public static final String S2S_VPN_GATEWAY_ID = "s2svpngatewayid";
+ public static final String S2S_CUSTOMER_GATEWAY_ID = "s2scustomergatewayid";
+ public static final String IPSEC_PSK = "ipsecpsk";
+ public static final String GUEST_IP = "guestip";
+ public static final String REMOVED = "removed";
+ public static final String IKE_POLICY = "ikepolicy";
+ public static final String ESP_POLICY = "esppolicy";
+ public static final String IKE_LIFETIME = "ikelifetime";
+ public static final String ESP_LIFETIME = "esplifetime";
+ public static final String DPD = "dpd";
+ public static final String FOR_VPC = "forvpc";
+ public static final String NICIRA_NVP_DEVICE_ID = "nvpdeviceid";
+ public static final String NICIRA_NVP_TRANSPORT_ZONE_UUID = "transportzoneuuid";
+ public static final String NICIRA_NVP_DEVICE_NAME = "niciradevicename";
+ public static final String NICIRA_NVP_GATEWAYSERVICE_UUID = "l3gatewayserviceuuid";
-
++ public static final String S3_ACCESS_KEY = "accesskey";
++ public static final String S3_SECRET_KEY = "secretkey";
++ public static final String S3_END_POINT = "endpoint";
++ public static final String S3_BUCKET_NAME = "bucket";
++ public static final String S3_HTTPS_FLAG = "usehttps";
++ public static final String S3_CONNECTION_TIMEOUT = "connectiontimeout";
++ public static final String S3_MAX_ERROR_RETRY = "maxerrorretry";
++ public static final String S3_SOCKET_TIMEOUT = "sockettimeout";
++ public static final String INCL_ZONES = "includezones";
++ public static final String EXCL_ZONES = "excludezones";
+ public static final String SOURCE = "source";
+ public static final String COUNTER_ID = "counterid";
+ public static final String AGGR_OPERATOR = "aggroperator";
+ public static final String AGGR_FUNCTION = "aggrfunction";
+ public static final String AGGR_VALUE = "aggrvalue";
+ public static final String THRESHOLD = "threshold";
+ public static final String RELATIONAL_OPERATOR = "relationaloperator";
+ public static final String OTHER_DEPLOY_PARAMS = "otherdeployparams";
+ public static final String MIN_MEMBERS = "minmembers";
+ public static final String MAX_MEMBERS = "maxmembers";
+ public static final String AUTOSCALE_VM_DESTROY_TIME = "destroyvmgraceperiod";
+ public static final String VMPROFILE_ID = "vmprofileid";
+ public static final String VMGROUP_ID = "vmgroupid";
+ public static final String CS_URL = "csurl";
+ public static final String SCALEUP_POLICY_IDS = "scaleuppolicyids";
+ public static final String SCALEDOWN_POLICY_IDS = "scaledownpolicyids";
+ public static final String SCALEUP_POLICIES = "scaleuppolicies";
+ public static final String SCALEDOWN_POLICIES = "scaledownpolicies";
+ public static final String INTERVAL = "interval";
+ public static final String QUIETTIME = "quiettime";
+ public static final String ACTION = "action";
+ public static final String CONDITION_ID = "conditionid";
+ public static final String CONDITION_IDS = "conditionids";
+ public static final String COUNTERPARAM_LIST = "counterparam";
+ public static final String AUTOSCALE_USER_ID = "autoscaleuserid";
+
+ public enum HostDetails {
+ all, capacity, events, stats, min;
+ }
+
+ public enum VMDetails {
+ all, group, nics, stats, secgrp, tmpl, servoff, iso, volume, min;
+ }
+
+ public enum LDAPParams {
+ hostname, port, usessl, queryfilter, searchbase, dn, passwd, truststore, truststorepass;
+
+ @Override
+ public String toString() {
+ return "ldap." + name();
+ }
+ }
+
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/296b49c2/api/src/org/apache/cloudstack/api/ResponseGenerator.java
----------------------------------------------------------------------
diff --cc api/src/org/apache/cloudstack/api/ResponseGenerator.java
index ee7f15e,0000000..559a7ad
mode 100644,000000..100644
--- a/api/src/org/apache/cloudstack/api/ResponseGenerator.java
+++ b/api/src/org/apache/cloudstack/api/ResponseGenerator.java
@@@ -1,379 -1,0 +1,382 @@@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package org.apache.cloudstack.api;
+
+import java.text.DecimalFormat;
+import java.util.EnumSet;
+import java.util.List;
+
+import org.apache.cloudstack.api.ApiConstants.HostDetails;
+import org.apache.cloudstack.api.ApiConstants.VMDetails;
+import org.apache.cloudstack.api.command.user.job.QueryAsyncJobResultCmd;
+import org.apache.cloudstack.api.response.AccountResponse;
+import org.apache.cloudstack.api.response.AsyncJobResponse;
+import org.apache.cloudstack.api.response.AutoScalePolicyResponse;
+import org.apache.cloudstack.api.response.AutoScaleVmGroupResponse;
+import org.apache.cloudstack.api.response.AutoScaleVmProfileResponse;
+import org.apache.cloudstack.api.response.CapacityResponse;
+import org.apache.cloudstack.api.response.ClusterResponse;
+import org.apache.cloudstack.api.response.ConditionResponse;
+import org.apache.cloudstack.api.response.ConfigurationResponse;
+import org.apache.cloudstack.api.response.CounterResponse;
+import org.apache.cloudstack.api.response.CreateCmdResponse;
+import org.apache.cloudstack.api.response.DiskOfferingResponse;
+import org.apache.cloudstack.api.response.DomainResponse;
+import org.apache.cloudstack.api.response.DomainRouterResponse;
+import org.apache.cloudstack.api.response.EventResponse;
+import org.apache.cloudstack.api.response.ExtractResponse;
+import org.apache.cloudstack.api.response.FirewallResponse;
+import org.apache.cloudstack.api.response.FirewallRuleResponse;
+import org.apache.cloudstack.api.response.GuestOSResponse;
+import org.apache.cloudstack.api.response.HostResponse;
+import org.apache.cloudstack.api.response.HypervisorCapabilitiesResponse;
+import org.apache.cloudstack.api.response.IPAddressResponse;
+import org.apache.cloudstack.api.response.InstanceGroupResponse;
+import org.apache.cloudstack.api.response.IpForwardingRuleResponse;
+import org.apache.cloudstack.api.response.LBStickinessResponse;
+import org.apache.cloudstack.api.response.LDAPConfigResponse;
+import org.apache.cloudstack.api.response.LoadBalancerResponse;
+import org.apache.cloudstack.api.response.NetworkACLResponse;
+import org.apache.cloudstack.api.response.NetworkOfferingResponse;
+import org.apache.cloudstack.api.response.NetworkResponse;
+import org.apache.cloudstack.api.response.PhysicalNetworkResponse;
+import org.apache.cloudstack.api.response.PodResponse;
+import org.apache.cloudstack.api.response.PrivateGatewayResponse;
+import org.apache.cloudstack.api.response.ProjectAccountResponse;
+import org.apache.cloudstack.api.response.ProjectInvitationResponse;
+import org.apache.cloudstack.api.response.ProjectResponse;
+import org.apache.cloudstack.api.response.ProviderResponse;
+import org.apache.cloudstack.api.response.RemoteAccessVpnResponse;
+import org.apache.cloudstack.api.response.ResourceCountResponse;
+import org.apache.cloudstack.api.response.ResourceLimitResponse;
+import org.apache.cloudstack.api.response.ResourceTagResponse;
+import org.apache.cloudstack.api.response.SecurityGroupResponse;
+import org.apache.cloudstack.api.response.ServiceOfferingResponse;
+import org.apache.cloudstack.api.response.ServiceResponse;
+import org.apache.cloudstack.api.response.Site2SiteCustomerGatewayResponse;
+import org.apache.cloudstack.api.response.Site2SiteVpnConnectionResponse;
+import org.apache.cloudstack.api.response.Site2SiteVpnGatewayResponse;
+import org.apache.cloudstack.api.response.SnapshotPolicyResponse;
+import org.apache.cloudstack.api.response.SnapshotResponse;
+import org.apache.cloudstack.api.response.SnapshotScheduleResponse;
+import org.apache.cloudstack.api.response.StaticRouteResponse;
+import org.apache.cloudstack.api.response.StorageNetworkIpRangeResponse;
+import org.apache.cloudstack.api.response.StoragePoolResponse;
+import org.apache.cloudstack.api.response.SwiftResponse;
+import org.apache.cloudstack.api.response.SystemVmInstanceResponse;
+import org.apache.cloudstack.api.response.SystemVmResponse;
+import org.apache.cloudstack.api.response.TemplatePermissionsResponse;
+import org.apache.cloudstack.api.response.TemplateResponse;
+import org.apache.cloudstack.api.response.TrafficTypeResponse;
+import org.apache.cloudstack.api.response.UserResponse;
+import org.apache.cloudstack.api.response.UserVmResponse;
+import org.apache.cloudstack.api.response.VirtualRouterProviderResponse;
+import org.apache.cloudstack.api.response.VlanIpRangeResponse;
+import org.apache.cloudstack.api.response.VolumeResponse;
+import org.apache.cloudstack.api.response.VpcOfferingResponse;
+import org.apache.cloudstack.api.response.VpcResponse;
+import org.apache.cloudstack.api.response.VpnUsersResponse;
+import org.apache.cloudstack.api.response.ZoneResponse;
+
++import com.cloud.api.response.S3Response;
+
+import com.cloud.async.AsyncJob;
+import com.cloud.capacity.Capacity;
+import com.cloud.configuration.Configuration;
+import com.cloud.configuration.ResourceCount;
+import com.cloud.configuration.ResourceLimit;
+import com.cloud.dc.DataCenter;
+import com.cloud.dc.Pod;
+import com.cloud.dc.StorageNetworkIpRange;
+import com.cloud.dc.Vlan;
+import com.cloud.domain.Domain;
+import com.cloud.event.Event;
+import com.cloud.host.Host;
+import com.cloud.hypervisor.HypervisorCapabilities;
+import com.cloud.network.IpAddress;
+import com.cloud.network.Network;
+import com.cloud.network.Network.Service;
+import com.cloud.network.PhysicalNetwork;
+import com.cloud.network.PhysicalNetworkServiceProvider;
+import com.cloud.network.PhysicalNetworkTrafficType;
+import com.cloud.network.RemoteAccessVpn;
+import com.cloud.network.Site2SiteCustomerGateway;
+import com.cloud.network.Site2SiteVpnConnection;
+import com.cloud.network.Site2SiteVpnGateway;
+import com.cloud.network.VirtualRouterProvider;
+import com.cloud.network.VpnUser;
+import com.cloud.network.as.AutoScalePolicy;
+import com.cloud.network.as.AutoScaleVmGroup;
+import com.cloud.network.as.AutoScaleVmProfile;
+import com.cloud.network.as.Condition;
+import com.cloud.network.as.Counter;
+import com.cloud.network.router.VirtualRouter;
+import com.cloud.network.rules.FirewallRule;
+import com.cloud.network.rules.LoadBalancer;
+import com.cloud.network.rules.PortForwardingRule;
+import com.cloud.network.rules.StaticNatRule;
+import com.cloud.network.rules.StickinessPolicy;
+import com.cloud.network.security.SecurityGroup;
+import com.cloud.network.security.SecurityRule;
+import com.cloud.network.vpc.PrivateGateway;
+import com.cloud.network.vpc.StaticRoute;
+import com.cloud.network.vpc.Vpc;
+import com.cloud.network.vpc.VpcOffering;
+import com.cloud.offering.DiskOffering;
+import com.cloud.offering.NetworkOffering;
+import com.cloud.offering.ServiceOffering;
+import com.cloud.org.Cluster;
+import com.cloud.projects.Project;
+import com.cloud.projects.ProjectAccount;
+import com.cloud.projects.ProjectInvitation;
+import com.cloud.server.ResourceTag;
+import com.cloud.storage.GuestOS;
++import com.cloud.storage.S3;
+import com.cloud.storage.Snapshot;
+import com.cloud.storage.StoragePool;
+import com.cloud.storage.Swift;
+import com.cloud.storage.Volume;
+import com.cloud.storage.snapshot.SnapshotPolicy;
+import com.cloud.storage.snapshot.SnapshotSchedule;
+import com.cloud.template.VirtualMachineTemplate;
+import com.cloud.user.Account;
+import com.cloud.user.User;
+import com.cloud.user.UserAccount;
+import com.cloud.uservm.UserVm;
+import com.cloud.vm.InstanceGroup;
+import com.cloud.vm.VirtualMachine;
+
+public interface ResponseGenerator {
+ UserResponse createUserResponse(UserAccount user);
+
+ AccountResponse createAccountResponse(Account account);
+
+ DomainResponse createDomainResponse(Domain domain);
+
+ DiskOfferingResponse createDiskOfferingResponse(DiskOffering offering);
+
+ ResourceLimitResponse createResourceLimitResponse(ResourceLimit limit);
+
+ ResourceCountResponse createResourceCountResponse(ResourceCount resourceCount);
+
+ ServiceOfferingResponse createServiceOfferingResponse(ServiceOffering offering);
+
+ ConfigurationResponse createConfigurationResponse(Configuration cfg);
+
+ SnapshotResponse createSnapshotResponse(Snapshot snapshot);
+
+ SnapshotPolicyResponse createSnapshotPolicyResponse(SnapshotPolicy policy);
+
+ List<UserVmResponse> createUserVmResponse(String objectName, UserVm... userVms);
+
+ List<UserVmResponse> createUserVmResponse(String objectName, EnumSet<VMDetails> details, UserVm... userVms);
+
+ SystemVmResponse createSystemVmResponse(VirtualMachine systemVM);
+
+ DomainRouterResponse createDomainRouterResponse(VirtualRouter router);
+
+ HostResponse createHostResponse(Host host, EnumSet<HostDetails> details);
+
+ HostResponse createHostResponse(Host host);
+
+ VlanIpRangeResponse createVlanIpRangeResponse(Vlan vlan);
+
+ IPAddressResponse createIPAddressResponse(IpAddress ipAddress);
+
+ LoadBalancerResponse createLoadBalancerResponse(LoadBalancer loadBalancer);
+
+ LBStickinessResponse createLBStickinessPolicyResponse(List<? extends StickinessPolicy> stickinessPolicies, LoadBalancer lb);
+
+ LBStickinessResponse createLBStickinessPolicyResponse(StickinessPolicy stickinessPolicy, LoadBalancer lb);
+
+ PodResponse createPodResponse(Pod pod, Boolean showCapacities);
+
+ ZoneResponse createZoneResponse(DataCenter dataCenter, Boolean showCapacities);
+
+ VolumeResponse createVolumeResponse(Volume volume);
+
+ InstanceGroupResponse createInstanceGroupResponse(InstanceGroup group);
+
+ StoragePoolResponse createStoragePoolResponse(StoragePool pool);
+
+ ClusterResponse createClusterResponse(Cluster cluster, Boolean showCapacities);
+
+ FirewallRuleResponse createPortForwardingRuleResponse(PortForwardingRule fwRule);
+
+ IpForwardingRuleResponse createIpForwardingRuleResponse(StaticNatRule fwRule);
+
+ User findUserById(Long userId);
+
+ UserVm findUserVmById(Long vmId);
+
+ Volume findVolumeById(Long volumeId);
+
+ Account findAccountByNameDomain(String accountName, Long domainId);
+
+ VirtualMachineTemplate findTemplateById(Long templateId);
+
+ Host findHostById(Long hostId);
+
+ List<TemplateResponse> createTemplateResponses(long templateId, long zoneId, boolean readyOnly);
+
+ VpnUsersResponse createVpnUserResponse(VpnUser user);
+
+ RemoteAccessVpnResponse createRemoteAccessVpnResponse(RemoteAccessVpn vpn);
+
+ List<TemplateResponse> createTemplateResponses(long templateId, Long zoneId, boolean readyOnly);
+
+ List<TemplateResponse> createTemplateResponses(long templateId, Long snapshotId, Long volumeId, boolean readyOnly);
+
+ //ListResponse<SecurityGroupResponse> createSecurityGroupResponses(List<? extends SecurityGroupRules> networkGroups);
+
+ SecurityGroupResponse createSecurityGroupResponseFromSecurityGroupRule(List<? extends SecurityRule> SecurityRules);
+
+ SecurityGroupResponse createSecurityGroupResponse(SecurityGroup group);
+
+ ExtractResponse createExtractResponse(Long uploadId, Long id, Long zoneId, Long accountId, String mode);
+
+ String toSerializedString(CreateCmdResponse response, String responseType);
+
+ AsyncJobResponse createAsyncJobResponse(AsyncJob job);
+
+ EventResponse createEventResponse(Event event);
+
+ //List<EventResponse> createEventResponse(EventJoinVO... events);
+
+ TemplateResponse createIsoResponse(VirtualMachineTemplate result);
+
+ List<CapacityResponse> createCapacityResponse(List<? extends Capacity> result, DecimalFormat format);
+
+ TemplatePermissionsResponse createTemplatePermissionsResponse(List<String> accountNames, Long id, boolean isAdmin);
+
+ AsyncJobResponse queryJobResult(QueryAsyncJobResultCmd cmd);
+
+ NetworkOfferingResponse createNetworkOfferingResponse(NetworkOffering offering);
+
+ NetworkResponse createNetworkResponse(Network network);
+
+ UserResponse createUserResponse(User user);
+
+ //List<UserResponse> createUserResponse(UserAccountJoinVO... users);
+
+ AccountResponse createUserAccountResponse(UserAccount user);
+
+ Long getSecurityGroupId(String groupName, long accountId);
+
+ List<TemplateResponse> createIsoResponses(long isoId, Long zoneId, boolean readyOnly);
+
+ ProjectResponse createProjectResponse(Project project);
+
+
+ List<TemplateResponse> createIsoResponses(VirtualMachineTemplate iso, long zoneId, boolean readyOnly);
+
+ List<TemplateResponse> createTemplateResponses(long templateId, Long vmId);
+
+ FirewallResponse createFirewallResponse(FirewallRule fwRule);
+
+ HypervisorCapabilitiesResponse createHypervisorCapabilitiesResponse(HypervisorCapabilities hpvCapabilities);
+
+ ProjectAccountResponse createProjectAccountResponse(ProjectAccount projectAccount);
+
+ ProjectInvitationResponse createProjectInvitationResponse(ProjectInvitation invite);
+
+ SystemVmInstanceResponse createSystemVmInstanceResponse(VirtualMachine systemVM);
+
+ SwiftResponse createSwiftResponse(Swift swift);
+
++ S3Response createS3Response(S3 result);
++
+ PhysicalNetworkResponse createPhysicalNetworkResponse(PhysicalNetwork result);
+
+ ServiceResponse createNetworkServiceResponse(Service service);
+
+ ProviderResponse createNetworkServiceProviderResponse(PhysicalNetworkServiceProvider result);
+
+ TrafficTypeResponse createTrafficTypeResponse(PhysicalNetworkTrafficType result);
+
+ VirtualRouterProviderResponse createVirtualRouterProviderResponse(VirtualRouterProvider result);
+
+ LDAPConfigResponse createLDAPConfigResponse(String hostname, Integer port, Boolean useSSL, String queryFilter, String baseSearch, String dn);
+
+ StorageNetworkIpRangeResponse createStorageNetworkIpRangeResponse(StorageNetworkIpRange result);
+
+ /**
+ * @param tableName TODO
+ * @param token
+ * @return
+ */
+ Long getIdentiyId(String tableName, String token);
+
+ /**
+ * @param resourceTag
+ * @param keyValueOnly TODO
+ * @return
+ */
+ ResourceTagResponse createResourceTagResponse(ResourceTag resourceTag, boolean keyValueOnly);
+
+
+ Site2SiteVpnGatewayResponse createSite2SiteVpnGatewayResponse(Site2SiteVpnGateway result);
+
+
+ /**
+ * @param offering
+ * @return
+ */
+ VpcOfferingResponse createVpcOfferingResponse(VpcOffering offering);
+
+ /**
+ * @param vpc
+ * @return
+ */
+ VpcResponse createVpcResponse(Vpc vpc);
+
+ /**
+ * @param networkACL
+ * @return
+ */
+ NetworkACLResponse createNetworkACLResponse(FirewallRule networkACL);
+
+ /**
+ * @param result
+ * @return
+ */
+ PrivateGatewayResponse createPrivateGatewayResponse(PrivateGateway result);
+
+ /**
+ * @param result
+ * @return
+ */
+ StaticRouteResponse createStaticRouteResponse(StaticRoute result);
+
+ Site2SiteCustomerGatewayResponse createSite2SiteCustomerGatewayResponse(Site2SiteCustomerGateway result);
+
+ Site2SiteVpnConnectionResponse createSite2SiteVpnConnectionResponse(Site2SiteVpnConnection result);
+
+ CounterResponse createCounterResponse(Counter ctr);
+
+ ConditionResponse createConditionResponse(Condition cndn);
+
+ AutoScalePolicyResponse createAutoScalePolicyResponse(AutoScalePolicy policy);
+
+ AutoScaleVmProfileResponse createAutoScaleVmProfileResponse(AutoScaleVmProfile profile);
+
+ AutoScaleVmGroupResponse createAutoScaleVmGroupResponse(AutoScaleVmGroup vmGroup);
+
+ GuestOSResponse createGuestOSResponse(GuestOS os);
+
+ SnapshotScheduleResponse createSnapshotScheduleResponse(SnapshotSchedule sched);
-
+}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/296b49c2/api/src/org/apache/cloudstack/api/command/user/address/AssociateIPAddrCmd.java
----------------------------------------------------------------------
diff --cc api/src/org/apache/cloudstack/api/command/user/address/AssociateIPAddrCmd.java
index f4d4853,0000000..c696c6e
mode 100644,000000..100644
--- a/api/src/org/apache/cloudstack/api/command/user/address/AssociateIPAddrCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/address/AssociateIPAddrCmd.java
@@@ -1,273 -1,0 +1,274 @@@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package org.apache.cloudstack.api.command.user.address;
+
+import java.util.List;
+
+import org.apache.log4j.Logger;
+
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.BaseAsyncCmd;
+import org.apache.cloudstack.api.BaseAsyncCreateCmd;
+import org.apache.cloudstack.api.BaseCmd;
+import org.apache.cloudstack.api.Implementation;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.ServerApiException;
+import org.apache.cloudstack.api.response.DomainResponse;
+import org.apache.cloudstack.api.response.IPAddressResponse;
+import org.apache.cloudstack.api.response.ProjectResponse;
+import org.apache.cloudstack.api.response.NetworkResponse;
+import org.apache.cloudstack.api.response.VpcResponse;
+import org.apache.cloudstack.api.response.ZoneResponse;
+import com.cloud.async.AsyncJob;
+import com.cloud.dc.DataCenter;
+import com.cloud.dc.DataCenter.NetworkType;
+import com.cloud.event.EventTypes;
+import com.cloud.exception.ConcurrentOperationException;
+import com.cloud.exception.InsufficientAddressCapacityException;
+import com.cloud.exception.InsufficientCapacityException;
+import com.cloud.exception.InvalidParameterValueException;
+import com.cloud.exception.ResourceAllocationException;
+import com.cloud.exception.ResourceUnavailableException;
+import com.cloud.network.IpAddress;
+import com.cloud.network.Network;
+import com.cloud.network.vpc.Vpc;
+import com.cloud.user.Account;
+import com.cloud.user.UserContext;
+
+@Implementation(description="Acquires and associates a public IP to an account.", responseObject=IPAddressResponse.class)
+public class AssociateIPAddrCmd extends BaseAsyncCreateCmd {
+ public static final Logger s_logger = Logger.getLogger(AssociateIPAddrCmd.class.getName());
+ private static final String s_name = "associateipaddressresponse";
+
+ /////////////////////////////////////////////////////
+ //////////////// API parameters /////////////////////
+ /////////////////////////////////////////////////////
+
+ @Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING,
+ description="the account to associate with this IP address")
+ private String accountName;
+
+ @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.UUID, entityType = DomainResponse.class,
+ description="the ID of the domain to associate with this IP address")
+ private Long domainId;
+
+ @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.UUID, entityType = ZoneResponse.class,
+ description="the ID of the availability zone you want to acquire an public IP address from")
+ private Long zoneId;
+
+ @Parameter(name=ApiConstants.NETWORK_ID, type=CommandType.UUID, entityType = NetworkResponse.class,
+ description="The network this ip address should be associated to.")
+ private Long networkId;
+
+ @Parameter(name=ApiConstants.PROJECT_ID, type=CommandType.UUID, entityType = ProjectResponse.class,
+ description="Deploy vm for the project")
+ private Long projectId;
+
+ @Parameter(name=ApiConstants.VPC_ID, type=CommandType.UUID, entityType = VpcResponse.class,
+ description="the VPC you want the ip address to " +
+ "be associated with")
+ private Long vpcId;
+
+ /////////////////////////////////////////////////////
+ /////////////////// Accessors ///////////////////////
+ /////////////////////////////////////////////////////
+
+ public String getEntityTable() {
+ return "user_ip_address";
+ }
+
+ public String getAccountName() {
+ if (accountName != null) {
+ return accountName;
+ }
+ return UserContext.current().getCaller().getAccountName();
+ }
+
+ public long getDomainId() {
+ if (domainId != null) {
+ return domainId;
+ }
+ return UserContext.current().getCaller().getDomainId();
+ }
+
+ private long getZoneId() {
+ if (zoneId != null) {
+ return zoneId;
+ } else if (vpcId != null) {
+ Vpc vpc = _entityMgr.findById(Vpc.class, vpcId);
+ if (vpc != null) {
+ return vpc.getZoneId();
+ }
+ } else if (networkId != null) {
+ Network ntwk = _entityMgr.findById(Network.class, networkId);
+ if (ntwk != null) {
+ return ntwk.getDataCenterId();
+ }
+ }
+
+ throw new InvalidParameterValueException("Unable to figure out zone to assign ip to");
+ }
+
+ public Long getVpcId() {
+ return vpcId;
+ }
+
+ public Long getNetworkId() {
+ if (vpcId != null) {
+ return null;
+ }
+
+ if (networkId != null) {
+ return networkId;
+ }
+ Long zoneId = getZoneId();
+
+ if (zoneId == null) {
+ return null;
+ }
+
+ DataCenter zone = _configService.getZone(zoneId);
+ if (zone.getNetworkType() == NetworkType.Advanced) {
+ List<? extends Network> networks = _networkService.getIsolatedNetworksOwnedByAccountInZone(getZoneId(),
+ _accountService.getAccount(getEntityOwnerId()));
+ if (networks.size() == 0) {
+ String domain = _domainService.getDomain(getDomainId()).getName();
+ throw new InvalidParameterValueException("Account name=" + getAccountName() + " domain=" + domain +
+ " doesn't have virtual networks in zone=" + zone.getName());
+ }
+
+ if (networks.size() < 1) {
+ throw new InvalidParameterValueException("Account doesn't have any Isolated networks in the zone");
+ } else if (networks.size() > 1) {
+ throw new InvalidParameterValueException("Account has more than one Isolated network in the zone");
+ }
+
+ return networks.get(0).getId();
+ } else {
+ Network defaultGuestNetwork = _networkService.getExclusiveGuestNetwork(zoneId);
+ if (defaultGuestNetwork == null) {
+ throw new InvalidParameterValueException("Unable to find a default Guest network for account " +
+ getAccountName() + " in domain id=" + getDomainId());
+ } else {
+ return defaultGuestNetwork.getId();
+ }
+ }
+ }
+
+ @Override
+ public long getEntityOwnerId() {
+ Account caller = UserContext.current().getCaller();
+ if (accountName != null && domainId != null) {
+ Account account = _accountService.finalizeOwner(caller, accountName, domainId, projectId);
+ return account.getId();
+ } else if (networkId != null){
+ Network network = _networkService.getNetwork(networkId);
+ return network.getAccountId();
+ } else if (vpcId != null) {
+ Vpc vpc = _vpcService.getVpc(getVpcId());
+ if (vpc == null) {
+ throw new InvalidParameterValueException("Can't find Enabled vpc by id specified");
+ }
+ return vpc.getAccountId();
+ }
+
+ return caller.getAccountId();
+ }
+
+ @Override
+ public String getEventType() {
+ return EventTypes.EVENT_NET_IP_ASSIGN;
+ }
+
+ @Override
+ public String getEventDescription() {
+ return "associating ip to network id: " + getNetworkId() + " in zone " + getZoneId();
+ }
+
+ /////////////////////////////////////////////////////
+ /////////////// API Implementation///////////////////
+ /////////////////////////////////////////////////////
+
+
+ @Override
+ public String getCommandName() {
+ return s_name;
+ }
+
+ public static String getResultObjectName() {
+ return "addressinfo";
+ }
+
+ @Override
+ public void create() throws ResourceAllocationException{
+ try {
- IpAddress ip = _networkService.allocateIP(_accountService.getAccount(getEntityOwnerId()), false, getZoneId());
++ IpAddress ip = _networkService.allocateIP(_accountService.getAccount(getEntityOwnerId()), getZoneId(), getNetworkId());
++
+ if (ip != null) {
+ this.setEntityId(ip.getId());
+ } else {
+ throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to allocate ip address");
+ }
+ } catch (ConcurrentOperationException ex) {
+ s_logger.warn("Exception: ", ex);
+ throw new ServerApiException(BaseCmd.INTERNAL_ERROR, ex.getMessage());
+ } catch (InsufficientAddressCapacityException ex) {
+ s_logger.info(ex);
+ s_logger.trace(ex);
+ throw new ServerApiException(BaseCmd.INSUFFICIENT_CAPACITY_ERROR, ex.getMessage());
+ }
+ }
+
+ @Override
+ public void execute() throws ResourceUnavailableException, ResourceAllocationException,
+ ConcurrentOperationException, InsufficientCapacityException {
+ UserContext.current().setEventDetails("Ip Id: " + getEntityId());
+
+ IpAddress result = null;
+
+ if (getVpcId() != null) {
+ result = _vpcService.associateIPToVpc(getEntityId(), getVpcId());
+ } else if (getNetworkId() != null) {
+ result = _networkService.associateIPToNetwork(getEntityId(), getNetworkId());
+ }
+
+ if (result != null) {
+ IPAddressResponse ipResponse = _responseGenerator.createIPAddressResponse(result);
+ ipResponse.setResponseName(getCommandName());
+ this.setResponseObject(ipResponse);
+ } else {
+ throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to assign ip address");
+ }
+ }
+
+
+ @Override
+ public String getSyncObjType() {
+ return BaseAsyncCmd.networkSyncObject;
+ }
+
+ @Override
+ public Long getSyncObjId() {
+ return getNetworkId();
+ }
+
+ @Override
+ public AsyncJob.Type getInstanceType() {
+ return AsyncJob.Type.IpAddress;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/296b49c2/client/tomcatconf/commands.properties.in
----------------------------------------------------------------------
diff --cc client/tomcatconf/commands.properties.in
index df77687,437c8d4..c334c81
--- a/client/tomcatconf/commands.properties.in
+++ b/client/tomcatconf/commands.properties.in
@@@ -79,178 -79,181 +79,182 @@@ listSnapshotPolicies=org.apache.cloudst
#### template commands
-createTemplate=com.cloud.api.commands.CreateTemplateCmd;15
-registerTemplate=com.cloud.api.commands.RegisterTemplateCmd;15
-updateTemplate=com.cloud.api.commands.UpdateTemplateCmd;15
-copyTemplate=com.cloud.api.commands.CopyTemplateCmd;15
-deleteTemplate=com.cloud.api.commands.DeleteTemplateCmd;15
-listTemplates=com.cloud.api.commands.ListTemplatesCmd;15
-updateTemplatePermissions=com.cloud.api.commands.UpdateTemplatePermissionsCmd;15
-listTemplatePermissions=com.cloud.api.commands.ListTemplatePermissionsCmd;15
-extractTemplate=com.cloud.api.commands.ExtractTemplateCmd;15
-prepareTemplate=com.cloud.api.commands.PrepareTemplateCmd;1
+createTemplate=org.apache.cloudstack.api.command.user.template.CreateTemplateCmd;15
+registerTemplate=org.apache.cloudstack.api.command.user.template.RegisterTemplateCmd;15
+updateTemplate=org.apache.cloudstack.api.command.user.template.UpdateTemplateCmd;15
+copyTemplate=org.apache.cloudstack.api.command.user.template.CopyTemplateCmd;15
+deleteTemplate=org.apache.cloudstack.api.command.user.template.DeleteTemplateCmd;15
+listTemplates=org.apache.cloudstack.api.command.user.template.ListTemplatesCmd;15
+updateTemplatePermissions=org.apache.cloudstack.api.command.user.template.UpdateTemplatePermissionsCmd;15
+listTemplatePermissions=org.apache.cloudstack.api.command.user.template.ListTemplatePermissionsCmd;15
+extractTemplate=org.apache.cloudstack.api.command.user.template.ExtractTemplateCmd;15
+prepareTemplate=org.apache.cloudstack.api.command.admin.template.PrepareTemplateCmd;1
#### iso commands
-attachIso=com.cloud.api.commands.AttachIsoCmd;15
-detachIso=com.cloud.api.commands.DetachIsoCmd;15
-listIsos=com.cloud.api.commands.ListIsosCmd;15
-registerIso=com.cloud.api.commands.RegisterIsoCmd;15
-updateIso=com.cloud.api.commands.UpdateIsoCmd;15
-deleteIso=com.cloud.api.commands.DeleteIsoCmd;15
-copyIso=com.cloud.api.commands.CopyTemplateCmd;15
-updateIsoPermissions=com.cloud.api.commands.UpdateIsoPermissionsCmd;15
-listIsoPermissions=com.cloud.api.commands.ListIsoPermissionsCmd;15
-extractIso=com.cloud.api.commands.ExtractIsoCmd;15
+attachIso=org.apache.cloudstack.api.command.user.iso.AttachIsoCmd;15
+detachIso=org.apache.cloudstack.api.command.user.iso.DetachIsoCmd;15
+listIsos=org.apache.cloudstack.api.command.user.iso.ListIsosCmd;15
+registerIso=org.apache.cloudstack.api.command.user.iso.RegisterIsoCmd;15
+updateIso=org.apache.cloudstack.api.command.user.iso.UpdateIsoCmd;15
+deleteIso=org.apache.cloudstack.api.command.user.iso.DeleteIsoCmd;15
+copyIso=org.apache.cloudstack.api.command.user.template.CopyTemplateCmd;15
+updateIsoPermissions=org.apache.cloudstack.api.command.user.iso.UpdateIsoPermissionsCmd;15
+listIsoPermissions=org.apache.cloudstack.api.command.user.iso.ListIsoPermissionsCmd;15
+extractIso=org.apache.cloudstack.api.command.user.iso.ExtractIsoCmd;15
#### guest OS commands
-listOsTypes=com.cloud.api.commands.ListGuestOsCmd;15
-listOsCategories=com.cloud.api.commands.ListGuestOsCategoriesCmd;15
+listOsTypes=org.apache.cloudstack.api.command.user.guest.ListGuestOsCmd;15
+listOsCategories=org.apache.cloudstack.api.command.user.guest.ListGuestOsCategoriesCmd;15
#### service offering commands
-createServiceOffering=com.cloud.api.commands.CreateServiceOfferingCmd;1
-deleteServiceOffering=com.cloud.api.commands.DeleteServiceOfferingCmd;1
-updateServiceOffering=com.cloud.api.commands.UpdateServiceOfferingCmd;1
-listServiceOfferings=com.cloud.api.commands.ListServiceOfferingsCmd;15
+createServiceOffering=org.apache.cloudstack.api.command.admin.offering.CreateServiceOfferingCmd;1
+deleteServiceOffering=org.apache.cloudstack.api.command.admin.offering.DeleteServiceOfferingCmd;1
+updateServiceOffering=org.apache.cloudstack.api.command.admin.offering.UpdateServiceOfferingCmd;1
+listServiceOfferings=org.apache.cloudstack.api.command.user.offering.ListServiceOfferingsCmd;15
#### disk offering commands
-createDiskOffering=com.cloud.api.commands.CreateDiskOfferingCmd;1
-updateDiskOffering=com.cloud.api.commands.UpdateDiskOfferingCmd;1
-deleteDiskOffering=com.cloud.api.commands.DeleteDiskOfferingCmd;1
-listDiskOfferings=com.cloud.api.commands.ListDiskOfferingsCmd;15
+createDiskOffering=org.apache.cloudstack.api.command.admin.offering.CreateDiskOfferingCmd;1
+updateDiskOffering=org.apache.cloudstack.api.command.admin.offering.UpdateDiskOfferingCmd;1
+deleteDiskOffering=org.apache.cloudstack.api.command.admin.offering.DeleteDiskOfferingCmd;1
+listDiskOfferings=org.apache.cloudstack.api.command.user.offering.ListDiskOfferingsCmd;15
#### vlan commands
-createVlanIpRange=com.cloud.api.commands.CreateVlanIpRangeCmd;1
-deleteVlanIpRange=com.cloud.api.commands.DeleteVlanIpRangeCmd;1
-listVlanIpRanges=com.cloud.api.commands.ListVlanIpRangesCmd;1
+createVlanIpRange=org.apache.cloudstack.api.command.admin.vlan.CreateVlanIpRangeCmd;1
+deleteVlanIpRange=org.apache.cloudstack.api.command.admin.vlan.DeleteVlanIpRangeCmd;1
+listVlanIpRanges=org.apache.cloudstack.api.command.admin.vlan.ListVlanIpRangesCmd;1
#### address commands
-associateIpAddress=com.cloud.api.commands.AssociateIPAddrCmd;15
-disassociateIpAddress=com.cloud.api.commands.DisassociateIPAddrCmd;15
-listPublicIpAddresses=com.cloud.api.commands.ListPublicIpAddressesCmd;15
+associateIpAddress=org.apache.cloudstack.api.command.user.address.AssociateIPAddrCmd;15
+disassociateIpAddress=org.apache.cloudstack.api.command.user.address.DisassociateIPAddrCmd;15
+listPublicIpAddresses=org.apache.cloudstack.api.command.user.address.ListPublicIpAddressesCmd;15
#### firewall commands
-listPortForwardingRules=com.cloud.api.commands.ListPortForwardingRulesCmd;15
-createPortForwardingRule=com.cloud.api.commands.CreatePortForwardingRuleCmd;15
-deletePortForwardingRule=com.cloud.api.commands.DeletePortForwardingRuleCmd;15
-#### updatePortForwardingRule=com.cloud.api.commands.UpdatePortForwardingRuleCmd;15
+listPortForwardingRules=org.apache.cloudstack.api.command.user.firewall.ListPortForwardingRulesCmd;15
+createPortForwardingRule=org.apache.cloudstack.api.command.user.firewall.CreatePortForwardingRuleCmd;15
+deletePortForwardingRule=org.apache.cloudstack.api.command.user.firewall.DeletePortForwardingRuleCmd;15
+updatePortForwardingRule=org.apache.cloudstack.api.command.user.firewall.UpdatePortForwardingRuleCmd;15
#### NAT commands
-enableStaticNat=com.cloud.api.commands.EnableStaticNatCmd;15
-createIpForwardingRule=com.cloud.api.commands.CreateIpForwardingRuleCmd;15
-deleteIpForwardingRule=com.cloud.api.commands.DeleteIpForwardingRuleCmd;15
-listIpForwardingRules=com.cloud.api.commands.ListIpForwardingRulesCmd;15
-disableStaticNat=com.cloud.api.commands.DisableStaticNatCmd;15
+enableStaticNat=org.apache.cloudstack.api.command.user.nat.EnableStaticNatCmd;15
+createIpForwardingRule=org.apache.cloudstack.api.command.user.nat.CreateIpForwardingRuleCmd;15
+deleteIpForwardingRule=org.apache.cloudstack.api.command.user.nat.DeleteIpForwardingRuleCmd;15
+listIpForwardingRules=org.apache.cloudstack.api.command.user.nat.ListIpForwardingRulesCmd;15
+disableStaticNat=org.apache.cloudstack.api.command.user.nat.DisableStaticNatCmd;15
#### load balancer commands
-createLoadBalancerRule=com.cloud.api.commands.CreateLoadBalancerRuleCmd;15
-deleteLoadBalancerRule=com.cloud.api.commands.DeleteLoadBalancerRuleCmd;15
-removeFromLoadBalancerRule=com.cloud.api.commands.RemoveFromLoadBalancerRuleCmd;15
-assignToLoadBalancerRule=com.cloud.api.commands.AssignToLoadBalancerRuleCmd;15
-createLBStickinessPolicy=com.cloud.api.commands.CreateLBStickinessPolicyCmd;15
-deleteLBStickinessPolicy=com.cloud.api.commands.DeleteLBStickinessPolicyCmd;15
-listLoadBalancerRules=com.cloud.api.commands.ListLoadBalancerRulesCmd;15
-listLBStickinessPolicies=com.cloud.api.commands.ListLBStickinessPoliciesCmd;15
-listLoadBalancerRuleInstances=com.cloud.api.commands.ListLoadBalancerRuleInstancesCmd;15
-updateLoadBalancerRule=com.cloud.api.commands.UpdateLoadBalancerRuleCmd;15
+createLoadBalancerRule=org.apache.cloudstack.api.command.user.loadbalancer.CreateLoadBalancerRuleCmd;15
+deleteLoadBalancerRule=org.apache.cloudstack.api.command.user.loadbalancer.DeleteLoadBalancerRuleCmd;15
+removeFromLoadBalancerRule=org.apache.cloudstack.api.command.user.loadbalancer.RemoveFromLoadBalancerRuleCmd;15
+assignToLoadBalancerRule=org.apache.cloudstack.api.command.user.loadbalancer.AssignToLoadBalancerRuleCmd;15
+createLBStickinessPolicy=org.apache.cloudstack.api.command.user.loadbalancer.CreateLBStickinessPolicyCmd;15
+deleteLBStickinessPolicy=org.apache.cloudstack.api.command.user.loadbalancer.DeleteLBStickinessPolicyCmd;15
+listLoadBalancerRules=org.apache.cloudstack.api.command.user.loadbalancer.ListLoadBalancerRulesCmd;15
+listLBStickinessPolicies=org.apache.cloudstack.api.command.user.loadbalancer.ListLBStickinessPoliciesCmd;15
+listLoadBalancerRuleInstances=org.apache.cloudstack.api.command.user.loadbalancer.ListLoadBalancerRuleInstancesCmd;15
+updateLoadBalancerRule=org.apache.cloudstack.api.command.user.loadbalancer.UpdateLoadBalancerRuleCmd;15
#### autoscale commands
-createCounter = com.cloud.api.commands.CreateCounterCmd;1
-createCondition = com.cloud.api.commands.CreateConditionCmd;15
-createAutoScalePolicy=com.cloud.api.commands.CreateAutoScalePolicyCmd;15
-createAutoScaleVmProfile=com.cloud.api.commands.CreateAutoScaleVmProfileCmd;15
-createAutoScaleVmGroup=com.cloud.api.commands.CreateAutoScaleVmGroupCmd;15
-deleteCounter = com.cloud.api.commands.DeleteCounterCmd;1
-deleteCondition = com.cloud.api.commands.DeleteConditionCmd;15
-deleteAutoScalePolicy=com.cloud.api.commands.DeleteAutoScalePolicyCmd;15
-deleteAutoScaleVmProfile=com.cloud.api.commands.DeleteAutoScaleVmProfileCmd;15
-deleteAutoScaleVmGroup=com.cloud.api.commands.DeleteAutoScaleVmGroupCmd;15
-listCounters = com.cloud.api.commands.ListCountersCmd;15
-listConditions = com.cloud.api.commands.ListConditionsCmd;15
-listAutoScalePolicies=com.cloud.api.commands.ListAutoScalePoliciesCmd;15
-listAutoScaleVmProfiles=com.cloud.api.commands.ListAutoScaleVmProfilesCmd;15
-listAutoScaleVmGroups=com.cloud.api.commands.ListAutoScaleVmGroupsCmd;15
-enableAutoScaleVmGroup=com.cloud.api.commands.EnableAutoScaleVmGroupCmd;15
-disableAutoScaleVmGroup=com.cloud.api.commands.DisableAutoScaleVmGroupCmd;15
-updateAutoScalePolicy=com.cloud.api.commands.UpdateAutoScalePolicyCmd;15
-updateAutoScaleVmProfile=com.cloud.api.commands.UpdateAutoScaleVmProfileCmd;15
-updateAutoScaleVmGroup=com.cloud.api.commands.UpdateAutoScaleVmGroupCmd;15
+createCounter = org.apache.cloudstack.api.command.admin.autoscale.CreateCounterCmd;1
+createCondition = org.apache.cloudstack.api.command.user.autoscale.CreateConditionCmd;15
+createAutoScalePolicy=org.apache.cloudstack.api.command.user.autoscale.CreateAutoScalePolicyCmd;15
+createAutoScaleVmProfile=org.apache.cloudstack.api.command.user.autoscale.CreateAutoScaleVmProfileCmd;15
+createAutoScaleVmGroup=org.apache.cloudstack.api.command.user.autoscale.CreateAutoScaleVmGroupCmd;15
+deleteCounter = org.apache.cloudstack.api.command.admin.autoscale.DeleteCounterCmd;1
+deleteCondition = org.apache.cloudstack.api.command.user.autoscale.DeleteConditionCmd;15
+deleteAutoScalePolicy=org.apache.cloudstack.api.command.user.autoscale.DeleteAutoScalePolicyCmd;15
+deleteAutoScaleVmProfile=org.apache.cloudstack.api.command.user.autoscale.DeleteAutoScaleVmProfileCmd;15
+deleteAutoScaleVmGroup=org.apache.cloudstack.api.command.user.autoscale.DeleteAutoScaleVmGroupCmd;15
+listCounters = org.apache.cloudstack.api.command.user.autoscale.ListCountersCmd;15
+listConditions = org.apache.cloudstack.api.command.user.autoscale.ListConditionsCmd;15
+listAutoScalePolicies=org.apache.cloudstack.api.command.user.autoscale.ListAutoScalePoliciesCmd;15
+listAutoScaleVmProfiles=org.apache.cloudstack.api.command.user.autoscale.ListAutoScaleVmProfilesCmd;15
+listAutoScaleVmGroups=org.apache.cloudstack.api.command.user.autoscale.ListAutoScaleVmGroupsCmd;15
+enableAutoScaleVmGroup=org.apache.cloudstack.api.command.user.autoscale.EnableAutoScaleVmGroupCmd;15
+disableAutoScaleVmGroup=org.apache.cloudstack.api.command.user.autoscale.DisableAutoScaleVmGroupCmd;15
+updateAutoScalePolicy=org.apache.cloudstack.api.command.user.autoscale.UpdateAutoScalePolicyCmd;15
+updateAutoScaleVmProfile=org.apache.cloudstack.api.command.user.autoscale.UpdateAutoScaleVmProfileCmd;15
+updateAutoScaleVmGroup=org.apache.cloudstack.api.command.user.autoscale.UpdateAutoScaleVmGroupCmd;15
#### router commands
-startRouter=com.cloud.api.commands.StartRouterCmd;7
-rebootRouter=com.cloud.api.commands.RebootRouterCmd;7
-stopRouter=com.cloud.api.commands.StopRouterCmd;7
-destroyRouter=com.cloud.api.commands.DestroyRouterCmd;7
-changeServiceForRouter=com.cloud.api.commands.UpgradeRouterCmd;7
-listRouters=com.cloud.api.commands.ListRoutersCmd;7
-listVirtualRouterElements=com.cloud.api.commands.ListVirtualRouterElementsCmd;7
-configureVirtualRouterElement=com.cloud.api.commands.ConfigureVirtualRouterElementCmd;7
+startRouter=org.apache.cloudstack.api.command.admin.router.StartRouterCmd;7
+rebootRouter=org.apache.cloudstack.api.command.admin.router.RebootRouterCmd;7
+stopRouter=org.apache.cloudstack.api.command.admin.router.StopRouterCmd;7
+destroyRouter=org.apache.cloudstack.api.command.admin.router.DestroyRouterCmd;7
+changeServiceForRouter=org.apache.cloudstack.api.command.admin.router.UpgradeRouterCmd;7
+listRouters=org.apache.cloudstack.api.command.admin.router.ListRoutersCmd;7
+listVirtualRouterElements=org.apache.cloudstack.api.command.admin.router.ListVirtualRouterElementsCmd;7
+configureVirtualRouterElement=org.apache.cloudstack.api.command.admin.router.ConfigureVirtualRouterElementCmd;7
+createVirtualRouterElement=org.apache.cloudstack.api.command.admin.router.CreateVirtualRouterElementCmd;7
#### system vm commands
-startSystemVm=com.cloud.api.commands.StartSystemVMCmd;1
-rebootSystemVm=com.cloud.api.commands.RebootSystemVmCmd;1
-stopSystemVm=com.cloud.api.commands.StopSystemVmCmd;1
-destroySystemVm=com.cloud.api.commands.DestroySystemVmCmd;1
-listSystemVms=com.cloud.api.commands.ListSystemVMsCmd;3
-migrateSystemVm=com.cloud.api.commands.MigrateSystemVMCmd;1
-changeServiceForSystemVm=com.cloud.api.commands.UpgradeSystemVMCmd;1
+startSystemVm=org.apache.cloudstack.api.command.admin.systemvm.StartSystemVMCmd;1
+rebootSystemVm=org.apache.cloudstack.api.command.admin.systemvm.RebootSystemVmCmd;1
+stopSystemVm=org.apache.cloudstack.api.command.admin.systemvm.StopSystemVmCmd;1
+destroySystemVm=org.apache.cloudstack.api.command.admin.systemvm.DestroySystemVmCmd;1
+listSystemVms=org.apache.cloudstack.api.command.admin.systemvm.ListSystemVMsCmd;3
+migrateSystemVm=org.apache.cloudstack.api.command.admin.systemvm.MigrateSystemVMCmd;1
+changeServiceForSystemVm=org.apache.cloudstack.api.command.admin.systemvm.UpgradeSystemVMCmd;1
#### configuration commands
-updateConfiguration=com.cloud.api.commands.UpdateCfgCmd;1
-listConfigurations=com.cloud.api.commands.ListCfgsByCmd;1
-ldapConfig=com.cloud.api.commands.LDAPConfigCmd;1
-ldapRemove=com.cloud.api.commands.LDAPRemoveCmd;1
-listCapabilities=com.cloud.api.commands.ListCapabilitiesCmd;15
+updateConfiguration=org.apache.cloudstack.api.command.admin.config.UpdateCfgCmd;1
+listConfigurations=org.apache.cloudstack.api.command.admin.config.ListCfgsByCmd;1
+ldapConfig=org.apache.cloudstack.api.command.admin.ldap.LDAPConfigCmd;1
+ldapRemove=org.apache.cloudstack.api.command.admin.ldap.LDAPRemoveCmd;1
+listCapabilities=org.apache.cloudstack.api.command.user.config.ListCapabilitiesCmd;15
#### pod commands
-createPod=com.cloud.api.commands.CreatePodCmd;1
-updatePod=com.cloud.api.commands.UpdatePodCmd;1
-deletePod=com.cloud.api.commands.DeletePodCmd;1
-listPods=com.cloud.api.commands.ListPodsByCmd;3
+createPod=org.apache.cloudstack.api.command.admin.pod.CreatePodCmd;1
+updatePod=org.apache.cloudstack.api.command.admin.pod.UpdatePodCmd;1
+deletePod=org.apache.cloudstack.api.command.admin.pod.DeletePodCmd;1
+listPods=org.apache.cloudstack.api.command.admin.pod.ListPodsByCmd;3
#### zone commands
-createZone=com.cloud.api.commands.CreateZoneCmd;1
-updateZone=com.cloud.api.commands.UpdateZoneCmd;1
-deleteZone=com.cloud.api.commands.DeleteZoneCmd;1
-listZones=com.cloud.api.commands.ListZonesByCmd;15
+createZone=org.apache.cloudstack.api.command.admin.zone.CreateZoneCmd;1
+updateZone=org.apache.cloudstack.api.command.admin.zone.UpdateZoneCmd;1
+deleteZone=org.apache.cloudstack.api.command.admin.zone.DeleteZoneCmd;1
+listZones=org.apache.cloudstack.api.command.user.zone.ListZonesByCmd;15
#### events commands
-listEvents=com.cloud.api.commands.ListEventsCmd;15
-listEventTypes=com.cloud.api.commands.ListEventTypesCmd;15
+listEvents=org.apache.cloudstack.api.command.user.event.ListEventsCmd;15
+listEventTypes=org.apache.cloudstack.api.command.user.event.ListEventTypesCmd;15
#### alerts commands
-listAlerts=com.cloud.api.commands.ListAlertsCmd;3
+listAlerts=org.apache.cloudstack.api.command.admin.resource.ListAlertsCmd;3
#### system capacity commands
-listCapacity=com.cloud.api.commands.ListCapacityCmd;3
+listCapacity=org.apache.cloudstack.api.command.admin.resource.ListCapacityCmd;3
--#### swift commands^M
-addSwift=com.cloud.api.commands.AddSwiftCmd;1
-listSwifts=com.cloud.api.commands.ListSwiftsCmd;1
++#### swift commands
+addSwift=org.apache.cloudstack.api.command.admin.swift.AddSwiftCmd;1
+listSwifts=org.apache.cloudstack.api.command.admin.swift.ListSwiftsCmd;1
+ #### s3 commands
+ addS3=com.cloud.api.commands.AddS3Cmd;1
+ listS3s=com.cloud.api.commands.ListS3sCmd;1
+
#### host commands
-addHost=com.cloud.api.commands.AddHostCmd;3
-addCluster=com.cloud.api.commands.AddClusterCmd;1
-deleteCluster=com.cloud.api.commands.DeleteClusterCmd;1
-updateCluster=com.cloud.api.commands.UpdateClusterCmd;1
-reconnectHost=com.cloud.api.commands.ReconnectHostCmd;1
-updateHost=com.cloud.api.commands.UpdateHostCmd;1
-deleteHost=com.cloud.api.commands.DeleteHostCmd;3
-prepareHostForMaintenance=com.cloud.api.commands.PrepareForMaintenanceCmd;1
-cancelHostMaintenance=com.cloud.api.commands.CancelMaintenanceCmd;1
-listHosts=com.cloud.api.commands.ListHostsCmd;3
-addSecondaryStorage=com.cloud.api.commands.AddSecondaryStorageCmd;1
-updateHostPassword=com.cloud.api.commands.UpdateHostPasswordCmd;1
+addHost=org.apache.cloudstack.api.command.admin.host.AddHostCmd;3
+addCluster=org.apache.cloudstack.api.command.admin.cluster.AddClusterCmd;1
+deleteCluster=org.apache.cloudstack.api.command.admin.cluster.DeleteClusterCmd;1
+updateCluster=org.apache.cloudstack.api.command.admin.cluster.UpdateClusterCmd;1
+reconnectHost=org.apache.cloudstack.api.command.admin.host.ReconnectHostCmd;1
+updateHost=org.apache.cloudstack.api.command.admin.host.UpdateHostCmd;1
+deleteHost=org.apache.cloudstack.api.command.admin.host.DeleteHostCmd;3
+prepareHostForMaintenance=org.apache.cloudstack.api.command.admin.host.PrepareForMaintenanceCmd;1
+cancelHostMaintenance=org.apache.cloudstack.api.command.admin.host.CancelMaintenanceCmd;1
+listHosts=org.apache.cloudstack.api.command.admin.host.ListHostsCmd;3
+addSecondaryStorage=org.apache.cloudstack.api.command.admin.host.AddSecondaryStorageCmd;1
+updateHostPassword=org.apache.cloudstack.api.command.admin.host.UpdateHostPasswordCmd;1
#### volume commands
-attachVolume=com.cloud.api.commands.AttachVolumeCmd;15
-uploadVolume=com.cloud.api.commands.UploadVolumeCmd;15
-detachVolume=com.cloud.api.commands.DetachVolumeCmd;15
-createVolume=com.cloud.api.commands.CreateVolumeCmd;15
-deleteVolume=com.cloud.api.commands.DeleteVolumeCmd;15
-listVolumes=com.cloud.api.commands.ListVolumesCmd;15
-extractVolume=com.cloud.api.commands.ExtractVolumeCmd;15
-migrateVolume=com.cloud.api.commands.MigrateVolumeCmd;15
+attachVolume=org.apache.cloudstack.api.command.user.volume.AttachVolumeCmd;15
+uploadVolume=org.apache.cloudstack.api.command.user.volume.UploadVolumeCmd;15
+detachVolume=org.apache.cloudstack.api.command.user.volume.DetachVolumeCmd;15
+createVolume=org.apache.cloudstack.api.command.user.volume.CreateVolumeCmd;15
+deleteVolume=org.apache.cloudstack.api.command.user.volume.DeleteVolumeCmd;15
+listVolumes=org.apache.cloudstack.api.command.user.volume.ListVolumesCmd;15
+extractVolume=org.apache.cloudstack.api.command.user.volume.ExtractVolumeCmd;15
+migrateVolume=org.apache.cloudstack.api.command.user.volume.MigrateVolumeCmd;15
#### registration command: FIXME -- this really should be something in management server that
#### generates a new key for the user and they just have to
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/296b49c2/core/src/com/cloud/storage/S3VO.java
----------------------------------------------------------------------
diff --cc core/src/com/cloud/storage/S3VO.java
index 0000000,89f233b..ab16b2a
mode 000000,100644..100644
--- a/core/src/com/cloud/storage/S3VO.java
+++ b/core/src/com/cloud/storage/S3VO.java
@@@ -1,0 -1,208 +1,208 @@@
+ /*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+ package com.cloud.storage;
+
+ import com.cloud.agent.api.to.S3TO;
-import com.cloud.api.Identity;
+ import com.cloud.utils.db.GenericDao;
++import org.apache.cloudstack.api.Identity;
+
+ import javax.persistence.Column;
+ import javax.persistence.Entity;
+ import javax.persistence.GeneratedValue;
+ import javax.persistence.GenerationType;
+ import javax.persistence.Id;
+ import javax.persistence.Table;
+ import java.util.Date;
+
+ @Entity
+ @Table(name = "s3")
+ public class S3VO implements S3, Identity {
+
+ public static final String ID_COLUMN_NAME = "id";
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ @Column(name = ID_COLUMN_NAME)
+ private long id;
+
+ @Column(name = "uuid")
+ private String uuid;
+
+ @Column(name = "access_key")
+ private String accessKey;
+
+ @Column(name = "secret_key")
+ private String secretKey;
+
+ @Column(name = "end_point")
+ private String endPoint;
+
+ @Column(name = "bucket")
+ private String bucketName;
+
+ @Column(name = "https")
+ private Integer httpsFlag;
+
+ @Column(name = "connection_timeout")
+ private Integer connectionTimeout;
+
+ @Column(name = "max_error_retry")
+ private Integer maxErrorRetry;
+
+ @Column(name = "socket_timeout")
+ private Integer socketTimeout;
+
+ @Column(name = GenericDao.CREATED_COLUMN)
+ private Date created;
+
+ public S3VO() {
+ super();
+ }
+
+ public S3VO(final String uuid, final String accessKey,
+ final String secretKey, final String endPoint,
+ final String bucketName, final Boolean httpsFlag,
+ final Integer connectionTimeout, final Integer maxErrorRetry,
+ final Integer socketTimeout, final Date created) {
+
+ super();
+
+ this.uuid = uuid;
+ this.accessKey = accessKey;
+ this.secretKey = secretKey;
+ this.endPoint = endPoint;
+ this.bucketName = bucketName;
+
+ Integer value = null;
+ if (httpsFlag != null) {
+ value = httpsFlag == false ? 0 : 1;
+ }
+ this.httpsFlag = value;
+
+ this.connectionTimeout = connectionTimeout;
+ this.maxErrorRetry = maxErrorRetry;
+ this.socketTimeout = socketTimeout;
+ this.created = created;
+
+ }
+
+ @Override
+ public S3TO toS3TO() {
+
+ Boolean httpsFlag = null;
+ if (this.httpsFlag != null) {
+ httpsFlag = this.httpsFlag == 0 ? false : true;
+ }
+
+ return new S3TO(this.id, this.uuid, this.accessKey, this.secretKey,
+ this.endPoint, this.bucketName, httpsFlag,
+ this.connectionTimeout, this.maxErrorRetry, this.socketTimeout,
+ this.created);
+
+ }
+
+ public long getId() {
+ return this.id;
+ }
+
+ public void setId(final long id) {
+ this.id = id;
+ }
+
+ public String getUuid() {
+ return this.uuid;
+ }
+
+ public void setUuid(final String uuid) {
+ this.uuid = uuid;
+ }
+
+ public String getAccessKey() {
+ return this.accessKey;
+ }
+
+ public void setAccessKey(final String accessKey) {
+ this.accessKey = accessKey;
+ }
+
+ public String getSecretKey() {
+ return this.secretKey;
+ }
+
+ public void setSecretKey(final String secretKey) {
+ this.secretKey = secretKey;
+ }
+
+ public String getEndPoint() {
+ return this.endPoint;
+ }
+
+ public void setEndPoint(final String endPoint) {
+ this.endPoint = endPoint;
+ }
+
+ public String getBucketName() {
+ return this.bucketName;
+ }
+
+ public void setBucketName(final String bucketName) {
+ this.bucketName = bucketName;
+ }
+
+ public Integer getHttpsFlag() {
+ return this.httpsFlag;
+ }
+
+ public void setHttpsFlag(final Integer httpsFlag) {
+ this.httpsFlag = httpsFlag;
+ }
+
+ public Integer getConnectionTimeout() {
+ return this.connectionTimeout;
+ }
+
+ public void setConnectionTimeout(final int connectionTimeout) {
+ this.connectionTimeout = connectionTimeout;
+ }
+
+ public Integer getMaxErrorRetry() {
+ return this.maxErrorRetry;
+ }
+
+ public void setMaxErrorRetry(final int maxErrorRetry) {
+ this.maxErrorRetry = maxErrorRetry;
+ }
+
+ public Integer getSocketTimeout() {
+ return this.socketTimeout;
+ }
+
+ public void setSocketTimeout(final int socketTimeout) {
+ this.socketTimeout = socketTimeout;
+ }
+
+ public Date getCreated() {
+ return this.created;
+ }
+
+ public void setCreated(final Date created) {
+ this.created = created;
+ }
+
+ }
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/296b49c2/core/src/com/cloud/storage/SnapshotVO.java
----------------------------------------------------------------------
diff --cc core/src/com/cloud/storage/SnapshotVO.java
index 928cd2d,ae4fd6a..885a479
--- a/core/src/com/cloud/storage/SnapshotVO.java
+++ b/core/src/com/cloud/storage/SnapshotVO.java
@@@ -87,10 -87,13 +87,13 @@@ public class SnapshotVO implements Snap
@Column(name="backup_snap_id")
String backupSnapshotId;
-
+
@Column(name="swift_id")
Long swiftId;
-
+
+ @Column(name="s3_id")
+ Long s3Id;
+
@Column(name="sechost_id")
Long secHostId;
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/296b49c2/core/src/com/cloud/storage/resource/NfsSecondaryStorageResource.java
----------------------------------------------------------------------
diff --cc core/src/com/cloud/storage/resource/NfsSecondaryStorageResource.java
index 3b4cc8f,d8fdc3a..a4bea9d
--- a/core/src/com/cloud/storage/resource/NfsSecondaryStorageResource.java
+++ b/core/src/com/cloud/storage/resource/NfsSecondaryStorageResource.java
@@@ -75,7 -91,9 +91,8 @@@ import com.cloud.agent.api.storage.List
import com.cloud.agent.api.storage.ListVolumeCommand;
import com.cloud.agent.api.storage.UploadCommand;
import com.cloud.agent.api.storage.ssCommand;
+ import com.cloud.agent.api.to.S3TO;
import com.cloud.agent.api.to.SwiftTO;
-import com.cloud.api.commands.DeleteVolumeCmd;
import com.cloud.exception.InternalErrorException;
import com.cloud.host.Host;
import com.cloud.host.Host.Type;
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/296b49c2/plugins/hypervisors/simulator/src/com/cloud/api/commands/ConfigureSimulator.java
----------------------------------------------------------------------
diff --cc plugins/hypervisors/simulator/src/com/cloud/api/commands/ConfigureSimulator.java
index 0000000,60ce82e..92f8948
mode 000000,100755..100755
--- a/plugins/hypervisors/simulator/src/com/cloud/api/commands/ConfigureSimulator.java
+++ b/plugins/hypervisors/simulator/src/com/cloud/api/commands/ConfigureSimulator.java
@@@ -1,0 -1,82 +1,82 @@@
+ // Licensed to the Apache Software Foundation (ASF) under one
+ // or more contributor license agreements. See the NOTICE file
+ // distributed with this work for additional information
+ // regarding copyright ownership. The ASF licenses this file
+ // to you under the Apache License, Version 2.0 (the
+ // "License"); you may not use this file except in compliance
+ // with the License. You may obtain a copy of the License at
+ //
+ // http://www.apache.org/licenses/LICENSE-2.0
+ //
+ // Unless required by applicable law or agreed to in writing,
+ // software distributed under the License is distributed on an
+ // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ // KIND, either express or implied. See the License for the
+ // specific language governing permissions and limitations
+ // under the License.
+ package com.cloud.api.commands;
+
+ import org.apache.log4j.Logger;
+
+ import com.cloud.agent.manager.SimulatorManager;
-import com.cloud.api.ApiConstants;
-import com.cloud.api.BaseCmd;
-import com.cloud.api.Implementation;
-import com.cloud.api.Parameter;
-import com.cloud.api.ServerApiException;
-import com.cloud.api.response.SuccessResponse;
++import org.apache.cloudstack.api.ApiConstants;
++import org.apache.cloudstack.api.BaseCmd;
++import org.apache.cloudstack.api.Implementation;
++import org.apache.cloudstack.api.Parameter;
++import org.apache.cloudstack.api.ServerApiException;
++import org.apache.cloudstack.api.response.SuccessResponse;
+ import com.cloud.exception.ConcurrentOperationException;
+ import com.cloud.exception.InsufficientCapacityException;
+ import com.cloud.exception.ResourceAllocationException;
+ import com.cloud.exception.ResourceUnavailableException;
+ import com.cloud.server.ManagementService;
+ import com.cloud.user.Account;
+ import com.cloud.utils.component.ComponentLocator;
+
+ @Implementation(description="configure simulator", responseObject=SuccessResponse.class)
+ public class ConfigureSimulator extends BaseCmd {
+ public static final Logger s_logger = Logger.getLogger(ConfigureSimulator.class.getName());
+ private static final String s_name = "configuresimulatorresponse";
+
+ @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, description="configure range: in a zone")
+ private Long zoneId;
+
+ @Parameter(name=ApiConstants.POD_ID, type=CommandType.LONG, description="configure range: in a pod")
+ private Long podId;
+
+ @Parameter(name=ApiConstants.CLUSTER_ID, type=CommandType.LONG, description="configure range: in a cluster")
+ private Long clusterId;
+
+ @Parameter(name=ApiConstants.HOST_ID, type=CommandType.LONG, description="configure range: in a host")
+ private Long hostId;
+
+ @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, required=true, description="which command needs to be configured")
+ private String command;
+
+ @Parameter(name=ApiConstants.VALUE, type=CommandType.STRING, required=true, description="configuration options for this command, which is seperated by ;")
+ private String values;
+
+ @Override
+ public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException, ResourceAllocationException {
+ ComponentLocator locator = ComponentLocator.getLocator(ManagementService.Name);
+ SimulatorManager _simMgr = locator.getManager(SimulatorManager.class);
+ boolean result = _simMgr.configureSimulator(zoneId, podId, clusterId, hostId, command, values);
+ if (!result) {
+ throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to configure simulator");
+ }
+
+ SuccessResponse response = new SuccessResponse(getCommandName());
+ this.setResponseObject(response);
+ }
+
+ @Override
+ public String getCommandName() {
+ return s_name;
+ }
+
+ @Override
+ public long getEntityOwnerId() {
+ return Account.ACCOUNT_ID_SYSTEM;
+ }
+
+ }