Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions api/src/main/java/com/cloud/network/as/AutoScaleService.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import org.apache.cloudstack.api.command.user.autoscale.CreateAutoScalePolicyCmd;
import org.apache.cloudstack.api.command.user.autoscale.CreateAutoScaleVmGroupCmd;
import org.apache.cloudstack.api.command.user.autoscale.CreateAutoScaleVmProfileCmd;
import org.apache.cloudstack.api.command.user.autoscale.CreateConditionCmd;
import org.apache.cloudstack.api.command.user.autoscale.CreateConditionForVmAutoScalingCmd;
import org.apache.cloudstack.api.command.user.autoscale.ListAutoScalePoliciesCmd;
import org.apache.cloudstack.api.command.user.autoscale.ListAutoScaleVmGroupsCmd;
import org.apache.cloudstack.api.command.user.autoscale.ListAutoScaleVmProfilesCmd;
Expand Down Expand Up @@ -74,7 +74,7 @@ public interface AutoScaleService {

List<? extends Counter> listCounters(ListCountersCmd cmd);

Condition createCondition(CreateConditionCmd cmd);
Condition createCondition(CreateConditionForVmAutoScalingCmd cmd);

List<? extends Condition> listConditions(ListConditionsCmd cmd);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

@APICommand(name = "createCondition", description = "Creates a condition for VM auto scaling", responseObject = ConditionResponse.class, entityType = {Condition.class},
requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
public class CreateConditionCmd extends BaseAsyncCreateCmd {
public class CreateConditionForVmAutoScalingCmd extends BaseAsyncCreateCmd {
private static final String s_name = "conditionresponse";

// ///////////////////////////////////////////////////
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
import org.apache.cloudstack.api.command.user.autoscale.CreateAutoScalePolicyCmd;
import org.apache.cloudstack.api.command.user.autoscale.CreateAutoScaleVmGroupCmd;
import org.apache.cloudstack.api.command.user.autoscale.CreateAutoScaleVmProfileCmd;
import org.apache.cloudstack.api.command.user.autoscale.CreateConditionCmd;
import org.apache.cloudstack.api.command.user.autoscale.CreateConditionForVmAutoScalingCmd;
import org.apache.cloudstack.api.command.user.autoscale.ListAutoScalePoliciesCmd;
import org.apache.cloudstack.api.command.user.autoscale.ListAutoScaleVmGroupsCmd;
import org.apache.cloudstack.api.command.user.autoscale.ListAutoScaleVmProfilesCmd;
Expand Down Expand Up @@ -1482,7 +1482,7 @@ public Counter createCounter(CreateCounterCmd cmd) {

@Override
@ActionEvent(eventType = EventTypes.EVENT_CONDITION_CREATE, eventDescription = "Condition", create = true)
public Condition createCondition(CreateConditionCmd cmd) {
public Condition createCondition(CreateConditionForVmAutoScalingCmd cmd) {
Account caller = CallContext.current().getCallingAccount();
Account owner = accountMgr.finalizeOwner(caller, cmd.getAccountName(), cmd.getDomainId(), cmd.getProjectId());
accountMgr.checkAccess(caller, null, true, owner);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@
import org.apache.cloudstack.api.command.user.autoscale.CreateAutoScalePolicyCmd;
import org.apache.cloudstack.api.command.user.autoscale.CreateAutoScaleVmGroupCmd;
import org.apache.cloudstack.api.command.user.autoscale.CreateAutoScaleVmProfileCmd;
import org.apache.cloudstack.api.command.user.autoscale.CreateConditionCmd;
import org.apache.cloudstack.api.command.user.autoscale.CreateConditionForVmAutoScalingCmd;
import org.apache.cloudstack.api.command.user.autoscale.DeleteAutoScalePolicyCmd;
import org.apache.cloudstack.api.command.user.autoscale.DeleteAutoScaleVmGroupCmd;
import org.apache.cloudstack.api.command.user.autoscale.DeleteAutoScaleVmProfileCmd;
Expand Down Expand Up @@ -3885,7 +3885,7 @@ public List<Class<?>> getCommands() {
cmdList.add(CreateAutoScalePolicyCmd.class);
cmdList.add(CreateAutoScaleVmGroupCmd.class);
cmdList.add(CreateAutoScaleVmProfileCmd.class);
cmdList.add(CreateConditionCmd.class);
cmdList.add(CreateConditionForVmAutoScalingCmd.class);
cmdList.add(DeleteAutoScalePolicyCmd.class);
cmdList.add(DeleteAutoScaleVmGroupCmd.class);
cmdList.add(DeleteAutoScaleVmProfileCmd.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
import org.apache.cloudstack.api.command.user.autoscale.CreateAutoScalePolicyCmd;
import org.apache.cloudstack.api.command.user.autoscale.CreateAutoScaleVmGroupCmd;
import org.apache.cloudstack.api.command.user.autoscale.CreateAutoScaleVmProfileCmd;
import org.apache.cloudstack.api.command.user.autoscale.CreateConditionCmd;
import org.apache.cloudstack.api.command.user.autoscale.CreateConditionForVmAutoScalingCmd;
import org.apache.cloudstack.api.command.user.autoscale.ListCountersCmd;
import org.apache.cloudstack.api.command.user.autoscale.UpdateAutoScaleVmGroupCmd;
import org.apache.cloudstack.api.command.user.autoscale.UpdateAutoScaleVmProfileCmd;
Expand Down Expand Up @@ -514,8 +514,8 @@ public void testDeleteCounterWithUsedCounter() throws ResourceInUseException {
}

@Test
public void testCreateConditionCmd() throws IllegalArgumentException {
CreateConditionCmd cmd = new CreateConditionCmd();
public void testCreateConditionForVmAutoScalingCmd() throws IllegalArgumentException {
CreateConditionForVmAutoScalingCmd cmd = new CreateConditionForVmAutoScalingCmd();

ReflectionTestUtils.setField(cmd, "counterId", counterId);
ReflectionTestUtils.setField(cmd, "relationalOperator", String.valueOf(relationalOperator));
Expand All @@ -528,8 +528,8 @@ public void testCreateConditionCmd() throws IllegalArgumentException {
}

@Test(expected = InvalidParameterValueException.class)
public void testCreateConditionCmdWithInvalidOperator() throws IllegalArgumentException {
CreateConditionCmd cmd = new CreateConditionCmd();
public void testCreateConditionForVmAutoScalingCmdWithInvalidOperator() throws IllegalArgumentException {
CreateConditionForVmAutoScalingCmd cmd = new CreateConditionForVmAutoScalingCmd();

ReflectionTestUtils.setField(cmd, "counterId", counterId);
ReflectionTestUtils.setField(cmd, "relationalOperator", INVALID);
Expand All @@ -541,8 +541,8 @@ public void testCreateConditionCmdWithInvalidOperator() throws IllegalArgumentEx
}

@Test(expected = InvalidParameterValueException.class)
public void testCreateConditionCmdWithInvalidThreshold() throws IllegalArgumentException {
CreateConditionCmd cmd = new CreateConditionCmd();
public void testCreateConditionForVmAutoScalingCmdWithInvalidThreshold() throws IllegalArgumentException {
CreateConditionForVmAutoScalingCmd cmd = new CreateConditionForVmAutoScalingCmd();

ReflectionTestUtils.setField(cmd, "counterId", counterId);
ReflectionTestUtils.setField(cmd, "relationalOperator", String.valueOf(relationalOperator));
Expand Down
Loading