api: Annotate autoscale apis

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
This commit is contained in:
Rohit Yadav 2012-12-22 20:28:19 -08:00
parent 575fab9711
commit af5eacfc01
23 changed files with 119 additions and 96 deletions

View File

@ -18,12 +18,12 @@ package org.apache.cloudstack.api.command.user.autoscale;
import java.util.List;
import org.apache.cloudstack.api.response.ConditionResponse;
import org.apache.log4j.Logger;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseAsyncCreateCmd;
import org.apache.cloudstack.api.BaseCmd;
import org.apache.cloudstack.api.IdentityMapper;
import org.apache.cloudstack.api.Implementation;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
@ -55,8 +55,8 @@ public class CreateAutoScalePolicyCmd extends BaseAsyncCreateCmd {
@Parameter(name = ApiConstants.QUIETTIME, type = CommandType.INTEGER, description = "the cool down period for which the policy should not be evaluated after the action has been taken")
private Integer quietTime;
@IdentityMapper(entityTableName = "conditions")
@Parameter(name = ApiConstants.CONDITION_IDS, type = CommandType.LIST, collectionType = CommandType.LONG, required = true, description = "the list of IDs of the conditions that are being evaluated on every interval")
@Parameter(name = ApiConstants.CONDITION_IDS, type = CommandType.LIST, collectionType = CommandType.UUID, entityType = ConditionResponse.class,
required = true, description = "the list of IDs of the conditions that are being evaluated on every interval")
private List<Long> conditionIds;
// ///////////////////////////////////////////////////

View File

@ -23,11 +23,13 @@ import org.apache.log4j.Logger;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseAsyncCreateCmd;
import org.apache.cloudstack.api.BaseCmd;
import org.apache.cloudstack.api.IdentityMapper;
import org.apache.cloudstack.api.Implementation;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.AutoScaleVmGroupResponse;
import org.apache.cloudstack.api.response.AutoScalePolicyResponse;
import org.apache.cloudstack.api.response.AutoScaleVmProfileResponse;
import org.apache.cloudstack.api.response.FirewallRuleResponse;
import com.cloud.async.AsyncJob;
import com.cloud.event.EventTypes;
import com.cloud.exception.InvalidParameterValueException;
@ -45,8 +47,8 @@ public class CreateAutoScaleVmGroupCmd extends BaseAsyncCreateCmd {
// ////////////// API parameters /////////////////////
// ///////////////////////////////////////////////////
@IdentityMapper(entityTableName = "firewall_rules")
@Parameter(name = ApiConstants.LBID, type = CommandType.LONG, required = true, description = "the ID of the load balancer rule")
@Parameter(name = ApiConstants.LBID, type = CommandType.UUID, entityType = FirewallRuleResponse.class,
required = true, description = "the ID of the load balancer rule")
private long lbRuleId;
@Parameter(name = ApiConstants.MIN_MEMBERS, type = CommandType.INTEGER, required = true, description = "the minimum number of members in the vmgroup, the number of instances in the vm group will be equal to or more than this number.")
@ -58,16 +60,16 @@ public class CreateAutoScaleVmGroupCmd extends BaseAsyncCreateCmd {
@Parameter(name = ApiConstants.INTERVAL, type = CommandType.INTEGER, description = "the frequency at which the conditions have to be evaluated")
private Integer interval;
@IdentityMapper(entityTableName = "autoscale_policies")
@Parameter(name = ApiConstants.SCALEUP_POLICY_IDS, type = CommandType.LIST, collectionType = CommandType.LONG, required = true, description = "list of scaleup autoscale policies")
@Parameter(name = ApiConstants.SCALEUP_POLICY_IDS, type = CommandType.LIST, collectionType = CommandType.UUID, entityType = AutoScalePolicyResponse.class,
required = true, description = "list of scaleup autoscale policies")
private List<Long> scaleUpPolicyIds;
@IdentityMapper(entityTableName = "autoscale_policies")
@Parameter(name = ApiConstants.SCALEDOWN_POLICY_IDS, type = CommandType.LIST, collectionType = CommandType.LONG, required = true, description = "list of scaledown autoscale policies")
@Parameter(name = ApiConstants.SCALEDOWN_POLICY_IDS, type = CommandType.LIST, collectionType = CommandType.UUID, entityType = AutoScalePolicyResponse.class,
required = true, description = "list of scaledown autoscale policies")
private List<Long> scaleDownPolicyIds;
@IdentityMapper(entityTableName = "autoscale_vmprofiles")
@Parameter(name = ApiConstants.VMPROFILE_ID, type = CommandType.LONG, required = true, description = "the autoscale profile that contains information about the vms in the vm group.")
@Parameter(name = ApiConstants.VMPROFILE_ID, type = CommandType.UUID, entityType = AutoScaleVmProfileResponse.class,
required = true, description = "the autoscale profile that contains information about the vms in the vm group.")
private long profileId;
// ///////////////////////////////////////////////////

View File

@ -24,11 +24,14 @@ import org.apache.log4j.Logger;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseAsyncCreateCmd;
import org.apache.cloudstack.api.BaseCmd;
import org.apache.cloudstack.api.IdentityMapper;
import org.apache.cloudstack.api.Implementation;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.AutoScaleVmProfileResponse;
import org.apache.cloudstack.api.response.DiskOfferingResponse;
import org.apache.cloudstack.api.response.TemplateResponse;
import org.apache.cloudstack.api.response.UserResponse;
import org.apache.cloudstack.api.response.ZoneResponse;
import com.cloud.async.AsyncJob;
import com.cloud.event.EventTypes;
import com.cloud.exception.InvalidParameterValueException;
@ -49,16 +52,16 @@ public class CreateAutoScaleVmProfileCmd extends BaseAsyncCreateCmd {
// ////////////// API parameters /////////////////////
// ///////////////////////////////////////////////////
@IdentityMapper(entityTableName = "data_center")
@Parameter(name = ApiConstants.ZONE_ID, type = CommandType.LONG, required = true, description = "availability zone for the auto deployed virtual machine")
@Parameter(name = ApiConstants.ZONE_ID, type = CommandType.UUID, entityType = ZoneResponse.class,
required = true, description = "availability zone for the auto deployed virtual machine")
private Long zoneId;
@IdentityMapper(entityTableName = "disk_offering")
@Parameter(name = ApiConstants.SERVICE_OFFERING_ID, type = CommandType.LONG, required = true, description = "the service offering of the auto deployed virtual machine")
@Parameter(name = ApiConstants.SERVICE_OFFERING_ID, type = CommandType.UUID, entityType = DiskOfferingResponse.class,
required = true, description = "the service offering of the auto deployed virtual machine")
private Long serviceOfferingId;
@IdentityMapper(entityTableName = "vm_template")
@Parameter(name = ApiConstants.TEMPLATE_ID, type = CommandType.LONG, required = true, description = "the template of the auto deployed virtual machine")
@Parameter(name = ApiConstants.TEMPLATE_ID, type = CommandType.UUID, entityType = TemplateResponse.class,
required = true, description = "the template of the auto deployed virtual machine")
private Long templateId;
@Parameter(name = ApiConstants.OTHER_DEPLOY_PARAMS, type = CommandType.STRING, description = "parameters other than zoneId/serviceOfferringId/templateId of the auto deployed virtual machine")
@ -70,8 +73,8 @@ public class CreateAutoScaleVmProfileCmd extends BaseAsyncCreateCmd {
@Parameter(name = ApiConstants.COUNTERPARAM_LIST, type = CommandType.MAP, description = "counterparam list. Example: counterparam[0].name=snmpcommunity&counterparam[0].value=public&counterparam[1].name=snmpport&counterparam[1].value=161")
private Map counterParamList;
@IdentityMapper(entityTableName = "user")
@Parameter(name = ApiConstants.AUTOSCALE_USER_ID, type = CommandType.LONG, description = "the ID of the user used to launch and destroy the VMs")
@Parameter(name = ApiConstants.AUTOSCALE_USER_ID, type = CommandType.UUID, entityType = UserResponse.class,
description = "the ID of the user used to launch and destroy the VMs")
private Long autoscaleUserId;
private Map<String, String> otherDeployParamMap;

View File

@ -17,12 +17,13 @@
package org.apache.cloudstack.api.command.user.autoscale;
import org.apache.cloudstack.api.response.CounterResponse;
import org.apache.cloudstack.api.response.DomainResponse;
import org.apache.log4j.Logger;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseAsyncCreateCmd;
import org.apache.cloudstack.api.BaseCmd;
import org.apache.cloudstack.api.IdentityMapper;
import org.apache.cloudstack.api.Implementation;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
@ -42,8 +43,8 @@ public class CreateConditionCmd extends BaseAsyncCreateCmd {
// ////////////// API parameters /////////////////////
// ///////////////////////////////////////////////////
@IdentityMapper(entityTableName = "counter")
@Parameter(name = ApiConstants.COUNTER_ID, type = CommandType.LONG, required = true, description = "ID of the Counter.")
@Parameter(name = ApiConstants.COUNTER_ID, type = CommandType.UUID, entityType = CounterResponse.class,
required = true, description = "ID of the Counter.")
private long counterId;
@Parameter(name = ApiConstants.RELATIONAL_OPERATOR, type = CommandType.STRING, required = true, description = "Relational Operator to be used with threshold.")
@ -56,8 +57,8 @@ public class CreateConditionCmd extends BaseAsyncCreateCmd {
"Must be used with the domainId parameter.")
private String accountName;
@IdentityMapper(entityTableName = "domain")
@Parameter(name = ApiConstants.DOMAIN_ID, type = CommandType.LONG, description = "the domain ID of the account.")
@Parameter(name = ApiConstants.DOMAIN_ID, type = CommandType.UUID, entityType = DomainResponse.class,
description = "the domain ID of the account.")
private Long domainId;
// ///////////////////////////////////////////////////

View File

@ -16,12 +16,12 @@
// under the License.
package org.apache.cloudstack.api.command.user.autoscale;
import org.apache.cloudstack.api.response.AutoScalePolicyResponse;
import org.apache.log4j.Logger;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseAsyncCmd;
import org.apache.cloudstack.api.BaseCmd;
import org.apache.cloudstack.api.IdentityMapper;
import org.apache.cloudstack.api.Implementation;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
@ -40,8 +40,8 @@ public class DeleteAutoScalePolicyCmd extends BaseAsyncCmd {
// ////////////// API parameters /////////////////////
// ///////////////////////////////////////////////////
@IdentityMapper(entityTableName = "autoscale_policies")
@Parameter(name = ApiConstants.ID, type = CommandType.LONG, required = true, description = "the ID of the autoscale policy")
@Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = AutoScalePolicyResponse.class,
required = true, description = "the ID of the autoscale policy")
private Long id;
// ///////////////////////////////////////////////////

View File

@ -16,12 +16,12 @@
// under the License.
package org.apache.cloudstack.api.command.user.autoscale;
import org.apache.cloudstack.api.response.AutoScaleVmGroupResponse;
import org.apache.log4j.Logger;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseAsyncCmd;
import org.apache.cloudstack.api.BaseCmd;
import org.apache.cloudstack.api.IdentityMapper;
import org.apache.cloudstack.api.Implementation;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
@ -40,8 +40,8 @@ public class DeleteAutoScaleVmGroupCmd extends BaseAsyncCmd {
// ////////////// API parameters /////////////////////
// ///////////////////////////////////////////////////
@IdentityMapper(entityTableName = "autoscale_vmgroups")
@Parameter(name = ApiConstants.ID, type = CommandType.LONG, required = true, description = "the ID of the autoscale group")
@Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = AutoScaleVmGroupResponse.class,
required = true, description = "the ID of the autoscale group")
private Long id;
// ///////////////////////////////////////////////////

View File

@ -16,12 +16,12 @@
// under the License.
package org.apache.cloudstack.api.command.user.autoscale;
import org.apache.cloudstack.api.response.AutoScaleVmProfileResponse;
import org.apache.log4j.Logger;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseAsyncCmd;
import org.apache.cloudstack.api.BaseCmd;
import org.apache.cloudstack.api.IdentityMapper;
import org.apache.cloudstack.api.Implementation;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
@ -40,8 +40,8 @@ public class DeleteAutoScaleVmProfileCmd extends BaseAsyncCmd {
// ////////////// API parameters /////////////////////
// ///////////////////////////////////////////////////
@IdentityMapper(entityTableName = "autoscale_vmprofiles")
@Parameter(name = ApiConstants.ID, type = CommandType.LONG, required = true, description = "the ID of the autoscale profile")
@Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = AutoScaleVmProfileResponse.class,
required = true, description = "the ID of the autoscale profile")
private Long id;
// ///////////////////////////////////////////////////

View File

@ -17,12 +17,12 @@
package org.apache.cloudstack.api.command.user.autoscale;
import org.apache.cloudstack.api.response.ConditionResponse;
import org.apache.log4j.Logger;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseAsyncCmd;
import org.apache.cloudstack.api.BaseCmd;
import org.apache.cloudstack.api.IdentityMapper;
import org.apache.cloudstack.api.Implementation;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
@ -42,8 +42,8 @@ public class DeleteConditionCmd extends BaseAsyncCmd {
// ////////////// API parameters /////////////////////
// ///////////////////////////////////////////////////
@IdentityMapper(entityTableName = "conditions")
@Parameter(name = ApiConstants.ID, type = CommandType.LONG, required = true, description = "the ID of the condition.")
@Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = ConditionResponse.class,
required= true, description = "the ID of the condition.")
private Long id;
// ///////////////////////////////////////////////////

View File

@ -22,7 +22,6 @@ import org.apache.log4j.Logger;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseAsyncCmd;
import org.apache.cloudstack.api.BaseCmd;
import org.apache.cloudstack.api.IdentityMapper;
import org.apache.cloudstack.api.Implementation;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
@ -41,8 +40,8 @@ public class DisableAutoScaleVmGroupCmd extends BaseAsyncCmd {
// ////////////// API parameters /////////////////////
// ///////////////////////////////////////////////////
@IdentityMapper(entityTableName="autoscale_vmgroups")
@Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="the ID of the autoscale group")
@Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType = AutoScaleVmGroupResponse.class,
required=true, description="the ID of the autoscale group")
private Long id;
// ///////////////////////////////////////////////////

View File

@ -22,7 +22,6 @@ import org.apache.log4j.Logger;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseAsyncCmd;
import org.apache.cloudstack.api.BaseCmd;
import org.apache.cloudstack.api.IdentityMapper;
import org.apache.cloudstack.api.Implementation;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
@ -41,8 +40,8 @@ public class EnableAutoScaleVmGroupCmd extends BaseAsyncCmd {
// ////////////// API parameters /////////////////////
// ///////////////////////////////////////////////////
@IdentityMapper(entityTableName="autoscale_vmgroups")
@Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="the ID of the autoscale group")
@Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType = AutoScaleVmGroupResponse.class,
required=true, description="the ID of the autoscale group")
private Long id;
// ///////////////////////////////////////////////////

View File

@ -19,11 +19,12 @@ package org.apache.cloudstack.api.command.user.autoscale;
import java.util.ArrayList;
import java.util.List;
import org.apache.cloudstack.api.response.AutoScaleVmGroupResponse;
import org.apache.cloudstack.api.response.ConditionResponse;
import org.apache.log4j.Logger;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseListAccountResourcesCmd;
import org.apache.cloudstack.api.IdentityMapper;
import org.apache.cloudstack.api.Implementation;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.response.AutoScalePolicyResponse;
@ -40,19 +41,19 @@ public class ListAutoScalePoliciesCmd extends BaseListAccountResourcesCmd {
// ////////////// API parameters /////////////////////
// ///////////////////////////////////////////////////
@IdentityMapper(entityTableName = "autoscale_policies")
@Parameter(name = ApiConstants.ID, type = CommandType.LONG, description = "the ID of the autoscale policy")
@Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = AutoScalePolicyResponse.class,
description = "the ID of the autoscale policy")
private Long id;
@IdentityMapper(entityTableName = "conditions")
@Parameter(name = ApiConstants.CONDITION_ID, type = CommandType.LONG, description = "the ID of the condition of the policy")
@Parameter(name = ApiConstants.CONDITION_ID, type = CommandType.UUID, entityType = ConditionResponse.class,
description = "the ID of the condition of the policy")
private Long conditionId;
@Parameter(name = ApiConstants.ACTION, type = CommandType.STRING, description = "the action to be executed if all the conditions evaluate to true for the specified duration.")
private String action;
@IdentityMapper(entityTableName="autoscale_vmgroups")
@Parameter(name = ApiConstants.VMGROUP_ID, type = CommandType.LONG, description = "the ID of the autoscale vm group")
@Parameter(name = ApiConstants.VMGROUP_ID, type = CommandType.UUID, entityType = AutoScaleVmGroupResponse.class,
description = "the ID of the autoscale vm group")
private Long vmGroupId;
// ///////////////////////////////////////////////////

View File

@ -23,11 +23,14 @@ import org.apache.log4j.Logger;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseListProjectAndAccountResourcesCmd;
import org.apache.cloudstack.api.IdentityMapper;
import org.apache.cloudstack.api.Implementation;
import org.apache.cloudstack.api.Parameter;
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.FirewallRuleResponse;
import org.apache.cloudstack.api.response.ListResponse;
import org.apache.cloudstack.api.response.ZoneResponse;
import com.cloud.exception.InvalidParameterValueException;
import com.cloud.network.as.AutoScaleVmGroup;
@ -41,24 +44,24 @@ public class ListAutoScaleVmGroupsCmd extends BaseListProjectAndAccountResources
// ////////////// API parameters /////////////////////
// ///////////////////////////////////////////////////
@IdentityMapper(entityTableName="autoscale_vmgroups")
@Parameter(name = ApiConstants.ID, type = CommandType.LONG, description = "the ID of the autoscale vm group")
@Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = AutoScaleVmGroupResponse.class,
description = "the ID of the autoscale vm group")
private Long id;
@IdentityMapper(entityTableName="firewall_rules")
@Parameter(name = ApiConstants.LBID, type = CommandType.LONG, description = "the ID of the loadbalancer")
@Parameter(name = ApiConstants.LBID, type = CommandType.UUID, entityType = FirewallRuleResponse.class,
description = "the ID of the loadbalancer")
private Long loadBalancerId;
@IdentityMapper(entityTableName="autoscale_vmprofiles")
@Parameter(name = ApiConstants.VMPROFILE_ID, type = CommandType.LONG, description = "the ID of the profile")
@Parameter(name = ApiConstants.VMPROFILE_ID, type = CommandType.UUID, entityType = AutoScaleVmProfileResponse.class,
description = "the ID of the profile")
private Long profileId;
@IdentityMapper(entityTableName="autoscale_policies")
@Parameter(name = ApiConstants.POLICY_ID, type = CommandType.LONG, description = "the ID of the policy")
@Parameter(name = ApiConstants.POLICY_ID, type = CommandType.UUID, entityType = AutoScalePolicyResponse.class,
description = "the ID of the policy")
private Long policyId;
@IdentityMapper(entityTableName="data_center")
@Parameter(name = ApiConstants.ZONE_ID, type = CommandType.LONG, description = "the availability zone ID")
@Parameter(name = ApiConstants.ZONE_ID, type = CommandType.UUID, entityType = ZoneResponse.class,
description = "the availability zone ID")
private Long zoneId;
// ///////////////////////////////////////////////////
// ///////////////// Accessors ///////////////////////

View File

@ -19,11 +19,11 @@ package org.apache.cloudstack.api.command.user.autoscale;
import java.util.ArrayList;
import java.util.List;
import org.apache.cloudstack.api.response.TemplateResponse;
import org.apache.log4j.Logger;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseListProjectAndAccountResourcesCmd;
import org.apache.cloudstack.api.IdentityMapper;
import org.apache.cloudstack.api.Implementation;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.response.AutoScaleVmProfileResponse;
@ -40,12 +40,12 @@ public class ListAutoScaleVmProfilesCmd extends BaseListProjectAndAccountResourc
// ////////////// API parameters /////////////////////
// ///////////////////////////////////////////////////
@IdentityMapper(entityTableName="autoscale_vmprofiles")
@Parameter(name = ApiConstants.ID, type = CommandType.LONG, description = "the ID of the autoscale vm profile")
@Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = AutoScaleVmProfileResponse.class,
description = "the ID of the autoscale vm profile")
private Long id;
@IdentityMapper(entityTableName="vm_template")
@Parameter(name=ApiConstants.TEMPLATE_ID, type=CommandType.LONG, description="the templateid of the autoscale vm profile")
@Parameter(name=ApiConstants.TEMPLATE_ID, type=CommandType.UUID, entityType = TemplateResponse.class,
description="the templateid of the autoscale vm profile")
private Long templateId;
@Parameter(name=ApiConstants.OTHER_DEPLOY_PARAMS, type=CommandType.STRING, description="the otherdeployparameters of the autoscale vm profile")

View File

@ -20,11 +20,11 @@ package org.apache.cloudstack.api.command.user.autoscale;
import java.util.ArrayList;
import java.util.List;
import org.apache.cloudstack.api.response.AutoScalePolicyResponse;
import org.apache.log4j.Logger;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseListAccountResourcesCmd;
import org.apache.cloudstack.api.IdentityMapper;
import org.apache.cloudstack.api.Implementation;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.response.ConditionResponse;
@ -41,16 +41,16 @@ public class ListConditionsCmd extends BaseListAccountResourcesCmd {
// ////////////// API parameters /////////////////////
// ///////////////////////////////////////////////////
@IdentityMapper(entityTableName = "conditions")
@Parameter(name = ApiConstants.ID, type = CommandType.LONG, required = false, description = "ID of the Condition.")
@Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = ConditionResponse.class,
required = false, description = "ID of the Condition.")
private Long id;
@IdentityMapper(entityTableName = "counter")
@Parameter(name = ApiConstants.COUNTER_ID, type = CommandType.LONG, required = false, description = "Counter-id of the condition.")
@Parameter(name = ApiConstants.COUNTER_ID, type = CommandType.UUID, entityType = CounterResponse.class,
required = false, description = "Counter-id of the condition.")
private Long counterId;
@IdentityMapper(entityTableName="autoscale_policies")
@Parameter(name = ApiConstants.POLICY_ID, type = CommandType.LONG, description = "the ID of the policy")
@Parameter(name = ApiConstants.POLICY_ID, type = CommandType.UUID, entityType = AutoScalePolicyResponse.class,
description = "the ID of the policy")
private Long policyId;
// ///////////////////////////////////////////////////
// ///////////// API Implementation///////////////////

View File

@ -24,7 +24,6 @@ import org.apache.log4j.Logger;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseListCmd;
import org.apache.cloudstack.api.IdentityMapper;
import org.apache.cloudstack.api.Implementation;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.response.CounterResponse;
@ -41,8 +40,8 @@ public class ListCountersCmd extends BaseListCmd {
// ////////////// API parameters /////////////////////
// ///////////////////////////////////////////////////
@IdentityMapper(entityTableName = "counter")
@Parameter(name = ApiConstants.ID, type = CommandType.LONG, description = "ID of the Counter.")
@Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = CounterResponse.class,
description = "ID of the Counter.")
private Long id;
@Parameter(name = ApiConstants.NAME, type = CommandType.STRING, description = "Name of the counter.")

View File

@ -19,12 +19,12 @@ package org.apache.cloudstack.api.command.user.autoscale;
import java.util.List;
import org.apache.cloudstack.api.response.ConditionResponse;
import org.apache.log4j.Logger;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseAsyncCmd;
import org.apache.cloudstack.api.BaseCmd;
import org.apache.cloudstack.api.IdentityMapper;
import org.apache.cloudstack.api.Implementation;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
@ -51,12 +51,12 @@ public class UpdateAutoScalePolicyCmd extends BaseAsyncCmd {
@Parameter(name = ApiConstants.QUIETTIME, type = CommandType.INTEGER, description = "the cool down period for which the policy should not be evaluated after the action has been taken")
private Integer quietTime;
@IdentityMapper(entityTableName = "conditions")
@Parameter(name = ApiConstants.CONDITION_IDS, type = CommandType.LIST, collectionType = CommandType.LONG, description = "the list of IDs of the conditions that are being evaluated on every interval")
@Parameter(name = ApiConstants.CONDITION_IDS, type = CommandType.LIST, collectionType = CommandType.UUID, entityType = ConditionResponse.class,
description = "the list of IDs of the conditions that are being evaluated on every interval")
private List<Long> conditionIds;
@IdentityMapper(entityTableName = "autoscale_policies")
@Parameter(name = ApiConstants.ID, type = CommandType.LONG, required = true, description = "the ID of the autoscale policy")
@Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = AutoScalePolicyResponse.class,
required = true, description = "the ID of the autoscale policy")
private Long id;
@Override

View File

@ -19,12 +19,12 @@ package org.apache.cloudstack.api.command.user.autoscale;
import java.util.List;
import org.apache.cloudstack.api.response.AutoScalePolicyResponse;
import org.apache.log4j.Logger;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseAsyncCmd;
import org.apache.cloudstack.api.BaseCmd;
import org.apache.cloudstack.api.IdentityMapper;
import org.apache.cloudstack.api.Implementation;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
@ -54,16 +54,16 @@ public class UpdateAutoScaleVmGroupCmd extends BaseAsyncCmd {
@Parameter(name=ApiConstants.INTERVAL, type=CommandType.INTEGER, description="the frequency at which the conditions have to be evaluated")
private Integer interval;
@IdentityMapper(entityTableName = "autoscale_policies")
@Parameter(name = ApiConstants.SCALEUP_POLICY_IDS, type = CommandType.LIST, collectionType = CommandType.LONG, description = "list of scaleup autoscale policies")
@Parameter(name = ApiConstants.SCALEUP_POLICY_IDS, type = CommandType.LIST, collectionType = CommandType.UUID, entityType = AutoScalePolicyResponse.class,
description = "list of scaleup autoscale policies")
private List<Long> scaleUpPolicyIds;
@IdentityMapper(entityTableName = "autoscale_policies")
@Parameter(name = ApiConstants.SCALEDOWN_POLICY_IDS, type = CommandType.LIST, collectionType = CommandType.LONG, description = "list of scaledown autoscale policies")
@Parameter(name = ApiConstants.SCALEDOWN_POLICY_IDS, type = CommandType.LIST, collectionType = CommandType.UUID, entityType = AutoScalePolicyResponse.class,
description = "list of scaledown autoscale policies")
private List<Long> scaleDownPolicyIds;
@IdentityMapper(entityTableName = "autoscale_vmgroups")
@Parameter(name = ApiConstants.ID, type = CommandType.LONG, required = true, description = "the ID of the autoscale group")
@Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = AutoScaleVmGroupResponse.class,
required = true, description = "the ID of the autoscale group")
private Long id;
// ///////////////////////////////////////////////////

View File

@ -19,12 +19,13 @@ package org.apache.cloudstack.api.command.user.autoscale;
import java.util.Map;
import org.apache.cloudstack.api.response.TemplateResponse;
import org.apache.cloudstack.api.response.UserResponse;
import org.apache.log4j.Logger;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseAsyncCmd;
import org.apache.cloudstack.api.BaseCmd;
import org.apache.cloudstack.api.IdentityMapper;
import org.apache.cloudstack.api.Implementation;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
@ -45,12 +46,12 @@ public class UpdateAutoScaleVmProfileCmd extends BaseAsyncCmd {
// ////////////// API parameters /////////////////////
// ///////////////////////////////////////////////////
@IdentityMapper(entityTableName = "autoscale_vmprofiles")
@Parameter(name = ApiConstants.ID, type = CommandType.LONG, required = true, description = "the ID of the autoscale vm profile")
@Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = AutoScaleVmProfileResponse.class,
required = true, description = "the ID of the autoscale vm profile")
private Long id;
@IdentityMapper(entityTableName = "vm_template")
@Parameter(name = ApiConstants.TEMPLATE_ID, type = CommandType.LONG, description = "the template of the auto deployed virtual machine")
@Parameter(name = ApiConstants.TEMPLATE_ID, type = CommandType.UUID, entityType = TemplateResponse.class,
description = "the template of the auto deployed virtual machine")
private Long templateId;
@Parameter(name = ApiConstants.AUTOSCALE_VM_DESTROY_TIME, type = CommandType.INTEGER, description = "the time allowed for existing connections to get closed before a vm is destroyed")
@ -59,8 +60,8 @@ public class UpdateAutoScaleVmProfileCmd extends BaseAsyncCmd {
@Parameter(name = ApiConstants.COUNTERPARAM_LIST, type = CommandType.MAP, description = "counterparam list. Example: counterparam[0].name=snmpcommunity&counterparam[0].value=public&counterparam[1].name=snmpport&counterparam[1].value=161")
private Map counterParamList;
@IdentityMapper(entityTableName = "user")
@Parameter(name = ApiConstants.AUTOSCALE_USER_ID, type = CommandType.LONG, description = "the ID of the user used to launch and destroy the VMs")
@Parameter(name = ApiConstants.AUTOSCALE_USER_ID, type = CommandType.UUID, entityType = UserResponse.class,
description = "the ID of the user used to launch and destroy the VMs")
private Long autoscaleUserId;
// ///////////////////////////////////////////////////

View File

@ -16,13 +16,16 @@
// under the License.
package org.apache.cloudstack.api.response;
import com.cloud.network.as.AutoScalePolicy;
import org.apache.cloudstack.api.ApiConstants;
import com.cloud.serializer.Param;
import com.google.gson.annotations.SerializedName;
import org.apache.cloudstack.api.BaseResponse;
import org.apache.cloudstack.api.Entity;
import java.util.List;
@Entity(value=AutoScalePolicy.class)
public class AutoScalePolicyResponse extends BaseResponse implements ControlledEntityResponse {
@SerializedName(ApiConstants.ID)

View File

@ -16,14 +16,17 @@
// under the License.
package org.apache.cloudstack.api.response;
import com.cloud.network.as.AutoScaleVmGroup;
import org.apache.cloudstack.api.ApiConstants;
import com.cloud.utils.IdentityProxy;
import com.cloud.serializer.Param;
import com.google.gson.annotations.SerializedName;
import org.apache.cloudstack.api.BaseResponse;
import org.apache.cloudstack.api.Entity;
import java.util.List;
@Entity(value=AutoScaleVmGroup.class)
public class AutoScaleVmGroupResponse extends BaseResponse implements ControlledEntityResponse {
@SerializedName(ApiConstants.ID)

View File

@ -20,14 +20,17 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.cloud.network.as.AutoScaleVmProfile;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseCmd.CommandType;
import org.apache.cloudstack.api.BaseResponse;
import org.apache.cloudstack.api.Entity;
import org.apache.cloudstack.api.Parameter;
import com.cloud.serializer.Param;
import com.cloud.utils.Pair;
import com.google.gson.annotations.SerializedName;
@Entity(value=AutoScaleVmProfile.class)
public class AutoScaleVmProfileResponse extends BaseResponse implements ControlledEntityResponse {
@SerializedName(ApiConstants.ID)

View File

@ -19,11 +19,14 @@ package org.apache.cloudstack.api.response;
import java.util.List;
import com.cloud.network.as.Condition;
import org.apache.cloudstack.api.ApiConstants;
import com.cloud.serializer.Param;
import com.google.gson.annotations.SerializedName;
import org.apache.cloudstack.api.BaseResponse;
import org.apache.cloudstack.api.Entity;
@Entity(value=Condition.class)
@SuppressWarnings("unused")
public class ConditionResponse extends BaseResponse implements ControlledEntityResponse {
@SerializedName("id")

View File

@ -18,11 +18,14 @@ package org.apache.cloudstack.api.response;
import java.util.List;
import com.cloud.network.rules.FirewallRule;
import org.apache.cloudstack.api.ApiConstants;
import com.cloud.serializer.Param;
import com.google.gson.annotations.SerializedName;
import org.apache.cloudstack.api.BaseResponse;
import org.apache.cloudstack.api.Entity;
@Entity(value=FirewallRule.class)
@SuppressWarnings("unused")
public class FirewallRuleResponse extends BaseResponse {
@SerializedName(ApiConstants.ID) @Param(description="the ID of the port forwarding rule")