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/05/11 11:59:54 UTC
[29/51] [partial] merge master
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/core/src/com/cloud/agent/api/StartupProxyCommand.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/agent/api/StartupProxyCommand.java b/core/src/com/cloud/agent/api/StartupProxyCommand.java
new file mode 100644
index 0000000..25cd769
--- /dev/null
+++ b/core/src/com/cloud/agent/api/StartupProxyCommand.java
@@ -0,0 +1,49 @@
+// 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.agent.api;
+
+import com.cloud.host.Host;
+
+public class StartupProxyCommand extends StartupCommand {
+ private int proxyPort;
+ private long proxyVmId;
+
+ public StartupProxyCommand() {
+ super(Host.Type.ConsoleProxy);
+ setIqn("NoIqn");
+ }
+
+ @Override
+ public boolean executeInSequence() {
+ return true;
+ }
+
+ public int getProxyPort() {
+ return proxyPort;
+ }
+
+ public void setProxyPort(int proxyPort) {
+ this.proxyPort = proxyPort;
+ }
+
+ public long getProxyVmId() {
+ return proxyVmId;
+ }
+ public void setProxyVmId(long proxyVmId) {
+ this.proxyVmId = proxyVmId;
+ }
+}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/core/src/com/cloud/agent/api/StartupPxeServerCommand.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/agent/api/StartupPxeServerCommand.java b/core/src/com/cloud/agent/api/StartupPxeServerCommand.java
new file mode 100644
index 0000000..dff5c53
--- /dev/null
+++ b/core/src/com/cloud/agent/api/StartupPxeServerCommand.java
@@ -0,0 +1,25 @@
+// 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.agent.api;
+
+import com.cloud.host.Host;
+
+public class StartupPxeServerCommand extends StartupCommand {
+ public StartupPxeServerCommand() {
+ super(Host.Type.PxeServer);
+ }
+}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/core/src/com/cloud/agent/api/StartupRoutingCommand.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/agent/api/StartupRoutingCommand.java b/core/src/com/cloud/agent/api/StartupRoutingCommand.java
new file mode 100755
index 0000000..5961ab0
--- /dev/null
+++ b/core/src/com/cloud/agent/api/StartupRoutingCommand.java
@@ -0,0 +1,224 @@
+// 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.agent.api;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import com.cloud.host.Host;
+import com.cloud.hypervisor.Hypervisor.HypervisorType;
+import com.cloud.network.Networks.RouterPrivateIpStrategy;
+import com.cloud.utils.Pair;
+import com.cloud.vm.VirtualMachine.State;
+
+public class StartupRoutingCommand extends StartupCommand {
+ public static class VmState {
+ State state;
+ String host;
+ public VmState() {
+ }
+ public VmState(State state, String host) {
+ this.state = state;
+ this.host = host;
+ }
+ public State getState() {
+ return state;
+ }
+ public String getHost() {
+ return host;
+ }
+ }
+ int cpus;
+ long speed;
+ long memory;
+ long dom0MinMemory;
+ boolean poolSync;
+ Map<String, VmState> vms;
+ HashMap<String, Pair<String, State>> _clusterVMStates;
+ String caps;
+ String pool;
+ HypervisorType hypervisorType;
+ Map<String, String> hostDetails; //stuff like host os, cpu capabilities
+ String hypervisorVersion;
+
+ public StartupRoutingCommand() {
+ super(Host.Type.Routing);
+ hostDetails = new HashMap<String, String>();
+ getHostDetails().put(RouterPrivateIpStrategy.class.getCanonicalName(), RouterPrivateIpStrategy.DcGlobal.toString());
+
+ }
+
+ public StartupRoutingCommand(int cpus,
+ long speed,
+ long memory,
+ long dom0MinMemory,
+ String caps,
+ HypervisorType hypervisorType,
+ RouterPrivateIpStrategy privIpStrategy,
+ Map<String, VmState> vms) {
+ this(cpus, speed, memory, dom0MinMemory, caps, hypervisorType, vms);
+ getHostDetails().put(RouterPrivateIpStrategy.class.getCanonicalName(), privIpStrategy.toString());
+ }
+
+ public StartupRoutingCommand(int cpus,
+ long speed,
+ long memory,
+ long dom0MinMemory,
+ String caps,
+ HypervisorType hypervisorType,
+ RouterPrivateIpStrategy privIpStrategy) {
+this(cpus, speed, memory, dom0MinMemory, caps, hypervisorType, new HashMap<String,String>(), new HashMap<String, VmState>());
+getHostDetails().put(RouterPrivateIpStrategy.class.getCanonicalName(), privIpStrategy.toString());
+}
+
+ public StartupRoutingCommand(int cpus,
+ long speed,
+ long memory,
+ long dom0MinMemory,
+ final String caps,
+ final HypervisorType hypervisorType,
+ final Map<String, String> hostDetails,
+ Map<String, VmState> vms) {
+ super(Host.Type.Routing);
+ this.cpus = cpus;
+ this.speed = speed;
+ this.memory = memory;
+ this.dom0MinMemory = dom0MinMemory;
+ this.vms = vms;
+ this.hypervisorType = hypervisorType;
+ this.hostDetails = hostDetails;
+ this.caps = caps;
+ this.poolSync = false;
+ }
+
+ public StartupRoutingCommand(int cpus2, long speed2, long memory2,
+ long dom0MinMemory2, String caps2, HypervisorType hypervisorType2,
+ Map<String, VmState> vms2) {
+ this(cpus2, speed2, memory2, dom0MinMemory2, caps2, hypervisorType2, new HashMap<String,String>(), vms2);
+ }
+
+ public StartupRoutingCommand(int cpus, long speed, long memory, long dom0MinMemory, final String caps, final HypervisorType hypervisorType, final Map<String, String> hostDetails, Map<String, VmState> vms, String hypervisorVersion) {
+ this(cpus, speed, memory, dom0MinMemory, caps, hypervisorType, hostDetails, vms);
+ this.hypervisorVersion = hypervisorVersion;
+ }
+
+ public void setChanges(Map<String, VmState> vms) {
+ this.vms = vms;
+ }
+
+ public void setStateChanges(Map<String, State> vms) {
+ for( String vm_name : vms.keySet() ) {
+ if( this.vms == null ) {
+ this.vms = new HashMap<String, VmState>();
+ }
+ this.vms.put(vm_name, new VmState(vms.get(vm_name), null));
+ }
+ }
+
+ public void setClusterVMStateChanges(HashMap<String, Pair<String, State>> allStates){
+ _clusterVMStates = allStates;
+ }
+
+ public int getCpus() {
+ return cpus;
+ }
+
+ public String getCapabilities() {
+ return caps;
+ }
+
+ public long getSpeed() {
+ return speed;
+ }
+
+ public long getMemory() {
+ return memory;
+ }
+
+ public long getDom0MinMemory() {
+ return dom0MinMemory;
+ }
+
+ public Map<String, VmState> getVmStates() {
+ return vms;
+ }
+
+ public HashMap<String, Pair<String, State>> getClusterVMStateChanges() {
+ return _clusterVMStates;
+ }
+
+ public void setSpeed(long speed) {
+ this.speed = speed;
+ }
+
+ public void setCpus(int cpus) {
+ this.cpus = cpus;
+ }
+
+ public void setMemory(long memory) {
+ this.memory = memory;
+ }
+
+ public void setDom0MinMemory(long dom0MinMemory) {
+ this.dom0MinMemory = dom0MinMemory;
+ }
+
+ public void setCaps(String caps) {
+ this.caps = caps;
+ }
+
+ public String getPool() {
+ return pool;
+ }
+
+ public void setPool(String pool) {
+ this.pool = pool;
+ }
+
+ public boolean isPoolSync() {
+ return poolSync;
+ }
+
+ public void setPoolSync(boolean poolSync) {
+ this.poolSync = poolSync;
+ }
+
+ public HypervisorType getHypervisorType() {
+ return hypervisorType;
+ }
+
+ public void setHypervisorType(HypervisorType hypervisorType) {
+ this.hypervisorType = hypervisorType;
+ }
+
+ public Map<String, String> getHostDetails() {
+ return hostDetails;
+ }
+
+ public void setHostDetails(Map<String, String> hostDetails) {
+ this.hostDetails = hostDetails;
+ }
+
+ public String getHypervisorVersion() {
+ return hypervisorVersion;
+ }
+
+ public void setHypervisorVersion(String hypervisorVersion) {
+ this.hypervisorVersion = hypervisorVersion;
+ }
+}
+
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/core/src/com/cloud/agent/api/StartupSecondaryStorageCommand.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/agent/api/StartupSecondaryStorageCommand.java b/core/src/com/cloud/agent/api/StartupSecondaryStorageCommand.java
new file mode 100644
index 0000000..c19ea99
--- /dev/null
+++ b/core/src/com/cloud/agent/api/StartupSecondaryStorageCommand.java
@@ -0,0 +1,32 @@
+// 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.agent.api;
+
+import com.cloud.host.Host;
+
+public class StartupSecondaryStorageCommand extends StartupCommand {
+
+ public StartupSecondaryStorageCommand() {
+ super(Host.Type.SecondaryStorage);
+ setIqn("NoIqn");
+ }
+
+ @Override
+ public boolean executeInSequence() {
+ return true;
+ }
+}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/core/src/com/cloud/agent/api/StartupStorageCommand.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/agent/api/StartupStorageCommand.java b/core/src/com/cloud/agent/api/StartupStorageCommand.java
new file mode 100755
index 0000000..3c3b058
--- /dev/null
+++ b/core/src/com/cloud/agent/api/StartupStorageCommand.java
@@ -0,0 +1,110 @@
+// 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.agent.api;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import com.cloud.host.Host;
+import com.cloud.storage.Storage;
+import com.cloud.storage.Storage.StoragePoolType;
+import com.cloud.storage.template.TemplateInfo;
+
+
+public class StartupStorageCommand extends StartupCommand {
+
+ String parent;
+ Map<String, TemplateInfo> templateInfo;
+ long totalSize;
+ StoragePoolInfo poolInfo;
+ Storage.StorageResourceType resourceType;
+ StoragePoolType fsType;
+ Map<String, String> hostDetails = new HashMap<String, String>();
+ String nfsShare;
+
+ public StartupStorageCommand() {
+ super(Host.Type.Storage);
+ }
+
+ public StartupStorageCommand(String parent, StoragePoolType fsType, long totalSize, Map<String, TemplateInfo> info) {
+ super(Host.Type.Storage);
+ this.parent = parent;
+ this.totalSize = totalSize;
+ this.templateInfo = info;
+ this.poolInfo = null;
+ this.fsType = fsType;
+ }
+
+
+ public StartupStorageCommand(String parent, StoragePoolType fsType, Map<String, TemplateInfo> templateInfo, StoragePoolInfo poolInfo) {
+ super(Host.Type.Storage);
+ this.parent = parent;
+ this.templateInfo = templateInfo;
+ this.totalSize = poolInfo.capacityBytes;
+ this.poolInfo = poolInfo;
+ this.fsType = fsType;
+ }
+
+ public String getParent() {
+ return parent;
+ }
+
+ public void setParent(String parent) {
+ this.parent = parent;
+ }
+
+ public void setNfsShare(String nfsShare) {
+ this.nfsShare = nfsShare;
+ }
+
+ public String getNfsShare() {
+ return nfsShare;
+ }
+
+ public long getTotalSize() {
+ return totalSize;
+ }
+
+ public Map<String, TemplateInfo> getTemplateInfo() {
+ return templateInfo;
+ }
+
+ public void setTemplateInfo(Map<String, TemplateInfo> templateInfo) {
+ this.templateInfo = templateInfo;
+ }
+
+ public StoragePoolInfo getPoolInfo() {
+ return poolInfo;
+ }
+
+ public void setPoolInfo(StoragePoolInfo poolInfo) {
+ this.poolInfo = poolInfo;
+ }
+
+ public Storage.StorageResourceType getResourceType() {
+ return resourceType;
+ }
+
+ public void setResourceType(Storage.StorageResourceType resourceType) {
+ this.resourceType = resourceType;
+ }
+
+ /*For secondary storage*/
+ public Map<String, String> getHostDetails() {
+ return hostDetails;
+ }
+}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/core/src/com/cloud/agent/api/StartupTrafficMonitorCommand.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/agent/api/StartupTrafficMonitorCommand.java b/core/src/com/cloud/agent/api/StartupTrafficMonitorCommand.java
new file mode 100644
index 0000000..bb8f3d7
--- /dev/null
+++ b/core/src/com/cloud/agent/api/StartupTrafficMonitorCommand.java
@@ -0,0 +1,26 @@
+// 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.agent.api;
+
+import com.cloud.host.Host;
+
+public class StartupTrafficMonitorCommand extends StartupCommand {
+ public StartupTrafficMonitorCommand() {
+ super(Host.Type.TrafficMonitor);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/core/src/com/cloud/agent/api/StopAnswer.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/agent/api/StopAnswer.java b/core/src/com/cloud/agent/api/StopAnswer.java
new file mode 100755
index 0000000..1111fed
--- /dev/null
+++ b/core/src/com/cloud/agent/api/StopAnswer.java
@@ -0,0 +1,45 @@
+// 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.agent.api;
+
+public class StopAnswer extends RebootAnswer {
+ Integer vncPort;
+
+ protected StopAnswer() {
+ }
+
+ public StopAnswer(StopCommand cmd, String details, Integer vncPort, boolean success) {
+ super(cmd, details, success);
+ this.vncPort = vncPort;
+ }
+
+ public StopAnswer(StopCommand cmd, String details, boolean success) {
+ super(cmd, details, success);
+ vncPort = null;
+
+ }
+
+ public StopAnswer(StopCommand cmd, Exception e) {
+ super(cmd, e);
+ }
+
+ @Override
+ public Integer getVncPort() {
+ return vncPort;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/core/src/com/cloud/agent/api/StopCommand.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/agent/api/StopCommand.java b/core/src/com/cloud/agent/api/StopCommand.java
new file mode 100755
index 0000000..1c67f38
--- /dev/null
+++ b/core/src/com/cloud/agent/api/StopCommand.java
@@ -0,0 +1,71 @@
+// 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.agent.api;
+
+import com.cloud.vm.VirtualMachine;
+
+public class StopCommand extends RebootCommand {
+ String vnet;
+ private boolean isProxy=false;
+ private String urlPort=null;
+ private String publicConsoleProxyIpAddress=null;
+
+ protected StopCommand() {
+ }
+
+ public StopCommand(VirtualMachine vm, boolean isProxy, String urlPort, String publicConsoleProxyIpAddress) {
+ super(vm);
+ this.isProxy = isProxy;
+ this.urlPort = urlPort;
+ this.publicConsoleProxyIpAddress = publicConsoleProxyIpAddress;
+ }
+
+ public StopCommand(VirtualMachine vm, String vnet) {
+ super(vm);
+ this.vnet = vnet;
+ }
+
+ public StopCommand(VirtualMachine vm) {
+ super(vm);
+ }
+
+ public StopCommand(String vmName) {
+ super(vmName);
+ }
+
+ public String getVnet() {
+ return vnet;
+ }
+
+ @Override
+ public boolean executeInSequence() {
+ return true;
+ }
+
+ public boolean isProxy() {
+ return this.isProxy;
+ }
+
+ public String getURLPort() {
+ return this.urlPort;
+ }
+
+ public String getPublicConsoleProxyIpAddress() {
+ return this.publicConsoleProxyIpAddress;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/core/src/com/cloud/agent/api/TransferAgentCommand.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/agent/api/TransferAgentCommand.java b/core/src/com/cloud/agent/api/TransferAgentCommand.java
new file mode 100644
index 0000000..0dfde7e
--- /dev/null
+++ b/core/src/com/cloud/agent/api/TransferAgentCommand.java
@@ -0,0 +1,57 @@
+// 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.agent.api;
+
+import com.cloud.host.Status.Event;
+
+public class TransferAgentCommand extends Command {
+ protected long agentId;
+ protected long futureOwner;
+ protected long currentOwner;
+ Event event;
+
+ protected TransferAgentCommand() {
+ }
+
+ public TransferAgentCommand(long agentId, long currentOwner, long futureOwner, Event event) {
+ this.agentId = agentId;
+ this.currentOwner = currentOwner;
+ this.futureOwner = futureOwner;
+ this.event = event;
+ }
+
+ public long getAgentId() {
+ return agentId;
+ }
+
+ public long getFutureOwner() {
+ return futureOwner;
+ }
+
+ public Event getEvent() {
+ return event;
+ }
+
+ public long getCurrentOwner() {
+ return currentOwner;
+ }
+
+ @Override
+ public boolean executeInSequence() {
+ return false;
+ }
+}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/core/src/com/cloud/agent/api/UnPlugNicAnswer.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/agent/api/UnPlugNicAnswer.java b/core/src/com/cloud/agent/api/UnPlugNicAnswer.java
new file mode 100644
index 0000000..232afef
--- /dev/null
+++ b/core/src/com/cloud/agent/api/UnPlugNicAnswer.java
@@ -0,0 +1,25 @@
+// 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.agent.api;
+
+public class UnPlugNicAnswer extends Answer{
+ public UnPlugNicAnswer() {}
+
+ public UnPlugNicAnswer(UnPlugNicCommand cmd, boolean success, String result) {
+ super(cmd, success, result);
+ }
+}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/core/src/com/cloud/agent/api/UnPlugNicCommand.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/agent/api/UnPlugNicCommand.java b/core/src/com/cloud/agent/api/UnPlugNicCommand.java
new file mode 100644
index 0000000..b6cab88
--- /dev/null
+++ b/core/src/com/cloud/agent/api/UnPlugNicCommand.java
@@ -0,0 +1,45 @@
+// 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.agent.api;
+
+import com.cloud.agent.api.to.NicTO;
+
+public class UnPlugNicCommand extends Command{
+ NicTO nic;
+ String instanceName;
+
+ public NicTO getNic() {
+ return nic;
+ }
+
+ @Override
+ public boolean executeInSequence() {
+ return true;
+ }
+
+ protected UnPlugNicCommand() {
+ }
+
+ public UnPlugNicCommand(NicTO nic, String instanceName) {
+ this.nic = nic;
+ this.instanceName = instanceName;
+ }
+
+ public String getInstanceName() {
+ return instanceName;
+ }
+}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/core/src/com/cloud/agent/api/UnregisterVMCommand.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/agent/api/UnregisterVMCommand.java b/core/src/com/cloud/agent/api/UnregisterVMCommand.java
new file mode 100644
index 0000000..428ffea
--- /dev/null
+++ b/core/src/com/cloud/agent/api/UnregisterVMCommand.java
@@ -0,0 +1,34 @@
+// 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.agent.api;
+
+public class UnregisterVMCommand extends Command {
+ String vmName;
+
+ public UnregisterVMCommand(String vmName){
+ this.vmName = vmName;
+ }
+
+ @Override
+ public boolean executeInSequence() {
+ return false;
+ }
+
+ public String getVmName() {
+ return vmName;
+ }
+}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/core/src/com/cloud/agent/api/UpdateHostPasswordCommand.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/agent/api/UpdateHostPasswordCommand.java b/core/src/com/cloud/agent/api/UpdateHostPasswordCommand.java
new file mode 100644
index 0000000..27cfd19
--- /dev/null
+++ b/core/src/com/cloud/agent/api/UpdateHostPasswordCommand.java
@@ -0,0 +1,48 @@
+// 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.agent.api;
+
+import com.cloud.agent.api.LogLevel.Log4jLevel;
+
+
+public class UpdateHostPasswordCommand extends Command {
+ @LogLevel(Log4jLevel.Off)
+ protected String _username;
+ @LogLevel(Log4jLevel.Off)
+ protected String _new_password;
+
+ protected UpdateHostPasswordCommand() {
+ }
+
+ public UpdateHostPasswordCommand(String username, String new_password) {
+ this._username = username;
+ this._new_password = new_password;
+ }
+
+ public String getNewPassword() {
+ return _new_password;
+ }
+
+ public String getUsername() {
+ return _username;
+ }
+
+ @Override
+ public boolean executeInSequence() {
+ return false;
+ }
+}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/core/src/com/cloud/agent/api/UpgradeAnswer.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/agent/api/UpgradeAnswer.java b/core/src/com/cloud/agent/api/UpgradeAnswer.java
new file mode 100644
index 0000000..00b0f25
--- /dev/null
+++ b/core/src/com/cloud/agent/api/UpgradeAnswer.java
@@ -0,0 +1,26 @@
+// 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.agent.api;
+
+public class UpgradeAnswer extends Answer {
+ protected UpgradeAnswer() {
+ }
+
+ public UpgradeAnswer(UpgradeCommand cmd, String failure) {
+ super(cmd, false, failure);
+ }
+}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/core/src/com/cloud/agent/api/UpgradeCommand.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/agent/api/UpgradeCommand.java b/core/src/com/cloud/agent/api/UpgradeCommand.java
new file mode 100644
index 0000000..0e1b6d2
--- /dev/null
+++ b/core/src/com/cloud/agent/api/UpgradeCommand.java
@@ -0,0 +1,42 @@
+// 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.agent.api;
+
+/**
+ * UpgradeCommand is sent when the agent should update.
+ */
+public class UpgradeCommand extends Command {
+
+ String url;
+
+ protected UpgradeCommand() {
+ }
+
+ public UpgradeCommand(String url) {
+ this.url = url;
+ }
+
+ public String getUpgradeUrl() {
+ return url;
+ }
+
+ @Override
+ public boolean executeInSequence() {
+ return true;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/core/src/com/cloud/agent/api/UpgradeSnapshotCommand.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/agent/api/UpgradeSnapshotCommand.java b/core/src/com/cloud/agent/api/UpgradeSnapshotCommand.java
new file mode 100644
index 0000000..f00f490
--- /dev/null
+++ b/core/src/com/cloud/agent/api/UpgradeSnapshotCommand.java
@@ -0,0 +1,64 @@
+// 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.agent.api;
+import com.cloud.storage.StoragePool;
+
+public class UpgradeSnapshotCommand extends SnapshotCommand {
+ private String version;
+ private Long templateId;
+ private Long tmpltAccountId;
+
+ protected UpgradeSnapshotCommand() {
+
+ }
+
+ /**
+ * @param primaryStoragePoolNameLabel The UUID of the primary storage Pool
+ * @param secondaryStoragePoolURL This is what shows up in the UI when you click on Secondary storage.
+ * @param snapshotUuid The UUID of the snapshot which is going to be upgraded
+ * @param _version version for this snapshot
+ */
+ public UpgradeSnapshotCommand(StoragePool pool,
+ String secondaryStoragePoolURL,
+ Long dcId,
+ Long accountId,
+ Long volumeId,
+ Long templateId,
+ Long tmpltAccountId,
+ String volumePath,
+ String snapshotUuid,
+ String snapshotName,
+ String version)
+ {
+ super(pool, secondaryStoragePoolURL, snapshotUuid, snapshotName, dcId, accountId, volumeId);
+ this.version = version;
+ this.templateId = templateId;
+ this.tmpltAccountId = tmpltAccountId;
+ }
+
+ public String getVersion() {
+ return version;
+ }
+
+ public Long getTemplateId() {
+ return templateId;
+ }
+
+ public Long getTmpltAccountId() {
+ return tmpltAccountId;
+ }
+}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/core/src/com/cloud/agent/api/UploadTemplateToS3FromSecondaryStorageCommand.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/agent/api/UploadTemplateToS3FromSecondaryStorageCommand.java b/core/src/com/cloud/agent/api/UploadTemplateToS3FromSecondaryStorageCommand.java
new file mode 100644
index 0000000..1807cd5
--- /dev/null
+++ b/core/src/com/cloud/agent/api/UploadTemplateToS3FromSecondaryStorageCommand.java
@@ -0,0 +1,121 @@
+/*
+ * 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.agent.api;
+
+import com.cloud.agent.api.to.S3TO;
+
+public class UploadTemplateToS3FromSecondaryStorageCommand extends Command {
+
+ private final S3TO s3;
+ private final String storagePath;
+ private final Long dataCenterId;
+ private final Long accountId;
+ private final Long templateId;
+
+ public UploadTemplateToS3FromSecondaryStorageCommand(final S3TO s3,
+ final String storagePath, final Long dataCenterId, final Long accountId,
+ final Long templateId) {
+
+ super();
+
+ this.s3 = s3;
+ this.storagePath = storagePath;
+ this.dataCenterId = dataCenterId;
+ this.accountId = accountId;
+ this.templateId = templateId;
+
+ }
+
+ @Override
+ public boolean executeInSequence() {
+ return false;
+ }
+
+ @Override
+ public boolean equals(final Object thatObject) {
+
+ if (this == thatObject) {
+ return true;
+ }
+
+ if (thatObject == null || getClass() != thatObject.getClass()) {
+ return false;
+ }
+
+ final UploadTemplateToS3FromSecondaryStorageCommand thatCommand =
+ (UploadTemplateToS3FromSecondaryStorageCommand) thatObject;
+
+ if (this.accountId != null ? !this.accountId.equals(thatCommand
+ .accountId) : thatCommand.accountId != null) {
+ return false;
+ }
+
+ if (this.dataCenterId != null ? !this.dataCenterId.equals(thatCommand
+ .dataCenterId) : thatCommand.dataCenterId != null) {
+ return false;
+ }
+
+ if (this.s3 != null ? !this.s3.equals(thatCommand.s3) : thatCommand.s3 != null) {
+ return false;
+ }
+
+ if (this.storagePath != null ? !this.storagePath.equals(thatCommand
+ .storagePath) : thatCommand.storagePath != null) {
+ return false;
+ }
+
+ if (this.templateId != null ? !this.templateId.equals(thatCommand.templateId) :
+ thatCommand.templateId != null) {
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ int result = this.s3 != null ? this.s3.hashCode() : 0;
+ result = 31 * result + (this.storagePath != null ? this.storagePath.hashCode() : 0);
+ result = 31 * result + (this.dataCenterId != null ? this.dataCenterId.hashCode() : 0);
+ result = 31 * result + (this.accountId != null ? this.accountId.hashCode() : 0);
+ result = 31 * result + (this.templateId != null ? this.templateId.hashCode() : 0);
+ return result;
+ }
+
+ public S3TO getS3() {
+ return this.s3;
+ }
+
+ public String getStoragePath() {
+ return this.storagePath;
+ }
+
+ public Long getDataCenterId() {
+ return this.dataCenterId;
+ }
+
+ public Long getAccountId() {
+ return this.accountId;
+ }
+
+ public Long getTemplateId() {
+ return this.templateId;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/core/src/com/cloud/agent/api/UploadTemplateToSwiftFromSecondaryStorageCommand.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/agent/api/UploadTemplateToSwiftFromSecondaryStorageCommand.java b/core/src/com/cloud/agent/api/UploadTemplateToSwiftFromSecondaryStorageCommand.java
new file mode 100644
index 0000000..7ba377d
--- /dev/null
+++ b/core/src/com/cloud/agent/api/UploadTemplateToSwiftFromSecondaryStorageCommand.java
@@ -0,0 +1,80 @@
+// 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.agent.api;
+
+import com.cloud.agent.api.LogLevel.Log4jLevel;
+import com.cloud.agent.api.to.SwiftTO;
+
+/**
+ *
+ *
+ */
+
+public class UploadTemplateToSwiftFromSecondaryStorageCommand extends Command {
+ @LogLevel(Log4jLevel.Off)
+ private SwiftTO swift;
+ private String secondaryStorageUrl;
+
+ private Long dcId;
+ private Long accountId;
+ private Long templateId;
+
+ protected UploadTemplateToSwiftFromSecondaryStorageCommand() {
+
+ }
+
+ public UploadTemplateToSwiftFromSecondaryStorageCommand(SwiftTO swift, String secondaryStorageUrl, Long dcId, Long accountId, Long templateId, int wait) {
+
+ this.swift = swift;
+ this.secondaryStorageUrl = secondaryStorageUrl;
+ this.dcId = dcId;
+ this.accountId = accountId;
+ this.templateId = templateId;
+ setWait(wait);
+ }
+
+ public SwiftTO getSwift() {
+ return this.swift;
+ }
+
+ public void setSwift(SwiftTO swift) {
+ this.swift = swift;
+ }
+
+ public String getSecondaryStorageUrl() {
+ return secondaryStorageUrl;
+ }
+
+ public Long getDcId() {
+ return dcId;
+ }
+
+ public Long getAccountId() {
+ return accountId;
+ }
+
+ public Long getTemplateId() {
+ return templateId;
+ }
+
+ @Override
+ public boolean executeInSequence() {
+ // TODO Auto-generated method stub
+ return true;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/core/src/com/cloud/agent/api/VMSnapshotBaseCommand.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/agent/api/VMSnapshotBaseCommand.java b/core/src/com/cloud/agent/api/VMSnapshotBaseCommand.java
new file mode 100644
index 0000000..2120f2f
--- /dev/null
+++ b/core/src/com/cloud/agent/api/VMSnapshotBaseCommand.java
@@ -0,0 +1,74 @@
+// 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.agent.api;
+
+import java.util.List;
+
+import com.cloud.agent.api.to.VolumeTO;
+
+public class VMSnapshotBaseCommand extends Command{
+ protected List<VolumeTO> volumeTOs;
+ protected VMSnapshotTO target;
+ protected String vmName;
+ protected String guestOSType;
+
+
+ public VMSnapshotBaseCommand(String vmName, VMSnapshotTO snapshot, List<VolumeTO> volumeTOs, String guestOSType) {
+ this.vmName = vmName;
+ this.target = snapshot;
+ this.volumeTOs = volumeTOs;
+ this.guestOSType = guestOSType;
+ }
+
+ public List<VolumeTO> getVolumeTOs() {
+ return volumeTOs;
+ }
+
+ public void setVolumeTOs(List<VolumeTO> volumeTOs) {
+ this.volumeTOs = volumeTOs;
+ }
+
+ public VMSnapshotTO getTarget() {
+ return target;
+ }
+
+ public void setTarget(VMSnapshotTO target) {
+ this.target = target;
+ }
+
+ public String getVmName() {
+ return vmName;
+ }
+
+ public void setVmName(String vmName) {
+ this.vmName = vmName;
+ }
+
+ @Override
+ public boolean executeInSequence() {
+ return false;
+ }
+
+ public String getGuestOSType() {
+ return guestOSType;
+ }
+
+ public void setGuestOSType(String guestOSType) {
+ this.guestOSType = guestOSType;
+ }
+}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/core/src/com/cloud/agent/api/VMSnapshotTO.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/agent/api/VMSnapshotTO.java b/core/src/com/cloud/agent/api/VMSnapshotTO.java
new file mode 100644
index 0000000..c7b42d2
--- /dev/null
+++ b/core/src/com/cloud/agent/api/VMSnapshotTO.java
@@ -0,0 +1,90 @@
+// 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.agent.api;
+
+import com.cloud.vm.snapshot.VMSnapshot;
+
+public class VMSnapshotTO {
+ private Long id;
+ private String snapshotName;
+ private VMSnapshot.Type type;
+ private Long createTime;
+ private Boolean current;
+ private String description;
+ private VMSnapshotTO parent;
+
+ public Long getId() {
+ return id;
+ }
+ public void setId(Long id) {
+ this.id = id;
+ }
+ public VMSnapshotTO(Long id, String snapshotName,
+ VMSnapshot.Type type, Long createTime,
+ String description, Boolean current, VMSnapshotTO parent) {
+ super();
+ this.id = id;
+ this.snapshotName = snapshotName;
+ this.type = type;
+ this.createTime = createTime;
+ this.current = current;
+ this.description = description;
+ this.parent = parent;
+ }
+ public VMSnapshotTO() {
+
+ }
+ public String getDescription() {
+ return description;
+ }
+ public void setDescription(String description) {
+ this.description = description;
+ }
+ public Boolean getCurrent() {
+ return current;
+ }
+ public void setCurrent(Boolean current) {
+ this.current = current;
+ }
+ public Long getCreateTime() {
+ return createTime;
+ }
+ public void setCreateTime(Long createTime) {
+ this.createTime = createTime;
+ }
+
+ public VMSnapshot.Type getType() {
+ return type;
+ }
+ public void setType(VMSnapshot.Type type) {
+ this.type = type;
+ }
+
+ public String getSnapshotName() {
+ return snapshotName;
+ }
+ public void setSnapshotName(String snapshotName) {
+ this.snapshotName = snapshotName;
+ }
+ public VMSnapshotTO getParent() {
+ return parent;
+ }
+ public void setParent(VMSnapshotTO parent) {
+ this.parent = parent;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/core/src/com/cloud/agent/api/ValidateSnapshotAnswer.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/agent/api/ValidateSnapshotAnswer.java b/core/src/com/cloud/agent/api/ValidateSnapshotAnswer.java
new file mode 100644
index 0000000..f5bb544
--- /dev/null
+++ b/core/src/com/cloud/agent/api/ValidateSnapshotAnswer.java
@@ -0,0 +1,53 @@
+// 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.agent.api;
+
+
+public class ValidateSnapshotAnswer extends Answer {
+ private String expectedSnapshotBackupUuid;
+ private String actualSnapshotBackupUuid;
+ private String actualSnapshotUuid;
+
+ protected ValidateSnapshotAnswer() {
+
+ }
+
+ public ValidateSnapshotAnswer(ValidateSnapshotCommand cmd, boolean success, String result, String expectedSnapshotBackupUuid, String actualSnapshotBackupUuid, String actualSnapshotUuid) {
+ super(cmd, success, result);
+ this.expectedSnapshotBackupUuid = expectedSnapshotBackupUuid;
+ this.actualSnapshotBackupUuid = actualSnapshotBackupUuid;
+ this.actualSnapshotUuid = actualSnapshotUuid;
+ }
+
+ /**
+ * @return the expectedSnapshotBackupUuid
+ */
+ public String getExpectedSnapshotBackupUuid() {
+ return expectedSnapshotBackupUuid;
+ }
+
+ /**
+ * @return the actualSnapshotBackupUuid
+ */
+ public String getActualSnapshotBackupUuid() {
+ return actualSnapshotBackupUuid;
+ }
+
+ public String getActualSnapshotUuid() {
+ return actualSnapshotUuid;
+ }
+}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/core/src/com/cloud/agent/api/ValidateSnapshotCommand.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/agent/api/ValidateSnapshotCommand.java b/core/src/com/cloud/agent/api/ValidateSnapshotCommand.java
new file mode 100644
index 0000000..9ffbf29
--- /dev/null
+++ b/core/src/com/cloud/agent/api/ValidateSnapshotCommand.java
@@ -0,0 +1,84 @@
+// 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.agent.api;
+
+public class ValidateSnapshotCommand extends Command {
+ private String primaryStoragePoolNameLabel;
+ private String volumeUuid;
+ private String firstBackupUuid;
+ private String previousSnapshotUuid;
+ private String templateUuid;
+
+ protected ValidateSnapshotCommand() {
+
+ }
+
+ /**
+ * @param primaryStoragePoolNameLabel The primary storage Pool Name Label
+ * @param volumeUuid The UUID of the volume for which the snapshot was taken
+ * @param firstBackupUuid This UUID of the first snapshot that was ever taken for this volume, even it was deleted.
+ * @param previousSnapshotUuid The UUID of the previous snapshot on the primary.
+ * @param templateUuid If this is a root volume and no snapshot has been taken for it,
+ * this is the UUID of the template VDI.
+ */
+ public ValidateSnapshotCommand(String primaryStoragePoolNameLabel,
+ String volumeUuid,
+ String firstBackupUuid,
+ String previousSnapshotUuid,
+ String templateUuid)
+ {
+ this.primaryStoragePoolNameLabel = primaryStoragePoolNameLabel;
+ this.volumeUuid = volumeUuid;
+ this.firstBackupUuid = firstBackupUuid;
+ this.previousSnapshotUuid = previousSnapshotUuid;
+ this.templateUuid = templateUuid;
+ }
+
+ public String getPrimaryStoragePoolNameLabel() {
+ return primaryStoragePoolNameLabel;
+ }
+
+ /**
+ * @return the volumeUuid
+ */
+ public String getVolumeUuid() {
+ return volumeUuid;
+ }
+
+ /**
+ * @return the firstBackupUuid
+ */
+ public String getFirstBackupUuid() {
+ return firstBackupUuid;
+ }
+
+ public String getPreviousSnapshotUuid() {
+ return previousSnapshotUuid;
+ }
+
+ /**
+ * @return the templateUuid
+ */
+ public String getTemplateUuid() {
+ return templateUuid;
+ }
+
+ @Override
+ public boolean executeInSequence() {
+ return false;
+ }
+}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/core/src/com/cloud/agent/api/VmStatsEntry.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/agent/api/VmStatsEntry.java b/core/src/com/cloud/agent/api/VmStatsEntry.java
new file mode 100755
index 0000000..8828e91
--- /dev/null
+++ b/core/src/com/cloud/agent/api/VmStatsEntry.java
@@ -0,0 +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.agent.api;
+
+import com.cloud.vm.VmStats;
+
+public class VmStatsEntry implements VmStats {
+
+ double cpuUtilization;
+ double networkReadKBs;
+ double networkWriteKBs;
+ int numCPUs;
+ String entityType;
+
+ public VmStatsEntry() {
+ }
+
+ public VmStatsEntry(double cpuUtilization, double networkReadKBs, double networkWriteKBs, int numCPUs, String entityType)
+ {
+ this.cpuUtilization = cpuUtilization;
+ this.networkReadKBs = networkReadKBs;
+ this.networkWriteKBs = networkWriteKBs;
+ this.numCPUs = numCPUs;
+ this.entityType = entityType;
+ }
+
+ public double getCPUUtilization() {
+ return cpuUtilization;
+ }
+
+ public void setCPUUtilization(double cpuUtilization) {
+ this.cpuUtilization = cpuUtilization;
+ }
+
+ public double getNetworkReadKBs() {
+ return networkReadKBs;
+ }
+
+ public void setNetworkReadKBs(double networkReadKBs) {
+ this.networkReadKBs = networkReadKBs;
+ }
+
+ public double getNetworkWriteKBs() {
+ return networkWriteKBs;
+ }
+
+ public void setNetworkWriteKBs(double networkWriteKBs) {
+ this.networkWriteKBs = networkWriteKBs;
+ }
+
+ public int getNumCPUs() {
+ return numCPUs;
+ }
+
+ public void setNumCPUs(int numCPUs) {
+ this.numCPUs = numCPUs;
+ }
+
+ public String getEntityType(){
+ return this.entityType;
+ }
+
+ public void setEntityType(String entityType){
+ this.entityType = entityType;
+ }
+
+
+}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/core/src/com/cloud/agent/api/baremetal/IpmISetBootDevCommand.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/agent/api/baremetal/IpmISetBootDevCommand.java b/core/src/com/cloud/agent/api/baremetal/IpmISetBootDevCommand.java
new file mode 100644
index 0000000..fdd1fe9
--- /dev/null
+++ b/core/src/com/cloud/agent/api/baremetal/IpmISetBootDevCommand.java
@@ -0,0 +1,43 @@
+// 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.agent.api.baremetal;
+
+import com.cloud.agent.api.Command;
+
+public class IpmISetBootDevCommand extends Command {
+ public enum BootDev {
+ pxe(),
+ disk(),
+ cdrom(),
+ }
+
+ BootDev bootDev;
+
+ public BootDev getBootDev() {
+ return bootDev;
+ }
+
+ public IpmISetBootDevCommand(BootDev dev) {
+ bootDev = dev;
+ }
+
+ @Override
+ public boolean executeInSequence() {
+ return true;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/core/src/com/cloud/agent/api/baremetal/IpmiBootorResetCommand.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/agent/api/baremetal/IpmiBootorResetCommand.java b/core/src/com/cloud/agent/api/baremetal/IpmiBootorResetCommand.java
new file mode 100644
index 0000000..4f8dcaf
--- /dev/null
+++ b/core/src/com/cloud/agent/api/baremetal/IpmiBootorResetCommand.java
@@ -0,0 +1,28 @@
+// 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.agent.api.baremetal;
+
+import com.cloud.agent.api.Command;
+
+public class IpmiBootorResetCommand extends Command {
+
+ @Override
+ public boolean executeInSequence() {
+ return true;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/core/src/com/cloud/agent/api/baremetal/PreparePxeServerAnswer.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/agent/api/baremetal/PreparePxeServerAnswer.java b/core/src/com/cloud/agent/api/baremetal/PreparePxeServerAnswer.java
new file mode 100644
index 0000000..d8f0529
--- /dev/null
+++ b/core/src/com/cloud/agent/api/baremetal/PreparePxeServerAnswer.java
@@ -0,0 +1,29 @@
+// 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.agent.api.baremetal;
+
+import com.cloud.agent.api.Answer;
+
+public class PreparePxeServerAnswer extends Answer {
+ public PreparePxeServerAnswer(PreparePxeServerCommand cmd) {
+ super(cmd, true, "SUCCESS");
+ }
+
+ public PreparePxeServerAnswer(PreparePxeServerCommand cmd, String details) {
+ super(cmd, false, details);
+ }
+}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/core/src/com/cloud/agent/api/baremetal/PreparePxeServerCommand.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/agent/api/baremetal/PreparePxeServerCommand.java b/core/src/com/cloud/agent/api/baremetal/PreparePxeServerCommand.java
new file mode 100644
index 0000000..6c73563
--- /dev/null
+++ b/core/src/com/cloud/agent/api/baremetal/PreparePxeServerCommand.java
@@ -0,0 +1,80 @@
+// 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.agent.api.baremetal;
+
+import com.cloud.agent.api.Command;
+
+public class PreparePxeServerCommand extends Command {
+
+ String ip;
+ String mac;
+ String netMask;
+ String gateway;
+ String dns;
+ String template;
+ String vmName;
+ String hostName;
+
+ @Override
+ public boolean executeInSequence() {
+ return true;
+ }
+
+ public PreparePxeServerCommand(String ip, String mac, String netMask, String gateway, String dns, String template, String vmName, String hostName) {
+ this.ip = ip;
+ this.mac = mac;
+ this.netMask = netMask;
+ this.gateway = gateway;
+ this.dns = dns;
+ this.template = template;
+ this.vmName = vmName;
+ this.hostName = hostName;
+ }
+
+ public String getIp() {
+ return ip;
+ }
+
+ public String getMac() {
+ return mac;
+ }
+
+ public String getNetMask() {
+ return netMask;
+ }
+
+ public String getGateWay() {
+ return gateway;
+ }
+
+ public String getDns() {
+ return dns;
+ }
+
+ public String getTemplate() {
+ return template;
+ }
+
+ public String getVmName() {
+ return vmName;
+ }
+
+ public String getHostName() {
+ return hostName;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/core/src/com/cloud/agent/api/baremetal/prepareCreateTemplateCommand.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/agent/api/baremetal/prepareCreateTemplateCommand.java b/core/src/com/cloud/agent/api/baremetal/prepareCreateTemplateCommand.java
new file mode 100644
index 0000000..b187420
--- /dev/null
+++ b/core/src/com/cloud/agent/api/baremetal/prepareCreateTemplateCommand.java
@@ -0,0 +1,66 @@
+// 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.agent.api.baremetal;
+
+import com.cloud.agent.api.Command;
+
+public class prepareCreateTemplateCommand extends Command {
+ String ip;
+ String mac;
+ String netMask;
+ String gateway;
+ String dns;
+ String template;
+
+ @Override
+ public boolean executeInSequence() {
+ return true;
+ }
+
+ public prepareCreateTemplateCommand(String ip, String mac, String netMask, String gateway, String dns, String template) {
+ this.ip = ip;
+ this.mac = mac;
+ this.netMask = netMask;
+ this.gateway = gateway;
+ this.dns = dns;
+ this.template = template;
+ }
+
+ public String getIp() {
+ return ip;
+ }
+
+ public String getMac() {
+ return mac;
+ }
+
+ public String getNetMask() {
+ return netMask;
+ }
+
+ public String getGateWay() {
+ return gateway;
+ }
+
+ public String getDns() {
+ return dns;
+ }
+
+ public String getTemplate() {
+ return template;
+ }
+}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/core/src/com/cloud/agent/api/check/CheckSshAnswer.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/agent/api/check/CheckSshAnswer.java b/core/src/com/cloud/agent/api/check/CheckSshAnswer.java
new file mode 100644
index 0000000..3414eb0
--- /dev/null
+++ b/core/src/com/cloud/agent/api/check/CheckSshAnswer.java
@@ -0,0 +1,37 @@
+// 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.agent.api.check;
+
+import com.cloud.agent.api.Answer;
+
+public class CheckSshAnswer extends Answer {
+ protected CheckSshAnswer() {
+
+ }
+
+ public CheckSshAnswer(CheckSshCommand cmd) {
+ super(cmd, true, null);
+ }
+
+ public CheckSshAnswer(CheckSshCommand cmd, String details) {
+ super(cmd, false, details);
+ }
+
+ public CheckSshAnswer(CheckSshCommand cmd, Throwable th) {
+ super(cmd, false, th.getMessage());
+ }
+}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/core/src/com/cloud/agent/api/check/CheckSshCommand.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/agent/api/check/CheckSshCommand.java b/core/src/com/cloud/agent/api/check/CheckSshCommand.java
new file mode 100644
index 0000000..e384983
--- /dev/null
+++ b/core/src/com/cloud/agent/api/check/CheckSshCommand.java
@@ -0,0 +1,65 @@
+// 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.agent.api.check;
+
+import com.cloud.agent.api.Command;
+
+public class CheckSshCommand extends Command {
+ String ip;
+ int port;
+ int interval;
+ int retries;
+ String name;
+
+ protected CheckSshCommand() {
+ super();
+ }
+
+ public CheckSshCommand(String instanceName, String ip, int port) {
+ super();
+ this.ip = ip;
+ this.port = port;
+ this.interval = 6;
+ this.retries = 100;
+ this.name = instanceName;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public String getIp() {
+ return ip;
+ }
+
+ public int getPort() {
+ return port;
+ }
+
+ public int getInterval() {
+ return interval;
+ }
+
+ public int getRetries() {
+ return retries;
+ }
+
+ @Override
+ public boolean executeInSequence() {
+ return false;
+ }
+}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/core/src/com/cloud/agent/api/proxy/CheckConsoleProxyLoadCommand.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/agent/api/proxy/CheckConsoleProxyLoadCommand.java b/core/src/com/cloud/agent/api/proxy/CheckConsoleProxyLoadCommand.java
new file mode 100644
index 0000000..7582b0d
--- /dev/null
+++ b/core/src/com/cloud/agent/api/proxy/CheckConsoleProxyLoadCommand.java
@@ -0,0 +1,60 @@
+// 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.agent.api.proxy;
+
+
+/**
+ * CheckConsoleProxyLoadCommand implements one-shot console proxy load-scan command
+ */
+public class CheckConsoleProxyLoadCommand extends ProxyCommand {
+
+ private long proxyVmId;
+ private String proxyVmName;
+ private String proxyManagementIp;
+ private int proxyCmdPort;
+
+ public CheckConsoleProxyLoadCommand() {
+ }
+
+ public CheckConsoleProxyLoadCommand(long proxyVmId, String proxyVmName, String proxyManagementIp, int proxyCmdPort) {
+ this.proxyVmId = proxyVmId;
+ this.proxyVmName = proxyVmName;
+ this.proxyManagementIp = proxyManagementIp;
+ this.proxyCmdPort = proxyCmdPort;
+ }
+
+ public long getProxyVmId() {
+ return proxyVmId;
+ }
+
+ public String getProxyVmName() {
+ return proxyVmName;
+ }
+
+ public String getProxyManagementIp() {
+ return proxyManagementIp;
+ }
+
+ public int getProxyCmdPort() {
+ return proxyCmdPort;
+ }
+
+ @Override
+ public boolean executeInSequence() {
+ return false;
+ }
+}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/core/src/com/cloud/agent/api/proxy/ConsoleProxyLoadAnswer.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/agent/api/proxy/ConsoleProxyLoadAnswer.java b/core/src/com/cloud/agent/api/proxy/ConsoleProxyLoadAnswer.java
new file mode 100644
index 0000000..ae93f51
--- /dev/null
+++ b/core/src/com/cloud/agent/api/proxy/ConsoleProxyLoadAnswer.java
@@ -0,0 +1,44 @@
+// 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.agent.api.proxy;
+
+import com.cloud.agent.api.Answer;
+import com.cloud.agent.api.Command;
+
+public class ConsoleProxyLoadAnswer extends Answer {
+
+ private long proxyVmId;
+ private String proxyVmName;
+
+ protected ConsoleProxyLoadAnswer() {
+ }
+
+ public ConsoleProxyLoadAnswer(Command command, long proxyVmId, String proxyVmName, boolean success, String details) {
+ super(command, success, details);
+
+ this.proxyVmId = proxyVmId;
+ this.proxyVmName = proxyVmName;
+ }
+
+ public long getProxyVmId() {
+ return proxyVmId;
+ }
+
+ public String getProxyVmName() {
+ return proxyVmName;
+ }
+}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/core/src/com/cloud/agent/api/proxy/ProxyCommand.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/agent/api/proxy/ProxyCommand.java b/core/src/com/cloud/agent/api/proxy/ProxyCommand.java
new file mode 100644
index 0000000..b283eb8
--- /dev/null
+++ b/core/src/com/cloud/agent/api/proxy/ProxyCommand.java
@@ -0,0 +1,25 @@
+// 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.agent.api.proxy;
+
+import com.cloud.agent.api.Command;
+
+public abstract class ProxyCommand extends Command {
+ protected ProxyCommand() {
+ super();
+ }
+}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/core/src/com/cloud/agent/api/proxy/StartConsoleProxyAgentHttpHandlerCommand.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/agent/api/proxy/StartConsoleProxyAgentHttpHandlerCommand.java b/core/src/com/cloud/agent/api/proxy/StartConsoleProxyAgentHttpHandlerCommand.java
new file mode 100644
index 0000000..3befc2f
--- /dev/null
+++ b/core/src/com/cloud/agent/api/proxy/StartConsoleProxyAgentHttpHandlerCommand.java
@@ -0,0 +1,68 @@
+// 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.agent.api.proxy;
+
+import com.cloud.agent.api.Command;
+import com.cloud.agent.api.LogLevel;
+import com.cloud.agent.api.LogLevel.Log4jLevel;
+
+public class StartConsoleProxyAgentHttpHandlerCommand extends Command {
+ @LogLevel(Log4jLevel.Off)
+ private byte[] keystoreBits;
+ @LogLevel(Log4jLevel.Off)
+ private String keystorePassword;
+ @LogLevel(Log4jLevel.Off)
+ private String encryptorPassword;
+
+ public StartConsoleProxyAgentHttpHandlerCommand() {
+ super();
+ }
+
+ public StartConsoleProxyAgentHttpHandlerCommand(byte[] ksBits, String ksPassword) {
+ this.keystoreBits = ksBits;
+ this.keystorePassword = ksPassword;
+ }
+
+ @Override
+ public boolean executeInSequence() {
+ return true;
+ }
+
+ public byte[] getKeystoreBits() {
+ return keystoreBits;
+ }
+
+ public void setKeystoreBits(byte[] keystoreBits) {
+ this.keystoreBits = keystoreBits;
+ }
+
+ public String getKeystorePassword() {
+ return keystorePassword;
+ }
+
+ public void setKeystorePassword(String keystorePassword) {
+ this.keystorePassword = keystorePassword;
+ }
+
+ public String getEncryptorPassword() {
+ return encryptorPassword;
+ }
+
+ public void setEncryptorPassword(String encryptorPassword) {
+ this.encryptorPassword = encryptorPassword;
+ }
+}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/core/src/com/cloud/agent/api/proxy/WatchConsoleProxyLoadCommand.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/agent/api/proxy/WatchConsoleProxyLoadCommand.java b/core/src/com/cloud/agent/api/proxy/WatchConsoleProxyLoadCommand.java
new file mode 100644
index 0000000..ef4a549
--- /dev/null
+++ b/core/src/com/cloud/agent/api/proxy/WatchConsoleProxyLoadCommand.java
@@ -0,0 +1,65 @@
+// 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.agent.api.proxy;
+
+import com.cloud.agent.api.CronCommand;
+
+public class WatchConsoleProxyLoadCommand extends ProxyCommand implements CronCommand {
+
+ private long proxyVmId;
+ private String proxyVmName;
+ private String proxyManagementIp;
+ private int proxyCmdPort;
+ int interval;
+
+ public WatchConsoleProxyLoadCommand(int interval, long proxyVmId, String proxyVmName,
+ String proxyManagementIp, int proxyCmdPort) {
+ this.interval = interval;
+ this.proxyVmId = proxyVmId;
+ this.proxyVmName = proxyVmName;
+ this.proxyManagementIp = proxyManagementIp;
+ this.proxyCmdPort = proxyCmdPort;
+ }
+
+ protected WatchConsoleProxyLoadCommand() {
+ }
+
+ public long getProxyVmId() {
+ return proxyVmId;
+ }
+
+ public String getProxyVmName() {
+ return proxyVmName;
+ }
+
+ public String getProxyManagementIp() {
+ return proxyManagementIp;
+ }
+
+ public int getProxyCmdPort() {
+ return proxyCmdPort;
+ }
+
+ public int getInterval() {
+ return interval;
+ }
+
+ @Override
+ public boolean executeInSequence() {
+ return false;
+ }
+}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/core/src/com/cloud/agent/api/routing/CreateLoadBalancerApplianceCommand.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/agent/api/routing/CreateLoadBalancerApplianceCommand.java b/core/src/com/cloud/agent/api/routing/CreateLoadBalancerApplianceCommand.java
new file mode 100644
index 0000000..dc7f1a1
--- /dev/null
+++ b/core/src/com/cloud/agent/api/routing/CreateLoadBalancerApplianceCommand.java
@@ -0,0 +1,48 @@
+// 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.agent.api.routing;
+
+/** NetworkElementCommand to spin a load balancer appliance */
+
+public class CreateLoadBalancerApplianceCommand extends NetworkElementCommand {
+
+ String ip;
+ String netmask;
+ String gateway;
+ String username;
+ String password;
+ String publicInterface;
+ String privateInterface;
+
+ public CreateLoadBalancerApplianceCommand(String ip, String netmask, String gateway) {
+ this.ip = ip;
+ this.netmask = netmask;
+ this.gateway = gateway;
+ }
+
+ public String getLoadBalancerIP() {
+ return ip;
+ }
+
+ public String getNetmask() {
+ return netmask;
+ }
+
+ public String getGateway() {
+ return gateway;
+ }
+}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/core/src/com/cloud/agent/api/routing/DestroyLoadBalancerApplianceCommand.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/agent/api/routing/DestroyLoadBalancerApplianceCommand.java b/core/src/com/cloud/agent/api/routing/DestroyLoadBalancerApplianceCommand.java
new file mode 100644
index 0000000..5f46d82
--- /dev/null
+++ b/core/src/com/cloud/agent/api/routing/DestroyLoadBalancerApplianceCommand.java
@@ -0,0 +1,32 @@
+// 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.
+/** NetworkElementCommand to destroy a VPX instance on the Netscaler SDX load balancer appliance */
+//TODO: fill in the Nitro API parameters required
+package com.cloud.agent.api.routing;
+
+public class DestroyLoadBalancerApplianceCommand extends NetworkElementCommand {
+
+ String ip;
+
+ public DestroyLoadBalancerApplianceCommand(String ip) {
+ this.ip = ip;
+ }
+
+ public String getLoadBalancerIP() {
+ return ip;
+ }
+}