mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
more line ending fixes
This commit is contained in:
parent
581640147c
commit
d5377b0ae3
@ -10,17 +10,17 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.agent.api;
|
||||
|
||||
public class AgentControlAnswer extends Answer {
|
||||
public AgentControlAnswer() {
|
||||
}
|
||||
|
||||
public AgentControlAnswer(Command command) {
|
||||
super(command);
|
||||
}
|
||||
|
||||
public AgentControlAnswer(Command command, boolean success, String details) {
|
||||
super(command, success, details);
|
||||
}
|
||||
}
|
||||
package com.cloud.agent.api;
|
||||
|
||||
public class AgentControlAnswer extends Answer {
|
||||
public AgentControlAnswer() {
|
||||
}
|
||||
|
||||
public AgentControlAnswer(Command command) {
|
||||
super(command);
|
||||
}
|
||||
|
||||
public AgentControlAnswer(Command command, boolean success, String details) {
|
||||
super(command, success, details);
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,14 +10,14 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.agent.api;
|
||||
|
||||
public class AgentControlCommand extends Command {
|
||||
|
||||
public AgentControlCommand() {
|
||||
}
|
||||
|
||||
public boolean executeInSequence() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
package com.cloud.agent.api;
|
||||
|
||||
public class AgentControlCommand extends Command {
|
||||
|
||||
public AgentControlCommand() {
|
||||
}
|
||||
|
||||
public boolean executeInSequence() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,13 +10,13 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.agent.api;
|
||||
|
||||
public class CheckHealthAnswer extends Answer {
|
||||
|
||||
public CheckHealthAnswer() {}
|
||||
|
||||
public CheckHealthAnswer(CheckHealthCommand cmd, boolean alive) {
|
||||
super(cmd, alive, "resource is " + (alive? "alive" : "not alive"));
|
||||
}
|
||||
}
|
||||
package com.cloud.agent.api;
|
||||
|
||||
public class CheckHealthAnswer extends Answer {
|
||||
|
||||
public CheckHealthAnswer() {}
|
||||
|
||||
public CheckHealthAnswer(CheckHealthCommand cmd, boolean alive) {
|
||||
super(cmd, alive, "resource is " + (alive? "alive" : "not alive"));
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,17 +10,17 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.agent.api;
|
||||
|
||||
public class CheckHealthCommand extends Command {
|
||||
|
||||
package com.cloud.agent.api;
|
||||
|
||||
public class CheckHealthCommand extends Command {
|
||||
|
||||
public CheckHealthCommand() {
|
||||
setWait(50);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean executeInSequence() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean executeInSequence() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,21 +10,21 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.agent.api;
|
||||
|
||||
public class ConsoleAccessAuthenticationAnswer extends AgentControlAnswer {
|
||||
|
||||
private boolean _success;
|
||||
|
||||
public ConsoleAccessAuthenticationAnswer() {
|
||||
}
|
||||
|
||||
public ConsoleAccessAuthenticationAnswer(Command cmd, boolean success) {
|
||||
super(cmd);
|
||||
_success = success;
|
||||
}
|
||||
|
||||
public boolean succeeded() {
|
||||
return _success;
|
||||
}
|
||||
}
|
||||
package com.cloud.agent.api;
|
||||
|
||||
public class ConsoleAccessAuthenticationAnswer extends AgentControlAnswer {
|
||||
|
||||
private boolean _success;
|
||||
|
||||
public ConsoleAccessAuthenticationAnswer() {
|
||||
}
|
||||
|
||||
public ConsoleAccessAuthenticationAnswer(Command cmd, boolean success) {
|
||||
super(cmd);
|
||||
_success = success;
|
||||
}
|
||||
|
||||
public boolean succeeded() {
|
||||
return _success;
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,26 +10,26 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.agent.api;
|
||||
|
||||
public class ConsoleAccessAuthenticationCommand extends AgentControlCommand {
|
||||
package com.cloud.agent.api;
|
||||
|
||||
public class ConsoleAccessAuthenticationCommand extends AgentControlCommand {
|
||||
|
||||
private String _host;
|
||||
private String _port;
|
||||
private String _vmId;
|
||||
private String _port;
|
||||
private String _vmId;
|
||||
private String _sid;
|
||||
private String _ticket;
|
||||
|
||||
public ConsoleAccessAuthenticationCommand() {
|
||||
}
|
||||
|
||||
private String _ticket;
|
||||
|
||||
public ConsoleAccessAuthenticationCommand() {
|
||||
}
|
||||
|
||||
public ConsoleAccessAuthenticationCommand(String host, String port, String vmId, String sid, String ticket) {
|
||||
_host = host;
|
||||
_port = port;
|
||||
_vmId = vmId;
|
||||
_vmId = vmId;
|
||||
_sid = sid;
|
||||
_ticket = ticket;
|
||||
}
|
||||
_ticket = ticket;
|
||||
}
|
||||
|
||||
public String getHost() {
|
||||
return _host;
|
||||
@ -38,16 +38,16 @@ public class ConsoleAccessAuthenticationCommand extends AgentControlCommand {
|
||||
public String getPort() {
|
||||
return _port;
|
||||
}
|
||||
|
||||
public String getVmId() {
|
||||
return _vmId;
|
||||
}
|
||||
|
||||
public String getSid() {
|
||||
return _sid;
|
||||
|
||||
public String getVmId() {
|
||||
return _vmId;
|
||||
}
|
||||
|
||||
public String getSid() {
|
||||
return _sid;
|
||||
}
|
||||
|
||||
public String getTicket() {
|
||||
return _ticket;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,26 +10,26 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.agent.api;
|
||||
|
||||
public class ConsoleProxyLoadReportCommand extends AgentControlCommand {
|
||||
|
||||
private long _proxyVmId;
|
||||
private String _loadInfo;
|
||||
|
||||
public ConsoleProxyLoadReportCommand() {
|
||||
}
|
||||
|
||||
public ConsoleProxyLoadReportCommand(long proxyVmId, String loadInfo) {
|
||||
_proxyVmId = proxyVmId;
|
||||
_loadInfo = loadInfo;
|
||||
}
|
||||
|
||||
public long getProxyVmId() {
|
||||
return _proxyVmId;
|
||||
}
|
||||
|
||||
public String getLoadInfo() {
|
||||
return _loadInfo;
|
||||
}
|
||||
}
|
||||
package com.cloud.agent.api;
|
||||
|
||||
public class ConsoleProxyLoadReportCommand extends AgentControlCommand {
|
||||
|
||||
private long _proxyVmId;
|
||||
private String _loadInfo;
|
||||
|
||||
public ConsoleProxyLoadReportCommand() {
|
||||
}
|
||||
|
||||
public ConsoleProxyLoadReportCommand(long proxyVmId, String loadInfo) {
|
||||
_proxyVmId = proxyVmId;
|
||||
_loadInfo = loadInfo;
|
||||
}
|
||||
|
||||
public long getProxyVmId() {
|
||||
return _proxyVmId;
|
||||
}
|
||||
|
||||
public String getLoadInfo() {
|
||||
return _loadInfo;
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,27 +10,27 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.agent.api;
|
||||
|
||||
|
||||
public class ManageSnapshotAnswer extends Answer {
|
||||
// For create Snapshot
|
||||
private String _snapshotPath;
|
||||
|
||||
public ManageSnapshotAnswer() {}
|
||||
|
||||
public ManageSnapshotAnswer(Command cmd, boolean success, String result) {
|
||||
super(cmd, success, result);
|
||||
}
|
||||
|
||||
// For XenServer
|
||||
public ManageSnapshotAnswer(ManageSnapshotCommand cmd, long snapshotId, String snapshotPath, boolean success, String result) {
|
||||
super(cmd, success, result);
|
||||
_snapshotPath = snapshotPath;
|
||||
}
|
||||
|
||||
public String getSnapshotPath() {
|
||||
return _snapshotPath;
|
||||
}
|
||||
|
||||
}
|
||||
package com.cloud.agent.api;
|
||||
|
||||
|
||||
public class ManageSnapshotAnswer extends Answer {
|
||||
// For create Snapshot
|
||||
private String _snapshotPath;
|
||||
|
||||
public ManageSnapshotAnswer() {}
|
||||
|
||||
public ManageSnapshotAnswer(Command cmd, boolean success, String result) {
|
||||
super(cmd, success, result);
|
||||
}
|
||||
|
||||
// For XenServer
|
||||
public ManageSnapshotAnswer(ManageSnapshotCommand cmd, long snapshotId, String snapshotPath, boolean success, String result) {
|
||||
super(cmd, success, result);
|
||||
_snapshotPath = snapshotPath;
|
||||
}
|
||||
|
||||
public String getSnapshotPath() {
|
||||
return _snapshotPath;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -10,79 +10,79 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.agent.api;
|
||||
package com.cloud.agent.api;
|
||||
|
||||
import com.cloud.agent.api.to.StorageFilerTO;
|
||||
import com.cloud.storage.StoragePool;
|
||||
|
||||
|
||||
public class ManageSnapshotCommand extends Command {
|
||||
|
||||
|
||||
public class ManageSnapshotCommand extends Command {
|
||||
// XXX: Should be an enum
|
||||
// XXX: Anyway there is something called inheritance in Java
|
||||
public static String CREATE_SNAPSHOT = "-c";
|
||||
public static String DESTROY_SNAPSHOT = "-d";
|
||||
|
||||
private String _commandSwitch;
|
||||
|
||||
// Information about the volume that the snapshot is based on
|
||||
private String _volumePath = null;
|
||||
public static String CREATE_SNAPSHOT = "-c";
|
||||
public static String DESTROY_SNAPSHOT = "-d";
|
||||
|
||||
private String _commandSwitch;
|
||||
|
||||
// Information about the volume that the snapshot is based on
|
||||
private String _volumePath = null;
|
||||
StorageFilerTO _pool;
|
||||
|
||||
// Information about the snapshot
|
||||
private String _snapshotPath = null;
|
||||
private String _snapshotName = null;
|
||||
|
||||
// Information about the snapshot
|
||||
private String _snapshotPath = null;
|
||||
private String _snapshotName = null;
|
||||
private long _snapshotId;
|
||||
private String _vmName = null;
|
||||
|
||||
public ManageSnapshotCommand() {}
|
||||
|
||||
public ManageSnapshotCommand(long snapshotId, String volumePath, StoragePool pool, String preSnapshotPath ,String snapshotName, String vmName) {
|
||||
private String _vmName = null;
|
||||
|
||||
public ManageSnapshotCommand() {}
|
||||
|
||||
public ManageSnapshotCommand(long snapshotId, String volumePath, StoragePool pool, String preSnapshotPath ,String snapshotName, String vmName) {
|
||||
_commandSwitch = ManageSnapshotCommand.CREATE_SNAPSHOT;
|
||||
_volumePath = volumePath;
|
||||
_pool = new StorageFilerTO(pool);
|
||||
_snapshotPath = preSnapshotPath;
|
||||
_snapshotName = snapshotName;
|
||||
_snapshotName = snapshotName;
|
||||
_snapshotId = snapshotId;
|
||||
_vmName = vmName;
|
||||
}
|
||||
_vmName = vmName;
|
||||
}
|
||||
|
||||
public ManageSnapshotCommand(long snapshotId, String snapshotPath) {
|
||||
_commandSwitch = ManageSnapshotCommand.DESTROY_SNAPSHOT;
|
||||
_snapshotPath = snapshotPath;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean executeInSequence() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public String getCommandSwitch() {
|
||||
return _commandSwitch;
|
||||
}
|
||||
|
||||
public String getVolumePath() {
|
||||
return _volumePath;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean executeInSequence() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public String getCommandSwitch() {
|
||||
return _commandSwitch;
|
||||
}
|
||||
|
||||
public String getVolumePath() {
|
||||
return _volumePath;
|
||||
}
|
||||
|
||||
public StorageFilerTO getPool() {
|
||||
return _pool;
|
||||
}
|
||||
|
||||
public String getSnapshotPath() {
|
||||
return _snapshotPath;
|
||||
}
|
||||
|
||||
public String getSnapshotPath() {
|
||||
return _snapshotPath;
|
||||
}
|
||||
|
||||
public String getSnapshotName() {
|
||||
return _snapshotName;
|
||||
}
|
||||
|
||||
public long getSnapshotId() {
|
||||
return _snapshotId;
|
||||
public String getSnapshotName() {
|
||||
return _snapshotName;
|
||||
}
|
||||
|
||||
public long getSnapshotId() {
|
||||
return _snapshotId;
|
||||
}
|
||||
|
||||
public String getVmName() {
|
||||
return _vmName;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -10,41 +10,41 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.agent.api;
|
||||
|
||||
public class PingTestCommand extends Command {
|
||||
|
||||
String _computingHostIp = null;
|
||||
String _routerIp = null;
|
||||
String _privateIp = null;
|
||||
|
||||
public PingTestCommand() {}
|
||||
|
||||
public PingTestCommand(String computingHostIp) {
|
||||
package com.cloud.agent.api;
|
||||
|
||||
public class PingTestCommand extends Command {
|
||||
|
||||
String _computingHostIp = null;
|
||||
String _routerIp = null;
|
||||
String _privateIp = null;
|
||||
|
||||
public PingTestCommand() {}
|
||||
|
||||
public PingTestCommand(String computingHostIp) {
|
||||
_computingHostIp = computingHostIp;
|
||||
setWait(20);
|
||||
}
|
||||
|
||||
public PingTestCommand(String routerIp, String privateIp) {
|
||||
_routerIp = routerIp;
|
||||
setWait(20);
|
||||
}
|
||||
|
||||
public PingTestCommand(String routerIp, String privateIp) {
|
||||
_routerIp = routerIp;
|
||||
_privateIp = privateIp;
|
||||
setWait(20);
|
||||
}
|
||||
|
||||
public String getComputingHostIp() {
|
||||
return _computingHostIp;
|
||||
}
|
||||
|
||||
public String getRouterIp() {
|
||||
return _routerIp;
|
||||
}
|
||||
|
||||
public String getPrivateIp() {
|
||||
return _privateIp;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean executeInSequence() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
setWait(20);
|
||||
}
|
||||
|
||||
public String getComputingHostIp() {
|
||||
return _computingHostIp;
|
||||
}
|
||||
|
||||
public String getRouterIp() {
|
||||
return _routerIp;
|
||||
}
|
||||
|
||||
public String getPrivateIp() {
|
||||
return _privateIp;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean executeInSequence() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,31 +10,31 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.agent.api;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.cloud.utils.Ternary;
|
||||
|
||||
public class PrepareOCFS2NodesCommand extends Command {
|
||||
List<Ternary<Integer, String, String>> nodes;
|
||||
String clusterName;
|
||||
|
||||
@Override
|
||||
public boolean executeInSequence() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public PrepareOCFS2NodesCommand(String clusterName, List<Ternary<Integer, String, String>> nodes) {
|
||||
this.nodes = nodes;
|
||||
this.clusterName = clusterName;
|
||||
}
|
||||
|
||||
public List<Ternary<Integer, String, String>> getNodes() {
|
||||
return nodes;
|
||||
}
|
||||
|
||||
public String getClusterName() {
|
||||
return clusterName;
|
||||
}
|
||||
}
|
||||
package com.cloud.agent.api;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.cloud.utils.Ternary;
|
||||
|
||||
public class PrepareOCFS2NodesCommand extends Command {
|
||||
List<Ternary<Integer, String, String>> nodes;
|
||||
String clusterName;
|
||||
|
||||
@Override
|
||||
public boolean executeInSequence() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public PrepareOCFS2NodesCommand(String clusterName, List<Ternary<Integer, String, String>> nodes) {
|
||||
this.nodes = nodes;
|
||||
this.clusterName = clusterName;
|
||||
}
|
||||
|
||||
public List<Ternary<Integer, String, String>> getNodes() {
|
||||
return nodes;
|
||||
}
|
||||
|
||||
public String getClusterName() {
|
||||
return clusterName;
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,35 +10,35 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.agent.api;
|
||||
|
||||
import com.cloud.resource.ResourceState;
|
||||
|
||||
public class PropagateResourceEventCommand extends Command {
|
||||
long hostId;
|
||||
ResourceState.Event event;
|
||||
|
||||
protected PropagateResourceEventCommand() {
|
||||
|
||||
}
|
||||
|
||||
public PropagateResourceEventCommand(long hostId, ResourceState.Event event) {
|
||||
this.hostId = hostId;
|
||||
this.event = event;
|
||||
}
|
||||
|
||||
public long getHostId() {
|
||||
return hostId;
|
||||
}
|
||||
|
||||
public ResourceState.Event getEvent() {
|
||||
return event;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean executeInSequence() {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
package com.cloud.agent.api;
|
||||
|
||||
import com.cloud.resource.ResourceState;
|
||||
|
||||
public class PropagateResourceEventCommand extends Command {
|
||||
long hostId;
|
||||
ResourceState.Event event;
|
||||
|
||||
protected PropagateResourceEventCommand() {
|
||||
|
||||
}
|
||||
|
||||
public PropagateResourceEventCommand(long hostId, ResourceState.Event event) {
|
||||
this.hostId = hostId;
|
||||
this.event = event;
|
||||
}
|
||||
|
||||
public long getHostId() {
|
||||
return hostId;
|
||||
}
|
||||
|
||||
public ResourceState.Event getEvent() {
|
||||
return event;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean executeInSequence() {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -10,47 +10,47 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
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;
|
||||
}
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,31 +10,31 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.agent.api.proxy;
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,52 +10,52 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.agent.api.proxy;
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,41 +10,41 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.agent.api.storage;
|
||||
|
||||
package com.cloud.agent.api.storage;
|
||||
|
||||
import com.cloud.agent.api.Answer;
|
||||
import com.cloud.agent.api.Command;
|
||||
import com.cloud.storage.Storage.ImageFormat;
|
||||
|
||||
public class CreatePrivateTemplateAnswer extends Answer {
|
||||
|
||||
public class CreatePrivateTemplateAnswer extends Answer {
|
||||
private String _path;
|
||||
private long _virtualSize;
|
||||
private long _physicalSize;
|
||||
private String _uniqueName;
|
||||
private ImageFormat _format;
|
||||
|
||||
public CreatePrivateTemplateAnswer() {}
|
||||
|
||||
private ImageFormat _format;
|
||||
|
||||
public CreatePrivateTemplateAnswer() {}
|
||||
|
||||
public CreatePrivateTemplateAnswer(Command cmd, boolean success, String result, String path, long virtualSize,
|
||||
long physicalSize, String uniqueName, ImageFormat format) {
|
||||
super(cmd, success, result);
|
||||
long physicalSize, String uniqueName, ImageFormat format) {
|
||||
super(cmd, success, result);
|
||||
_path = path;
|
||||
_virtualSize = virtualSize;
|
||||
_physicalSize = physicalSize;
|
||||
_uniqueName = uniqueName;
|
||||
_format = format;
|
||||
}
|
||||
_format = format;
|
||||
}
|
||||
|
||||
public CreatePrivateTemplateAnswer(Command cmd, boolean success, String result) {
|
||||
super(cmd, success, result);
|
||||
}
|
||||
|
||||
public String getPath() {
|
||||
return _path;
|
||||
}
|
||||
|
||||
public void setPath(String path) {
|
||||
_path = path;
|
||||
public String getPath() {
|
||||
return _path;
|
||||
}
|
||||
|
||||
public void setPath(String path) {
|
||||
_path = path;
|
||||
}
|
||||
|
||||
public long getVirtualSize() {
|
||||
@ -69,5 +69,5 @@ public class CreatePrivateTemplateAnswer extends Answer {
|
||||
|
||||
public ImageFormat getImageFormat() {
|
||||
return _format;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,77 +10,77 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.agent.api.storage;
|
||||
|
||||
public class CreatePrivateTemplateCommand extends StorageCommand {
|
||||
private String _snapshotFolder;
|
||||
private String _snapshotPath;
|
||||
private String _userFolder;
|
||||
private String _userSpecifiedName;
|
||||
private String _uniqueName;
|
||||
package com.cloud.agent.api.storage;
|
||||
|
||||
public class CreatePrivateTemplateCommand extends StorageCommand {
|
||||
private String _snapshotFolder;
|
||||
private String _snapshotPath;
|
||||
private String _userFolder;
|
||||
private String _userSpecifiedName;
|
||||
private String _uniqueName;
|
||||
private long _templateId;
|
||||
private long _accountId;
|
||||
|
||||
// For XenServer
|
||||
private String _secondaryStorageURL;
|
||||
private String _snapshotName;
|
||||
|
||||
public CreatePrivateTemplateCommand() {}
|
||||
|
||||
public CreatePrivateTemplateCommand(String secondaryStorageURL, long templateId, long accountId, String userSpecifiedName, String uniqueName, String snapshotFolder, String snapshotPath, String snapshotName, String userFolder) {
|
||||
_secondaryStorageURL = secondaryStorageURL;
|
||||
private long _accountId;
|
||||
|
||||
// For XenServer
|
||||
private String _secondaryStorageURL;
|
||||
private String _snapshotName;
|
||||
|
||||
public CreatePrivateTemplateCommand() {}
|
||||
|
||||
public CreatePrivateTemplateCommand(String secondaryStorageURL, long templateId, long accountId, String userSpecifiedName, String uniqueName, String snapshotFolder, String snapshotPath, String snapshotName, String userFolder) {
|
||||
_secondaryStorageURL = secondaryStorageURL;
|
||||
_templateId = templateId;
|
||||
_accountId = accountId;
|
||||
_userSpecifiedName = userSpecifiedName;
|
||||
_uniqueName = uniqueName;
|
||||
_snapshotFolder = snapshotFolder;
|
||||
_snapshotPath = snapshotPath;
|
||||
_snapshotName = snapshotName;
|
||||
_userFolder = userFolder;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean executeInSequence() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public String getSecondaryStorageURL() {
|
||||
return _secondaryStorageURL;
|
||||
}
|
||||
|
||||
public String getTemplateName() {
|
||||
return _userSpecifiedName;
|
||||
}
|
||||
|
||||
public String getUniqueName() {
|
||||
return _uniqueName;
|
||||
}
|
||||
|
||||
public String getSnapshotFolder() {
|
||||
return _snapshotFolder;
|
||||
}
|
||||
|
||||
public String getSnapshotPath() {
|
||||
return _snapshotPath;
|
||||
}
|
||||
|
||||
public String getSnapshotName() {
|
||||
return _snapshotName;
|
||||
}
|
||||
|
||||
public String getUserFolder() {
|
||||
return _userFolder;
|
||||
}
|
||||
|
||||
public long getTemplateId() {
|
||||
return _templateId;
|
||||
_accountId = accountId;
|
||||
_userSpecifiedName = userSpecifiedName;
|
||||
_uniqueName = uniqueName;
|
||||
_snapshotFolder = snapshotFolder;
|
||||
_snapshotPath = snapshotPath;
|
||||
_snapshotName = snapshotName;
|
||||
_userFolder = userFolder;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean executeInSequence() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public String getSecondaryStorageURL() {
|
||||
return _secondaryStorageURL;
|
||||
}
|
||||
|
||||
public String getTemplateName() {
|
||||
return _userSpecifiedName;
|
||||
}
|
||||
|
||||
public String getUniqueName() {
|
||||
return _uniqueName;
|
||||
}
|
||||
|
||||
public String getSnapshotFolder() {
|
||||
return _snapshotFolder;
|
||||
}
|
||||
|
||||
public String getSnapshotPath() {
|
||||
return _snapshotPath;
|
||||
}
|
||||
|
||||
public String getSnapshotName() {
|
||||
return _snapshotName;
|
||||
}
|
||||
|
||||
public String getUserFolder() {
|
||||
return _userFolder;
|
||||
}
|
||||
|
||||
public long getTemplateId() {
|
||||
return _templateId;
|
||||
}
|
||||
|
||||
public long getAccountId() {
|
||||
return _accountId;
|
||||
}
|
||||
|
||||
public void setTemplateId(long templateId) {
|
||||
_templateId = templateId;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setTemplateId(long templateId) {
|
||||
_templateId = templateId;
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,16 +10,16 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.agent.api.storage;
|
||||
|
||||
package com.cloud.agent.api.storage;
|
||||
|
||||
import com.cloud.agent.api.Answer;
|
||||
import com.cloud.agent.api.Command;
|
||||
|
||||
public class UpgradeDiskAnswer extends Answer {
|
||||
|
||||
public UpgradeDiskAnswer() {}
|
||||
|
||||
public UpgradeDiskAnswer(Command cmd, boolean success, String details) {
|
||||
super(cmd, success, details);
|
||||
}
|
||||
}
|
||||
|
||||
public class UpgradeDiskAnswer extends Answer {
|
||||
|
||||
public UpgradeDiskAnswer() {}
|
||||
|
||||
public UpgradeDiskAnswer(Command cmd, boolean success, String details) {
|
||||
super(cmd, success, details);
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,37 +10,37 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.agent.api.storage;
|
||||
|
||||
|
||||
public class UpgradeDiskCommand extends StorageCommand {
|
||||
|
||||
private String _imagePath;
|
||||
private String _newSize;
|
||||
|
||||
public UpgradeDiskCommand() {}
|
||||
|
||||
public UpgradeDiskCommand(String imagePath, String newSize) {
|
||||
_imagePath = imagePath;
|
||||
_newSize = newSize;
|
||||
}
|
||||
|
||||
public String getImagePath() {
|
||||
return _imagePath;
|
||||
}
|
||||
public void setImagePath(String imagePath) {
|
||||
_imagePath = imagePath;
|
||||
}
|
||||
|
||||
public String getNewSize() {
|
||||
return _newSize;
|
||||
}
|
||||
public void setNewSize(String newSize) {
|
||||
_newSize = newSize;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean executeInSequence() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
package com.cloud.agent.api.storage;
|
||||
|
||||
|
||||
public class UpgradeDiskCommand extends StorageCommand {
|
||||
|
||||
private String _imagePath;
|
||||
private String _newSize;
|
||||
|
||||
public UpgradeDiskCommand() {}
|
||||
|
||||
public UpgradeDiskCommand(String imagePath, String newSize) {
|
||||
_imagePath = imagePath;
|
||||
_newSize = newSize;
|
||||
}
|
||||
|
||||
public String getImagePath() {
|
||||
return _imagePath;
|
||||
}
|
||||
public void setImagePath(String imagePath) {
|
||||
_imagePath = imagePath;
|
||||
}
|
||||
|
||||
public String getNewSize() {
|
||||
return _newSize;
|
||||
}
|
||||
public void setNewSize(String newSize) {
|
||||
_newSize = newSize;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean executeInSequence() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,8 +10,8 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api;
|
||||
|
||||
public interface Identity {
|
||||
String getUuid();
|
||||
}
|
||||
package com.cloud.api;
|
||||
|
||||
public interface Identity {
|
||||
String getUuid();
|
||||
}
|
||||
|
||||
@ -10,16 +10,16 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api;
|
||||
|
||||
import static java.lang.annotation.ElementType.FIELD;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target({ FIELD })
|
||||
public @interface IdentityMapper {
|
||||
String entityTableName();
|
||||
}
|
||||
package com.cloud.api;
|
||||
|
||||
import static java.lang.annotation.ElementType.FIELD;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target({ FIELD })
|
||||
public @interface IdentityMapper {
|
||||
String entityTableName();
|
||||
}
|
||||
|
||||
@ -10,12 +10,12 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api;
|
||||
|
||||
public interface IdentityService {
|
||||
Long getIdentityId(IdentityMapper mapper, String identityString);
|
||||
|
||||
Long getIdentityId(String tableName, String identityString);
|
||||
|
||||
String getIdentityUuid(String tableName, String identityString);
|
||||
}
|
||||
package com.cloud.api;
|
||||
|
||||
public interface IdentityService {
|
||||
Long getIdentityId(IdentityMapper mapper, String identityString);
|
||||
|
||||
Long getIdentityId(String tableName, String identityString);
|
||||
|
||||
String getIdentityUuid(String tableName, String identityString);
|
||||
}
|
||||
|
||||
@ -10,136 +10,136 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.api.ApiConstants;
|
||||
import com.cloud.api.BaseCmd;
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.api.ApiConstants;
|
||||
import com.cloud.api.BaseCmd;
|
||||
import com.cloud.api.IdentityMapper;
|
||||
import com.cloud.api.Implementation;
|
||||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.ClusterResponse;
|
||||
import com.cloud.api.response.ListResponse;
|
||||
import com.cloud.exception.DiscoveryException;
|
||||
import com.cloud.org.Cluster;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
@Implementation(description="Adds a new cluster", responseObject=ClusterResponse.class)
|
||||
public class AddClusterCmd extends BaseCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(AddClusterCmd.class.getName());
|
||||
|
||||
private static final String s_name = "addclusterresponse";
|
||||
|
||||
@Parameter(name=ApiConstants.CLUSTER_NAME, type=CommandType.STRING, required=true, description="the cluster name")
|
||||
private String clusterName;
|
||||
|
||||
@Parameter(name=ApiConstants.PASSWORD, type=CommandType.STRING, required=false, description="the password for the host")
|
||||
private String password;
|
||||
|
||||
import com.cloud.api.Implementation;
|
||||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.ClusterResponse;
|
||||
import com.cloud.api.response.ListResponse;
|
||||
import com.cloud.exception.DiscoveryException;
|
||||
import com.cloud.org.Cluster;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
@Implementation(description="Adds a new cluster", responseObject=ClusterResponse.class)
|
||||
public class AddClusterCmd extends BaseCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(AddClusterCmd.class.getName());
|
||||
|
||||
private static final String s_name = "addclusterresponse";
|
||||
|
||||
@Parameter(name=ApiConstants.CLUSTER_NAME, type=CommandType.STRING, required=true, description="the cluster name")
|
||||
private String clusterName;
|
||||
|
||||
@Parameter(name=ApiConstants.PASSWORD, type=CommandType.STRING, required=false, description="the password for the host")
|
||||
private String password;
|
||||
|
||||
@IdentityMapper(entityTableName="host_pod_ref")
|
||||
@Parameter(name=ApiConstants.POD_ID, type=CommandType.LONG, required=true, description="the Pod ID for the host")
|
||||
private Long podId;
|
||||
|
||||
@Parameter(name=ApiConstants.URL, type=CommandType.STRING, required=false, description="the URL")
|
||||
private String url;
|
||||
|
||||
@Parameter(name=ApiConstants.USERNAME, type=CommandType.STRING, required=false, description="the username for the cluster")
|
||||
private String username;
|
||||
|
||||
@Parameter(name=ApiConstants.POD_ID, type=CommandType.LONG, required=true, description="the Pod ID for the host")
|
||||
private Long podId;
|
||||
|
||||
@Parameter(name=ApiConstants.URL, type=CommandType.STRING, required=false, description="the URL")
|
||||
private String url;
|
||||
|
||||
@Parameter(name=ApiConstants.USERNAME, type=CommandType.STRING, required=false, description="the username for the cluster")
|
||||
private String username;
|
||||
|
||||
@IdentityMapper(entityTableName="data_center")
|
||||
@Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, required=true, description="the Zone ID for the cluster")
|
||||
private Long zoneId;
|
||||
|
||||
@Parameter(name=ApiConstants.HYPERVISOR, type=CommandType.STRING, required=true, description="hypervisor type of the cluster: XenServer,KVM,VMware,Hyperv,BareMetal,Simulator")
|
||||
private String hypervisor;
|
||||
|
||||
@Parameter(name=ApiConstants.CLUSTER_TYPE, type=CommandType.STRING, required=true, description="type of the cluster: CloudManaged, ExternalManaged")
|
||||
private String clusterType;
|
||||
|
||||
@Parameter(name=ApiConstants.ALLOCATION_STATE, type=CommandType.STRING, description="Allocation state of this cluster for allocation of new resources")
|
||||
private String allocationState;
|
||||
|
||||
public String getClusterName() {
|
||||
return clusterName;
|
||||
}
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public Long getPodId() {
|
||||
return podId;
|
||||
}
|
||||
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
|
||||
public Long getZoneId() {
|
||||
return zoneId;
|
||||
}
|
||||
|
||||
public String getHypervisor() {
|
||||
return hypervisor;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
public String getClusterType() {
|
||||
return clusterType;
|
||||
}
|
||||
|
||||
public void setClusterType(String type) {
|
||||
this.clusterType = type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
return Account.ACCOUNT_ID_SYSTEM;
|
||||
}
|
||||
|
||||
public String getAllocationState() {
|
||||
return allocationState;
|
||||
}
|
||||
|
||||
public void setAllocationState(String allocationState) {
|
||||
this.allocationState = allocationState;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(){
|
||||
try {
|
||||
List<? extends Cluster> result = _resourceService.discoverCluster(this);
|
||||
ListResponse<ClusterResponse> response = new ListResponse<ClusterResponse>();
|
||||
List<ClusterResponse> clusterResponses = new ArrayList<ClusterResponse>();
|
||||
if (result != null) {
|
||||
for (Cluster cluster : result) {
|
||||
ClusterResponse clusterResponse = _responseGenerator.createClusterResponse(cluster, false);
|
||||
clusterResponses.add(clusterResponse);
|
||||
}
|
||||
} else {
|
||||
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to add cluster");
|
||||
}
|
||||
|
||||
response.setResponses(clusterResponses);
|
||||
response.setResponseName(getCommandName());
|
||||
|
||||
this.setResponseObject(response);
|
||||
} catch (DiscoveryException ex) {
|
||||
s_logger.warn("Exception: ", ex);
|
||||
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, ex.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
@Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, required=true, description="the Zone ID for the cluster")
|
||||
private Long zoneId;
|
||||
|
||||
@Parameter(name=ApiConstants.HYPERVISOR, type=CommandType.STRING, required=true, description="hypervisor type of the cluster: XenServer,KVM,VMware,Hyperv,BareMetal,Simulator")
|
||||
private String hypervisor;
|
||||
|
||||
@Parameter(name=ApiConstants.CLUSTER_TYPE, type=CommandType.STRING, required=true, description="type of the cluster: CloudManaged, ExternalManaged")
|
||||
private String clusterType;
|
||||
|
||||
@Parameter(name=ApiConstants.ALLOCATION_STATE, type=CommandType.STRING, description="Allocation state of this cluster for allocation of new resources")
|
||||
private String allocationState;
|
||||
|
||||
public String getClusterName() {
|
||||
return clusterName;
|
||||
}
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public Long getPodId() {
|
||||
return podId;
|
||||
}
|
||||
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
|
||||
public Long getZoneId() {
|
||||
return zoneId;
|
||||
}
|
||||
|
||||
public String getHypervisor() {
|
||||
return hypervisor;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
public String getClusterType() {
|
||||
return clusterType;
|
||||
}
|
||||
|
||||
public void setClusterType(String type) {
|
||||
this.clusterType = type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
return Account.ACCOUNT_ID_SYSTEM;
|
||||
}
|
||||
|
||||
public String getAllocationState() {
|
||||
return allocationState;
|
||||
}
|
||||
|
||||
public void setAllocationState(String allocationState) {
|
||||
this.allocationState = allocationState;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(){
|
||||
try {
|
||||
List<? extends Cluster> result = _resourceService.discoverCluster(this);
|
||||
ListResponse<ClusterResponse> response = new ListResponse<ClusterResponse>();
|
||||
List<ClusterResponse> clusterResponses = new ArrayList<ClusterResponse>();
|
||||
if (result != null) {
|
||||
for (Cluster cluster : result) {
|
||||
ClusterResponse clusterResponse = _responseGenerator.createClusterResponse(cluster, false);
|
||||
clusterResponses.add(clusterResponse);
|
||||
}
|
||||
} else {
|
||||
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to add cluster");
|
||||
}
|
||||
|
||||
response.setResponses(clusterResponses);
|
||||
response.setResponseName(getCommandName());
|
||||
|
||||
this.setResponseObject(response);
|
||||
} catch (DiscoveryException ex) {
|
||||
s_logger.warn("Exception: ", ex);
|
||||
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, ex.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -28,7 +28,7 @@ import com.cloud.api.response.ListResponse;
|
||||
import com.cloud.exception.DiscoveryException;
|
||||
import com.cloud.host.Host;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
|
||||
@Implementation(description="Adds a new host.", responseObject=HostResponse.class)
|
||||
public class AddHostCmd extends BaseCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(AddHostCmd.class.getName());
|
||||
|
||||
@ -10,8 +10,8 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.commands;
|
||||
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
@ -26,10 +26,10 @@ import com.cloud.api.response.HostResponse;
|
||||
import com.cloud.exception.DiscoveryException;
|
||||
import com.cloud.host.Host;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
|
||||
@Implementation(description="Adds secondary storage.", responseObject=HostResponse.class)
|
||||
public class AddSecondaryStorageCmd extends BaseCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(AddSecondaryStorageCmd.class.getName());
|
||||
public class AddSecondaryStorageCmd extends BaseCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(AddSecondaryStorageCmd.class.getName());
|
||||
private static final String s_name = "addsecondarystorageresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
@ -89,5 +89,5 @@ public class AddSecondaryStorageCmd extends BaseCmd {
|
||||
s_logger.warn("Exception: ", ex);
|
||||
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, ex.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,8 +10,8 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.commands;
|
||||
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.api.ApiConstants;
|
||||
@ -24,9 +24,9 @@ import com.cloud.api.response.SwiftResponse;
|
||||
import com.cloud.exception.DiscoveryException;
|
||||
import com.cloud.storage.Swift;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
|
||||
@Implementation(description = "Adds Swift.", responseObject = HostResponse.class, since="3.0.0")
|
||||
public class AddSwiftCmd extends BaseCmd {
|
||||
public class AddSwiftCmd extends BaseCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(AddSwiftCmd.class.getName());
|
||||
private static final String s_name = "addswiftresponse";
|
||||
|
||||
@ -98,5 +98,5 @@ public class AddSwiftCmd extends BaseCmd {
|
||||
s_logger.warn(errMsg, ex);
|
||||
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, errMsg);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,8 +10,8 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.commands;
|
||||
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.api.ApiConstants;
|
||||
@ -27,13 +27,13 @@ import com.cloud.event.EventTypes;
|
||||
import com.cloud.network.VpnUser;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.user.UserContext;
|
||||
|
||||
|
||||
@Implementation(description="Adds vpn users", responseObject=VpnUsersResponse.class)
|
||||
public class AddVpnUserCmd extends BaseAsyncCreateCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(AddVpnUserCmd.class.getName());
|
||||
|
||||
private static final String s_name = "addvpnuserresponse";
|
||||
|
||||
public class AddVpnUserCmd extends BaseAsyncCreateCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(AddVpnUserCmd.class.getName());
|
||||
|
||||
private static final String s_name = "addvpnuserresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
@ -84,8 +84,8 @@ public class AddVpnUserCmd extends BaseAsyncCreateCmd {
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -142,5 +142,5 @@ public class AddVpnUserCmd extends BaseAsyncCreateCmd {
|
||||
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to add vpn user");
|
||||
}
|
||||
setEntityId(vpnUser.getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.commands;
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -31,20 +31,20 @@ import com.cloud.user.Account;
|
||||
import com.cloud.user.UserContext;
|
||||
import com.cloud.utils.StringUtils;
|
||||
|
||||
@Implementation(description="Assigns virtual machine or a list of virtual machines to a load balancer rule.", responseObject=SuccessResponse.class)
|
||||
public class AssignToLoadBalancerRuleCmd extends BaseAsyncCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(AssignToLoadBalancerRuleCmd.class.getName());
|
||||
|
||||
@Implementation(description="Assigns virtual machine or a list of virtual machines to a load balancer rule.", responseObject=SuccessResponse.class)
|
||||
public class AssignToLoadBalancerRuleCmd extends BaseAsyncCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(AssignToLoadBalancerRuleCmd.class.getName());
|
||||
|
||||
private static final String s_name = "assigntoloadbalancerruleresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@IdentityMapper(entityTableName="firewall_rules")
|
||||
@Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="the ID of the load balancer rule")
|
||||
private Long id;
|
||||
|
||||
|
||||
@IdentityMapper(entityTableName="vm_instance")
|
||||
@Parameter(name=ApiConstants.VIRTUAL_MACHINE_IDS, type=CommandType.LIST, collectionType=CommandType.LONG, required=true, description="the list of IDs of the virtual machine that are being assigned to the load balancer rule(i.e. virtualMachineIds=1,2,3)")
|
||||
private List<Long> virtualMachineIds;
|
||||
@ -114,4 +114,4 @@ public class AssignToLoadBalancerRuleCmd extends BaseAsyncCmd {
|
||||
}
|
||||
return lb.getNetworkId();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,8 +10,8 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.commands;
|
||||
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
@ -39,10 +39,10 @@ import com.cloud.network.IpAddress;
|
||||
import com.cloud.network.Network;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.user.UserContext;
|
||||
|
||||
|
||||
@Implementation(description="Acquires and associates a public IP to an account.", responseObject=IPAddressResponse.class)
|
||||
public class AssociateIPAddrCmd extends BaseAsyncCreateCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(AssociateIPAddrCmd.class.getName());
|
||||
public class AssociateIPAddrCmd extends BaseAsyncCreateCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(AssociateIPAddrCmd.class.getName());
|
||||
private static final String s_name = "associateipaddressresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
@ -157,12 +157,12 @@ public class AssociateIPAddrCmd extends BaseAsyncCreateCmd {
|
||||
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
public static String getResultObjectName() {
|
||||
return "addressinfo";
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
public static String getResultObjectName() {
|
||||
return "addressinfo";
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -212,5 +212,5 @@ public class AssociateIPAddrCmd extends BaseAsyncCreateCmd {
|
||||
public AsyncJob.Type getInstanceType() {
|
||||
return AsyncJob.Type.IpAddress;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -10,8 +10,8 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.commands;
|
||||
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.api.ApiConstants;
|
||||
@ -27,12 +27,12 @@ import com.cloud.event.EventTypes;
|
||||
import com.cloud.host.Host;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.user.UserContext;
|
||||
|
||||
|
||||
@Implementation(description="Cancels host maintenance.", responseObject=HostResponse.class)
|
||||
public class CancelMaintenanceCmd extends BaseAsyncCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(CancelMaintenanceCmd.class.getName());
|
||||
|
||||
private static final String s_name = "cancelhostmaintenanceresponse";
|
||||
public class CancelMaintenanceCmd extends BaseAsyncCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(CancelMaintenanceCmd.class.getName());
|
||||
|
||||
private static final String s_name = "cancelhostmaintenanceresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
@ -57,10 +57,10 @@ public class CancelMaintenanceCmd extends BaseAsyncCmd {
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
public static String getResultObjectName() {
|
||||
return "host";
|
||||
}
|
||||
@ -106,4 +106,4 @@ public class CancelMaintenanceCmd extends BaseAsyncCmd {
|
||||
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to cancel host maintenance");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,8 +10,8 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.commands;
|
||||
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
|
||||
@ -29,7 +29,7 @@ import com.cloud.user.Account;
|
||||
import com.cloud.user.UserAccount;
|
||||
import com.cloud.user.UserContext;
|
||||
|
||||
@Implementation(description="Creates an account", responseObject=UserResponse.class)
|
||||
@Implementation(description="Creates an account", responseObject=UserResponse.class)
|
||||
public class CreateAccountCmd extends BaseCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(CreateAccountCmd.class.getName());
|
||||
|
||||
|
||||
@ -10,8 +10,8 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.commands;
|
||||
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.api.ApiConstants;
|
||||
@ -24,12 +24,12 @@ import com.cloud.api.response.DiskOfferingResponse;
|
||||
import com.cloud.offering.DiskOffering;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
@Implementation(description="Creates a disk offering.", responseObject=DiskOfferingResponse.class)
|
||||
public class CreateDiskOfferingCmd extends BaseCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(CreateDiskOfferingCmd.class.getName());
|
||||
|
||||
private static final String s_name = "creatediskofferingresponse";
|
||||
|
||||
@Implementation(description="Creates a disk offering.", responseObject=DiskOfferingResponse.class)
|
||||
public class CreateDiskOfferingCmd extends BaseCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(CreateDiskOfferingCmd.class.getName());
|
||||
|
||||
private static final String s_name = "creatediskofferingresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
@ -85,8 +85,8 @@ public class CreateDiskOfferingCmd extends BaseCmd {
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -105,4 +105,4 @@ public class CreateDiskOfferingCmd extends BaseCmd {
|
||||
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to create disk offering");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.commands;
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
@ -24,13 +24,13 @@ import com.cloud.api.response.DomainResponse;
|
||||
import com.cloud.domain.Domain;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.user.UserContext;
|
||||
|
||||
|
||||
@Implementation(description="Creates a domain", responseObject=DomainResponse.class)
|
||||
public class CreateDomainCmd extends BaseCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(CreateDomainCmd.class.getName());
|
||||
|
||||
private static final String s_name = "createdomainresponse";
|
||||
|
||||
public class CreateDomainCmd extends BaseCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(CreateDomainCmd.class.getName());
|
||||
|
||||
private static final String s_name = "createdomainresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
@ -65,9 +65,9 @@ public class CreateDomainCmd extends BaseCmd {
|
||||
/////////////// API Implementation///////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -87,4 +87,4 @@ public class CreateDomainCmd extends BaseCmd {
|
||||
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to create domain");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,8 +10,8 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.commands;
|
||||
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.api.ApiConstants;
|
||||
@ -29,13 +29,13 @@ import com.cloud.exception.NetworkRuleConflictException;
|
||||
import com.cloud.exception.ResourceUnavailableException;
|
||||
import com.cloud.network.IpAddress;
|
||||
import com.cloud.network.RemoteAccessVpn;
|
||||
|
||||
|
||||
@Implementation(description="Creates a l2tp/ipsec remote access vpn", responseObject=RemoteAccessVpnResponse.class)
|
||||
public class CreateRemoteAccessVpnCmd extends BaseAsyncCreateCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(CreateRemoteAccessVpnCmd.class.getName());
|
||||
|
||||
private static final String s_name = "createremoteaccessvpnresponse";
|
||||
|
||||
public class CreateRemoteAccessVpnCmd extends BaseAsyncCreateCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(CreateRemoteAccessVpnCmd.class.getName());
|
||||
|
||||
private static final String s_name = "createremoteaccessvpnresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
@ -100,8 +100,8 @@ public class CreateRemoteAccessVpnCmd extends BaseAsyncCreateCmd {
|
||||
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -175,5 +175,5 @@ public class CreateRemoteAccessVpnCmd extends BaseAsyncCreateCmd {
|
||||
throw new InvalidParameterValueException("Unable to find ip address by id " + publicIpId);
|
||||
}
|
||||
return ip;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,8 +10,8 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.commands;
|
||||
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.api.ApiConstants;
|
||||
@ -24,10 +24,10 @@ import com.cloud.api.response.ServiceOfferingResponse;
|
||||
import com.cloud.offering.ServiceOffering;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
@Implementation(description="Creates a service offering.", responseObject=ServiceOfferingResponse.class)
|
||||
public class CreateServiceOfferingCmd extends BaseCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(CreateServiceOfferingCmd.class.getName());
|
||||
private static final String _name = "createserviceofferingresponse";
|
||||
@Implementation(description="Creates a service offering.", responseObject=ServiceOfferingResponse.class)
|
||||
public class CreateServiceOfferingCmd extends BaseCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(CreateServiceOfferingCmd.class.getName());
|
||||
private static final String _name = "createserviceofferingresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
@ -141,14 +141,14 @@ public class CreateServiceOfferingCmd extends BaseCmd {
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return _name;
|
||||
public String getCommandName() {
|
||||
return _name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
return Account.ACCOUNT_ID_SYSTEM;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(){
|
||||
@ -160,5 +160,5 @@ public class CreateServiceOfferingCmd extends BaseCmd {
|
||||
} else {
|
||||
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to create service offering");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,8 +10,8 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.commands;
|
||||
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.api.ApiConstants;
|
||||
@ -28,12 +28,12 @@ import com.cloud.storage.Volume;
|
||||
import com.cloud.storage.snapshot.SnapshotPolicy;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
@Implementation(description="Creates a snapshot policy for the account.", responseObject=SnapshotPolicyResponse.class)
|
||||
public class CreateSnapshotPolicyCmd extends BaseCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(CreateSnapshotPolicyCmd.class.getName());
|
||||
|
||||
private static final String s_name = "createsnapshotpolicyresponse";
|
||||
|
||||
@Implementation(description="Creates a snapshot policy for the account.", responseObject=SnapshotPolicyResponse.class)
|
||||
public class CreateSnapshotPolicyCmd extends BaseCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(CreateSnapshotPolicyCmd.class.getName());
|
||||
|
||||
private static final String s_name = "createsnapshotpolicyresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
@ -90,8 +90,8 @@ public class CreateSnapshotPolicyCmd extends BaseCmd {
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -127,5 +127,5 @@ public class CreateSnapshotPolicyCmd extends BaseCmd {
|
||||
} else {
|
||||
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to create snapshot policy");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,114 +10,114 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.api.ApiConstants;
|
||||
import com.cloud.api.BaseAsyncCmd;
|
||||
import com.cloud.api.BaseCmd;
|
||||
import com.cloud.api.IdentityMapper;
|
||||
import com.cloud.api.Implementation;
|
||||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.StorageNetworkIpRangeResponse;
|
||||
import com.cloud.dc.StorageNetworkIpRange;
|
||||
import com.cloud.event.EventTypes;
|
||||
import com.cloud.exception.ConcurrentOperationException;
|
||||
import com.cloud.exception.InsufficientCapacityException;
|
||||
import com.cloud.exception.ResourceAllocationException;
|
||||
import com.cloud.exception.ResourceUnavailableException;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
@Implementation(description="Creates a Storage network IP range.", responseObject=StorageNetworkIpRangeResponse.class, since="3.0.0")
|
||||
public class CreateStorageNetworkIpRangeCmd extends BaseAsyncCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(CreateStorageNetworkIpRangeCmd.class);
|
||||
|
||||
private static final String s_name = "createstoragenetworkiprangeresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
@IdentityMapper(entityTableName="host_pod_ref")
|
||||
@Parameter(name=ApiConstants.POD_ID, type=CommandType.LONG, required=true, description="UUID of pod where the ip range belongs to")
|
||||
private Long podId;
|
||||
|
||||
@Parameter(name=ApiConstants.START_IP, type=CommandType.STRING, required=true, description="the beginning IP address")
|
||||
private String startIp;
|
||||
|
||||
@Parameter(name=ApiConstants.END_IP, type=CommandType.STRING, description="the ending IP address")
|
||||
private String endIp;
|
||||
|
||||
@Parameter(name = ApiConstants.VLAN, type = CommandType.INTEGER, description = "Optional. The vlan the ip range sits on, default to Null when it is not specificed which means you network is not on any Vlan. This is mainly for Vmware as other hypervisors can directly reterive bridge from pyhsical network traffic type table")
|
||||
private Integer vlan;
|
||||
|
||||
@Parameter(name=ApiConstants.NETMASK, type=CommandType.STRING, required=true, description="the netmask for storage network")
|
||||
private String netmask;
|
||||
|
||||
@Parameter(name=ApiConstants.GATEWAY, type=CommandType.STRING, required=true, description="the gateway for storage network")
|
||||
private String gateway;
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////////// Accessors ///////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
public String getEndIp() {
|
||||
return endIp;
|
||||
}
|
||||
|
||||
public Long getPodId() {
|
||||
return podId;
|
||||
}
|
||||
|
||||
public String getStartIp() {
|
||||
return startIp;
|
||||
}
|
||||
|
||||
public Integer getVlan() {
|
||||
return vlan;
|
||||
}
|
||||
|
||||
public String getNetmask() {
|
||||
return netmask;
|
||||
}
|
||||
|
||||
public String getGateWay() {
|
||||
return gateway;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType() {
|
||||
return EventTypes.EVENT_STORAGE_IP_RANGE_CREATE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventDescription() {
|
||||
return "Creating storage ip range from " + getStartIp() + " to " + getEndIp() + " with vlan " + getVlan();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException,
|
||||
ResourceAllocationException {
|
||||
try {
|
||||
StorageNetworkIpRange result = _storageNetworkService.createIpRange(this);
|
||||
StorageNetworkIpRangeResponse response = _responseGenerator.createStorageNetworkIpRangeResponse(result);
|
||||
response.setResponseName(getCommandName());
|
||||
this.setResponseObject(response);
|
||||
} catch (Exception e) {
|
||||
s_logger.warn("Create storage network IP range failed", e);
|
||||
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
return Account.ACCOUNT_ID_SYSTEM;
|
||||
}
|
||||
|
||||
}
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.api.ApiConstants;
|
||||
import com.cloud.api.BaseAsyncCmd;
|
||||
import com.cloud.api.BaseCmd;
|
||||
import com.cloud.api.IdentityMapper;
|
||||
import com.cloud.api.Implementation;
|
||||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.StorageNetworkIpRangeResponse;
|
||||
import com.cloud.dc.StorageNetworkIpRange;
|
||||
import com.cloud.event.EventTypes;
|
||||
import com.cloud.exception.ConcurrentOperationException;
|
||||
import com.cloud.exception.InsufficientCapacityException;
|
||||
import com.cloud.exception.ResourceAllocationException;
|
||||
import com.cloud.exception.ResourceUnavailableException;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
@Implementation(description="Creates a Storage network IP range.", responseObject=StorageNetworkIpRangeResponse.class, since="3.0.0")
|
||||
public class CreateStorageNetworkIpRangeCmd extends BaseAsyncCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(CreateStorageNetworkIpRangeCmd.class);
|
||||
|
||||
private static final String s_name = "createstoragenetworkiprangeresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
@IdentityMapper(entityTableName="host_pod_ref")
|
||||
@Parameter(name=ApiConstants.POD_ID, type=CommandType.LONG, required=true, description="UUID of pod where the ip range belongs to")
|
||||
private Long podId;
|
||||
|
||||
@Parameter(name=ApiConstants.START_IP, type=CommandType.STRING, required=true, description="the beginning IP address")
|
||||
private String startIp;
|
||||
|
||||
@Parameter(name=ApiConstants.END_IP, type=CommandType.STRING, description="the ending IP address")
|
||||
private String endIp;
|
||||
|
||||
@Parameter(name = ApiConstants.VLAN, type = CommandType.INTEGER, description = "Optional. The vlan the ip range sits on, default to Null when it is not specificed which means you network is not on any Vlan. This is mainly for Vmware as other hypervisors can directly reterive bridge from pyhsical network traffic type table")
|
||||
private Integer vlan;
|
||||
|
||||
@Parameter(name=ApiConstants.NETMASK, type=CommandType.STRING, required=true, description="the netmask for storage network")
|
||||
private String netmask;
|
||||
|
||||
@Parameter(name=ApiConstants.GATEWAY, type=CommandType.STRING, required=true, description="the gateway for storage network")
|
||||
private String gateway;
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////////// Accessors ///////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
public String getEndIp() {
|
||||
return endIp;
|
||||
}
|
||||
|
||||
public Long getPodId() {
|
||||
return podId;
|
||||
}
|
||||
|
||||
public String getStartIp() {
|
||||
return startIp;
|
||||
}
|
||||
|
||||
public Integer getVlan() {
|
||||
return vlan;
|
||||
}
|
||||
|
||||
public String getNetmask() {
|
||||
return netmask;
|
||||
}
|
||||
|
||||
public String getGateWay() {
|
||||
return gateway;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType() {
|
||||
return EventTypes.EVENT_STORAGE_IP_RANGE_CREATE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventDescription() {
|
||||
return "Creating storage ip range from " + getStartIp() + " to " + getEndIp() + " with vlan " + getVlan();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException,
|
||||
ResourceAllocationException {
|
||||
try {
|
||||
StorageNetworkIpRange result = _storageNetworkService.createIpRange(this);
|
||||
StorageNetworkIpRangeResponse response = _responseGenerator.createStorageNetworkIpRangeResponse(result);
|
||||
response.setResponseName(getCommandName());
|
||||
this.setResponseObject(response);
|
||||
} catch (Exception e) {
|
||||
s_logger.warn("Create storage network IP range failed", e);
|
||||
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
return Account.ACCOUNT_ID_SYSTEM;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -10,8 +10,8 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.commands;
|
||||
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import java.net.UnknownHostException;
|
||||
import java.util.Map;
|
||||
|
||||
@ -30,12 +30,12 @@ import com.cloud.storage.StoragePool;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
@Implementation(description="Creates a storage pool.", responseObject=StoragePoolResponse.class)
|
||||
public class CreateStoragePoolCmd extends BaseCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(CreateStoragePoolCmd.class.getName());
|
||||
|
||||
private static final String s_name = "createstoragepoolresponse";
|
||||
|
||||
@Implementation(description="Creates a storage pool.", responseObject=StoragePoolResponse.class)
|
||||
public class CreateStoragePoolCmd extends BaseCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(CreateStoragePoolCmd.class.getName());
|
||||
|
||||
private static final String s_name = "createstoragepoolresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
@ -100,9 +100,9 @@ public class CreateStoragePoolCmd extends BaseCmd {
|
||||
/////////////// API Implementation///////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -131,5 +131,5 @@ public class CreateStoragePoolCmd extends BaseCmd {
|
||||
s_logger.warn("Exception: ", ex3);
|
||||
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, ex3.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,8 +10,8 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.commands;
|
||||
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.api.ApiConstants;
|
||||
@ -28,12 +28,12 @@ import com.cloud.exception.ResourceAllocationException;
|
||||
import com.cloud.exception.ResourceUnavailableException;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
@Implementation(description="Creates a VLAN IP range.", responseObject=VlanIpRangeResponse.class)
|
||||
public class CreateVlanIpRangeCmd extends BaseCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(CreateVlanIpRangeCmd.class.getName());
|
||||
|
||||
private static final String s_name = "createvlaniprangeresponse";
|
||||
|
||||
@Implementation(description="Creates a VLAN IP range.", responseObject=VlanIpRangeResponse.class)
|
||||
public class CreateVlanIpRangeCmd extends BaseCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(CreateVlanIpRangeCmd.class.getName());
|
||||
|
||||
private static final String s_name = "createvlaniprangeresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
@ -145,8 +145,8 @@ public class CreateVlanIpRangeCmd extends BaseCmd {
|
||||
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -172,5 +172,5 @@ public class CreateVlanIpRangeCmd extends BaseCmd {
|
||||
s_logger.info(ex);
|
||||
throw new ServerApiException(BaseCmd.INSUFFICIENT_CAPACITY_ERROR, ex.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,8 +10,8 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.commands;
|
||||
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.api.ApiConstants;
|
||||
@ -28,11 +28,11 @@ import com.cloud.user.Account;
|
||||
import com.cloud.user.User;
|
||||
import com.cloud.user.UserContext;
|
||||
|
||||
@Implementation(description="Deletes a account, and all users associated with this account", responseObject=SuccessResponse.class)
|
||||
public class DeleteAccountCmd extends BaseAsyncCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(DeleteAccountCmd.class.getName());
|
||||
private static final String s_name = "deleteaccountresponse";
|
||||
|
||||
@Implementation(description="Deletes a account, and all users associated with this account", responseObject=SuccessResponse.class)
|
||||
public class DeleteAccountCmd extends BaseAsyncCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(DeleteAccountCmd.class.getName());
|
||||
private static final String s_name = "deleteaccountresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
@ -56,14 +56,14 @@ public class DeleteAccountCmd extends BaseAsyncCmd {
|
||||
/////////////// API Implementation///////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
public static String getStaticName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
public static String getStaticName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
@ -102,4 +102,4 @@ public class DeleteAccountCmd extends BaseAsyncCmd {
|
||||
public AsyncJob.Type getInstanceType() {
|
||||
return AsyncJob.Type.Account;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,66 +10,66 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.api.ApiConstants;
|
||||
import com.cloud.api.BaseCmd;
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.api.ApiConstants;
|
||||
import com.cloud.api.BaseCmd;
|
||||
import com.cloud.api.IdentityMapper;
|
||||
import com.cloud.api.Implementation;
|
||||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.SuccessResponse;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
|
||||
@Implementation(description="Deletes a cluster.", responseObject=SuccessResponse.class)
|
||||
public class DeleteClusterCmd extends BaseCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(DeleteClusterCmd.class.getName());
|
||||
|
||||
private static final String s_name = "deleteclusterresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
import com.cloud.api.Implementation;
|
||||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.SuccessResponse;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
|
||||
@Implementation(description="Deletes a cluster.", responseObject=SuccessResponse.class)
|
||||
public class DeleteClusterCmd extends BaseCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(DeleteClusterCmd.class.getName());
|
||||
|
||||
private static final String s_name = "deleteclusterresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@IdentityMapper(entityTableName="cluster")
|
||||
@Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="the cluster ID")
|
||||
private Long id;
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////////// Accessors ///////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////// API Implementation///////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
return Account.ACCOUNT_ID_SYSTEM;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(){
|
||||
boolean result = _resourceService.deleteCluster(this);
|
||||
if (result) {
|
||||
SuccessResponse response = new SuccessResponse(getCommandName());
|
||||
this.setResponseObject(response);
|
||||
} else {
|
||||
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to delete cluster");
|
||||
}
|
||||
}
|
||||
}
|
||||
@Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="the cluster ID")
|
||||
private Long id;
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////////// Accessors ///////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////// API Implementation///////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
return Account.ACCOUNT_ID_SYSTEM;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(){
|
||||
boolean result = _resourceService.deleteCluster(this);
|
||||
if (result) {
|
||||
SuccessResponse response = new SuccessResponse(getCommandName());
|
||||
this.setResponseObject(response);
|
||||
} else {
|
||||
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to delete cluster");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -23,11 +23,11 @@ import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.SuccessResponse;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
@Implementation(description="Updates a disk offering.", responseObject=SuccessResponse.class)
|
||||
public class DeleteDiskOfferingCmd extends BaseCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(DeleteDiskOfferingCmd.class.getName());
|
||||
private static final String s_name = "deletediskofferingresponse";
|
||||
|
||||
@Implementation(description="Updates a disk offering.", responseObject=SuccessResponse.class)
|
||||
public class DeleteDiskOfferingCmd extends BaseCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(DeleteDiskOfferingCmd.class.getName());
|
||||
private static final String s_name = "deletediskofferingresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
@ -50,8 +50,8 @@ public class DeleteDiskOfferingCmd extends BaseCmd {
|
||||
/////////////// API Implementation///////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -68,5 +68,5 @@ public class DeleteDiskOfferingCmd extends BaseCmd {
|
||||
} else {
|
||||
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to delete disk offering");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,8 +10,8 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.commands;
|
||||
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.api.ApiConstants;
|
||||
@ -27,11 +27,11 @@ import com.cloud.event.EventTypes;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.user.UserContext;
|
||||
|
||||
@Implementation(description="Deletes a specified domain", responseObject=SuccessResponse.class)
|
||||
public class DeleteDomainCmd extends BaseAsyncCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(DeleteDomainCmd.class.getName());
|
||||
private static final String s_name = "deletedomainresponse";
|
||||
|
||||
@Implementation(description="Deletes a specified domain", responseObject=SuccessResponse.class)
|
||||
public class DeleteDomainCmd extends BaseAsyncCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(DeleteDomainCmd.class.getName());
|
||||
private static final String s_name = "deletedomainresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
@ -60,11 +60,11 @@ public class DeleteDomainCmd extends BaseAsyncCmd {
|
||||
/////////////// API Implementation///////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
Domain domain = _entityMgr.findById(Domain.class, getId());
|
||||
@ -95,5 +95,5 @@ public class DeleteDomainCmd extends BaseAsyncCmd {
|
||||
} else {
|
||||
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to delete domain");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,8 +10,8 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.commands;
|
||||
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.api.ApiConstants;
|
||||
@ -28,11 +28,11 @@ import com.cloud.template.VirtualMachineTemplate;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.user.UserContext;
|
||||
|
||||
@Implementation(description="Deletes an ISO file.", responseObject=SuccessResponse.class)
|
||||
public class DeleteIsoCmd extends BaseAsyncCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(DeleteIsoCmd.class.getName());
|
||||
private static final String s_name = "deleteisosresponse";
|
||||
|
||||
@Implementation(description="Deletes an ISO file.", responseObject=SuccessResponse.class)
|
||||
public class DeleteIsoCmd extends BaseAsyncCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(DeleteIsoCmd.class.getName());
|
||||
private static final String s_name = "deleteisosresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
@ -62,13 +62,13 @@ public class DeleteIsoCmd extends BaseAsyncCmd {
|
||||
/////////////// API Implementation///////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
public static String getStaticName() {
|
||||
return s_name;
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
public static String getStaticName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -109,5 +109,5 @@ public class DeleteIsoCmd extends BaseAsyncCmd {
|
||||
} else {
|
||||
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to delete iso");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,8 +10,8 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.commands;
|
||||
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.api.ApiConstants;
|
||||
@ -109,4 +109,4 @@ public class DeleteLBStickinessPolicyCmd extends BaseAsyncCmd {
|
||||
}
|
||||
return lb.getNetworkId();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,8 +10,8 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.commands;
|
||||
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.api.ApiConstants;
|
||||
@ -29,10 +29,10 @@ import com.cloud.network.rules.LoadBalancer;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.user.UserContext;
|
||||
|
||||
@Implementation(description="Deletes a load balancer rule.", responseObject=SuccessResponse.class)
|
||||
public class DeleteLoadBalancerRuleCmd extends BaseAsyncCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(DeleteLoadBalancerRuleCmd.class.getName());
|
||||
private static final String s_name = "deleteloadbalancerruleresponse";
|
||||
@Implementation(description="Deletes a load balancer rule.", responseObject=SuccessResponse.class)
|
||||
public class DeleteLoadBalancerRuleCmd extends BaseAsyncCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(DeleteLoadBalancerRuleCmd.class.getName());
|
||||
private static final String s_name = "deleteloadbalancerruleresponse";
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
@ -55,8 +55,8 @@ public class DeleteLoadBalancerRuleCmd extends BaseAsyncCmd {
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -111,4 +111,4 @@ public class DeleteLoadBalancerRuleCmd extends BaseAsyncCmd {
|
||||
public AsyncJob.Type getInstanceType() {
|
||||
return AsyncJob.Type.FirewallRule;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,8 +10,8 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.commands;
|
||||
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.api.ApiConstants;
|
||||
@ -28,11 +28,11 @@ import com.cloud.exception.InvalidParameterValueException;
|
||||
import com.cloud.network.rules.PortForwardingRule;
|
||||
import com.cloud.user.UserContext;
|
||||
|
||||
@Implementation(description="Deletes a port forwarding rule", responseObject=SuccessResponse.class)
|
||||
public class DeletePortForwardingRuleCmd extends BaseAsyncCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(DeletePortForwardingRuleCmd.class.getName());
|
||||
private static final String s_name = "deleteportforwardingruleresponse";
|
||||
|
||||
@Implementation(description="Deletes a port forwarding rule", responseObject=SuccessResponse.class)
|
||||
public class DeletePortForwardingRuleCmd extends BaseAsyncCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(DeletePortForwardingRuleCmd.class.getName());
|
||||
private static final String s_name = "deleteportforwardingruleresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
@ -57,8 +57,8 @@ public class DeletePortForwardingRuleCmd extends BaseAsyncCmd {
|
||||
/////////////// API Implementation///////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -115,4 +115,4 @@ public class DeletePortForwardingRuleCmd extends BaseAsyncCmd {
|
||||
public AsyncJob.Type getInstanceType() {
|
||||
return AsyncJob.Type.FirewallRule;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,8 +10,8 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.commands;
|
||||
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.api.ApiConstants;
|
||||
@ -24,13 +24,13 @@ import com.cloud.event.EventTypes;
|
||||
import com.cloud.exception.InvalidParameterValueException;
|
||||
import com.cloud.exception.ResourceUnavailableException;
|
||||
import com.cloud.network.RemoteAccessVpn;
|
||||
|
||||
|
||||
@Implementation(description="Destroys a l2tp/ipsec remote access vpn", responseObject=SuccessResponse.class)
|
||||
public class DeleteRemoteAccessVpnCmd extends BaseAsyncCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(DeleteRemoteAccessVpnCmd.class.getName());
|
||||
|
||||
private static final String s_name = "deleteremoteaccessvpnresponse";
|
||||
|
||||
public class DeleteRemoteAccessVpnCmd extends BaseAsyncCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(DeleteRemoteAccessVpnCmd.class.getName());
|
||||
|
||||
private static final String s_name = "deleteremoteaccessvpnresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
@ -51,8 +51,8 @@ public class DeleteRemoteAccessVpnCmd extends BaseAsyncCmd {
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -91,5 +91,5 @@ public class DeleteRemoteAccessVpnCmd extends BaseAsyncCmd {
|
||||
public Long getSyncObjId() {
|
||||
return _ravService.getRemoteAccessVpn(publicIpId).getNetworkId();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -10,118 +10,118 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.api.ApiConstants;
|
||||
import com.cloud.api.BaseCmd;
|
||||
import com.cloud.api.IdentityMapper;
|
||||
import com.cloud.api.Implementation;
|
||||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.SuccessResponse;
|
||||
import com.cloud.exception.InvalidParameterValueException;
|
||||
import com.cloud.exception.ResourceInUseException;
|
||||
import com.cloud.user.UserContext;
|
||||
|
||||
@Implementation(description="Deletes security group", responseObject=SuccessResponse.class)
|
||||
public class DeleteSecurityGroupCmd extends BaseCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(DeleteSecurityGroupCmd.class.getName());
|
||||
private static final String s_name = "deletesecuritygroupresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, description="the account of the security group. Must be specified with domain ID")
|
||||
private String accountName;
|
||||
|
||||
@IdentityMapper(entityTableName="domain")
|
||||
@Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, description="the domain ID of account owning the security group")
|
||||
private Long domainId;
|
||||
|
||||
@IdentityMapper(entityTableName="projects")
|
||||
@Parameter(name=ApiConstants.PROJECT_ID, type=CommandType.LONG, description="the project of the security group")
|
||||
private Long projectId;
|
||||
|
||||
@IdentityMapper(entityTableName="security_group")
|
||||
@Parameter(name=ApiConstants.ID, type=CommandType.LONG, description="The ID of the security group. Mutually exclusive with name parameter")
|
||||
private Long id;
|
||||
|
||||
@Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="The ID of the security group. Mutually exclusive with id parameter")
|
||||
private String name;
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////////// Accessors ///////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
public String getAccountName() {
|
||||
return accountName;
|
||||
}
|
||||
|
||||
public Long getDomainId() {
|
||||
return domainId;
|
||||
}
|
||||
|
||||
public Long getProjectId() {
|
||||
return projectId;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
if (id != null && name != null) {
|
||||
throw new InvalidParameterValueException("name and id parameters are mutually exclusive");
|
||||
}
|
||||
|
||||
if (name != null) {
|
||||
id = _responseGenerator.getSecurityGroupId(name, getEntityOwnerId());
|
||||
if (id == null) {
|
||||
throw new InvalidParameterValueException("Unable to find security group by name " + name + " for the account id=" + getEntityOwnerId());
|
||||
}
|
||||
}
|
||||
|
||||
if (id == null) {
|
||||
throw new InvalidParameterValueException("Either id or name parameter is requred by deleteSecurityGroup command");
|
||||
}
|
||||
|
||||
return id;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////// API Implementation///////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
Long accountId = finalyzeAccountId(accountName, domainId, projectId, true);
|
||||
if (accountId == null) {
|
||||
return UserContext.current().getCaller().getId();
|
||||
}
|
||||
|
||||
return accountId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(){
|
||||
try{
|
||||
boolean result = _securityGroupService.deleteSecurityGroup(this);
|
||||
if (result) {
|
||||
SuccessResponse response = new SuccessResponse(getCommandName());
|
||||
this.setResponseObject(response);
|
||||
} else {
|
||||
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to delete security group");
|
||||
}
|
||||
} catch (ResourceInUseException ex) {
|
||||
s_logger.warn("Exception: ", ex);
|
||||
throw new ServerApiException(BaseCmd.RESOURCE_IN_USE_ERROR, ex.getMessage());
|
||||
}
|
||||
}
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.api.ApiConstants;
|
||||
import com.cloud.api.BaseCmd;
|
||||
import com.cloud.api.IdentityMapper;
|
||||
import com.cloud.api.Implementation;
|
||||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.SuccessResponse;
|
||||
import com.cloud.exception.InvalidParameterValueException;
|
||||
import com.cloud.exception.ResourceInUseException;
|
||||
import com.cloud.user.UserContext;
|
||||
|
||||
@Implementation(description="Deletes security group", responseObject=SuccessResponse.class)
|
||||
public class DeleteSecurityGroupCmd extends BaseCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(DeleteSecurityGroupCmd.class.getName());
|
||||
private static final String s_name = "deletesecuritygroupresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, description="the account of the security group. Must be specified with domain ID")
|
||||
private String accountName;
|
||||
|
||||
@IdentityMapper(entityTableName="domain")
|
||||
@Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, description="the domain ID of account owning the security group")
|
||||
private Long domainId;
|
||||
|
||||
@IdentityMapper(entityTableName="projects")
|
||||
@Parameter(name=ApiConstants.PROJECT_ID, type=CommandType.LONG, description="the project of the security group")
|
||||
private Long projectId;
|
||||
|
||||
@IdentityMapper(entityTableName="security_group")
|
||||
@Parameter(name=ApiConstants.ID, type=CommandType.LONG, description="The ID of the security group. Mutually exclusive with name parameter")
|
||||
private Long id;
|
||||
|
||||
@Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="The ID of the security group. Mutually exclusive with id parameter")
|
||||
private String name;
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////////// Accessors ///////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
public String getAccountName() {
|
||||
return accountName;
|
||||
}
|
||||
|
||||
public Long getDomainId() {
|
||||
return domainId;
|
||||
}
|
||||
|
||||
public Long getProjectId() {
|
||||
return projectId;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
if (id != null && name != null) {
|
||||
throw new InvalidParameterValueException("name and id parameters are mutually exclusive");
|
||||
}
|
||||
|
||||
if (name != null) {
|
||||
id = _responseGenerator.getSecurityGroupId(name, getEntityOwnerId());
|
||||
if (id == null) {
|
||||
throw new InvalidParameterValueException("Unable to find security group by name " + name + " for the account id=" + getEntityOwnerId());
|
||||
}
|
||||
}
|
||||
|
||||
if (id == null) {
|
||||
throw new InvalidParameterValueException("Either id or name parameter is requred by deleteSecurityGroup command");
|
||||
}
|
||||
|
||||
return id;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////// API Implementation///////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
Long accountId = finalyzeAccountId(accountName, domainId, projectId, true);
|
||||
if (accountId == null) {
|
||||
return UserContext.current().getCaller().getId();
|
||||
}
|
||||
|
||||
return accountId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(){
|
||||
try{
|
||||
boolean result = _securityGroupService.deleteSecurityGroup(this);
|
||||
if (result) {
|
||||
SuccessResponse response = new SuccessResponse(getCommandName());
|
||||
this.setResponseObject(response);
|
||||
} else {
|
||||
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to delete security group");
|
||||
}
|
||||
} catch (ResourceInUseException ex) {
|
||||
s_logger.warn("Exception: ", ex);
|
||||
throw new ServerApiException(BaseCmd.RESOURCE_IN_USE_ERROR, ex.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,8 +10,8 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.commands;
|
||||
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.api.ApiConstants;
|
||||
@ -23,11 +23,11 @@ import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.SuccessResponse;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
@Implementation(description="Deletes a service offering.", responseObject=SuccessResponse.class)
|
||||
public class DeleteServiceOfferingCmd extends BaseCmd{
|
||||
public static final Logger s_logger = Logger.getLogger(DeleteServiceOfferingCmd.class.getName());
|
||||
private static final String s_name = "deleteserviceofferingresponse";
|
||||
|
||||
@Implementation(description="Deletes a service offering.", responseObject=SuccessResponse.class)
|
||||
public class DeleteServiceOfferingCmd extends BaseCmd{
|
||||
public static final Logger s_logger = Logger.getLogger(DeleteServiceOfferingCmd.class.getName());
|
||||
private static final String s_name = "deleteserviceofferingresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
@ -50,9 +50,9 @@ public class DeleteServiceOfferingCmd extends BaseCmd{
|
||||
/////////////// API Implementation///////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -70,4 +70,4 @@ public class DeleteServiceOfferingCmd extends BaseCmd{
|
||||
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to delete service offering");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,8 +10,8 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.commands;
|
||||
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.api.ApiConstants;
|
||||
@ -28,11 +28,11 @@ import com.cloud.storage.Snapshot;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.user.UserContext;
|
||||
|
||||
@Implementation(description="Deletes a snapshot of a disk volume.", responseObject=SuccessResponse.class)
|
||||
public class DeleteSnapshotCmd extends BaseAsyncCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(DeleteSnapshotCmd.class.getName());
|
||||
private static final String s_name = "deletesnapshotresponse";
|
||||
|
||||
@Implementation(description="Deletes a snapshot of a disk volume.", responseObject=SuccessResponse.class)
|
||||
public class DeleteSnapshotCmd extends BaseAsyncCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(DeleteSnapshotCmd.class.getName());
|
||||
private static final String s_name = "deletesnapshotresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
@ -55,9 +55,9 @@ public class DeleteSnapshotCmd extends BaseAsyncCmd {
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
@ -98,4 +98,4 @@ public class DeleteSnapshotCmd extends BaseAsyncCmd {
|
||||
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to delete snapshot");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,8 +10,8 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.commands;
|
||||
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
@ -25,12 +25,12 @@ import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.SuccessResponse;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
@Implementation(description="Deletes snapshot policies for the account.", responseObject=SuccessResponse.class)
|
||||
public class DeleteSnapshotPoliciesCmd extends BaseCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(DeleteSnapshotPoliciesCmd.class.getName());
|
||||
|
||||
@Implementation(description="Deletes snapshot policies for the account.", responseObject=SuccessResponse.class)
|
||||
public class DeleteSnapshotPoliciesCmd extends BaseCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(DeleteSnapshotPoliciesCmd.class.getName());
|
||||
|
||||
private static final String s_name = "deletesnapshotpoliciesresponse";
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
@ -62,8 +62,8 @@ public class DeleteSnapshotPoliciesCmd extends BaseCmd {
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -81,4 +81,4 @@ public class DeleteSnapshotPoliciesCmd extends BaseCmd {
|
||||
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to delete snapshot policy");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,79 +10,79 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.api.ApiConstants;
|
||||
import com.cloud.api.BaseAsyncCmd;
|
||||
import com.cloud.api.BaseCmd;
|
||||
import com.cloud.api.IdentityMapper;
|
||||
import com.cloud.api.Implementation;
|
||||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.BaseCmd.CommandType;
|
||||
import com.cloud.api.response.SuccessResponse;
|
||||
import com.cloud.event.EventTypes;
|
||||
import com.cloud.exception.ConcurrentOperationException;
|
||||
import com.cloud.exception.InsufficientCapacityException;
|
||||
import com.cloud.exception.ResourceAllocationException;
|
||||
import com.cloud.exception.ResourceUnavailableException;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
@Implementation(description="Deletes a storage network IP Range.", responseObject=SuccessResponse.class, since="3.0.0")
|
||||
public class DeleteStorageNetworkIpRangeCmd extends BaseAsyncCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(DeleteStorageNetworkIpRangeCmd.class);
|
||||
|
||||
private static final String s_name = "deletestoragenetworkiprangeresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@IdentityMapper(entityTableName="dc_storage_network_ip_range")
|
||||
@Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="the uuid of the storage network ip range")
|
||||
private Long id;
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////////// Accessors ///////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType() {
|
||||
return EventTypes.EVENT_STORAGE_IP_RANGE_DELETE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventDescription() {
|
||||
return "Deleting storage ip range " + getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException,
|
||||
ResourceAllocationException {
|
||||
try {
|
||||
_storageNetworkService.deleteIpRange(this);
|
||||
SuccessResponse response = new SuccessResponse(getCommandName());
|
||||
this.setResponseObject(response);
|
||||
} catch (Exception e) {
|
||||
s_logger.warn("Failed to delete storage network ip range " + getId(), e);
|
||||
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
return Account.ACCOUNT_ID_SYSTEM;
|
||||
}
|
||||
|
||||
}
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.api.ApiConstants;
|
||||
import com.cloud.api.BaseAsyncCmd;
|
||||
import com.cloud.api.BaseCmd;
|
||||
import com.cloud.api.IdentityMapper;
|
||||
import com.cloud.api.Implementation;
|
||||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.BaseCmd.CommandType;
|
||||
import com.cloud.api.response.SuccessResponse;
|
||||
import com.cloud.event.EventTypes;
|
||||
import com.cloud.exception.ConcurrentOperationException;
|
||||
import com.cloud.exception.InsufficientCapacityException;
|
||||
import com.cloud.exception.ResourceAllocationException;
|
||||
import com.cloud.exception.ResourceUnavailableException;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
@Implementation(description="Deletes a storage network IP Range.", responseObject=SuccessResponse.class, since="3.0.0")
|
||||
public class DeleteStorageNetworkIpRangeCmd extends BaseAsyncCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(DeleteStorageNetworkIpRangeCmd.class);
|
||||
|
||||
private static final String s_name = "deletestoragenetworkiprangeresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@IdentityMapper(entityTableName="dc_storage_network_ip_range")
|
||||
@Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="the uuid of the storage network ip range")
|
||||
private Long id;
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////////// Accessors ///////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType() {
|
||||
return EventTypes.EVENT_STORAGE_IP_RANGE_DELETE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventDescription() {
|
||||
return "Deleting storage ip range " + getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException,
|
||||
ResourceAllocationException {
|
||||
try {
|
||||
_storageNetworkService.deleteIpRange(this);
|
||||
SuccessResponse response = new SuccessResponse(getCommandName());
|
||||
this.setResponseObject(response);
|
||||
} catch (Exception e) {
|
||||
s_logger.warn("Failed to delete storage network ip range " + getId(), e);
|
||||
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
return Account.ACCOUNT_ID_SYSTEM;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -10,8 +10,8 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.commands;
|
||||
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.api.ApiConstants;
|
||||
@ -28,10 +28,10 @@ import com.cloud.template.VirtualMachineTemplate;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.user.UserContext;
|
||||
|
||||
@Implementation(responseObject=SuccessResponse.class, description="Deletes a template from the system. All virtual machines using the deleted template will not be affected.")
|
||||
public class DeleteTemplateCmd extends BaseAsyncCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(DeleteTemplateCmd.class.getName());
|
||||
private static final String s_name = "deletetemplateresponse";
|
||||
@Implementation(responseObject=SuccessResponse.class, description="Deletes a template from the system. All virtual machines using the deleted template will not be affected.")
|
||||
public class DeleteTemplateCmd extends BaseAsyncCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(DeleteTemplateCmd.class.getName());
|
||||
private static final String s_name = "deletetemplateresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
@ -63,13 +63,13 @@ public class DeleteTemplateCmd extends BaseAsyncCmd {
|
||||
/////////////// API Implementation///////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
public static String getStaticName() {
|
||||
return s_name;
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
public static String getStaticName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -110,5 +110,5 @@ public class DeleteTemplateCmd extends BaseAsyncCmd {
|
||||
} else {
|
||||
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to delete template");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,8 +10,8 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.commands;
|
||||
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
@ -25,12 +25,12 @@ import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.SuccessResponse;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
@Implementation(description="Creates a VLAN IP range.", responseObject=SuccessResponse.class)
|
||||
public class DeleteVlanIpRangeCmd extends BaseCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(DeleteVlanIpRangeCmd.class.getName());
|
||||
|
||||
private static final String s_name = "deletevlaniprangeresponse";
|
||||
|
||||
@Implementation(description="Creates a VLAN IP range.", responseObject=SuccessResponse.class)
|
||||
public class DeleteVlanIpRangeCmd extends BaseCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(DeleteVlanIpRangeCmd.class.getName());
|
||||
|
||||
private static final String s_name = "deletevlaniprangeresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
@ -52,8 +52,8 @@ public class DeleteVlanIpRangeCmd extends BaseCmd {
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -10,8 +10,8 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.commands;
|
||||
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.api.ApiConstants;
|
||||
@ -25,12 +25,12 @@ import com.cloud.event.EventTypes;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.user.UserContext;
|
||||
|
||||
@Implementation(description="Destroys console proxy", responseObject=SuccessResponse.class)
|
||||
public class DestroyConsoleProxyCmd extends BaseAsyncCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(DestroyConsoleProxyCmd.class.getName());
|
||||
|
||||
private static final String s_name = "destroyconsoleproxyresponse";
|
||||
|
||||
@Implementation(description="Destroys console proxy", responseObject=SuccessResponse.class)
|
||||
public class DestroyConsoleProxyCmd extends BaseAsyncCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(DestroyConsoleProxyCmd.class.getName());
|
||||
|
||||
private static final String s_name = "destroyconsoleproxyresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
@ -53,9 +53,9 @@ public class DestroyConsoleProxyCmd extends BaseAsyncCmd {
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
@ -87,4 +87,4 @@ public class DestroyConsoleProxyCmd extends BaseAsyncCmd {
|
||||
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to destroy console proxy");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,93 +10,93 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.api.ApiConstants;
|
||||
import com.cloud.api.BaseAsyncCmd;
|
||||
import com.cloud.api.BaseCmd;
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.api.ApiConstants;
|
||||
import com.cloud.api.BaseAsyncCmd;
|
||||
import com.cloud.api.BaseCmd;
|
||||
import com.cloud.api.IdentityMapper;
|
||||
import com.cloud.api.Implementation;
|
||||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.SystemVmResponse;
|
||||
import com.cloud.async.AsyncJob;
|
||||
import com.cloud.event.EventTypes;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.user.UserContext;
|
||||
import com.cloud.vm.VirtualMachine;
|
||||
|
||||
@Implementation(responseObject=SystemVmResponse.class, description="Destroyes a system virtual machine.")
|
||||
public class DestroySystemVmCmd extends BaseAsyncCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(DestroySystemVmCmd.class.getName());
|
||||
|
||||
private static final String s_name = "destroysystemvmresponse";
|
||||
|
||||
import com.cloud.api.Implementation;
|
||||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.SystemVmResponse;
|
||||
import com.cloud.async.AsyncJob;
|
||||
import com.cloud.event.EventTypes;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.user.UserContext;
|
||||
import com.cloud.vm.VirtualMachine;
|
||||
|
||||
@Implementation(responseObject=SystemVmResponse.class, description="Destroyes a system virtual machine.")
|
||||
public class DestroySystemVmCmd extends BaseAsyncCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(DestroySystemVmCmd.class.getName());
|
||||
|
||||
private static final String s_name = "destroysystemvmresponse";
|
||||
|
||||
@IdentityMapper(entityTableName="vm_instance")
|
||||
@Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="The ID of the system virtual machine")
|
||||
private Long id;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
public static String getResultObjectName() {
|
||||
return "systemvm";
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
Account account = UserContext.current().getCaller();
|
||||
if (account != null) {
|
||||
return account.getId();
|
||||
}
|
||||
|
||||
return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType() {
|
||||
VirtualMachine.Type type = _mgr.findSystemVMTypeById(getId());
|
||||
if(type == VirtualMachine.Type.ConsoleProxy){
|
||||
return EventTypes.EVENT_PROXY_DESTROY;
|
||||
}
|
||||
else{
|
||||
return EventTypes.EVENT_SSVM_DESTROY;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventDescription() {
|
||||
return "destroying system vm: " + getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AsyncJob.Type getInstanceType() {
|
||||
return AsyncJob.Type.SystemVm;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long getInstanceId() {
|
||||
return getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(){
|
||||
UserContext.current().setEventDetails("Vm Id: "+getId());
|
||||
VirtualMachine instance = _mgr.destroySystemVM(this);
|
||||
if (instance != null) {
|
||||
SystemVmResponse response = _responseGenerator.createSystemVmResponse(instance);
|
||||
response.setResponseName(getCommandName());
|
||||
this.setResponseObject(response);
|
||||
} else {
|
||||
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Fail to destroy system vm");
|
||||
}
|
||||
}
|
||||
}
|
||||
@Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="The ID of the system virtual machine")
|
||||
private Long id;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
public static String getResultObjectName() {
|
||||
return "systemvm";
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
Account account = UserContext.current().getCaller();
|
||||
if (account != null) {
|
||||
return account.getId();
|
||||
}
|
||||
|
||||
return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType() {
|
||||
VirtualMachine.Type type = _mgr.findSystemVMTypeById(getId());
|
||||
if(type == VirtualMachine.Type.ConsoleProxy){
|
||||
return EventTypes.EVENT_PROXY_DESTROY;
|
||||
}
|
||||
else{
|
||||
return EventTypes.EVENT_SSVM_DESTROY;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventDescription() {
|
||||
return "destroying system vm: " + getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AsyncJob.Type getInstanceType() {
|
||||
return AsyncJob.Type.SystemVm;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long getInstanceId() {
|
||||
return getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(){
|
||||
UserContext.current().setEventDetails("Vm Id: "+getId());
|
||||
VirtualMachine instance = _mgr.destroySystemVM(this);
|
||||
if (instance != null) {
|
||||
SystemVmResponse response = _responseGenerator.createSystemVmResponse(instance);
|
||||
response.setResponseName(getCommandName());
|
||||
this.setResponseObject(response);
|
||||
} else {
|
||||
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Fail to destroy system vm");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,8 +10,8 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.commands;
|
||||
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.api.ApiConstants;
|
||||
@ -31,12 +31,12 @@ import com.cloud.user.Account;
|
||||
import com.cloud.user.UserContext;
|
||||
import com.cloud.uservm.UserVm;
|
||||
|
||||
@Implementation(description="Destroys a virtual machine. Once destroyed, only the administrator can recover it.", responseObject=UserVmResponse.class)
|
||||
public class DestroyVMCmd extends BaseAsyncCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(DestroyVMCmd.class.getName());
|
||||
|
||||
private static final String s_name = "destroyvirtualmachineresponse";
|
||||
|
||||
@Implementation(description="Destroys a virtual machine. Once destroyed, only the administrator can recover it.", responseObject=UserVmResponse.class)
|
||||
public class DestroyVMCmd extends BaseAsyncCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(DestroyVMCmd.class.getName());
|
||||
|
||||
private static final String s_name = "destroyvirtualmachineresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
@ -58,9 +58,9 @@ public class DestroyVMCmd extends BaseAsyncCmd {
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
@ -107,5 +107,5 @@ public class DestroyVMCmd extends BaseAsyncCmd {
|
||||
} else {
|
||||
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to destroy vm");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,8 +10,8 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.commands;
|
||||
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.api.ApiConstants;
|
||||
@ -26,12 +26,12 @@ import com.cloud.event.EventTypes;
|
||||
import com.cloud.exception.InvalidParameterValueException;
|
||||
import com.cloud.uservm.UserVm;
|
||||
|
||||
@Implementation(description="Detaches any ISO file (if any) currently attached to a virtual machine.", responseObject=UserVmResponse.class)
|
||||
public class DetachIsoCmd extends BaseAsyncCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(DetachIsoCmd.class.getName());
|
||||
|
||||
private static final String s_name = "detachisoresponse";
|
||||
|
||||
@Implementation(description="Detaches any ISO file (if any) currently attached to a virtual machine.", responseObject=UserVmResponse.class)
|
||||
public class DetachIsoCmd extends BaseAsyncCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(DetachIsoCmd.class.getName());
|
||||
|
||||
private static final String s_name = "detachisoresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
@ -52,10 +52,10 @@ public class DetachIsoCmd extends BaseAsyncCmd {
|
||||
/////////////// API Implementation///////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
@ -89,4 +89,4 @@ public class DetachIsoCmd extends BaseAsyncCmd {
|
||||
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to detach iso");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,8 +10,8 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.commands;
|
||||
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.api.ApiConstants;
|
||||
@ -29,11 +29,11 @@ import com.cloud.exception.ResourceUnavailableException;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.user.UserContext;
|
||||
|
||||
@Implementation(description="Disables an account", responseObject=AccountResponse.class)
|
||||
public class DisableAccountCmd extends BaseAsyncCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(DisableAccountCmd.class.getName());
|
||||
private static final String s_name = "disableaccountresponse";
|
||||
|
||||
@Implementation(description="Disables an account", responseObject=AccountResponse.class)
|
||||
public class DisableAccountCmd extends BaseAsyncCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(DisableAccountCmd.class.getName());
|
||||
private static final String s_name = "disableaccountresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
@ -71,11 +71,11 @@ public class DisableAccountCmd extends BaseAsyncCmd {
|
||||
/////////////// API Implementation///////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType() {
|
||||
return EventTypes.EVENT_ACCOUNT_DISABLE;
|
||||
@ -121,5 +121,5 @@ public class DisableAccountCmd extends BaseAsyncCmd {
|
||||
@Override
|
||||
public AsyncJob.Type getInstanceType() {
|
||||
return AsyncJob.Type.Account;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,8 +10,8 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.commands;
|
||||
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.api.ApiConstants;
|
||||
@ -29,11 +29,11 @@ import com.cloud.user.User;
|
||||
import com.cloud.user.UserAccount;
|
||||
import com.cloud.user.UserContext;
|
||||
|
||||
@Implementation(description="Disables a user account", responseObject=UserResponse.class)
|
||||
public class DisableUserCmd extends BaseAsyncCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(DisableUserCmd.class.getName());
|
||||
private static final String s_name = "disableuserresponse";
|
||||
|
||||
@Implementation(description="Disables a user account", responseObject=UserResponse.class)
|
||||
public class DisableUserCmd extends BaseAsyncCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(DisableUserCmd.class.getName());
|
||||
private static final String s_name = "disableuserresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
@ -54,10 +54,10 @@ public class DisableUserCmd extends BaseAsyncCmd {
|
||||
/////////////// API Implementation///////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType() {
|
||||
@ -96,5 +96,5 @@ public class DisableUserCmd extends BaseAsyncCmd {
|
||||
@Override
|
||||
public AsyncJob.Type getInstanceType() {
|
||||
return AsyncJob.Type.User;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,8 +10,8 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.commands;
|
||||
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.api.ApiConstants;
|
||||
@ -30,12 +30,12 @@ import com.cloud.network.IpAddress;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.user.UserContext;
|
||||
|
||||
@Implementation(description="Disassociates an ip address from the account.", responseObject=SuccessResponse.class)
|
||||
public class DisassociateIPAddrCmd extends BaseAsyncCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(DisassociateIPAddrCmd.class.getName());
|
||||
|
||||
private static final String s_name = "disassociateipaddressresponse";
|
||||
|
||||
@Implementation(description="Disassociates an ip address from the account.", responseObject=SuccessResponse.class)
|
||||
public class DisassociateIPAddrCmd extends BaseAsyncCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(DisassociateIPAddrCmd.class.getName());
|
||||
|
||||
private static final String s_name = "disassociateipaddressresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
@ -61,9 +61,9 @@ public class DisassociateIPAddrCmd extends BaseAsyncCmd {
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute() throws InsufficientAddressCapacityException{
|
||||
@ -133,4 +133,4 @@ public class DisassociateIPAddrCmd extends BaseAsyncCmd {
|
||||
public Long getInstanceId() {
|
||||
return getIpAddressId();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,8 +10,8 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.commands;
|
||||
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.api.ApiConstants;
|
||||
@ -23,11 +23,11 @@ import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.AccountResponse;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
@Implementation(description="Enables an account", responseObject=AccountResponse.class)
|
||||
public class EnableAccountCmd extends BaseCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(EnableAccountCmd.class.getName());
|
||||
private static final String s_name = "enableaccountresponse";
|
||||
|
||||
@Implementation(description="Enables an account", responseObject=AccountResponse.class)
|
||||
public class EnableAccountCmd extends BaseCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(EnableAccountCmd.class.getName());
|
||||
private static final String s_name = "enableaccountresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
@ -62,9 +62,9 @@ public class EnableAccountCmd extends BaseCmd {
|
||||
/////////////// API Implementation///////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -80,7 +80,7 @@ public class EnableAccountCmd extends BaseCmd {
|
||||
}
|
||||
|
||||
return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(){
|
||||
@ -92,5 +92,5 @@ public class EnableAccountCmd extends BaseCmd {
|
||||
} else {
|
||||
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to enable account");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,8 +10,8 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.commands;
|
||||
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.api.ApiConstants;
|
||||
@ -26,11 +26,11 @@ import com.cloud.user.User;
|
||||
import com.cloud.user.UserAccount;
|
||||
import com.cloud.user.UserContext;
|
||||
|
||||
@Implementation(description="Enables a user account", responseObject=UserResponse.class)
|
||||
public class EnableUserCmd extends BaseCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(EnableUserCmd.class.getName());
|
||||
private static final String s_name = "enableuserresponse";
|
||||
|
||||
@Implementation(description="Enables a user account", responseObject=UserResponse.class)
|
||||
public class EnableUserCmd extends BaseCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(EnableUserCmd.class.getName());
|
||||
private static final String s_name = "enableuserresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
@ -52,9 +52,9 @@ public class EnableUserCmd extends BaseCmd {
|
||||
/////////////// API Implementation///////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -78,5 +78,5 @@ public class EnableUserCmd extends BaseCmd {
|
||||
} else {
|
||||
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to enable user");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,136 +10,136 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.commands;
|
||||
|
||||
|
||||
import javax.naming.NamingException;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.api.ApiConstants;
|
||||
import com.cloud.api.BaseCmd;
|
||||
import com.cloud.api.Implementation;
|
||||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.LDAPConfigResponse;
|
||||
import com.cloud.exception.ConcurrentOperationException;
|
||||
import com.cloud.exception.InsufficientCapacityException;
|
||||
import com.cloud.exception.ResourceAllocationException;
|
||||
import com.cloud.exception.ResourceUnavailableException;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
@Implementation(description="Configure the LDAP context for this site.", responseObject=LDAPConfigResponse.class, since="3.0.0")
|
||||
public class LDAPConfigCmd extends BaseCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(LDAPConfigCmd.class.getName());
|
||||
|
||||
private static final String s_name = "ldapconfigresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Parameter(name=ApiConstants.HOST_NAME, type=CommandType.STRING, required=true, description="Hostname or ip address of the ldap server eg: my.ldap.com")
|
||||
private String hostname;
|
||||
|
||||
@Parameter(name=ApiConstants.PORT, type=CommandType.INTEGER, description="Specify the LDAP port if required, default is 389.")
|
||||
private Integer port=0;
|
||||
|
||||
@Parameter(name=ApiConstants.USE_SSL, type=CommandType.BOOLEAN, description="Check Use SSL if the external LDAP server is configured for LDAP over SSL.")
|
||||
private Boolean useSSL;
|
||||
|
||||
@Parameter(name=ApiConstants.SEARCH_BASE, type=CommandType.STRING, required=true, description="The search base defines the starting point for the search in the directory tree Example: dc=cloud,dc=com.")
|
||||
private String searchBase;
|
||||
|
||||
@Parameter(name=ApiConstants.QUERY_FILTER, type=CommandType.STRING, required=true, description="You specify a query filter here, which narrows down the users, who can be part of this domain.")
|
||||
private String queryFilter;
|
||||
|
||||
@Parameter(name=ApiConstants.BIND_DN, type=CommandType.STRING, description="Specify the distinguished name of a user with the search permission on the directory.")
|
||||
private String bindDN;
|
||||
|
||||
@Parameter(name=ApiConstants.BIND_PASSWORD, type=CommandType.STRING, description="Enter the password.")
|
||||
private String bindPassword;
|
||||
|
||||
@Parameter(name=ApiConstants.TRUST_STORE, type=CommandType.STRING, description="Enter the path to trust certificates store.")
|
||||
private String trustStore;
|
||||
|
||||
@Parameter(name=ApiConstants.TRUST_STORE_PASSWORD, type=CommandType.STRING, description="Enter the password for trust store.")
|
||||
private String trustStorePassword;
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////////// Accessors ///////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
public String getBindPassword() {
|
||||
return bindPassword;
|
||||
}
|
||||
|
||||
public String getBindDN() {
|
||||
return bindDN;
|
||||
}
|
||||
|
||||
public String getQueryFilter() {
|
||||
return queryFilter;
|
||||
}
|
||||
|
||||
public String getSearchBase() {
|
||||
return searchBase;
|
||||
}
|
||||
|
||||
public Boolean getUseSSL() {
|
||||
return useSSL == null ? Boolean.FALSE : Boolean.TRUE;
|
||||
}
|
||||
|
||||
public String getHostname() {
|
||||
return hostname;
|
||||
}
|
||||
|
||||
public Integer getPort() {
|
||||
return port <= 0 ? 389 : port;
|
||||
}
|
||||
|
||||
public String getTrustStore() {
|
||||
return trustStore;
|
||||
}
|
||||
|
||||
|
||||
public String getTrustStorePassword() {
|
||||
return trustStorePassword;
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////// API Implementation///////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
|
||||
@Override
|
||||
public void execute() throws ResourceUnavailableException,
|
||||
InsufficientCapacityException, ServerApiException,
|
||||
ConcurrentOperationException, ResourceAllocationException {
|
||||
try {
|
||||
boolean result = _configService.updateLDAP(this);
|
||||
if (result){
|
||||
LDAPConfigResponse lr = _responseGenerator.createLDAPConfigResponse(getHostname(), getPort(), getUseSSL(), getQueryFilter(), getSearchBase(), getBindDN());
|
||||
lr.setResponseName(getCommandName());
|
||||
this.setResponseObject(lr);
|
||||
}
|
||||
}
|
||||
catch (NamingException ne){
|
||||
ne.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
return Account.ACCOUNT_ID_SYSTEM;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
package com.cloud.api.commands;
|
||||
|
||||
|
||||
import javax.naming.NamingException;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.api.ApiConstants;
|
||||
import com.cloud.api.BaseCmd;
|
||||
import com.cloud.api.Implementation;
|
||||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.LDAPConfigResponse;
|
||||
import com.cloud.exception.ConcurrentOperationException;
|
||||
import com.cloud.exception.InsufficientCapacityException;
|
||||
import com.cloud.exception.ResourceAllocationException;
|
||||
import com.cloud.exception.ResourceUnavailableException;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
@Implementation(description="Configure the LDAP context for this site.", responseObject=LDAPConfigResponse.class, since="3.0.0")
|
||||
public class LDAPConfigCmd extends BaseCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(LDAPConfigCmd.class.getName());
|
||||
|
||||
private static final String s_name = "ldapconfigresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Parameter(name=ApiConstants.HOST_NAME, type=CommandType.STRING, required=true, description="Hostname or ip address of the ldap server eg: my.ldap.com")
|
||||
private String hostname;
|
||||
|
||||
@Parameter(name=ApiConstants.PORT, type=CommandType.INTEGER, description="Specify the LDAP port if required, default is 389.")
|
||||
private Integer port=0;
|
||||
|
||||
@Parameter(name=ApiConstants.USE_SSL, type=CommandType.BOOLEAN, description="Check Use SSL if the external LDAP server is configured for LDAP over SSL.")
|
||||
private Boolean useSSL;
|
||||
|
||||
@Parameter(name=ApiConstants.SEARCH_BASE, type=CommandType.STRING, required=true, description="The search base defines the starting point for the search in the directory tree Example: dc=cloud,dc=com.")
|
||||
private String searchBase;
|
||||
|
||||
@Parameter(name=ApiConstants.QUERY_FILTER, type=CommandType.STRING, required=true, description="You specify a query filter here, which narrows down the users, who can be part of this domain.")
|
||||
private String queryFilter;
|
||||
|
||||
@Parameter(name=ApiConstants.BIND_DN, type=CommandType.STRING, description="Specify the distinguished name of a user with the search permission on the directory.")
|
||||
private String bindDN;
|
||||
|
||||
@Parameter(name=ApiConstants.BIND_PASSWORD, type=CommandType.STRING, description="Enter the password.")
|
||||
private String bindPassword;
|
||||
|
||||
@Parameter(name=ApiConstants.TRUST_STORE, type=CommandType.STRING, description="Enter the path to trust certificates store.")
|
||||
private String trustStore;
|
||||
|
||||
@Parameter(name=ApiConstants.TRUST_STORE_PASSWORD, type=CommandType.STRING, description="Enter the password for trust store.")
|
||||
private String trustStorePassword;
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////////// Accessors ///////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
public String getBindPassword() {
|
||||
return bindPassword;
|
||||
}
|
||||
|
||||
public String getBindDN() {
|
||||
return bindDN;
|
||||
}
|
||||
|
||||
public String getQueryFilter() {
|
||||
return queryFilter;
|
||||
}
|
||||
|
||||
public String getSearchBase() {
|
||||
return searchBase;
|
||||
}
|
||||
|
||||
public Boolean getUseSSL() {
|
||||
return useSSL == null ? Boolean.FALSE : Boolean.TRUE;
|
||||
}
|
||||
|
||||
public String getHostname() {
|
||||
return hostname;
|
||||
}
|
||||
|
||||
public Integer getPort() {
|
||||
return port <= 0 ? 389 : port;
|
||||
}
|
||||
|
||||
public String getTrustStore() {
|
||||
return trustStore;
|
||||
}
|
||||
|
||||
|
||||
public String getTrustStorePassword() {
|
||||
return trustStorePassword;
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////// API Implementation///////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
|
||||
@Override
|
||||
public void execute() throws ResourceUnavailableException,
|
||||
InsufficientCapacityException, ServerApiException,
|
||||
ConcurrentOperationException, ResourceAllocationException {
|
||||
try {
|
||||
boolean result = _configService.updateLDAP(this);
|
||||
if (result){
|
||||
LDAPConfigResponse lr = _responseGenerator.createLDAPConfigResponse(getHostname(), getPort(), getUseSSL(), getQueryFilter(), getSearchBase(), getBindDN());
|
||||
lr.setResponseName(getCommandName());
|
||||
this.setResponseObject(lr);
|
||||
}
|
||||
}
|
||||
catch (NamingException ne){
|
||||
ne.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
return Account.ACCOUNT_ID_SYSTEM;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -26,11 +26,11 @@ import com.cloud.api.response.AccountResponse;
|
||||
import com.cloud.api.response.ListResponse;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
@Implementation(description="Lists accounts and provides detailed account information for listed accounts", responseObject=AccountResponse.class)
|
||||
public class ListAccountsCmd extends BaseListDomainResourcesCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(ListAccountsCmd.class.getName());
|
||||
private static final String s_name = "listaccountsresponse";
|
||||
|
||||
@Implementation(description="Lists accounts and provides detailed account information for listed accounts", responseObject=AccountResponse.class)
|
||||
public class ListAccountsCmd extends BaseListDomainResourcesCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(ListAccountsCmd.class.getName());
|
||||
private static final String s_name = "listaccountsresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
@ -81,8 +81,8 @@ public class ListAccountsCmd extends BaseListDomainResourcesCmd {
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -99,5 +99,5 @@ public class ListAccountsCmd extends BaseListDomainResourcesCmd {
|
||||
response.setResponseName(getCommandName());
|
||||
|
||||
this.setResponseObject(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.commands;
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
@ -24,9 +24,9 @@ import com.cloud.api.response.AsyncJobResponse;
|
||||
import com.cloud.api.response.ListResponse;
|
||||
import com.cloud.async.AsyncJob;
|
||||
|
||||
@Implementation(description="Lists all pending asynchronous jobs for the account.", responseObject=AsyncJobResponse.class)
|
||||
public class ListAsyncJobsCmd extends BaseListAccountResourcesCmd {
|
||||
private static final String s_name = "listasyncjobsresponse";
|
||||
@Implementation(description="Lists all pending asynchronous jobs for the account.", responseObject=AsyncJobResponse.class)
|
||||
public class ListAsyncJobsCmd extends BaseListAccountResourcesCmd {
|
||||
private static final String s_name = "listasyncjobsresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
@ -48,9 +48,9 @@ public class ListAsyncJobsCmd extends BaseListAccountResourcesCmd {
|
||||
/////////////// API Implementation///////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(){
|
||||
@ -64,5 +64,5 @@ public class ListAsyncJobsCmd extends BaseListAccountResourcesCmd {
|
||||
response.setResponses(jobResponses);
|
||||
response.setResponseName(getCommandName());
|
||||
this.setResponseObject(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,8 +10,8 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.commands;
|
||||
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
@ -21,15 +21,15 @@ import com.cloud.api.Implementation;
|
||||
import com.cloud.api.response.CapabilitiesResponse;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
@Implementation(description="Lists capabilities", responseObject=CapabilitiesResponse.class)
|
||||
public class ListCapabilitiesCmd extends BaseCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(ListCapabilitiesCmd.class.getName());
|
||||
|
||||
private static final String s_name = "listcapabilitiesresponse";
|
||||
@Implementation(description="Lists capabilities", responseObject=CapabilitiesResponse.class)
|
||||
public class ListCapabilitiesCmd extends BaseCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(ListCapabilitiesCmd.class.getName());
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
private static final String s_name = "listcapabilitiesresponse";
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -50,5 +50,5 @@ public class ListCapabilitiesCmd extends BaseCmd {
|
||||
response.setObjectName("capability");
|
||||
response.setResponseName(getCommandName());
|
||||
this.setResponseObject(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,8 +10,8 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.commands;
|
||||
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.List;
|
||||
|
||||
@ -27,13 +27,13 @@ import com.cloud.api.response.ListResponse;
|
||||
import com.cloud.capacity.Capacity;
|
||||
import com.cloud.exception.InvalidParameterValueException;
|
||||
|
||||
@Implementation(description="Lists all the system wide capacities.", responseObject=CapacityResponse.class)
|
||||
public class ListCapacityCmd extends BaseListCmd {
|
||||
|
||||
public static final Logger s_logger = Logger.getLogger(ListCapacityCmd.class.getName());
|
||||
private static final DecimalFormat s_percentFormat = new DecimalFormat("##.##");
|
||||
|
||||
private static final String s_name = "listcapacityresponse";
|
||||
@Implementation(description="Lists all the system wide capacities.", responseObject=CapacityResponse.class)
|
||||
public class ListCapacityCmd extends BaseListCmd {
|
||||
|
||||
public static final Logger s_logger = Logger.getLogger(ListCapacityCmd.class.getName());
|
||||
private static final DecimalFormat s_percentFormat = new DecimalFormat("##.##");
|
||||
|
||||
private static final String s_name = "listcapacityresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
@ -112,8 +112,8 @@ public class ListCapacityCmd extends BaseListCmd {
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -130,5 +130,5 @@ public class ListCapacityCmd extends BaseListCmd {
|
||||
response.setResponses(capacityResponses);
|
||||
response.setResponseName(getCommandName());
|
||||
this.setResponseObject(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,8 +10,8 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.commands;
|
||||
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@ -26,11 +26,11 @@ import com.cloud.api.response.DiskOfferingResponse;
|
||||
import com.cloud.api.response.ListResponse;
|
||||
import com.cloud.offering.DiskOffering;
|
||||
|
||||
@Implementation(description="Lists all available disk offerings.", responseObject=DiskOfferingResponse.class)
|
||||
public class ListDiskOfferingsCmd extends BaseListCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(ListDiskOfferingsCmd.class.getName());
|
||||
|
||||
private static final String s_name = "listdiskofferingsresponse";
|
||||
@Implementation(description="Lists all available disk offerings.", responseObject=DiskOfferingResponse.class)
|
||||
public class ListDiskOfferingsCmd extends BaseListCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(ListDiskOfferingsCmd.class.getName());
|
||||
|
||||
private static final String s_name = "listdiskofferingsresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
@ -68,8 +68,8 @@ public class ListDiskOfferingsCmd extends BaseListCmd {
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -86,5 +86,5 @@ public class ListDiskOfferingsCmd extends BaseListCmd {
|
||||
response.setResponses(diskOfferingResponses);
|
||||
response.setResponseName(getCommandName());
|
||||
this.setResponseObject(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,8 +10,8 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.commands;
|
||||
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@ -26,11 +26,11 @@ import com.cloud.api.response.DomainResponse;
|
||||
import com.cloud.api.response.ListResponse;
|
||||
import com.cloud.domain.Domain;
|
||||
|
||||
@Implementation(description="Lists all children domains belonging to a specified domain", responseObject=DomainResponse.class)
|
||||
public class ListDomainChildrenCmd extends BaseListCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(ListDomainChildrenCmd.class.getName());
|
||||
|
||||
private static final String s_name = "listdomainchildrenresponse";
|
||||
@Implementation(description="Lists all children domains belonging to a specified domain", responseObject=DomainResponse.class)
|
||||
public class ListDomainChildrenCmd extends BaseListCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(ListDomainChildrenCmd.class.getName());
|
||||
|
||||
private static final String s_name = "listdomainchildrenresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
@ -74,8 +74,8 @@ public class ListDomainChildrenCmd extends BaseListCmd {
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -92,5 +92,5 @@ public class ListDomainChildrenCmd extends BaseListCmd {
|
||||
response.setResponses(domainResponses);
|
||||
response.setResponseName(getCommandName());
|
||||
this.setResponseObject(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,8 +10,8 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.commands;
|
||||
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@ -26,12 +26,12 @@ import com.cloud.api.response.DomainResponse;
|
||||
import com.cloud.api.response.ListResponse;
|
||||
import com.cloud.domain.Domain;
|
||||
|
||||
@Implementation(description="Lists domains and provides detailed information for listed domains", responseObject=DomainResponse.class)
|
||||
public class ListDomainsCmd extends BaseListCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(ListDomainsCmd.class.getName());
|
||||
|
||||
private static final String s_name = "listdomainsresponse";
|
||||
|
||||
@Implementation(description="Lists domains and provides detailed information for listed domains", responseObject=DomainResponse.class)
|
||||
public class ListDomainsCmd extends BaseListCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(ListDomainsCmd.class.getName());
|
||||
|
||||
private static final String s_name = "listdomainsresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
@ -74,8 +74,8 @@ public class ListDomainsCmd extends BaseListCmd {
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -92,5 +92,5 @@ public class ListDomainsCmd extends BaseListCmd {
|
||||
response.setResponses(domainResponses);
|
||||
response.setResponseName(getCommandName());
|
||||
this.setResponseObject(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,8 +10,8 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.commands;
|
||||
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
@ -27,12 +27,12 @@ import com.cloud.api.response.EventResponse;
|
||||
import com.cloud.api.response.ListResponse;
|
||||
import com.cloud.event.Event;
|
||||
|
||||
@Implementation(description="A command to list events.", responseObject=EventResponse.class)
|
||||
public class ListEventsCmd extends BaseListProjectAndAccountResourcesCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(ListEventsCmd.class.getName());
|
||||
|
||||
private static final String s_name = "listeventsresponse";
|
||||
|
||||
@Implementation(description="A command to list events.", responseObject=EventResponse.class)
|
||||
public class ListEventsCmd extends BaseListProjectAndAccountResourcesCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(ListEventsCmd.class.getName());
|
||||
|
||||
private static final String s_name = "listeventsresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
@ -96,8 +96,8 @@ public class ListEventsCmd extends BaseListProjectAndAccountResourcesCmd {
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -112,5 +112,5 @@ public class ListEventsCmd extends BaseListProjectAndAccountResourcesCmd {
|
||||
response.setResponses(eventResponses);
|
||||
response.setResponseName(getCommandName());
|
||||
this.setResponseObject(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,8 +10,8 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.commands;
|
||||
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
@ -31,12 +31,12 @@ import com.cloud.exception.InvalidParameterValueException;
|
||||
import com.cloud.host.Host;
|
||||
import com.cloud.utils.Pair;
|
||||
|
||||
@Implementation(description="Lists hosts.", responseObject=HostResponse.class)
|
||||
public class ListHostsCmd extends BaseListCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(ListHostsCmd.class.getName());
|
||||
|
||||
private static final String s_name = "listhostsresponse";
|
||||
|
||||
@Implementation(description="Lists hosts.", responseObject=HostResponse.class)
|
||||
public class ListHostsCmd extends BaseListCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(ListHostsCmd.class.getName());
|
||||
|
||||
private static final String s_name = "listhostsresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
@ -140,13 +140,13 @@ public class ListHostsCmd extends BaseListCmd {
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
public AsyncJob.Type getInstanceType() {
|
||||
return AsyncJob.Type.Host;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(){
|
||||
@ -177,5 +177,5 @@ public class ListHostsCmd extends BaseListCmd {
|
||||
response.setResponses(hostResponses);
|
||||
response.setResponseName(getCommandName());
|
||||
this.setResponseObject(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,8 +10,8 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.commands;
|
||||
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@ -26,12 +26,12 @@ import com.cloud.api.response.FirewallRuleResponse;
|
||||
import com.cloud.api.response.ListResponse;
|
||||
import com.cloud.network.rules.PortForwardingRule;
|
||||
|
||||
@Implementation(description="Lists all port forwarding rules for an IP address.", responseObject=FirewallRuleResponse.class)
|
||||
public class ListPortForwardingRulesCmd extends BaseListProjectAndAccountResourcesCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(ListPortForwardingRulesCmd.class.getName());
|
||||
|
||||
private static final String s_name = "listportforwardingrulesresponse";
|
||||
|
||||
@Implementation(description="Lists all port forwarding rules for an IP address.", responseObject=FirewallRuleResponse.class)
|
||||
public class ListPortForwardingRulesCmd extends BaseListProjectAndAccountResourcesCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(ListPortForwardingRulesCmd.class.getName());
|
||||
|
||||
private static final String s_name = "listportforwardingrulesresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
@ -61,7 +61,7 @@ public class ListPortForwardingRulesCmd extends BaseListProjectAndAccountResourc
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@ -79,5 +79,5 @@ public class ListPortForwardingRulesCmd extends BaseListProjectAndAccountResourc
|
||||
response.setResponses(fwResponses);
|
||||
response.setResponseName(getCommandName());
|
||||
this.setResponseObject(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,8 +10,8 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.commands;
|
||||
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@ -27,12 +27,12 @@ import com.cloud.api.response.ListResponse;
|
||||
import com.cloud.async.AsyncJob;
|
||||
import com.cloud.network.IpAddress;
|
||||
|
||||
@Implementation(description="Lists all public ip addresses", responseObject=IPAddressResponse.class)
|
||||
public class ListPublicIpAddressesCmd extends BaseListProjectAndAccountResourcesCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(ListPublicIpAddressesCmd.class.getName());
|
||||
|
||||
private static final String s_name = "listpublicipaddressesresponse";
|
||||
|
||||
@Implementation(description="Lists all public ip addresses", responseObject=IPAddressResponse.class)
|
||||
public class ListPublicIpAddressesCmd extends BaseListProjectAndAccountResourcesCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(ListPublicIpAddressesCmd.class.getName());
|
||||
|
||||
private static final String s_name = "listpublicipaddressesresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
@ -121,9 +121,9 @@ public class ListPublicIpAddressesCmd extends BaseListProjectAndAccountResources
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////// API Implementation///////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -161,5 +161,5 @@ public class ListPublicIpAddressesCmd extends BaseListProjectAndAccountResources
|
||||
|
||||
public Boolean getForLoadBalancing() {
|
||||
return forLoadBalancing;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,8 +10,8 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.commands;
|
||||
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@ -23,10 +23,10 @@ import com.cloud.api.response.ListResponse;
|
||||
import com.cloud.api.response.SnapshotScheduleResponse;
|
||||
import com.cloud.storage.snapshot.SnapshotSchedule;
|
||||
|
||||
@Implementation(description="Lists recurring snapshot schedule", responseObject=SnapshotScheduleResponse.class)
|
||||
public class ListRecurringSnapshotScheduleCmd extends BaseListCmd {
|
||||
private static final String s_name = "listrecurringsnapshotscheduleresponse";
|
||||
|
||||
@Implementation(description="Lists recurring snapshot schedule", responseObject=SnapshotScheduleResponse.class)
|
||||
public class ListRecurringSnapshotScheduleCmd extends BaseListCmd {
|
||||
private static final String s_name = "listrecurringsnapshotscheduleresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
@ -54,7 +54,7 @@ public class ListRecurringSnapshotScheduleCmd extends BaseListCmd {
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@ -77,5 +77,5 @@ public class ListRecurringSnapshotScheduleCmd extends BaseListCmd {
|
||||
response.setResponses(snapshotScheduleResponses);
|
||||
response.setResponseName(getCommandName());
|
||||
this.setResponseObject(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,8 +10,8 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.commands;
|
||||
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@ -26,12 +26,12 @@ import com.cloud.api.response.ListResponse;
|
||||
import com.cloud.api.response.RemoteAccessVpnResponse;
|
||||
import com.cloud.network.RemoteAccessVpn;
|
||||
|
||||
@Implementation(description="Lists remote access vpns", responseObject=RemoteAccessVpnResponse.class)
|
||||
public class ListRemoteAccessVpnsCmd extends BaseListProjectAndAccountResourcesCmd {
|
||||
public static final Logger s_logger = Logger.getLogger (ListRemoteAccessVpnsCmd.class.getName());
|
||||
|
||||
private static final String s_name = "listremoteaccessvpnsresponse";
|
||||
|
||||
@Implementation(description="Lists remote access vpns", responseObject=RemoteAccessVpnResponse.class)
|
||||
public class ListRemoteAccessVpnsCmd extends BaseListProjectAndAccountResourcesCmd {
|
||||
public static final Logger s_logger = Logger.getLogger (ListRemoteAccessVpnsCmd.class.getName());
|
||||
|
||||
private static final String s_name = "listremoteaccessvpnsresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
@ -54,8 +54,8 @@ public class ListRemoteAccessVpnsCmd extends BaseListProjectAndAccountResourcesC
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -71,5 +71,5 @@ public class ListRemoteAccessVpnsCmd extends BaseListProjectAndAccountResourcesC
|
||||
response.setResponses(vpnResponses);
|
||||
response.setResponseName(getCommandName());
|
||||
this.setResponseObject(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,8 +10,8 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.commands;
|
||||
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@ -28,12 +28,12 @@ import com.cloud.api.response.ListResponse;
|
||||
import com.cloud.async.AsyncJob;
|
||||
import com.cloud.network.router.VirtualRouter;
|
||||
|
||||
@Implementation(description="List routers.", responseObject=DomainRouterResponse.class)
|
||||
public class ListRoutersCmd extends BaseListProjectAndAccountResourcesCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(ListRoutersCmd.class.getName());
|
||||
|
||||
private static final String s_name = "listroutersresponse";
|
||||
|
||||
@Implementation(description="List routers.", responseObject=DomainRouterResponse.class)
|
||||
public class ListRoutersCmd extends BaseListProjectAndAccountResourcesCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(ListRoutersCmd.class.getName());
|
||||
|
||||
private static final String s_name = "listroutersresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
@ -101,8 +101,8 @@ public class ListRoutersCmd extends BaseListProjectAndAccountResourcesCmd {
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
public AsyncJob.Type getInstanceType() {
|
||||
@ -123,5 +123,5 @@ public class ListRoutersCmd extends BaseListProjectAndAccountResourcesCmd {
|
||||
response.setResponses(routerResponses);
|
||||
response.setResponseName(getCommandName());
|
||||
this.setResponseObject(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,8 +10,8 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.commands;
|
||||
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
@ -26,63 +26,63 @@ import com.cloud.api.response.ListResponse;
|
||||
import com.cloud.api.response.SecurityGroupResponse;
|
||||
import com.cloud.async.AsyncJob;
|
||||
import com.cloud.network.security.SecurityGroupRules;
|
||||
|
||||
@Implementation(description="Lists security groups", responseObject=SecurityGroupResponse.class)
|
||||
public class ListSecurityGroupsCmd extends BaseListProjectAndAccountResourcesCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(ListSecurityGroupsCmd.class.getName());
|
||||
|
||||
private static final String s_name = "listsecuritygroupsresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Parameter(name=ApiConstants.SECURITY_GROUP_NAME, type=CommandType.STRING, description="lists security groups by name")
|
||||
private String securityGroupName;
|
||||
|
||||
|
||||
@Implementation(description="Lists security groups", responseObject=SecurityGroupResponse.class)
|
||||
public class ListSecurityGroupsCmd extends BaseListProjectAndAccountResourcesCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(ListSecurityGroupsCmd.class.getName());
|
||||
|
||||
private static final String s_name = "listsecuritygroupsresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Parameter(name=ApiConstants.SECURITY_GROUP_NAME, type=CommandType.STRING, description="lists security groups by name")
|
||||
private String securityGroupName;
|
||||
|
||||
@IdentityMapper(entityTableName="vm_instance")
|
||||
@Parameter(name=ApiConstants.VIRTUAL_MACHINE_ID, type=CommandType.LONG, description="lists security groups by virtual machine id")
|
||||
private Long virtualMachineId;
|
||||
|
||||
@Parameter(name=ApiConstants.VIRTUAL_MACHINE_ID, type=CommandType.LONG, description="lists security groups by virtual machine id")
|
||||
private Long virtualMachineId;
|
||||
|
||||
@IdentityMapper(entityTableName="security_group")
|
||||
@Parameter(name=ApiConstants.ID, type=CommandType.LONG, description="list the security group by the id provided")
|
||||
private Long id;
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////////// Accessors ///////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
public String getSecurityGroupName() {
|
||||
return securityGroupName;
|
||||
}
|
||||
|
||||
public Long getVirtualMachineId() {
|
||||
return virtualMachineId;
|
||||
}
|
||||
|
||||
public Long getId(){
|
||||
return id;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////// API Implementation///////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(){
|
||||
List<? extends SecurityGroupRules> securityGroups = _securityGroupService.searchForSecurityGroupRules(this);
|
||||
|
||||
ListResponse<SecurityGroupResponse> response = _responseGenerator.createSecurityGroupResponses(securityGroups);
|
||||
response.setResponseName(getCommandName());
|
||||
this.setResponseObject(response);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AsyncJob.Type getInstanceType() {
|
||||
return AsyncJob.Type.SecurityGroup;
|
||||
}
|
||||
}
|
||||
@Parameter(name=ApiConstants.ID, type=CommandType.LONG, description="list the security group by the id provided")
|
||||
private Long id;
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////////// Accessors ///////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
public String getSecurityGroupName() {
|
||||
return securityGroupName;
|
||||
}
|
||||
|
||||
public Long getVirtualMachineId() {
|
||||
return virtualMachineId;
|
||||
}
|
||||
|
||||
public Long getId(){
|
||||
return id;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////// API Implementation///////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(){
|
||||
List<? extends SecurityGroupRules> securityGroups = _securityGroupService.searchForSecurityGroupRules(this);
|
||||
|
||||
ListResponse<SecurityGroupResponse> response = _responseGenerator.createSecurityGroupResponses(securityGroups);
|
||||
response.setResponseName(getCommandName());
|
||||
this.setResponseObject(response);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AsyncJob.Type getInstanceType() {
|
||||
return AsyncJob.Type.SecurityGroup;
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,8 +10,8 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.commands;
|
||||
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@ -26,12 +26,12 @@ import com.cloud.api.response.ListResponse;
|
||||
import com.cloud.api.response.SnapshotPolicyResponse;
|
||||
import com.cloud.storage.snapshot.SnapshotPolicy;
|
||||
|
||||
@Implementation(description="Lists snapshot policies.", responseObject=SnapshotPolicyResponse.class)
|
||||
public class ListSnapshotPoliciesCmd extends BaseListCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(ListSnapshotPoliciesCmd.class.getName());
|
||||
|
||||
private static final String s_name = "listsnapshotpoliciesresponse";
|
||||
|
||||
@Implementation(description="Lists snapshot policies.", responseObject=SnapshotPolicyResponse.class)
|
||||
public class ListSnapshotPoliciesCmd extends BaseListCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(ListSnapshotPoliciesCmd.class.getName());
|
||||
|
||||
private static final String s_name = "listsnapshotpoliciesresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
@ -52,9 +52,9 @@ public class ListSnapshotPoliciesCmd extends BaseListCmd {
|
||||
/////////////// API Implementation///////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -70,5 +70,5 @@ public class ListSnapshotPoliciesCmd extends BaseListCmd {
|
||||
response.setResponses(policyResponses);
|
||||
response.setResponseName(getCommandName());
|
||||
this.setResponseObject(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,8 +10,8 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.commands;
|
||||
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@ -27,12 +27,12 @@ import com.cloud.api.response.SnapshotResponse;
|
||||
import com.cloud.async.AsyncJob;
|
||||
import com.cloud.storage.Snapshot;
|
||||
|
||||
@Implementation(description="Lists all available snapshots for the account.", responseObject=SnapshotResponse.class)
|
||||
public class ListSnapshotsCmd extends BaseListProjectAndAccountResourcesCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(ListSnapshotsCmd.class.getName());
|
||||
|
||||
private static final String s_name = "listsnapshotsresponse";
|
||||
|
||||
@Implementation(description="Lists all available snapshots for the account.", responseObject=SnapshotResponse.class)
|
||||
public class ListSnapshotsCmd extends BaseListProjectAndAccountResourcesCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(ListSnapshotsCmd.class.getName());
|
||||
|
||||
private static final String s_name = "listsnapshotsresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
@ -83,8 +83,8 @@ public class ListSnapshotsCmd extends BaseListProjectAndAccountResourcesCmd {
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
public AsyncJob.Type getInstanceType() {
|
||||
@ -105,5 +105,5 @@ public class ListSnapshotsCmd extends BaseListProjectAndAccountResourcesCmd {
|
||||
response.setResponseName(getCommandName());
|
||||
|
||||
this.setResponseObject(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,8 +10,8 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.commands;
|
||||
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@ -28,12 +28,12 @@ import com.cloud.api.response.StoragePoolResponse;
|
||||
import com.cloud.async.AsyncJob;
|
||||
import com.cloud.storage.StoragePool;
|
||||
|
||||
@Implementation(description="Lists storage pools.", responseObject=StoragePoolResponse.class)
|
||||
public class ListStoragePoolsCmd extends BaseListCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(ListStoragePoolsCmd.class.getName());
|
||||
|
||||
private static final String s_name = "liststoragepoolsresponse";
|
||||
|
||||
@Implementation(description="Lists storage pools.", responseObject=StoragePoolResponse.class)
|
||||
public class ListStoragePoolsCmd extends BaseListCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(ListStoragePoolsCmd.class.getName());
|
||||
|
||||
private static final String s_name = "liststoragepoolsresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
@ -99,14 +99,14 @@ public class ListStoragePoolsCmd extends BaseListCmd {
|
||||
/////////////// API Implementation///////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
public AsyncJob.Type getInstanceType() {
|
||||
return AsyncJob.Type.StoragePool;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(){
|
||||
@ -122,5 +122,5 @@ public class ListStoragePoolsCmd extends BaseListCmd {
|
||||
response.setResponses(poolResponses);
|
||||
response.setResponseName(getCommandName());
|
||||
this.setResponseObject(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,8 +10,8 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.commands;
|
||||
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@ -26,7 +26,7 @@ import com.cloud.api.response.ListResponse;
|
||||
import com.cloud.api.response.SwiftResponse;
|
||||
import com.cloud.storage.Swift;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
|
||||
@Implementation(description = "List Swift.", responseObject = HostResponse.class, since="3.0.0")
|
||||
public class ListSwiftsCmd extends BaseListCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(ListSwiftsCmd.class.getName());
|
||||
@ -77,4 +77,4 @@ public class ListSwiftsCmd extends BaseListCmd {
|
||||
response.setResponseName(getCommandName());
|
||||
this.setResponseObject(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.commands;
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@ -27,11 +27,11 @@ import com.cloud.api.response.SystemVmResponse;
|
||||
import com.cloud.async.AsyncJob;
|
||||
import com.cloud.vm.VirtualMachine;
|
||||
|
||||
@Implementation(description="List system virtual machines.", responseObject=SystemVmResponse.class)
|
||||
public class ListSystemVMsCmd extends BaseListCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(ListSystemVMsCmd.class.getName());
|
||||
|
||||
private static final String s_name = "listsystemvmsresponse";
|
||||
@Implementation(description="List system virtual machines.", responseObject=SystemVmResponse.class)
|
||||
public class ListSystemVMsCmd extends BaseListCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(ListSystemVMsCmd.class.getName());
|
||||
|
||||
private static final String s_name = "listsystemvmsresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
@ -107,8 +107,8 @@ public class ListSystemVMsCmd extends BaseListCmd {
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
public AsyncJob.Type getInstanceType() {
|
||||
@ -129,5 +129,5 @@ public class ListSystemVMsCmd extends BaseListCmd {
|
||||
response.setResponses(vmResponses);
|
||||
response.setResponseName(getCommandName());
|
||||
this.setResponseObject(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,14 +10,14 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.commands;
|
||||
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.storage.Storage.ImageFormat;
|
||||
import com.cloud.template.VirtualMachineTemplate;
|
||||
|
||||
public class ListTemplatePermissionsCmd extends ListTemplateOrIsoPermissionsCmd {
|
||||
|
||||
public class ListTemplatePermissionsCmd extends ListTemplateOrIsoPermissionsCmd {
|
||||
protected String getResponseName() {
|
||||
return "listtemplatepermissionsresponse";
|
||||
}
|
||||
@ -34,5 +34,5 @@ public class ListTemplatePermissionsCmd extends ListTemplateOrIsoPermissionsCmd
|
||||
|
||||
protected boolean templateIsCorrectType(VirtualMachineTemplate template) {
|
||||
return !template.getFormat().equals(ImageFormat.ISO);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,73 +10,73 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.api.ApiConstants;
|
||||
import com.cloud.api.BaseListCmd;
|
||||
import com.cloud.api.Implementation;
|
||||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.ListResponse;
|
||||
import com.cloud.api.response.TrafficTypeImplementorResponse;
|
||||
import com.cloud.exception.ConcurrentOperationException;
|
||||
import com.cloud.exception.InsufficientCapacityException;
|
||||
import com.cloud.exception.ResourceAllocationException;
|
||||
import com.cloud.exception.ResourceUnavailableException;
|
||||
import com.cloud.network.Networks.TrafficType;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.utils.Pair;
|
||||
|
||||
@Implementation(description="Lists implementors of implementor of a network traffic type or implementors of all network traffic types", responseObject=TrafficTypeImplementorResponse.class, since="3.0.0")
|
||||
public class ListTrafficTypeImplementorsCmd extends BaseListCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(ListTrafficTypeImplementorsCmd.class);
|
||||
private static final String _name = "listtraffictypeimplementorsresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
@Parameter(name=ApiConstants.TRAFFIC_TYPE, type=CommandType.STRING, description="Optional. The network traffic type, if specified, return its implementor. Otherwise, return all traffic types with their implementor")
|
||||
private String trafficType;
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////////// Accessors ///////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
public String getTrafficType() {
|
||||
return trafficType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException,
|
||||
ResourceAllocationException {
|
||||
List<Pair<TrafficType, String>> results = _networkService.listTrafficTypeImplementor(this);
|
||||
ListResponse<TrafficTypeImplementorResponse> response = new ListResponse<TrafficTypeImplementorResponse>();
|
||||
List<TrafficTypeImplementorResponse> responses= new ArrayList<TrafficTypeImplementorResponse>();
|
||||
for (Pair<TrafficType, String> r : results) {
|
||||
TrafficTypeImplementorResponse p = new TrafficTypeImplementorResponse();
|
||||
p.setTrafficType(r.first().toString());
|
||||
p.setImplementor(r.second());
|
||||
p.setObjectName("traffictypeimplementorresponse");
|
||||
responses.add(p);
|
||||
}
|
||||
|
||||
response.setResponses(responses);
|
||||
response.setResponseName(getCommandName());
|
||||
this.setResponseObject(response);
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
return Account.ACCOUNT_ID_SYSTEM;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return _name;
|
||||
}
|
||||
}
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.api.ApiConstants;
|
||||
import com.cloud.api.BaseListCmd;
|
||||
import com.cloud.api.Implementation;
|
||||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.ListResponse;
|
||||
import com.cloud.api.response.TrafficTypeImplementorResponse;
|
||||
import com.cloud.exception.ConcurrentOperationException;
|
||||
import com.cloud.exception.InsufficientCapacityException;
|
||||
import com.cloud.exception.ResourceAllocationException;
|
||||
import com.cloud.exception.ResourceUnavailableException;
|
||||
import com.cloud.network.Networks.TrafficType;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.utils.Pair;
|
||||
|
||||
@Implementation(description="Lists implementors of implementor of a network traffic type or implementors of all network traffic types", responseObject=TrafficTypeImplementorResponse.class, since="3.0.0")
|
||||
public class ListTrafficTypeImplementorsCmd extends BaseListCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(ListTrafficTypeImplementorsCmd.class);
|
||||
private static final String _name = "listtraffictypeimplementorsresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
@Parameter(name=ApiConstants.TRAFFIC_TYPE, type=CommandType.STRING, description="Optional. The network traffic type, if specified, return its implementor. Otherwise, return all traffic types with their implementor")
|
||||
private String trafficType;
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////////// Accessors ///////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
public String getTrafficType() {
|
||||
return trafficType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException,
|
||||
ResourceAllocationException {
|
||||
List<Pair<TrafficType, String>> results = _networkService.listTrafficTypeImplementor(this);
|
||||
ListResponse<TrafficTypeImplementorResponse> response = new ListResponse<TrafficTypeImplementorResponse>();
|
||||
List<TrafficTypeImplementorResponse> responses= new ArrayList<TrafficTypeImplementorResponse>();
|
||||
for (Pair<TrafficType, String> r : results) {
|
||||
TrafficTypeImplementorResponse p = new TrafficTypeImplementorResponse();
|
||||
p.setTrafficType(r.first().toString());
|
||||
p.setImplementor(r.second());
|
||||
p.setObjectName("traffictypeimplementorresponse");
|
||||
responses.add(p);
|
||||
}
|
||||
|
||||
response.setResponses(responses);
|
||||
response.setResponseName(getCommandName());
|
||||
this.setResponseObject(response);
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
return Account.ACCOUNT_ID_SYSTEM;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return _name;
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,8 +10,8 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.commands;
|
||||
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@ -26,12 +26,12 @@ import com.cloud.api.response.ListResponse;
|
||||
import com.cloud.api.response.UserResponse;
|
||||
import com.cloud.user.UserAccount;
|
||||
|
||||
@Implementation(description="Lists user accounts", responseObject=UserResponse.class)
|
||||
public class ListUsersCmd extends BaseListAccountResourcesCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(ListUsersCmd.class.getName());
|
||||
|
||||
private static final String s_name = "listusersresponse";
|
||||
|
||||
@Implementation(description="Lists user accounts", responseObject=UserResponse.class)
|
||||
public class ListUsersCmd extends BaseListAccountResourcesCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(ListUsersCmd.class.getName());
|
||||
|
||||
private static final String s_name = "listusersresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
@ -75,8 +75,8 @@ public class ListUsersCmd extends BaseListAccountResourcesCmd {
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -91,5 +91,5 @@ public class ListUsersCmd extends BaseListAccountResourcesCmd {
|
||||
response.setResponses(userResponses);
|
||||
response.setResponseName(getCommandName());
|
||||
this.setResponseObject(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,8 +10,8 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.commands;
|
||||
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@ -26,12 +26,12 @@ import com.cloud.api.response.ListResponse;
|
||||
import com.cloud.api.response.VlanIpRangeResponse;
|
||||
import com.cloud.dc.Vlan;
|
||||
|
||||
@Implementation(description="Lists all VLAN IP ranges.", responseObject=VlanIpRangeResponse.class)
|
||||
public class ListVlanIpRangesCmd extends BaseListCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(ListVlanIpRangesCmd.class.getName());
|
||||
|
||||
private static final String s_name = "listvlaniprangesresponse";
|
||||
|
||||
@Implementation(description="Lists all VLAN IP ranges.", responseObject=VlanIpRangeResponse.class)
|
||||
public class ListVlanIpRangesCmd extends BaseListCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(ListVlanIpRangesCmd.class.getName());
|
||||
|
||||
private static final String s_name = "listvlaniprangesresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
@ -122,8 +122,8 @@ public class ListVlanIpRangesCmd extends BaseListCmd {
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -140,5 +140,5 @@ public class ListVlanIpRangesCmd extends BaseListCmd {
|
||||
response.setResponses(vlanResponses);
|
||||
response.setResponseName(getCommandName());
|
||||
this.setResponseObject(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,8 +10,8 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.commands;
|
||||
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@ -27,12 +27,12 @@ import com.cloud.api.response.VolumeResponse;
|
||||
import com.cloud.async.AsyncJob;
|
||||
import com.cloud.storage.Volume;
|
||||
|
||||
@Implementation(description="Lists all volumes.", responseObject=VolumeResponse.class)
|
||||
public class ListVolumesCmd extends BaseListProjectAndAccountResourcesCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(ListVolumesCmd.class.getName());
|
||||
|
||||
private static final String s_name = "listvolumesresponse";
|
||||
|
||||
@Implementation(description="Lists all volumes.", responseObject=VolumeResponse.class)
|
||||
public class ListVolumesCmd extends BaseListProjectAndAccountResourcesCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(ListVolumesCmd.class.getName());
|
||||
|
||||
private static final String s_name = "listvolumesresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
@ -101,8 +101,8 @@ public class ListVolumesCmd extends BaseListProjectAndAccountResourcesCmd {
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -125,5 +125,5 @@ public class ListVolumesCmd extends BaseListProjectAndAccountResourcesCmd {
|
||||
response.setResponses(volResponses);
|
||||
response.setResponseName(getCommandName());
|
||||
this.setResponseObject(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,8 +10,8 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.commands;
|
||||
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@ -26,12 +26,12 @@ import com.cloud.api.response.ListResponse;
|
||||
import com.cloud.api.response.VpnUsersResponse;
|
||||
import com.cloud.network.VpnUser;
|
||||
|
||||
@Implementation(description="Lists vpn users", responseObject=VpnUsersResponse.class)
|
||||
public class ListVpnUsersCmd extends BaseListProjectAndAccountResourcesCmd {
|
||||
public static final Logger s_logger = Logger.getLogger (ListVpnUsersCmd.class.getName());
|
||||
|
||||
private static final String s_name = "listvpnusersresponse";
|
||||
|
||||
@Implementation(description="Lists vpn users", responseObject=VpnUsersResponse.class)
|
||||
public class ListVpnUsersCmd extends BaseListProjectAndAccountResourcesCmd {
|
||||
public static final Logger s_logger = Logger.getLogger (ListVpnUsersCmd.class.getName());
|
||||
|
||||
private static final String s_name = "listvpnusersresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
@ -59,8 +59,8 @@ public class ListVpnUsersCmd extends BaseListProjectAndAccountResourcesCmd {
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -76,5 +76,5 @@ public class ListVpnUsersCmd extends BaseListProjectAndAccountResourcesCmd {
|
||||
response.setResponses(vpnResponses);
|
||||
response.setResponseName(getCommandName());
|
||||
this.setResponseObject(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,8 +10,8 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.commands;
|
||||
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@ -27,12 +27,12 @@ import com.cloud.api.response.ListResponse;
|
||||
import com.cloud.api.response.ZoneResponse;
|
||||
import com.cloud.dc.DataCenter;
|
||||
|
||||
@Implementation(description="Lists zones", responseObject=ZoneResponse.class)
|
||||
public class ListZonesByCmd extends BaseListCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(ListZonesByCmd.class.getName());
|
||||
|
||||
private static final String s_name = "listzonesresponse";
|
||||
|
||||
@Implementation(description="Lists zones", responseObject=ZoneResponse.class)
|
||||
public class ListZonesByCmd extends BaseListCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(ListZonesByCmd.class.getName());
|
||||
|
||||
private static final String s_name = "listzonesresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
@ -74,9 +74,9 @@ public class ListZonesByCmd extends BaseListCmd {
|
||||
/////////////// API Implementation///////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -93,5 +93,5 @@ public class ListZonesByCmd extends BaseListCmd {
|
||||
response.setResponses(zoneResponses);
|
||||
response.setResponseName(getCommandName());
|
||||
this.setResponseObject(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.commands;
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
@ -22,12 +22,12 @@ import com.cloud.api.Parameter;
|
||||
import com.cloud.api.response.AccountResponse;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
@Implementation(description="Locks an account", responseObject=AccountResponse.class)
|
||||
public class LockAccountCmd extends BaseCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(LockAccountCmd.class.getName());
|
||||
|
||||
private static final String s_name = "lockaccountresponse";
|
||||
|
||||
@Implementation(description="Locks an account", responseObject=AccountResponse.class)
|
||||
public class LockAccountCmd extends BaseCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(LockAccountCmd.class.getName());
|
||||
|
||||
private static final String s_name = "lockaccountresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
@ -56,7 +56,7 @@ public class LockAccountCmd extends BaseCmd {
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@ -81,5 +81,5 @@ public class LockAccountCmd extends BaseCmd {
|
||||
// } else {
|
||||
// throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to lock account");
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,8 +10,8 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.commands;
|
||||
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.api.ApiConstants;
|
||||
@ -25,12 +25,12 @@ import com.cloud.user.Account;
|
||||
import com.cloud.user.User;
|
||||
import com.cloud.user.UserAccount;
|
||||
|
||||
@Implementation(description="Locks a user account", responseObject=UserResponse.class)
|
||||
public class LockUserCmd extends BaseCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(LockUserCmd.class.getName());
|
||||
|
||||
private static final String s_name = "lockuserresponse";
|
||||
|
||||
@Implementation(description="Locks a user account", responseObject=UserResponse.class)
|
||||
public class LockUserCmd extends BaseCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(LockUserCmd.class.getName());
|
||||
|
||||
private static final String s_name = "lockuserresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
@ -52,8 +52,8 @@ public class LockUserCmd extends BaseCmd {
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -76,5 +76,5 @@ public class LockUserCmd extends BaseCmd {
|
||||
} else {
|
||||
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to lock user");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,8 +10,8 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.commands;
|
||||
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.api.ApiConstants;
|
||||
@ -28,12 +28,12 @@ import com.cloud.host.Host;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.user.UserContext;
|
||||
|
||||
@Implementation(description="Prepares a host for maintenance.", responseObject=HostResponse.class)
|
||||
public class PrepareForMaintenanceCmd extends BaseAsyncCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(PrepareForMaintenanceCmd.class.getName());
|
||||
|
||||
private static final String s_name = "preparehostformaintenanceresponse";
|
||||
|
||||
@Implementation(description="Prepares a host for maintenance.", responseObject=HostResponse.class)
|
||||
public class PrepareForMaintenanceCmd extends BaseAsyncCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(PrepareForMaintenanceCmd.class.getName());
|
||||
|
||||
private static final String s_name = "preparehostformaintenanceresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
@ -55,9 +55,9 @@ public class PrepareForMaintenanceCmd extends BaseAsyncCmd {
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
public static String getResultObjectName() {
|
||||
return "host";
|
||||
@ -103,5 +103,5 @@ public class PrepareForMaintenanceCmd extends BaseAsyncCmd {
|
||||
} else {
|
||||
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to prepare host for maintenance");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,8 +10,8 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.commands;
|
||||
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.api.ApiConstants;
|
||||
@ -22,12 +22,12 @@ import com.cloud.api.Parameter;
|
||||
import com.cloud.api.response.AsyncJobResponse;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
@Implementation(description="Retrieves the current status of asynchronous job.", responseObject=AsyncJobResponse.class)
|
||||
public class QueryAsyncJobResultCmd extends BaseCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(QueryAsyncJobResultCmd.class.getName());
|
||||
|
||||
private static final String s_name = "queryasyncjobresultresponse";
|
||||
|
||||
@Implementation(description="Retrieves the current status of asynchronous job.", responseObject=AsyncJobResponse.class)
|
||||
public class QueryAsyncJobResultCmd extends BaseCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(QueryAsyncJobResultCmd.class.getName());
|
||||
|
||||
private static final String s_name = "queryasyncjobresultresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
@ -49,19 +49,19 @@ public class QueryAsyncJobResultCmd extends BaseCmd {
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
return Account.ACCOUNT_ID_SYSTEM;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(){
|
||||
AsyncJobResponse response = _responseGenerator.queryJobResult(this);
|
||||
response.setResponseName(getCommandName());
|
||||
this.setResponseObject(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,8 +10,8 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.commands;
|
||||
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.api.ApiConstants;
|
||||
@ -31,11 +31,11 @@ import com.cloud.network.router.VirtualRouter;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.user.UserContext;
|
||||
|
||||
@Implementation(description="Starts a router.", responseObject=DomainRouterResponse.class)
|
||||
public class RebootRouterCmd extends BaseAsyncCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(RebootRouterCmd.class.getName());
|
||||
private static final String s_name = "rebootrouterresponse";
|
||||
|
||||
@Implementation(description="Starts a router.", responseObject=DomainRouterResponse.class)
|
||||
public class RebootRouterCmd extends BaseAsyncCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(RebootRouterCmd.class.getName());
|
||||
private static final String s_name = "rebootrouterresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
@ -57,8 +57,8 @@ public class RebootRouterCmd extends BaseAsyncCmd {
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -101,5 +101,5 @@ public class RebootRouterCmd extends BaseAsyncCmd {
|
||||
} else {
|
||||
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to reboot router");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,8 +10,8 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.commands;
|
||||
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.api.ApiConstants;
|
||||
@ -28,12 +28,12 @@ import com.cloud.user.Account;
|
||||
import com.cloud.user.UserContext;
|
||||
import com.cloud.vm.VirtualMachine;
|
||||
|
||||
@Implementation(description="Reboots a system VM.", responseObject=SystemVmResponse.class)
|
||||
public class RebootSystemVmCmd extends BaseAsyncCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(RebootSystemVmCmd.class.getName());
|
||||
|
||||
private static final String s_name = "rebootsystemvmresponse";
|
||||
|
||||
@Implementation(description="Reboots a system VM.", responseObject=SystemVmResponse.class)
|
||||
public class RebootSystemVmCmd extends BaseAsyncCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(RebootSystemVmCmd.class.getName());
|
||||
|
||||
private static final String s_name = "rebootsystemvmresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
@ -55,9 +55,9 @@ public class RebootSystemVmCmd extends BaseAsyncCmd {
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
@ -104,5 +104,5 @@ public class RebootSystemVmCmd extends BaseAsyncCmd {
|
||||
} else {
|
||||
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Fail to reboot system vm");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,8 +10,8 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.commands;
|
||||
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.api.ApiConstants;
|
||||
@ -31,10 +31,10 @@ import com.cloud.user.Account;
|
||||
import com.cloud.user.UserContext;
|
||||
import com.cloud.uservm.UserVm;
|
||||
|
||||
@Implementation(description="Reboots a virtual machine.", responseObject=UserVmResponse.class)
|
||||
public class RebootVMCmd extends BaseAsyncCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(RebootVMCmd.class.getName());
|
||||
private static final String s_name = "rebootvirtualmachineresponse";
|
||||
@Implementation(description="Reboots a virtual machine.", responseObject=UserVmResponse.class)
|
||||
public class RebootVMCmd extends BaseAsyncCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(RebootVMCmd.class.getName());
|
||||
private static final String s_name = "rebootvirtualmachineresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
@ -57,9 +57,9 @@ public class RebootVMCmd extends BaseAsyncCmd {
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
@ -106,5 +106,5 @@ public class RebootVMCmd extends BaseAsyncCmd {
|
||||
} else {
|
||||
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to reboot vm instance");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,8 +10,8 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
package com.cloud.api.commands;
|
||||
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.api.ApiConstants;
|
||||
@ -29,12 +29,12 @@ import com.cloud.host.Host;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.user.UserContext;
|
||||
|
||||
@Implementation(description="Reconnects a host.", responseObject=HostResponse.class)
|
||||
public class ReconnectHostCmd extends BaseAsyncCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(ReconnectHostCmd.class.getName());
|
||||
|
||||
private static final String s_name = "reconnecthostresponse";
|
||||
|
||||
@Implementation(description="Reconnects a host.", responseObject=HostResponse.class)
|
||||
public class ReconnectHostCmd extends BaseAsyncCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(ReconnectHostCmd.class.getName());
|
||||
|
||||
private static final String s_name = "reconnecthostresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
@ -56,9 +56,9 @@ public class ReconnectHostCmd extends BaseAsyncCmd {
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
public static String getResultObjectName() {
|
||||
return "host";
|
||||
@ -107,5 +107,5 @@ public class ReconnectHostCmd extends BaseAsyncCmd {
|
||||
s_logger.warn("Exception: ", ex);
|
||||
throw new ServerApiException(BaseCmd.RESOURCE_UNAVAILABLE_ERROR, ex.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user