You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ni...@apache.org on 2013/02/28 12:24:57 UTC

git commit: refs/heads/master - CLOUDSTACK-658 - Adding Scalevm commands

Updated Branches:
  refs/heads/master 80a6aaf7e -> 2081aa310


CLOUDSTACK-658 - Adding Scalevm commands


Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/2081aa31
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/2081aa31
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/2081aa31

Branch: refs/heads/master
Commit: 2081aa3100f6a664d65a2cc425dc014c555f3a6c
Parents: 80a6aaf
Author: Nitin Mehta <ni...@citrix.com>
Authored: Thu Feb 28 16:54:39 2013 +0530
Committer: Nitin Mehta <ni...@citrix.com>
Committed: Thu Feb 28 16:54:39 2013 +0530

----------------------------------------------------------------------
 api/src/com/cloud/agent/api/ScaleVmAnswer.java  |   12 ++
 api/src/com/cloud/agent/api/ScaleVmCommand.java |   97 ++++++++++++++++++
 2 files changed, 109 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/2081aa31/api/src/com/cloud/agent/api/ScaleVmAnswer.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/agent/api/ScaleVmAnswer.java b/api/src/com/cloud/agent/api/ScaleVmAnswer.java
new file mode 100644
index 0000000..9481e0b
--- /dev/null
+++ b/api/src/com/cloud/agent/api/ScaleVmAnswer.java
@@ -0,0 +1,12 @@
+package com.cloud.agent.api;
+
+public class ScaleVmAnswer extends Answer {
+
+    protected ScaleVmAnswer() {
+    }
+    
+    public ScaleVmAnswer(ScaleVmCommand cmd, boolean result, String detail) {
+        super(cmd, result, detail);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/2081aa31/api/src/com/cloud/agent/api/ScaleVmCommand.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/agent/api/ScaleVmCommand.java b/api/src/com/cloud/agent/api/ScaleVmCommand.java
new file mode 100644
index 0000000..41db206
--- /dev/null
+++ b/api/src/com/cloud/agent/api/ScaleVmCommand.java
@@ -0,0 +1,97 @@
+package com.cloud.agent.api;
+
+import com.cloud.agent.api.to.VirtualMachineTO;
+
+public class ScaleVmCommand extends Command {
+
+    VirtualMachineTO vm;
+    String vmName;
+    int cpus;
+    Integer speed;
+    long minRam;
+    long maxRam;
+    
+    public VirtualMachineTO getVm() {
+		return vm;
+	}
+
+	public void setVm(VirtualMachineTO vm) {
+		this.vm = vm;
+	}
+
+	public int getCpus() {
+		return cpus;
+	}
+
+	public ScaleVmCommand(String vmName, int cpus,
+			Integer speed, long minRam, long maxRam) {
+		super();
+		this.vmName = vmName;
+		this.cpus = cpus;
+		//this.speed = speed;
+		this.minRam = minRam;
+		this.maxRam = maxRam;
+		this.vm = new VirtualMachineTO(1L, vmName, null, cpus, null, minRam, maxRam, null, null, false, false, null);
+		/*vm.setName(vmName);
+		vm.setCpus(cpus);
+		vm.setRam(minRam, maxRam);*/
+	}
+
+	public void setCpus(int cpus) {
+		this.cpus = cpus;
+	}
+
+	public Integer getSpeed() {
+		return speed;
+	}
+
+	public void setSpeed(Integer speed) {
+		this.speed = speed;
+	}
+
+	public long getMinRam() {
+		return minRam;
+	}
+
+	public void setMinRam(long minRam) {
+		this.minRam = minRam;
+	}
+
+	public long getMaxRam() {
+		return maxRam;
+	}
+
+	public void setMaxRam(long maxRam) {
+		this.maxRam = maxRam;
+	}
+
+	public String getVmName() {
+		return vmName;
+	}
+
+	public void setVmName(String vmName) {
+		this.vmName = vmName;
+	}
+
+	public VirtualMachineTO getVirtualMachine() {
+        return vm;
+    }
+    
+    @Override
+    public boolean executeInSequence() {
+        return true;
+    }
+    
+    protected ScaleVmCommand() {
+    }
+    
+    public ScaleVmCommand(VirtualMachineTO vm) {
+        this.vm = vm;
+    }
+
+	public boolean getLimitCpuUse() {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+}