mirror of https://github.com/apache/cloudstack.git
Merge branch 'master' into ui-ucs
Conflicts: ui/scripts/system.js
This commit is contained in:
commit
9334dab7f7
|
|
@ -81,3 +81,4 @@ debian/*.debhelper
|
|||
replace.properties.tmp
|
||||
build-indep-stamp
|
||||
configure-stamp
|
||||
*_flymake.js
|
||||
19
INSTALL.md
19
INSTALL.md
|
|
@ -1,5 +1,5 @@
|
|||
This document describes how to develop, build, package and install Apache CloudStack
|
||||
(Incubating). For more information please refer to the project's website:
|
||||
This document describes how to develop, build, package and install Apache
|
||||
CloudStack. For more information please refer to:
|
||||
|
||||
http://cloudstack.apache.org
|
||||
|
||||
|
|
@ -10,7 +10,7 @@ Refer to the [wiki](http://cwiki.apache.org/confluence/display/CLOUDSTACK/Index)
|
|||
for the latest information, especially:
|
||||
|
||||
- [Setting up development environment](https://cwiki.apache.org/confluence/display/CLOUDSTACK/Setting+up+CloudStack+Development+Environment) for Apache CloudStack.
|
||||
- [Building](https://cwiki.apache.org/confluence/display/CLOUDSTACK/Building) Apache CloudStack.
|
||||
- [Building](https://cwiki.apache.org/confluence/display/CLOUDSTACK/How+to+build+on+master+branch) Apache CloudStack.
|
||||
|
||||
## Setting up Development Environment
|
||||
|
||||
|
|
@ -21,12 +21,12 @@ Install tools and dependencies used for development:
|
|||
$ yum install git ant ant-devel java-1.6.0-openjdk java-1.6.0-openjdk-devel
|
||||
mysql mysql-server tomcat6 mkisofs gcc python MySQL-python openssh-clients wget
|
||||
|
||||
Set up Maven (3.0.4):
|
||||
Set up Maven (3.0.5):
|
||||
|
||||
$ wget http://www.us.apache.org/dist/maven/maven-3/3.0.4/binaries/apache-maven-3.0.4-bin.tar.gz
|
||||
$ wget http://www.us.apache.org/dist/maven/maven-3/3.0.5/binaries/apache-maven-3.0.5-bin.tar.gz
|
||||
$ cd /usr/local/ # or any path
|
||||
$ tar -zxvf apache-maven-3.0.4-bin.tar.gz
|
||||
$ echo export M2_HOME=/usr/local/apache-maven-3.0.4 >> ~/.bashrc # or .zshrc or .profile
|
||||
$ tar -zxvf apache-maven-3.0.5-bin.tar.gz
|
||||
$ echo export M2_HOME=/usr/local/apache-maven-3.0.5 >> ~/.bashrc # or .zshrc or .profile
|
||||
$ echo export PATH=${M2_HOME}/bin:${PATH} >> ~/.bashrc # or .zshrc or .profile
|
||||
|
||||
Note: Tomcat 6.0.35 has some known issue with Apache CloudStack, please use Tomcat
|
||||
|
|
@ -77,10 +77,10 @@ Start the MySQL service:
|
|||
|
||||
You may get the source code from the repository hosted on Apache:
|
||||
|
||||
$ git clone https://git-wip-us.apache.org/repos/asf/cloudstack.git
|
||||
$ git clone git://git.apache.org/cloudstack.git
|
||||
|
||||
Or, you may fork a repository from the official Apache CloudStack mirror by
|
||||
Apache on [Github](https://github.com/apache/incubator-cloudstack)
|
||||
Apache on [Github](https://github.com/apache/cloudstack)
|
||||
|
||||
To keep yourself updated on a branch, do:
|
||||
|
||||
|
|
@ -92,7 +92,6 @@ For example, for master:
|
|||
|
||||
## Building
|
||||
|
||||
|
||||
Clean and build:
|
||||
|
||||
$ mvn clean install -P systemvm,developer
|
||||
|
|
|
|||
|
|
@ -1,54 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<!--
|
||||
Licensed to the Apache Software Foundation (ASF) under one
|
||||
or more contributor license agreements. See the NOTICE file
|
||||
distributed with this work for additional information
|
||||
regarding copyright ownership. The ASF licenses this file
|
||||
to you under the Apache License, Version 2.0 (the
|
||||
"License"); you may not use this file except in compliance
|
||||
with the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing,
|
||||
software distributed under the License is distributed on an
|
||||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, either express or implied. See the License for the
|
||||
specific language governing permissions and limitations
|
||||
under the License.
|
||||
-->
|
||||
<components-simulator.xml>
|
||||
<management-server class="com.cloud.server.ManagementServerSimulatorImpl" library="com.cloud.configuration.SimulatorComponentLibrary" extends="components.xml:management-server">
|
||||
<dao name="Configuration configuration server" class="com.cloud.configuration.dao.ConfigurationDaoImpl">
|
||||
<param name="premium">true</param>
|
||||
</dao>
|
||||
<adapters key="com.cloud.ha.Investigator">
|
||||
<adapter name="SimpleInvestigator" class="com.cloud.ha.CheckOnAgentInvestigator"/>
|
||||
<adapter name="PingInvestigator" class="com.cloud.ha.UserVmDomRInvestigator"/>
|
||||
<adapter name="ManagementIPSysVMInvestigator" class="com.cloud.ha.ManagementIPSystemVMInvestigator"/>
|
||||
</adapters>
|
||||
<adapters key="com.cloud.resource.Discoverer">
|
||||
<adapter name="Simulator Agent" class="com.cloud.resource.SimulatorDiscoverer"/>
|
||||
<adapter name="XCP Agent" class="com.cloud.hypervisor.xen.discoverer.XcpServerDiscoverer"/>
|
||||
<adapter name="SecondaryStorage" class="com.cloud.storage.secondary.SecondaryStorageDiscoverer"/>
|
||||
<adapter name="KVM Agent" class="com.cloud.hypervisor.kvm.discoverer.KvmServerDiscoverer"/>
|
||||
<adapter name="SecondaryStorage" class="com.cloud.resource.SimulatorSecondaryDiscoverer"/>
|
||||
</adapters>
|
||||
|
||||
<adapters key="com.cloud.hypervisor.HypervisorGuru">
|
||||
<adapter name="SimulatorGuru" class="com.cloud.simulator.SimulatorGuru"/>
|
||||
<adapter name="XenServerGuru" class="com.cloud.hypervisor.XenServerGuru"/>
|
||||
<adapter name="KVMGuru" class="com.cloud.hypervisor.KVMGuru"/>
|
||||
</adapters>
|
||||
<adapters key="com.cloud.agent.StartupCommandProcessor">
|
||||
<adapter name="BasicAgentAuthorizer" class="com.cloud.agent.manager.authn.impl.BasicAgentAuthManager"/>
|
||||
</adapters>
|
||||
</management-server>
|
||||
|
||||
<configuration-server class="com.cloud.server.ConfigurationServerImpl" extends="components.xml:configuration-server">
|
||||
<dao name="Configuration configuration server" class="com.cloud.configuration.dao.ConfigurationDaoImpl" singleton="false">
|
||||
<param name="premium">true</param>
|
||||
</dao>
|
||||
</configuration-server>
|
||||
|
||||
</components-simulator.xml>
|
||||
|
|
@ -95,6 +95,11 @@ if __name__ == '__main__':
|
|||
parser.add_option("--prvNic", dest="prvNic", help="Private traffic interface")
|
||||
parser.add_option("--guestNic", dest="guestNic", help="Guest traffic interface")
|
||||
|
||||
old_config = configFileOps("@AGENTSYSCONFDIR@/agent.properties")
|
||||
bridgeType = old_config.getEntry("network.bridge.type").lower()
|
||||
if bridgeType:
|
||||
glbEnv.bridgeType = bridgeType
|
||||
|
||||
(options, args) = parser.parse_args()
|
||||
if options.auto is None:
|
||||
userInputs = getUserInputs()
|
||||
|
|
@ -104,7 +109,7 @@ if __name__ == '__main__':
|
|||
glbEnv.pod = userInputs[3]
|
||||
glbEnv.cluster = userInputs[4]
|
||||
#generate UUID
|
||||
glbEnv.uuid = configFileOps("@AGENTSYSCONFDIR@/agent.properties").getEntry("guid")
|
||||
glbEnv.uuid = old_config.getEntry("guid")
|
||||
if glbEnv.uuid == "":
|
||||
glbEnv.uuid = bash("uuidgen").getStdout()
|
||||
else:
|
||||
|
|
|
|||
|
|
@ -84,6 +84,11 @@ domr.scripts.dir=scripts/network/domr/kvm
|
|||
# set the hypervisor type, values are: kvm, lxc
|
||||
# hypervisor.type=kvm
|
||||
|
||||
# set the hypervisor URI. Usually there is no need for changing this
|
||||
# For KVM: qemu:///system
|
||||
# For LXC: lxc:///
|
||||
# hypervisor.uri=qemu:///system
|
||||
|
||||
# settings to enable direct networking in libvirt, should not be used
|
||||
# on hosts that run system vms, values for mode are: private, bridge, vepa
|
||||
# libvirt.vif.driver=com.cloud.hypervisor.kvm.resource.DirectVifDriver
|
||||
|
|
|
|||
|
|
@ -82,6 +82,7 @@ public class AgentShell implements IAgentShell, Daemon {
|
|||
private int _pingRetries;
|
||||
private final List<Agent> _agents = new ArrayList<Agent>();
|
||||
|
||||
|
||||
public AgentShell() {
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,504 +0,0 @@
|
|||
// Licensed to the Apache Software Foundation (ASF) under one
|
||||
// or more contributor license agreements. See the NOTICE file
|
||||
// distributed with this work for additional information
|
||||
// regarding copyright ownership. The ASF licenses this file
|
||||
// to you under the Apache License, Version 2.0 (the
|
||||
// "License"); you may not use this file except in compliance
|
||||
// with the License. You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing,
|
||||
// software distributed under the License is distributed on an
|
||||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
// KIND, either express or implied. See the License for the
|
||||
// specific language governing permissions and limitations
|
||||
// under the License.
|
||||
package com.cloud.agent;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
|
||||
import javax.naming.ConfigurationException;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.agent.Agent.ExitStatus;
|
||||
import com.cloud.agent.api.Command;
|
||||
import com.cloud.agent.api.StartupVMMAgentCommand;
|
||||
import com.cloud.agent.dao.StorageComponent;
|
||||
import com.cloud.agent.dao.impl.PropertiesStorage;
|
||||
import com.cloud.agent.transport.Request;
|
||||
import com.cloud.resource.ServerResource;
|
||||
import com.cloud.utils.NumbersUtil;
|
||||
import com.cloud.utils.PropertiesUtil;
|
||||
import com.cloud.utils.backoff.BackoffAlgorithm;
|
||||
import com.cloud.utils.backoff.impl.ConstantTimeBackoff;
|
||||
import com.cloud.utils.exception.CloudRuntimeException;
|
||||
import com.cloud.utils.net.MacAddress;
|
||||
import com.cloud.utils.nio.HandlerFactory;
|
||||
import com.cloud.utils.nio.Link;
|
||||
import com.cloud.utils.nio.NioServer;
|
||||
import com.cloud.utils.nio.Task;
|
||||
|
||||
/**
|
||||
* Implementation of agent shell to run the agents on System Center Virtual Machine manager
|
||||
**/
|
||||
|
||||
public class VmmAgentShell implements IAgentShell, HandlerFactory {
|
||||
|
||||
private static final Logger s_logger = Logger.getLogger(VmmAgentShell.class.getName());
|
||||
private final Properties _properties = new Properties();
|
||||
private final Map<String, Object> _cmdLineProperties = new HashMap<String, Object>();
|
||||
private StorageComponent _storage;
|
||||
private BackoffAlgorithm _backoff;
|
||||
private String _version;
|
||||
private String _zone;
|
||||
private String _pod;
|
||||
private String _cluster;
|
||||
private String _host;
|
||||
private String _privateIp;
|
||||
private int _port;
|
||||
private int _proxyPort;
|
||||
private int _workers;
|
||||
private String _guid;
|
||||
static private NioServer _connection;
|
||||
static private int _listenerPort=9000;
|
||||
private int _nextAgentId = 1;
|
||||
private volatile boolean _exit = false;
|
||||
private int _pingRetries;
|
||||
private final Thread _consoleProxyMain = null;
|
||||
private final List<Agent> _agents = new ArrayList<Agent>();
|
||||
|
||||
public VmmAgentShell() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Properties getProperties() {
|
||||
return _properties;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BackoffAlgorithm getBackoffAlgorithm() {
|
||||
return _backoff;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPingRetries() {
|
||||
return _pingRetries;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getZone() {
|
||||
return _zone;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPod() {
|
||||
return _pod;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHost() {
|
||||
return _host;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPrivateIp() {
|
||||
return _privateIp;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPort() {
|
||||
return _port;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getProxyPort() {
|
||||
return _proxyPort;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getWorkers() {
|
||||
return _workers;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGuid() {
|
||||
return _guid;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void upgradeAgent(String url) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getVersion() {
|
||||
return _version;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getCmdLineProperties() {
|
||||
// TODO Auto-generated method stub
|
||||
return _cmdLineProperties;
|
||||
}
|
||||
|
||||
public String getProperty(String prefix, String name) {
|
||||
if(prefix != null)
|
||||
return _properties.getProperty(prefix + "." + name);
|
||||
|
||||
return _properties.getProperty(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPersistentProperty(String prefix, String name) {
|
||||
if(prefix != null)
|
||||
return _storage.get(prefix + "." + name);
|
||||
return _storage.get(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPersistentProperty(String prefix, String name, String value) {
|
||||
if(prefix != null)
|
||||
_storage.persist(prefix + "." + name, value);
|
||||
else
|
||||
_storage.persist(name, value);
|
||||
}
|
||||
|
||||
private void loadProperties() throws ConfigurationException {
|
||||
final File file = PropertiesUtil.findConfigFile("agent.properties");
|
||||
if (file == null) {
|
||||
throw new ConfigurationException("Unable to find agent.properties.");
|
||||
}
|
||||
|
||||
s_logger.info("agent.properties found at " + file.getAbsolutePath());
|
||||
|
||||
try {
|
||||
_properties.load(new FileInputStream(file));
|
||||
} catch (final FileNotFoundException ex) {
|
||||
throw new CloudRuntimeException("Cannot find the file: " + file.getAbsolutePath(), ex);
|
||||
} catch (final IOException ex) {
|
||||
throw new CloudRuntimeException("IOException in reading " + file.getAbsolutePath(), ex);
|
||||
}
|
||||
}
|
||||
|
||||
protected boolean parseCommand(final String[] args) throws ConfigurationException {
|
||||
String host = null;
|
||||
String workers = null;
|
||||
String port = null;
|
||||
String zone = null;
|
||||
String pod = null;
|
||||
String guid = null;
|
||||
for (int i = 0; i < args.length; i++) {
|
||||
final String[] tokens = args[i].split("=");
|
||||
if (tokens.length != 2) {
|
||||
System.out.println("Invalid Parameter: " + args[i]);
|
||||
continue;
|
||||
}
|
||||
|
||||
// save command line properties
|
||||
_cmdLineProperties.put(tokens[0], tokens[1]);
|
||||
|
||||
if (tokens[0].equalsIgnoreCase("port")) {
|
||||
port = tokens[1];
|
||||
} else if (tokens[0].equalsIgnoreCase("threads")) {
|
||||
workers = tokens[1];
|
||||
} else if (tokens[0].equalsIgnoreCase("host")) {
|
||||
host = tokens[1];
|
||||
} else if(tokens[0].equalsIgnoreCase("zone")) {
|
||||
zone = tokens[1];
|
||||
} else if(tokens[0].equalsIgnoreCase("pod")) {
|
||||
pod = tokens[1];
|
||||
} else if(tokens[0].equalsIgnoreCase("guid")) {
|
||||
guid = tokens[1];
|
||||
} else if(tokens[0].equalsIgnoreCase("eth1ip")) {
|
||||
_privateIp = tokens[1];
|
||||
}
|
||||
}
|
||||
|
||||
if (port == null) {
|
||||
port = getProperty(null, "port");
|
||||
}
|
||||
|
||||
_port = NumbersUtil.parseInt(port, 8250);
|
||||
|
||||
_proxyPort = NumbersUtil.parseInt(getProperty(null, "consoleproxy.httpListenPort"), 443);
|
||||
|
||||
if (workers == null) {
|
||||
workers = getProperty(null, "workers");
|
||||
}
|
||||
|
||||
_workers = NumbersUtil.parseInt(workers, 5);
|
||||
|
||||
if (host == null) {
|
||||
host = getProperty(null, "host");
|
||||
}
|
||||
|
||||
if (host == null) {
|
||||
host = "localhost";
|
||||
}
|
||||
_host = host;
|
||||
|
||||
if(zone != null)
|
||||
_zone = zone;
|
||||
else
|
||||
_zone = getProperty(null, "zone");
|
||||
if (_zone == null || (_zone.startsWith("@") && _zone.endsWith("@"))) {
|
||||
_zone = "default";
|
||||
}
|
||||
|
||||
if(pod != null)
|
||||
_pod = pod;
|
||||
else
|
||||
_pod = getProperty(null, "pod");
|
||||
if (_pod == null || (_pod.startsWith("@") && _pod.endsWith("@"))) {
|
||||
_pod = "default";
|
||||
}
|
||||
|
||||
if (_host == null || (_host.startsWith("@") && _host.endsWith("@"))) {
|
||||
throw new ConfigurationException("Host is not configured correctly: " + _host);
|
||||
}
|
||||
|
||||
final String retries = getProperty(null, "ping.retries");
|
||||
_pingRetries = NumbersUtil.parseInt(retries, 5);
|
||||
|
||||
String value = getProperty(null, "developer");
|
||||
boolean developer = Boolean.parseBoolean(value);
|
||||
|
||||
if(guid != null)
|
||||
_guid = guid;
|
||||
else
|
||||
_guid = getProperty(null, "guid");
|
||||
if (_guid == null) {
|
||||
if (!developer) {
|
||||
throw new ConfigurationException("Unable to find the guid");
|
||||
}
|
||||
_guid = MacAddress.getMacAddress().toString(":");
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private void launchAgentFromTypeInfo() throws ConfigurationException {
|
||||
String typeInfo = getProperty(null, "type");
|
||||
if (typeInfo == null) {
|
||||
s_logger.error("Unable to retrieve the type");
|
||||
throw new ConfigurationException("Unable to retrieve the type of this agent.");
|
||||
}
|
||||
s_logger.trace("Launching agent based on type=" + typeInfo);
|
||||
}
|
||||
|
||||
private void launchAgent() throws ConfigurationException {
|
||||
String resourceClassNames = getProperty(null, "resource");
|
||||
s_logger.trace("resource=" + resourceClassNames);
|
||||
if(resourceClassNames != null) {
|
||||
launchAgentFromClassInfo(resourceClassNames);
|
||||
return;
|
||||
}
|
||||
|
||||
launchAgentFromTypeInfo();
|
||||
}
|
||||
|
||||
private void init(String[] args) throws ConfigurationException{
|
||||
|
||||
final Class<?> c = this.getClass();
|
||||
_version = c.getPackage().getImplementationVersion();
|
||||
if (_version == null) {
|
||||
throw new CloudRuntimeException("Unable to find the implementation version of this agent");
|
||||
}
|
||||
s_logger.info("Implementation Version is " + _version);
|
||||
|
||||
parseCommand(args);
|
||||
|
||||
s_logger.info("Defaulting to using properties file for storage");
|
||||
_storage = new PropertiesStorage();
|
||||
_storage.configure("Storage", new HashMap<String, Object>());
|
||||
|
||||
// merge with properties from command line to let resource access command line parameters
|
||||
for(Map.Entry<String, Object> cmdLineProp : getCmdLineProperties().entrySet()) {
|
||||
_properties.put(cmdLineProp.getKey(), cmdLineProp.getValue());
|
||||
}
|
||||
|
||||
s_logger.info("Defaulting to the constant time backoff algorithm");
|
||||
_backoff = new ConstantTimeBackoff();
|
||||
_backoff.configure("ConstantTimeBackoff", new HashMap<String, Object>());
|
||||
}
|
||||
|
||||
private void launchAgentFromClassInfo(String resourceClassNames) throws ConfigurationException {
|
||||
String[] names = resourceClassNames.split("\\|");
|
||||
for(String name: names) {
|
||||
Class<?> impl;
|
||||
try {
|
||||
impl = Class.forName(name);
|
||||
final Constructor<?> constructor = impl.getDeclaredConstructor();
|
||||
constructor.setAccessible(true);
|
||||
ServerResource resource = (ServerResource)constructor.newInstance();
|
||||
launchAgent(getNextAgentId(), resource);
|
||||
} catch (final ClassNotFoundException e) {
|
||||
throw new ConfigurationException("Resource class not found: " + name);
|
||||
} catch (final SecurityException e) {
|
||||
throw new ConfigurationException("Security excetion when loading resource: " + name);
|
||||
} catch (final NoSuchMethodException e) {
|
||||
throw new ConfigurationException("Method not found excetion when loading resource: " + name);
|
||||
} catch (final IllegalArgumentException e) {
|
||||
throw new ConfigurationException("Illegal argument excetion when loading resource: " + name);
|
||||
} catch (final InstantiationException e) {
|
||||
throw new ConfigurationException("Instantiation excetion when loading resource: " + name);
|
||||
} catch (final IllegalAccessException e) {
|
||||
throw new ConfigurationException("Illegal access exception when loading resource: " + name);
|
||||
} catch (final InvocationTargetException e) {
|
||||
throw new ConfigurationException("Invocation target exception when loading resource: " + name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void launchAgent(int localAgentId, ServerResource resource) throws ConfigurationException {
|
||||
// we don't track agent after it is launched for now
|
||||
Agent agent = new Agent(this, localAgentId, resource);
|
||||
_agents.add(agent);
|
||||
agent.start();
|
||||
}
|
||||
|
||||
public synchronized int getNextAgentId() {
|
||||
return _nextAgentId++;
|
||||
}
|
||||
|
||||
private void run(String[] args) {
|
||||
|
||||
try {
|
||||
System.setProperty("java.net.preferIPv4Stack","true");
|
||||
loadProperties();
|
||||
init(args);
|
||||
|
||||
String instance = getProperty(null, "instance");
|
||||
if (instance == null) {
|
||||
instance = "";
|
||||
} else {
|
||||
instance += ".";
|
||||
}
|
||||
|
||||
// TODO need to do this check. For Agentshell running on windows needs different approach
|
||||
//final String run = "agent." + instance + "pid";
|
||||
//s_logger.debug("Checking to see if " + run + "exists.");
|
||||
//ProcessUtil.pidCheck(run);
|
||||
|
||||
|
||||
// TODO: For Hyper-V agent.properties need to be revamped to support multiple agents
|
||||
// corresponding to multiple clusters but running on a SCVMM host
|
||||
|
||||
// read the persistent storage and launch the agents
|
||||
//launchAgent();
|
||||
|
||||
// FIXME get rid of this approach of agent listening for boot strap commands from the management server
|
||||
|
||||
// now listen for bootstrap request from the management server and launch agents
|
||||
_connection = new NioServer("VmmAgentShell", _listenerPort, 1, this);
|
||||
_connection.start();
|
||||
s_logger.info("SCVMM agent is listening on port " +_listenerPort + " for bootstrap command from management server");
|
||||
while(_connection.isRunning());
|
||||
} catch(final ConfigurationException e) {
|
||||
s_logger.error("Unable to start agent: " + e.getMessage());
|
||||
System.out.println("Unable to start agent: " + e.getMessage());
|
||||
System.exit(ExitStatus.Configuration.value());
|
||||
} catch (final Exception e) {
|
||||
s_logger.error("Unable to start agent: ", e);
|
||||
System.out.println("Unable to start agent: " + e.getMessage());
|
||||
System.exit(ExitStatus.Error.value());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Task create(com.cloud.utils.nio.Task.Type type, Link link,
|
||||
byte[] data) {
|
||||
return new AgentBootStrapHandler(type, link, data);
|
||||
}
|
||||
|
||||
public void stop() {
|
||||
_exit = true;
|
||||
if(_consoleProxyMain != null) {
|
||||
_consoleProxyMain.interrupt();
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
VmmAgentShell shell = new VmmAgentShell();
|
||||
Runtime.getRuntime().addShutdownHook(new ShutdownThread(shell));
|
||||
shell.run(args);
|
||||
}
|
||||
|
||||
// class to handle the bootstrap command from the management server
|
||||
private class AgentBootStrapHandler extends Task {
|
||||
|
||||
public AgentBootStrapHandler(Task.Type type, Link link, byte[] data) {
|
||||
super(type, link, data);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doTask(Task task) throws Exception {
|
||||
final Type type = task.getType();
|
||||
s_logger.info("recieved task of type "+ type.toString() +" to handle in BootStrapTakHandler");
|
||||
if (type == Task.Type.DATA)
|
||||
{
|
||||
final byte[] data = task.getData();
|
||||
final Request request = Request.parse(data);
|
||||
final Command cmd = request.getCommand();
|
||||
|
||||
if (cmd instanceof StartupVMMAgentCommand) {
|
||||
|
||||
StartupVMMAgentCommand vmmCmd = (StartupVMMAgentCommand) cmd;
|
||||
|
||||
_zone = Long.toString(vmmCmd.getDataCenter());
|
||||
_cmdLineProperties.put("zone", _zone);
|
||||
|
||||
_pod = Long.toString(vmmCmd.getPod());
|
||||
_cmdLineProperties.put("pod", _pod);
|
||||
|
||||
_cluster = vmmCmd.getClusterName();
|
||||
_cmdLineProperties.put("cluster", _cluster);
|
||||
|
||||
_guid = vmmCmd.getGuid();
|
||||
_cmdLineProperties.put("guid", _guid);
|
||||
|
||||
_host = vmmCmd.getManagementServerIP();
|
||||
_port = NumbersUtil.parseInt(vmmCmd.getport(), 8250);
|
||||
|
||||
s_logger.info("Recieved boot strap command from management server with parameters " +
|
||||
" Zone:"+ _zone + " "+
|
||||
" Cluster:"+ _cluster + " "+
|
||||
" pod:"+_pod + " "+
|
||||
" host:"+ _host +" "+
|
||||
" port:"+_port);
|
||||
|
||||
launchAgentFromClassInfo("com.cloud.hypervisor.hyperv.resource.HypervResource");
|
||||
|
||||
// TODO: persist the info in agent.properties for agent restarts
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static class ShutdownThread extends Thread {
|
||||
VmmAgentShell _shell;
|
||||
public ShutdownThread(VmmAgentShell shell) {
|
||||
this._shell = shell;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
_shell.stop();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -23,6 +23,7 @@ public class Answer extends Command {
|
|||
protected String details;
|
||||
|
||||
protected Answer() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
public Answer(Command command) {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
package com.cloud.agent.api.storage;
|
||||
// Licensed to the Apache Software Foundation (ASF) under one
|
||||
// or more contributor license agreements. See the NOTICE file
|
||||
// distributed with this work for additional information
|
||||
31
core/src/com/cloud/agent/api/storage/DeleteVolumeCommand.java → api/src/com/cloud/agent/api/storage/PasswordAuth.java
Executable file → Normal file
31
core/src/com/cloud/agent/api/storage/DeleteVolumeCommand.java → api/src/com/cloud/agent/api/storage/PasswordAuth.java
Executable file → Normal file
|
|
@ -16,23 +16,24 @@
|
|||
// under the License.
|
||||
package com.cloud.agent.api.storage;
|
||||
|
||||
public class DeleteVolumeCommand extends ssCommand {
|
||||
private String volumePath;
|
||||
/**
|
||||
* Password authentication
|
||||
*/
|
||||
public class PasswordAuth {
|
||||
|
||||
public DeleteVolumeCommand() {
|
||||
}
|
||||
String userName;
|
||||
String password;
|
||||
public PasswordAuth() {
|
||||
|
||||
public DeleteVolumeCommand(String secUrl, String volumePath) {
|
||||
this.setSecUrl(secUrl);
|
||||
this.volumePath = volumePath;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean executeInSequence() {
|
||||
return true;
|
||||
public PasswordAuth(String user, String password) {
|
||||
this.userName = user;
|
||||
this.password = password;
|
||||
}
|
||||
public String getUserName() {
|
||||
return userName;
|
||||
}
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public String getVolumePath() {
|
||||
return volumePath;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,72 @@
|
|||
// Licensed to the Apache Software Foundation (ASF) under one
|
||||
// or more contributor license agreements. See the NOTICE file
|
||||
// distributed with this work for additional information
|
||||
// regarding copyright ownership. The ASF licenses this file
|
||||
// to you under the Apache License, Version 2.0 (the
|
||||
// "License"); you may not use this file except in compliance
|
||||
// with the License. You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing,
|
||||
// software distributed under the License is distributed on an
|
||||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
// KIND, either express or implied. See the License for the
|
||||
// specific language governing permissions and limitations
|
||||
// under the License.
|
||||
package com.cloud.agent.api.storage;
|
||||
|
||||
import java.net.URI;
|
||||
|
||||
/**
|
||||
* Download Proxy
|
||||
*/
|
||||
public class Proxy {
|
||||
private String _host;
|
||||
private int _port;
|
||||
private String _userName;
|
||||
private String _password;
|
||||
|
||||
public Proxy() {
|
||||
|
||||
}
|
||||
|
||||
public Proxy(String host, int port, String userName, String password) {
|
||||
this._host = host;
|
||||
this._port = port;
|
||||
this._userName = userName;
|
||||
this._password = password;
|
||||
}
|
||||
|
||||
public Proxy(URI uri) {
|
||||
this._host = uri.getHost();
|
||||
this._port = uri.getPort() == -1 ? 3128 : uri.getPort();
|
||||
String userInfo = uri.getUserInfo();
|
||||
if (userInfo != null) {
|
||||
String[] tokens = userInfo.split(":");
|
||||
if (tokens.length == 1) {
|
||||
this._userName = userInfo;
|
||||
this._password = "";
|
||||
} else if (tokens.length == 2) {
|
||||
this._userName = tokens[0];
|
||||
this._password = tokens[1];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public String getHost() {
|
||||
return _host;
|
||||
}
|
||||
|
||||
public int getPort() {
|
||||
return _port;
|
||||
}
|
||||
|
||||
public String getUserName() {
|
||||
return _userName;
|
||||
}
|
||||
|
||||
public String getPassword() {
|
||||
return _password;
|
||||
}
|
||||
}
|
||||
|
|
@ -16,7 +16,7 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.cloudstack.engine.subsystem.api.storage;
|
||||
package com.cloud.agent.api.to;
|
||||
|
||||
public enum DataObjectType {
|
||||
VOLUME,
|
||||
|
|
@ -16,8 +16,11 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.cloudstack.storage.volume;
|
||||
package com.cloud.agent.api.to;
|
||||
|
||||
public interface VolumeMotionService {
|
||||
boolean copyVolume(String volumeUri, String destVolumeUri);
|
||||
import com.cloud.storage.DataStoreRole;
|
||||
|
||||
|
||||
public interface DataStoreTO {
|
||||
public DataStoreRole getRole();
|
||||
}
|
||||
|
|
@ -16,9 +16,15 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.cloudstack.storage.image.motion;
|
||||
package com.cloud.agent.api.to;
|
||||
|
||||
import org.apache.cloudstack.storage.motion.DataMotionStrategy;
|
||||
public interface DataTO {
|
||||
public DataObjectType getObjectType();
|
||||
public DataStoreTO getDataStore();
|
||||
/**
|
||||
* @return
|
||||
*/
|
||||
String getPath();
|
||||
|
||||
public interface ImageMotionStrategy extends DataMotionStrategy {
|
||||
long getId();
|
||||
}
|
||||
|
|
@ -0,0 +1,70 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package com.cloud.agent.api.to;
|
||||
|
||||
import com.cloud.storage.Volume;
|
||||
|
||||
public class DiskTO {
|
||||
private DataTO data;
|
||||
private Long diskSeq;
|
||||
private String vdiUuid;
|
||||
private Volume.Type type;
|
||||
public DiskTO() {
|
||||
|
||||
}
|
||||
|
||||
public DiskTO(DataTO data, Long diskSeq, String vdiUuid, Volume.Type type) {
|
||||
this.data = data;
|
||||
this.diskSeq = diskSeq;
|
||||
this.vdiUuid = vdiUuid;
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public DataTO getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(DataTO data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public Long getDiskSeq() {
|
||||
return diskSeq;
|
||||
}
|
||||
|
||||
public void setDiskSeq(Long diskSeq) {
|
||||
this.diskSeq = diskSeq;
|
||||
}
|
||||
|
||||
public String getVdiUuid() {
|
||||
return vdiUuid;
|
||||
}
|
||||
|
||||
public void setVdiUuid(String vdiUuid) {
|
||||
this.vdiUuid = vdiUuid;
|
||||
}
|
||||
|
||||
public Volume.Type getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(Volume.Type type) {
|
||||
this.type = type;
|
||||
}
|
||||
}
|
||||
|
|
@ -20,11 +20,14 @@ public class DnsmasqTO {
|
|||
String routerIp;
|
||||
String gateway;
|
||||
String netmask;
|
||||
String startIpOfSubnet;
|
||||
|
||||
public DnsmasqTO(String routerIp, String gateway, String netmask) {
|
||||
public DnsmasqTO(String routerIp, String gateway, String netmask, String StartIpOfSubnet) {
|
||||
this.routerIp = routerIp;
|
||||
this.startIpOfSubnet = StartIpOfSubnet;
|
||||
this.gateway = gateway;
|
||||
this.netmask =netmask;
|
||||
|
||||
}
|
||||
|
||||
public void setRouterIp(String routerIp){
|
||||
|
|
@ -39,6 +42,10 @@ public class DnsmasqTO {
|
|||
this.netmask = netmask ;
|
||||
}
|
||||
|
||||
public void setStartIpOfSubnet( String ipOfSubNet) {
|
||||
startIpOfSubnet = ipOfSubNet;
|
||||
}
|
||||
|
||||
public String getRouterIp() {
|
||||
return routerIp;
|
||||
}
|
||||
|
|
@ -50,4 +57,8 @@ public class DnsmasqTO {
|
|||
public String getNetmask() {
|
||||
return netmask;
|
||||
}
|
||||
public String getStartIpOfSubnet() {
|
||||
return startIpOfSubnet;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,6 +53,9 @@ public class FirewallRuleTO implements InternalIdentity {
|
|||
private Integer icmpType;
|
||||
private Integer icmpCode;
|
||||
private FirewallRule.TrafficType trafficType;
|
||||
private String guestCidr;
|
||||
private boolean defaultEgressPolicy;
|
||||
private FirewallRule.FirewallRuleType type;
|
||||
|
||||
protected FirewallRuleTO() {
|
||||
}
|
||||
|
|
@ -106,13 +109,22 @@ public class FirewallRuleTO implements InternalIdentity {
|
|||
this.trafficType = trafficType;
|
||||
}
|
||||
|
||||
public FirewallRuleTO(FirewallRule rule, String srcVlanTag, String srcIp, FirewallRule.Purpose purpose, FirewallRule.TrafficType trafficType, boolean defaultEgressPolicy) {
|
||||
this(rule.getId(),srcVlanTag, srcIp, rule.getProtocol(), rule.getSourcePortStart(), rule.getSourcePortEnd(), rule.getState()==State.Revoke, rule.getState()==State.Active, purpose,rule.getSourceCidrList(),rule.getIcmpType(),rule.getIcmpCode());
|
||||
this.trafficType = trafficType;
|
||||
this.defaultEgressPolicy = defaultEgressPolicy;
|
||||
}
|
||||
|
||||
public FirewallRuleTO(FirewallRule rule, String srcVlanTag, String srcIp, FirewallRule.Purpose purpose, boolean revokeState, boolean alreadyAdded) {
|
||||
this(rule.getId(),srcVlanTag, srcIp, rule.getProtocol(), rule.getSourcePortStart(), rule.getSourcePortEnd(), revokeState, alreadyAdded, purpose,rule.getSourceCidrList(),rule.getIcmpType(),rule.getIcmpCode());
|
||||
}
|
||||
|
||||
public FirewallRuleTO(FirewallRule rule, String guestVlanTag, FirewallRule.TrafficType trafficType) {
|
||||
public FirewallRuleTO(FirewallRule rule, String guestVlanTag, FirewallRule.TrafficType trafficType, String guestCidr, boolean defaultEgressPolicy, FirewallRule.FirewallRuleType type) {
|
||||
this(rule.getId(), guestVlanTag, null, rule.getProtocol(), rule.getSourcePortStart(), rule.getSourcePortEnd(), rule.getState()==State.Revoke, rule.getState()==State.Active, rule.getPurpose(), rule.getSourceCidrList(), rule.getIcmpType(), rule.getIcmpCode());
|
||||
this.trafficType = trafficType;
|
||||
this.defaultEgressPolicy = defaultEgressPolicy;
|
||||
this.guestCidr = guestCidr;
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public FirewallRule.TrafficType getTrafficType(){
|
||||
|
|
@ -170,4 +182,15 @@ public class FirewallRuleTO implements InternalIdentity {
|
|||
return purpose;
|
||||
}
|
||||
|
||||
public boolean isDefaultEgressPolicy() {
|
||||
return defaultEgressPolicy;
|
||||
}
|
||||
|
||||
public String getGuestCidr() {
|
||||
return guestCidr;
|
||||
}
|
||||
|
||||
public FirewallRule.FirewallRuleType getType() {
|
||||
return type;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,31 +14,47 @@
|
|||
// KIND, either express or implied. See the License for the
|
||||
// specific language governing permissions and limitations
|
||||
// under the License.
|
||||
package org.apache.cloudstack.storage.to;
|
||||
package com.cloud.agent.api.to;
|
||||
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStoreInfo;
|
||||
import com.cloud.storage.DataStoreRole;
|
||||
|
||||
public final class NfsTO implements DataStoreTO {
|
||||
|
||||
private String _url;
|
||||
private DataStoreRole _role;
|
||||
|
||||
public NfsTO() {
|
||||
|
||||
super();
|
||||
|
||||
public class NfsPrimaryDataStoreTO extends PrimaryDataStoreTO {
|
||||
private String server;
|
||||
private String path;
|
||||
|
||||
public NfsPrimaryDataStoreTO(PrimaryDataStoreInfo dataStore) {
|
||||
super(dataStore);
|
||||
}
|
||||
|
||||
public void setServer(String server) {
|
||||
this.server = server;
|
||||
|
||||
public NfsTO(String url, DataStoreRole role) {
|
||||
|
||||
super();
|
||||
|
||||
this._url = url;
|
||||
this._role = role;
|
||||
|
||||
}
|
||||
|
||||
public String getServer() {
|
||||
return this.server;
|
||||
|
||||
public String getUrl() {
|
||||
return _url;
|
||||
}
|
||||
|
||||
public void setPath(String path) {
|
||||
this.path = path;
|
||||
|
||||
public void setUrl(String _url) {
|
||||
this._url = _url;
|
||||
}
|
||||
|
||||
public String getPath() {
|
||||
return this.path;
|
||||
|
||||
@Override
|
||||
public DataStoreRole getRole() {
|
||||
return _role;
|
||||
}
|
||||
|
||||
public void setRole(DataStoreRole _role) {
|
||||
this._role = _role;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -18,9 +18,10 @@ package com.cloud.agent.api.to;
|
|||
|
||||
import java.util.Date;
|
||||
|
||||
import com.cloud.storage.DataStoreRole;
|
||||
import com.cloud.utils.S3Utils;
|
||||
|
||||
public final class S3TO implements S3Utils.ClientOptions {
|
||||
public final class S3TO implements S3Utils.ClientOptions, DataStoreTO {
|
||||
|
||||
private Long id;
|
||||
private String uuid;
|
||||
|
|
@ -33,6 +34,7 @@ public final class S3TO implements S3Utils.ClientOptions {
|
|||
private Integer maxErrorRetry;
|
||||
private Integer socketTimeout;
|
||||
private Date created;
|
||||
private boolean enableRRS;
|
||||
|
||||
public S3TO() {
|
||||
|
||||
|
|
@ -44,7 +46,7 @@ public final class S3TO implements S3Utils.ClientOptions {
|
|||
final String secretKey, final String endPoint,
|
||||
final String bucketName, final Boolean httpsFlag,
|
||||
final Integer connectionTimeout, final Integer maxErrorRetry,
|
||||
final Integer socketTimeout, final Date created) {
|
||||
final Integer socketTimeout, final Date created, final boolean enableRRS) {
|
||||
|
||||
super();
|
||||
|
||||
|
|
@ -59,6 +61,7 @@ public final class S3TO implements S3Utils.ClientOptions {
|
|||
this.maxErrorRetry = maxErrorRetry;
|
||||
this.socketTimeout = socketTimeout;
|
||||
this.created = created;
|
||||
this.enableRRS = enableRRS;
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -128,6 +131,10 @@ public final class S3TO implements S3Utils.ClientOptions {
|
|||
return false;
|
||||
}
|
||||
|
||||
if (enableRRS != thatS3TO.enableRRS) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
|
@ -249,4 +256,20 @@ public final class S3TO implements S3Utils.ClientOptions {
|
|||
this.created = created;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataStoreRole getRole() {
|
||||
return DataStoreRole.Image;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public boolean getEnableRRS() {
|
||||
return enableRRS;
|
||||
}
|
||||
|
||||
public void setEnableRRS(boolean enableRRS) {
|
||||
this.enableRRS = enableRRS;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,9 @@
|
|||
// under the License.
|
||||
package com.cloud.agent.api.to;
|
||||
|
||||
public class SwiftTO {
|
||||
import com.cloud.storage.DataStoreRole;
|
||||
|
||||
public class SwiftTO implements DataStoreTO {
|
||||
Long id;
|
||||
String url;
|
||||
String account;
|
||||
|
|
@ -54,5 +56,11 @@ public class SwiftTO {
|
|||
return key;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataStoreRole getRole() {
|
||||
return DataStoreRole.Image;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,12 +52,13 @@ public class VirtualMachineTO {
|
|||
boolean rebootOnCrash;
|
||||
boolean enableHA;
|
||||
boolean limitCpuUse;
|
||||
boolean enableDynamicallyScaleVm;
|
||||
String vncPassword;
|
||||
String vncAddr;
|
||||
Map<String, String> params;
|
||||
String uuid;
|
||||
|
||||
VolumeTO[] disks;
|
||||
DiskTO[] disks;
|
||||
NicTO[] nics;
|
||||
|
||||
public VirtualMachineTO(long id, String instanceName, VirtualMachine.Type type, int cpus, Integer speed, long minRam, long maxRam, BootloaderType bootloader, String os, boolean enableHA, boolean limitCpuUse, String vncPassword) {
|
||||
|
|
@ -102,6 +103,14 @@ public class VirtualMachineTO {
|
|||
this.id = id;
|
||||
}
|
||||
|
||||
public boolean isEnableDynamicallyScaleVm() {
|
||||
return enableDynamicallyScaleVm;
|
||||
}
|
||||
|
||||
public void setEnableDynamicallyScaleVm(boolean enableDynamicallyScaleVm) {
|
||||
this.enableDynamicallyScaleVm = enableDynamicallyScaleVm;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
|
@ -206,11 +215,11 @@ public class VirtualMachineTO {
|
|||
this.bootupScripts = bootupScripts;
|
||||
}
|
||||
|
||||
public VolumeTO[] getDisks() {
|
||||
public DiskTO[] getDisks() {
|
||||
return disks;
|
||||
}
|
||||
|
||||
public void setDisks(VolumeTO[] disks) {
|
||||
public void setDisks(DiskTO[] disks) {
|
||||
this.disks = disks;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -37,6 +37,10 @@ public class VolumeTO implements InternalIdentity {
|
|||
private long deviceId;
|
||||
private String chainInfo;
|
||||
private String guestOsType;
|
||||
private Long bytesReadRate;
|
||||
private Long bytesWriteRate;
|
||||
private Long iopsReadRate;
|
||||
private Long iopsWriteRate;
|
||||
|
||||
public VolumeTO(long id, Volume.Type type, StoragePoolType poolType, String poolUuid, String name, String mountPoint, String path, long size, String chainInfo) {
|
||||
this.id = id;
|
||||
|
|
@ -133,4 +137,37 @@ public class VolumeTO implements InternalIdentity {
|
|||
public String toString() {
|
||||
return new StringBuilder("Vol[").append(id).append("|").append(type).append("|").append(path).append("|").append(size).append("]").toString();
|
||||
}
|
||||
|
||||
public void setBytesReadRate(Long bytesReadRate) {
|
||||
this.bytesReadRate = bytesReadRate;
|
||||
}
|
||||
|
||||
public Long getBytesReadRate() {
|
||||
return bytesReadRate;
|
||||
}
|
||||
|
||||
public void setBytesWriteRate(Long bytesWriteRate) {
|
||||
this.bytesWriteRate = bytesWriteRate;
|
||||
}
|
||||
|
||||
public Long getBytesWriteRate() {
|
||||
return bytesWriteRate;
|
||||
}
|
||||
|
||||
public void setIopsReadRate(Long iopsReadRate) {
|
||||
this.iopsReadRate = iopsReadRate;
|
||||
}
|
||||
|
||||
public Long getIopsReadRate() {
|
||||
return iopsReadRate;
|
||||
}
|
||||
|
||||
public void setIopsWriteRate(Long iopsWriteRate) {
|
||||
this.iopsWriteRate = iopsWriteRate;
|
||||
}
|
||||
|
||||
public Long getIopsWriteRate() {
|
||||
return iopsWriteRate;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@ import java.util.List;
|
|||
import com.cloud.deploy.DeploymentPlan;
|
||||
import com.cloud.deploy.DeploymentPlanner.ExcludeList;
|
||||
import com.cloud.host.Host;
|
||||
import com.cloud.host.HostVO;
|
||||
import com.cloud.host.Host.Type;
|
||||
import com.cloud.offering.ServiceOffering;
|
||||
import com.cloud.utils.component.Adapter;
|
||||
|
|
@ -36,9 +35,9 @@ public interface HostAllocator extends Adapter {
|
|||
**/
|
||||
boolean isVirtualMachineUpgradable(final VirtualMachine vm, final ServiceOffering offering);
|
||||
|
||||
/**
|
||||
* Determines which physical hosts are suitable to
|
||||
* allocate the guest virtual machines on
|
||||
/**
|
||||
* Determines which physical hosts are suitable to
|
||||
* allocate the guest virtual machines on
|
||||
*
|
||||
* @param VirtualMachineProfile vmProfile
|
||||
* @param DeploymentPlan plan
|
||||
|
|
@ -46,13 +45,13 @@ public interface HostAllocator extends Adapter {
|
|||
* @param ExcludeList avoid
|
||||
* @param int returnUpTo (use -1 to return all possible hosts)
|
||||
* @return List<Host> List of hosts that are suitable for VM allocation
|
||||
**/
|
||||
**/
|
||||
|
||||
public List<Host> allocateTo(VirtualMachineProfile<?extends VirtualMachine> vmProfile, DeploymentPlan plan, Type type, ExcludeList avoid, int returnUpTo);
|
||||
|
||||
/**
|
||||
* Determines which physical hosts are suitable to
|
||||
* allocate the guest virtual machines on
|
||||
/**
|
||||
* Determines which physical hosts are suitable to
|
||||
* allocate the guest virtual machines on
|
||||
*
|
||||
* @param VirtualMachineProfile vmProfile
|
||||
* @param DeploymentPlan plan
|
||||
|
|
@ -61,7 +60,7 @@ public interface HostAllocator extends Adapter {
|
|||
* @param int returnUpTo (use -1 to return all possible hosts)
|
||||
* @param boolean considerReservedCapacity (default should be true, set to false if host capacity calculation should not look at reserved capacity)
|
||||
* @return List<Host> List of hosts that are suitable for VM allocation
|
||||
**/
|
||||
**/
|
||||
|
||||
public List<Host> allocateTo(VirtualMachineProfile<?extends VirtualMachine> vmProfile, DeploymentPlan plan, Type type, ExcludeList avoid, int returnUpTo, boolean considerReservedCapacity);
|
||||
|
||||
|
|
@ -78,7 +77,8 @@ public interface HostAllocator extends Adapter {
|
|||
* @param boolean considerReservedCapacity (default should be true, set to false if host capacity calculation should not look at reserved capacity)
|
||||
* @return List<Host> List of hosts that are suitable for VM allocation
|
||||
**/
|
||||
public List<Host> allocateTo(VirtualMachineProfile<? extends VirtualMachine> vmProfile, DeploymentPlan plan, Type type, ExcludeList avoid, List<HostVO> hosts, int returnUpTo, boolean considerReservedCapacity);
|
||||
public List<Host> allocateTo(VirtualMachineProfile<? extends VirtualMachine> vmProfile, DeploymentPlan plan, Type type, ExcludeList avoid, List<? extends Host> hosts,
|
||||
int returnUpTo, boolean considerReservedCapacity);
|
||||
|
||||
public static int RETURN_UPTO_ALL = -1;
|
||||
|
||||
|
|
@ -19,17 +19,15 @@ package com.cloud.agent.manager.allocator;
|
|||
import java.util.Set;
|
||||
|
||||
import com.cloud.dc.DataCenter;
|
||||
import com.cloud.dc.DataCenterVO;
|
||||
import com.cloud.dc.HostPodVO;
|
||||
import com.cloud.dc.Pod;
|
||||
import com.cloud.service.ServiceOfferingVO;
|
||||
import com.cloud.offering.ServiceOffering;
|
||||
import com.cloud.template.VirtualMachineTemplate;
|
||||
import com.cloud.utils.Pair;
|
||||
import com.cloud.utils.component.Adapter;
|
||||
import com.cloud.vm.VirtualMachineProfile;
|
||||
|
||||
public interface PodAllocator extends Adapter {
|
||||
Pair<HostPodVO, Long> allocateTo(VirtualMachineTemplate template, ServiceOfferingVO offering, DataCenterVO dc, long userId, Set<Long> avoids);
|
||||
Pair<Pod, Long> allocateTo(VirtualMachineTemplate template, ServiceOffering offering, DataCenter dc, long userId, Set<Long> avoids);
|
||||
|
||||
Pod allocateTo(VirtualMachineProfile vm, DataCenter dc, Set<? extends Pod> avoids);
|
||||
}
|
||||
|
|
@ -16,46 +16,13 @@
|
|||
// under the License.
|
||||
package com.cloud.async;
|
||||
|
||||
import org.apache.cloudstack.api.ApiCommandJobType;
|
||||
import org.apache.cloudstack.api.Identity;
|
||||
import org.apache.cloudstack.api.InternalIdentity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public interface AsyncJob extends Identity, InternalIdentity {
|
||||
public enum Type {
|
||||
None,
|
||||
VirtualMachine,
|
||||
DomainRouter,
|
||||
Volume,
|
||||
ConsoleProxy,
|
||||
Snapshot,
|
||||
Template,
|
||||
Iso,
|
||||
SystemVm,
|
||||
Host,
|
||||
StoragePool,
|
||||
IpAddress,
|
||||
SecurityGroup,
|
||||
PhysicalNetwork,
|
||||
TrafficType,
|
||||
PhysicalNetworkServiceProvider,
|
||||
FirewallRule,
|
||||
Account,
|
||||
User,
|
||||
PrivateGateway,
|
||||
StaticRoute,
|
||||
Counter,
|
||||
Condition,
|
||||
AutoScalePolicy,
|
||||
AutoScaleVmProfile,
|
||||
AutoScaleVmGroup,
|
||||
GlobalLoadBalancerRule,
|
||||
LoadBalancerRule,
|
||||
AffinityGroup,
|
||||
InternalLbVm,
|
||||
DedicatedGuestVlanRange
|
||||
}
|
||||
|
||||
long getUserId();
|
||||
|
||||
long getAccountId();
|
||||
|
|
@ -90,7 +57,7 @@ public interface AsyncJob extends Identity, InternalIdentity {
|
|||
|
||||
Date getRemoved();
|
||||
|
||||
Type getInstanceType();
|
||||
ApiCommandJobType getInstanceType();
|
||||
|
||||
Long getInstanceId();
|
||||
|
||||
|
|
|
|||
|
|
@ -39,6 +39,9 @@ import org.apache.cloudstack.api.command.admin.offering.UpdateDiskOfferingCmd;
|
|||
import org.apache.cloudstack.api.command.admin.offering.UpdateServiceOfferingCmd;
|
||||
import org.apache.cloudstack.api.command.admin.pod.DeletePodCmd;
|
||||
import org.apache.cloudstack.api.command.admin.pod.UpdatePodCmd;
|
||||
import org.apache.cloudstack.api.command.admin.region.CreatePortableIpRangeCmd;
|
||||
import org.apache.cloudstack.api.command.admin.region.DeletePortableIpRangeCmd;
|
||||
import org.apache.cloudstack.api.command.admin.region.ListPortableIpRangesCmd;
|
||||
import org.apache.cloudstack.api.command.admin.vlan.CreateVlanIpRangeCmd;
|
||||
import org.apache.cloudstack.api.command.admin.vlan.DedicatePublicIpRangeCmd;
|
||||
import org.apache.cloudstack.api.command.admin.vlan.DeleteVlanIpRangeCmd;
|
||||
|
|
@ -56,6 +59,8 @@ import com.cloud.offering.DiskOffering;
|
|||
import com.cloud.offering.NetworkOffering;
|
||||
import com.cloud.offering.ServiceOffering;
|
||||
import com.cloud.user.Account;
|
||||
import org.apache.cloudstack.region.PortableIp;
|
||||
import org.apache.cloudstack.region.PortableIpRange;
|
||||
|
||||
public interface ConfigurationService {
|
||||
|
||||
|
|
@ -278,4 +283,12 @@ public interface ConfigurationService {
|
|||
* @return
|
||||
*/
|
||||
boolean isOfferingForVpc(NetworkOffering offering);
|
||||
|
||||
PortableIpRange createPortableIpRange(CreatePortableIpRangeCmd cmd) throws ConcurrentOperationException;
|
||||
|
||||
boolean deletePortableIpRange(DeletePortableIpRangeCmd cmd);
|
||||
|
||||
List<? extends PortableIpRange> listPortableIpRanges(ListPortableIpRangesCmd cmd);
|
||||
|
||||
List<? extends PortableIp> listPortableIps(long id);
|
||||
}
|
||||
|
|
|
|||
33
core/src/com/cloud/agent/api/storage/DeleteTemplateCommand.java → api/src/com/cloud/dc/DedicatedResources.java
Normal file → Executable file
33
core/src/com/cloud/agent/api/storage/DeleteTemplateCommand.java → api/src/com/cloud/dc/DedicatedResources.java
Normal file → Executable file
|
|
@ -14,27 +14,20 @@
|
|||
// KIND, either express or implied. See the License for the
|
||||
// specific language governing permissions and limitations
|
||||
// under the License.
|
||||
package com.cloud.agent.api.storage;
|
||||
package com.cloud.dc;
|
||||
|
||||
import org.apache.cloudstack.acl.InfrastructureEntity;
|
||||
import org.apache.cloudstack.api.Identity;
|
||||
import org.apache.cloudstack.api.InternalIdentity;
|
||||
|
||||
public class DeleteTemplateCommand extends ssCommand {
|
||||
private String templatePath;
|
||||
public interface DedicatedResources extends InfrastructureEntity, InternalIdentity, Identity{
|
||||
long getId();
|
||||
Long getDataCenterId();
|
||||
Long getPodId();
|
||||
Long getClusterId();
|
||||
Long getHostId();
|
||||
Long getDomainId();
|
||||
Long getAccountId();
|
||||
String getUuid();
|
||||
|
||||
|
||||
public DeleteTemplateCommand() {
|
||||
}
|
||||
|
||||
public DeleteTemplateCommand(String secUrl, String templatePath) {
|
||||
this.setSecUrl(secUrl);
|
||||
this.templatePath = templatePath;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean executeInSequence() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public String getTemplatePath() {
|
||||
return templatePath;
|
||||
}
|
||||
}
|
||||
|
|
@ -18,6 +18,7 @@ package com.cloud.deploy;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import com.cloud.deploy.DeploymentPlanner.ExcludeList;
|
||||
import com.cloud.exception.InsufficientServerCapacityException;
|
||||
import com.cloud.vm.VirtualMachine;
|
||||
import com.cloud.vm.VirtualMachineProfile;
|
||||
|
|
@ -40,6 +41,7 @@ public interface DeploymentClusterPlanner extends DeploymentPlanner {
|
|||
List<Long> orderClusters(VirtualMachineProfile<? extends VirtualMachine> vm, DeploymentPlan plan, ExcludeList avoid)
|
||||
throws InsufficientServerCapacityException;
|
||||
|
||||
PlannerResourceUsage getResourceUsage();
|
||||
PlannerResourceUsage getResourceUsage(VirtualMachineProfile<? extends VirtualMachine> vmProfile,
|
||||
DeploymentPlan plan, ExcludeList avoid) throws InsufficientServerCapacityException;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,4 +52,5 @@ public class EventCategory {
|
|||
public static final EventCategory ALERT_EVENT = new EventCategory("AlertEvent");
|
||||
public static final EventCategory USAGE_EVENT = new EventCategory("UsageEvent");
|
||||
public static final EventCategory RESOURCE_STATE_CHANGE_EVENT = new EventCategory("ResourceStateEvent");
|
||||
public static final EventCategory ASYNC_JOB_CHANGE_EVENT = new EventCategory("AsyncJobEvent");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -102,6 +102,8 @@ public class EventTypes {
|
|||
// Network Events
|
||||
public static final String EVENT_NET_IP_ASSIGN = "NET.IPASSIGN";
|
||||
public static final String EVENT_NET_IP_RELEASE = "NET.IPRELEASE";
|
||||
public static final String EVENT_PORTABLE_IP_ASSIGN = "PORTABLE.IPASSIGN";
|
||||
public static final String EVENT_PORTABLE_IP_RELEASE = "PORTABLE.IPRELEASE";
|
||||
public static final String EVENT_NET_RULE_ADD = "NET.RULEADD";
|
||||
public static final String EVENT_NET_RULE_DELETE = "NET.RULEDELETE";
|
||||
public static final String EVENT_NET_RULE_MODIFY = "NET.RULEMODIFY";
|
||||
|
|
@ -432,6 +434,14 @@ public class EventTypes {
|
|||
public static final String EVENT_DEDICATED_GUEST_VLAN_RANGE_RELEASE = "GUESTVLANRANGE.RELEASE";
|
||||
|
||||
|
||||
public static final String EVENT_PORTABLE_IP_RANGE_CREATE = "PORTABLE.IP.RANGE.CREATE";
|
||||
public static final String EVENT_PORTABLE_IP_RANGE_DELETE = "PORTABLE.IP.RANGE.DELETE";
|
||||
public static final String EVENT_PORTABLE_IP_TRANSFER = "PORTABLE.IP.TRANSFER";
|
||||
|
||||
// Dedicated Resources
|
||||
public static final String EVENT_DEDICATE_RESOURCE = "DEDICATE.RESOURCE";
|
||||
public static final String EVENT_DEDICATE_RESOURCE_RELEASE = "DEDICATE.RESOURCE.RELEASE";
|
||||
|
||||
static {
|
||||
|
||||
// TODO: need a way to force author adding event types to declare the entity details as well, with out braking
|
||||
|
|
|
|||
|
|
@ -27,6 +27,8 @@ public class InsufficientServerCapacityException extends InsufficientCapacityExc
|
|||
|
||||
private static final long serialVersionUID = SerialVersionUID.InsufficientServerCapacityException;
|
||||
|
||||
private boolean affinityGroupsApplied = false;
|
||||
|
||||
public InsufficientServerCapacityException(String msg, Long clusterId) {
|
||||
this(msg, Cluster.class, clusterId);
|
||||
}
|
||||
|
|
@ -34,4 +36,13 @@ public class InsufficientServerCapacityException extends InsufficientCapacityExc
|
|||
public InsufficientServerCapacityException(String msg, Class<?> scope, Long id) {
|
||||
super(msg, scope, id);
|
||||
}
|
||||
|
||||
public InsufficientServerCapacityException(String msg, Class<?> scope, Long id, boolean affinityGroupsApplied) {
|
||||
super(msg, scope, id);
|
||||
this.affinityGroupsApplied = affinityGroupsApplied;
|
||||
}
|
||||
|
||||
public boolean isAffinityApplied() {
|
||||
return affinityGroupsApplied;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -81,7 +81,9 @@ public interface IpAddress extends ControlledEntity, Identity, InternalIdentity
|
|||
Long getVpcId();
|
||||
|
||||
String getVmIp();
|
||||
|
||||
|
||||
boolean isPortable();
|
||||
|
||||
Long getNetworkId();
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,70 @@
|
|||
// Licensed to the Apache Software Foundation (ASF) under one
|
||||
// or more contributor license agreements. See the NOTICE file
|
||||
// distributed with this work for additional information
|
||||
// regarding copyright ownership. The ASF licenses this file
|
||||
// to you under the Apache License, Version 2.0 (the
|
||||
// "License"); you may not use this file except in compliance
|
||||
// with the License. You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing,
|
||||
// software distributed under the License is distributed on an
|
||||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
// KIND, either express or implied. See the License for the
|
||||
// specific language governing permissions and limitations
|
||||
// under the License.
|
||||
package com.cloud.network;
|
||||
|
||||
import com.cloud.deploy.DeployDestination;
|
||||
import com.cloud.vm.NicProfile;
|
||||
import com.cloud.vm.ReservationContext;
|
||||
import com.cloud.vm.VirtualMachine;
|
||||
import com.cloud.vm.VirtualMachineProfile;
|
||||
|
||||
/**
|
||||
* NetworkGuru and NetworkElements that implement this interface
|
||||
* will be called during Virtual Machine migration.
|
||||
*/
|
||||
public interface NetworkMigrationResponder {
|
||||
/**
|
||||
* Prepare for migration.
|
||||
*
|
||||
* This method will be called per nic before the vm migration.
|
||||
* @param nic
|
||||
* @param network
|
||||
* @param vm
|
||||
* @param dest
|
||||
* @param context
|
||||
* @return true when operation was successful.
|
||||
*/
|
||||
public boolean prepareMigration(NicProfile nic, Network network, VirtualMachineProfile<? extends VirtualMachine> vm, DeployDestination dest, ReservationContext context);
|
||||
|
||||
/**
|
||||
* Cancel for migration preparation.
|
||||
*
|
||||
* This method will be called per nic when the entire vm migration
|
||||
* process failed and need to release the resouces that was
|
||||
* allocated at the migration preparation.
|
||||
* @param nic destination nic
|
||||
* @param network destination network
|
||||
* @param vm destination vm profile
|
||||
* @param src The context nic migrates from.
|
||||
* @param dst The context nic migrates to.
|
||||
*/
|
||||
public void rollbackMigration(NicProfile nic, Network network, VirtualMachineProfile<? extends VirtualMachine> vm, ReservationContext src, ReservationContext dst);
|
||||
|
||||
/**
|
||||
* Commit the migration resource.
|
||||
*
|
||||
* This method will be called per nic when the entire vm migration
|
||||
* process was successful. This is useful to release the resource of
|
||||
* source deployment where vm has left.
|
||||
* @param nic source nic
|
||||
* @param network source network
|
||||
* @param vm source vm profile
|
||||
* @param src the context nic migrates from.
|
||||
* @param dst the context nic migrates to.
|
||||
*/
|
||||
public void commitMigration(NicProfile nic, Network network, VirtualMachineProfile<? extends VirtualMachine> vm, ReservationContext src, ReservationContext dst);
|
||||
}
|
||||
|
|
@ -272,4 +272,10 @@ public interface NetworkModel {
|
|||
Map<Detail, String> getNtwkOffDetails(long offId);
|
||||
|
||||
Networks.IsolationType[] listNetworkIsolationMethods();
|
||||
|
||||
Nic getNicInNetworkIncludingRemoved(long vmId, long networkId);
|
||||
|
||||
boolean getExecuteInSeqNtwkElmtCmd();
|
||||
|
||||
boolean isNetworkReadyForGc(long networkId);
|
||||
}
|
||||
|
|
@ -52,6 +52,11 @@ public interface NetworkService {
|
|||
|
||||
boolean releaseIpAddress(long ipAddressId) throws InsufficientAddressCapacityException;
|
||||
|
||||
IpAddress allocatePortableIP(Account ipOwner, int regionId, Long zoneId, Long networkId, Long vpcId) throws ResourceAllocationException,
|
||||
InsufficientAddressCapacityException, ConcurrentOperationException;
|
||||
|
||||
boolean releasePortableIpAddress(long ipAddressId);
|
||||
|
||||
Network createGuestNetwork(CreateNetworkCmd cmd) throws InsufficientCapacityException, ConcurrentOperationException,
|
||||
ResourceAllocationException;
|
||||
|
||||
|
|
|
|||
|
|
@ -38,7 +38,8 @@ public interface PhysicalNetwork extends Identity, InternalIdentity {
|
|||
GRE,
|
||||
STT,
|
||||
VNS,
|
||||
MIDO;
|
||||
MIDO,
|
||||
SSP;
|
||||
}
|
||||
|
||||
public enum BroadcastDomainRange {
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ import com.cloud.exception.ConcurrentOperationException;
|
|||
import com.cloud.exception.InsufficientCapacityException;
|
||||
import com.cloud.exception.InsufficientNetworkCapacityException;
|
||||
import com.cloud.exception.ResourceUnavailableException;
|
||||
import com.cloud.network.vpc.NetworkACLItem;
|
||||
import com.cloud.network.vpc.PrivateGateway;
|
||||
import com.cloud.network.vpc.StaticRouteProfile;
|
||||
import com.cloud.network.vpc.Vpc;
|
||||
|
|
@ -53,5 +54,5 @@ public interface VpcProvider extends NetworkElement{
|
|||
|
||||
boolean applyStaticRoutes(Vpc vpc, List<StaticRouteProfile> routes) throws ResourceUnavailableException;
|
||||
|
||||
boolean applyACLItemsToPrivateGw(PrivateGateway gateway) throws ResourceUnavailableException;
|
||||
boolean applyACLItemsToPrivateGw(PrivateGateway gateway, List<? extends NetworkACLItem> rules) throws ResourceUnavailableException;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ public interface RemoteAccessVpnService {
|
|||
|
||||
RemoteAccessVpn createRemoteAccessVpn(long vpnServerAddressId, String ipRange, boolean openFirewall, long networkId)
|
||||
throws NetworkRuleConflictException;
|
||||
void destroyRemoteAccessVpn(long vpnServerAddressId, Account caller) throws ResourceUnavailableException;
|
||||
void destroyRemoteAccessVpnForIp(long vpnServerAddressId, Account caller) throws ResourceUnavailableException;
|
||||
RemoteAccessVpn startRemoteAccessVpn(long vpnServerAddressId, boolean openFirewall) throws ResourceUnavailableException;
|
||||
|
||||
VpnUser addVpnUser(long vpnOwnerId, String userName, String password);
|
||||
|
|
|
|||
|
|
@ -47,9 +47,37 @@ public interface DiskOffering extends InfrastructureEntity, Identity, InternalId
|
|||
|
||||
Date getCreated();
|
||||
|
||||
long getDiskSize();
|
||||
|
||||
boolean isCustomized();
|
||||
|
||||
void setDiskSize(long diskSize);
|
||||
|
||||
long getDiskSize();
|
||||
|
||||
void setCustomizedIops(Boolean customizedIops);
|
||||
|
||||
Boolean isCustomizedIops();
|
||||
|
||||
void setMinIops(Long minIops);
|
||||
|
||||
Long getMinIops();
|
||||
|
||||
void setMaxIops(Long maxIops);
|
||||
|
||||
Long getMaxIops();
|
||||
|
||||
void setBytesReadRate(Long bytesReadRate);
|
||||
|
||||
Long getBytesReadRate();
|
||||
|
||||
void setBytesWriteRate(Long bytesWriteRate);
|
||||
|
||||
Long getBytesWriteRate();
|
||||
|
||||
void setIopsReadRate(Long iopsReadRate);
|
||||
|
||||
Long getIopsReadRate();
|
||||
|
||||
void setIopsWriteRate(Long iopsWriteRate);
|
||||
|
||||
Long getIopsWriteRate();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,8 +16,6 @@
|
|||
// under the License.
|
||||
package com.cloud.offering;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.cloudstack.acl.InfrastructureEntity;
|
||||
import org.apache.cloudstack.api.Identity;
|
||||
import org.apache.cloudstack.api.InternalIdentity;
|
||||
|
|
@ -61,6 +59,8 @@ public interface NetworkOffering extends InfrastructureEntity, InternalIdentity,
|
|||
public final static String DefaultSharedEIPandELBNetworkOffering = "DefaultSharedNetscalerEIPandELBNetworkOffering";
|
||||
public final static String DefaultIsolatedNetworkOfferingForVpcNetworks = "DefaultIsolatedNetworkOfferingForVpcNetworks";
|
||||
public final static String DefaultIsolatedNetworkOfferingForVpcNetworksNoLB = "DefaultIsolatedNetworkOfferingForVpcNetworksNoLB";
|
||||
public final static String DefaultIsolatedNetworkOfferingForVpcNetworksWithInternalLB = "DefaultIsolatedNetworkOfferingForVpcNetworksWithInternalLB";
|
||||
|
||||
|
||||
/**
|
||||
* @return name for the network offering.
|
||||
|
|
@ -127,5 +127,6 @@ public interface NetworkOffering extends InfrastructureEntity, InternalIdentity,
|
|||
boolean getInternalLb();
|
||||
|
||||
boolean getPublicLb();
|
||||
boolean getEgressDefaultPolicy();
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,6 +33,9 @@ public interface GlobalLoadBalancingRulesService {
|
|||
|
||||
GlobalLoadBalancerRule updateGlobalLoadBalancerRule(UpdateGlobalLoadBalancerRuleCmd updateGslbCmd);
|
||||
|
||||
boolean revokeAllGslbRulesForAccount(com.cloud.user.Account caller, long accountId)
|
||||
throws com.cloud.exception.ResourceUnavailableException;
|
||||
|
||||
/*
|
||||
* methods for managing sites participating in global load balancing
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -124,15 +124,6 @@ public interface ManagementService {
|
|||
*/
|
||||
Pair<List<? extends Host>, Integer> searchForServers(ListHostsCmd cmd);
|
||||
|
||||
/**
|
||||
* Creates a new template
|
||||
*
|
||||
* @param cmd
|
||||
* @return updated template
|
||||
*/
|
||||
VirtualMachineTemplate updateTemplate(UpdateIsoCmd cmd);
|
||||
|
||||
VirtualMachineTemplate updateTemplate(UpdateTemplateCmd cmd);
|
||||
|
||||
|
||||
|
||||
|
|
@ -223,28 +214,6 @@ public interface ManagementService {
|
|||
*/
|
||||
List<? extends Capacity> listCapacities(ListCapacityCmd cmd);
|
||||
|
||||
/**
|
||||
* List ISOs that match the specified criteria.
|
||||
*
|
||||
* @param cmd
|
||||
* The command that wraps the (optional) templateId, name, keyword, templateFilter, bootable, account,
|
||||
* and zoneId
|
||||
* parameters.
|
||||
* @return list of ISOs
|
||||
*/
|
||||
Set<Pair<Long, Long>> listIsos(ListIsosCmd cmd);
|
||||
|
||||
/**
|
||||
* List templates that match the specified criteria.
|
||||
*
|
||||
* @param cmd
|
||||
* The command that wraps the (optional) templateId, name, keyword, templateFilter, bootable, account,
|
||||
* and zoneId
|
||||
* parameters.
|
||||
* @return list of ISOs
|
||||
*/
|
||||
Set<Pair<Long, Long>> listTemplates(ListTemplatesCmd cmd);
|
||||
|
||||
|
||||
/**
|
||||
* List system VMs by the given search criteria
|
||||
|
|
@ -271,20 +240,6 @@ public interface ManagementService {
|
|||
|
||||
Map<String, Object> listCapabilities(ListCapabilitiesCmd cmd);
|
||||
|
||||
/**
|
||||
* Extracts the volume to a particular location.
|
||||
*
|
||||
* @param cmd
|
||||
* the command specifying url (where the volume needs to be extracted to), zoneId (zone where the volume
|
||||
* exists),
|
||||
* id (the id of the volume)
|
||||
* @throws URISyntaxException
|
||||
* @throws InternalErrorException
|
||||
* @throws PermissionDeniedException
|
||||
*
|
||||
*/
|
||||
Long extractVolume(ExtractVolumeCmd cmd) throws URISyntaxException;
|
||||
|
||||
/**
|
||||
* return an array of available hypervisors
|
||||
*
|
||||
|
|
@ -412,7 +367,7 @@ public interface ManagementService {
|
|||
* @return List of capacities
|
||||
*/
|
||||
List<? extends Capacity> listTopConsumedResources(ListCapacityCmd cmd);
|
||||
|
||||
|
||||
List<String> listDeploymentPlanners();
|
||||
|
||||
VirtualMachine upgradeSystemVM(ScaleSystemVMCmd cmd) throws ResourceUnavailableException, ManagementServerException, VirtualMachineMigrationException, ConcurrentOperationException;
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.cloudstack.engine.subsystem.api.storage;
|
||||
package com.cloud.storage;
|
||||
|
||||
import com.cloud.utils.exception.CloudRuntimeException;
|
||||
|
||||
|
|
@ -14,3 +14,15 @@
|
|||
// KIND, either express or implied. See the License for the
|
||||
// specific language governing permissions and limitations
|
||||
// under the License.
|
||||
package com.cloud.storage;
|
||||
|
||||
import org.apache.cloudstack.api.InternalIdentity;
|
||||
|
||||
public interface GuestOSHypervisor extends InternalIdentity {
|
||||
|
||||
String getHypervisorType();
|
||||
|
||||
String getGuestOsName();
|
||||
|
||||
long getGuestOsId();
|
||||
}
|
||||
|
|
@ -14,24 +14,34 @@
|
|||
// KIND, either express or implied. See the License for the
|
||||
// specific language governing permissions and limitations
|
||||
// under the License.
|
||||
package com.cloud.agent;
|
||||
package com.cloud.storage;
|
||||
|
||||
import java.io.Serializable;
|
||||
import org.apache.cloudstack.api.Identity;
|
||||
import org.apache.cloudstack.api.InternalIdentity;
|
||||
|
||||
public class SimulatorCmd implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
public interface ImageStore extends Identity, InternalIdentity {
|
||||
|
||||
private String testCase = "DEFAULT";
|
||||
|
||||
public SimulatorCmd(String testCase) {
|
||||
this.testCase = testCase;
|
||||
}
|
||||
/**
|
||||
* @return name of the object store.
|
||||
*/
|
||||
String getName();
|
||||
|
||||
public String getTestCase() {
|
||||
return testCase;
|
||||
}
|
||||
/**
|
||||
* @return availability zone.
|
||||
*/
|
||||
Long getDataCenterId();
|
||||
|
||||
public void setTestCase(String testCase) {
|
||||
this.testCase = testCase;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return object store provider name
|
||||
*/
|
||||
String getProviderName();
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @return data store protocol
|
||||
*/
|
||||
String getProtocol();
|
||||
}
|
||||
|
|
@ -16,7 +16,7 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.cloudstack.engine.subsystem.api.storage;
|
||||
package com.cloud.storage;
|
||||
|
||||
public enum ScopeType {
|
||||
HOST,
|
||||
|
|
@ -18,12 +18,13 @@ package com.cloud.storage;
|
|||
|
||||
import java.util.Date;
|
||||
|
||||
import com.cloud.hypervisor.Hypervisor.HypervisorType;
|
||||
import com.cloud.utils.fsm.StateObject;
|
||||
import org.apache.cloudstack.acl.ControlledEntity;
|
||||
import org.apache.cloudstack.api.Identity;
|
||||
import org.apache.cloudstack.api.InternalIdentity;
|
||||
|
||||
import com.cloud.hypervisor.Hypervisor.HypervisorType;
|
||||
import com.cloud.utils.fsm.StateObject;
|
||||
|
||||
public interface Snapshot extends ControlledEntity, Identity, InternalIdentity, StateObject<Snapshot.State> {
|
||||
public enum Type {
|
||||
MANUAL,
|
||||
|
|
@ -59,6 +60,9 @@ public interface Snapshot extends ControlledEntity, Identity, InternalIdentity,
|
|||
CreatedOnPrimary,
|
||||
BackingUp,
|
||||
BackedUp,
|
||||
Copying,
|
||||
Destroying,
|
||||
Destroyed,//it's a state, user can't see the snapshot from ui, while the snapshot may still exist on the storage
|
||||
Error;
|
||||
|
||||
public String toString() {
|
||||
|
|
@ -75,6 +79,8 @@ public interface Snapshot extends ControlledEntity, Identity, InternalIdentity,
|
|||
OperationNotPerformed,
|
||||
BackupToSecondary,
|
||||
BackedupToSecondary,
|
||||
DestroyRequested,
|
||||
CopyingRequested,
|
||||
OperationSucceeded,
|
||||
OperationFailed
|
||||
}
|
||||
|
|
@ -85,8 +91,6 @@ public interface Snapshot extends ControlledEntity, Identity, InternalIdentity,
|
|||
|
||||
long getVolumeId();
|
||||
|
||||
String getPath();
|
||||
|
||||
String getName();
|
||||
|
||||
Date getCreated();
|
||||
|
|
|
|||
|
|
@ -21,13 +21,14 @@ import java.util.List;
|
|||
|
||||
public class Storage {
|
||||
public static enum ImageFormat {
|
||||
QCOW2(true, true, false),
|
||||
RAW(false, false, false),
|
||||
VHD(true, true, true),
|
||||
ISO(false, false, false),
|
||||
QCOW2(true, true, false, "qcow2"),
|
||||
RAW(false, false, false, "raw"),
|
||||
VHD(true, true, true, "vhd"),
|
||||
ISO(false, false, false, "iso"),
|
||||
OVA(true, true, true, "ova"),
|
||||
BAREMETAL(false, false, false),
|
||||
TAR(false, false, false);
|
||||
VHDX(true, true, true, "vhdx"),
|
||||
BAREMETAL(false, false, false, "BAREMETAL"),
|
||||
TAR(false, false, false, "tar");
|
||||
|
||||
private final boolean thinProvisioned;
|
||||
private final boolean supportSparse;
|
||||
|
|
@ -66,6 +67,7 @@ public class Storage {
|
|||
|
||||
return fileExtension;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static enum FileSystem {
|
||||
|
|
@ -84,6 +86,7 @@ public class Storage {
|
|||
}
|
||||
|
||||
public static enum TemplateType {
|
||||
ROUTING, // Router template
|
||||
SYSTEM, /* routing, system vm template */
|
||||
BUILTIN, /* buildin template */
|
||||
PERHOST, /* every host has this template, don't need to install it in secondary storage */
|
||||
|
|
@ -97,8 +100,8 @@ public class Storage {
|
|||
Iscsi(true), // for e.g., ZFS Comstar
|
||||
ISO(false), // for iso image
|
||||
LVM(false), // XenServer local LVM SR
|
||||
CLVM(true),
|
||||
RBD(true),
|
||||
CLVM(true),
|
||||
RBD(true), // http://libvirt.org/storage.html#StorageBackendRBD
|
||||
SharedMountPoint(true),
|
||||
VMFS(true), // VMware VMFS storage
|
||||
PreSetup(true), // for XenServer, Storage Pool is set up by customers.
|
||||
|
|
|
|||
|
|
@ -58,7 +58,9 @@ public interface StoragePool extends Identity, InternalIdentity {
|
|||
/**
|
||||
* @return available storage in bytes
|
||||
*/
|
||||
long getAvailableBytes();
|
||||
long getUsedBytes();
|
||||
|
||||
Long getCapacityIops();
|
||||
|
||||
Long getClusterId();
|
||||
|
||||
|
|
|
|||
|
|
@ -18,12 +18,17 @@ package com.cloud.storage;
|
|||
|
||||
import java.net.UnknownHostException;
|
||||
|
||||
import org.apache.cloudstack.api.command.admin.storage.AddImageStoreCmd;
|
||||
import org.apache.cloudstack.api.command.admin.storage.CancelPrimaryStorageMaintenanceCmd;
|
||||
import org.apache.cloudstack.api.command.admin.storage.CreateCacheStoreCmd;
|
||||
import org.apache.cloudstack.api.command.admin.storage.CreateStoragePoolCmd;
|
||||
import org.apache.cloudstack.api.command.admin.storage.DeleteImageStoreCmd;
|
||||
import org.apache.cloudstack.api.command.admin.storage.DeletePoolCmd;
|
||||
import org.apache.cloudstack.api.command.admin.storage.UpdateStoragePoolCmd;
|
||||
|
||||
import com.cloud.exception.DiscoveryException;
|
||||
import com.cloud.exception.InsufficientCapacityException;
|
||||
import com.cloud.exception.InvalidParameterValueException;
|
||||
import com.cloud.exception.ResourceInUseException;
|
||||
import com.cloud.exception.ResourceUnavailableException;
|
||||
|
||||
|
|
@ -43,6 +48,8 @@ public interface StorageService{
|
|||
*/
|
||||
StoragePool createPool(CreateStoragePoolCmd cmd) throws ResourceInUseException, IllegalArgumentException,
|
||||
UnknownHostException, ResourceUnavailableException;
|
||||
|
||||
ImageStore createCacheStore(CreateCacheStoreCmd cmd);
|
||||
|
||||
/**
|
||||
* Delete the storage pool
|
||||
|
|
@ -82,4 +89,9 @@ public interface StorageService{
|
|||
public StoragePool updateStoragePool(UpdateStoragePoolCmd cmd) throws IllegalArgumentException;
|
||||
|
||||
public StoragePool getStoragePool(long id);
|
||||
|
||||
boolean deleteImageStore(DeleteImageStoreCmd cmd);
|
||||
|
||||
ImageStore discoverImageStore(AddImageStoreCmd cmd) throws IllegalArgumentException, DiscoveryException, InvalidParameterValueException;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ public interface Upload extends InternalIdentity, Identity {
|
|||
FTP_UPLOAD, HTTP_DOWNLOAD
|
||||
}
|
||||
|
||||
long getHostId();
|
||||
long getDataStoreId();
|
||||
|
||||
Date getCreated();
|
||||
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@ public interface Volume extends ControlledEntity, Identity, InternalIdentity, Ba
|
|||
Destroying("The volume is destroying, and can't be recovered."),
|
||||
UploadOp ("The volume upload operation is in progress or in short the volume is on secondary storage"),
|
||||
Uploading("volume is uploading"),
|
||||
Copying("volume is copying from image store to primary, in case it's an uploaded volume"),
|
||||
Uploaded("volume is uploaded");
|
||||
|
||||
String _description;
|
||||
|
|
@ -73,9 +74,9 @@ public interface Volume extends ControlledEntity, Identity, InternalIdentity, Ba
|
|||
s_fsm.addTransition(Resizing, Event.OperationSucceeded, Ready);
|
||||
s_fsm.addTransition(Resizing, Event.OperationFailed, Ready);
|
||||
s_fsm.addTransition(Allocated, Event.UploadRequested, UploadOp);
|
||||
s_fsm.addTransition(Uploaded, Event.CopyRequested, Creating);// CopyRequested for volume from sec to primary storage
|
||||
s_fsm.addTransition(Creating, Event.CopySucceeded, Ready);
|
||||
s_fsm.addTransition(Creating, Event.CopyFailed, Uploaded);// Copying volume from sec to primary failed.
|
||||
s_fsm.addTransition(Uploaded, Event.CopyRequested, Copying);
|
||||
s_fsm.addTransition(Copying, Event.OperationSucceeded, Ready);
|
||||
s_fsm.addTransition(Copying, Event.OperationFailed, Uploaded);
|
||||
s_fsm.addTransition(UploadOp, Event.DestroyRequested, Destroy);
|
||||
s_fsm.addTransition(Ready, Event.DestroyRequested, Destroy);
|
||||
s_fsm.addTransition(Destroy, Event.ExpungingRequested, Expunging);
|
||||
|
|
@ -121,6 +122,12 @@ public interface Volume extends ControlledEntity, Identity, InternalIdentity, Ba
|
|||
*/
|
||||
Long getSize();
|
||||
|
||||
Long getMinIops();
|
||||
|
||||
Long getMaxIops();
|
||||
|
||||
String get_iScsiName();
|
||||
|
||||
/**
|
||||
* @return the vm instance id
|
||||
*/
|
||||
|
|
@ -152,7 +159,7 @@ public interface Volume extends ControlledEntity, Identity, InternalIdentity, Ba
|
|||
|
||||
Date getCreated();
|
||||
|
||||
long getDiskOfferingId();
|
||||
Long getDiskOfferingId();
|
||||
|
||||
String getChainInfo();
|
||||
|
||||
|
|
@ -173,4 +180,5 @@ public interface Volume extends ControlledEntity, Identity, InternalIdentity, Ba
|
|||
* @param reserv
|
||||
*/
|
||||
void setReservationId(String reserv);
|
||||
Storage.ImageFormat getFormat();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,9 +18,12 @@
|
|||
*/
|
||||
package com.cloud.storage;
|
||||
|
||||
import java.net.URISyntaxException;
|
||||
|
||||
import org.apache.cloudstack.api.command.user.volume.*;
|
||||
|
||||
import com.cloud.exception.ConcurrentOperationException;
|
||||
import com.cloud.exception.InternalErrorException;
|
||||
import com.cloud.exception.PermissionDeniedException;
|
||||
import com.cloud.exception.ResourceAllocationException;
|
||||
import com.cloud.user.Account;
|
||||
|
|
@ -36,7 +39,7 @@ public interface VolumeApiService {
|
|||
* @throws PermissionDeniedException
|
||||
*/
|
||||
Volume allocVolume(CreateVolumeCmd cmd) throws ResourceAllocationException;
|
||||
|
||||
|
||||
/**
|
||||
* Creates the volume based on the given criteria
|
||||
*
|
||||
|
|
@ -50,7 +53,7 @@ public interface VolumeApiService {
|
|||
|
||||
/**
|
||||
* Resizes the volume based on the given criteria
|
||||
*
|
||||
*
|
||||
* @param cmd
|
||||
* the API command wrapping the criteria
|
||||
* @return the volume object
|
||||
|
|
@ -58,7 +61,7 @@ public interface VolumeApiService {
|
|||
*/
|
||||
Volume resizeVolume(ResizeVolumeCmd cmd) throws ResourceAllocationException;
|
||||
|
||||
Volume migrateVolume(MigrateVolumeCmd cmd) throws ConcurrentOperationException;
|
||||
Volume migrateVolume(MigrateVolumeCmd cmd);
|
||||
|
||||
/**
|
||||
* Uploads the volume to secondary storage
|
||||
|
|
@ -75,5 +78,24 @@ public interface VolumeApiService {
|
|||
|
||||
Volume detachVolumeFromVM(DetachVolumeCmd cmmd);
|
||||
|
||||
Snapshot takeSnapshot(Long volumeId, Long policyId, Long snapshotId, Account account)
|
||||
throws ResourceAllocationException;
|
||||
|
||||
Snapshot allocSnapshot(Long volumeId, Long policyId)
|
||||
throws ResourceAllocationException;
|
||||
Volume updateVolume(UpdateVolumeCmd updateVolumeCmd);
|
||||
|
||||
/**
|
||||
* Extracts the volume to a particular location.
|
||||
*
|
||||
* @param cmd
|
||||
* the command specifying url (where the volume needs to be extracted to), zoneId (zone where the volume
|
||||
* exists),
|
||||
* id (the id of the volume)
|
||||
* @throws URISyntaxException
|
||||
* @throws InternalErrorException
|
||||
* @throws PermissionDeniedException
|
||||
*
|
||||
*/
|
||||
String extractVolume(ExtractVolumeCmd cmd);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ import com.cloud.storage.Volume;
|
|||
import com.cloud.user.Account;
|
||||
import com.cloud.utils.Pair;
|
||||
|
||||
public interface SnapshotService {
|
||||
public interface SnapshotApiService {
|
||||
|
||||
/**
|
||||
* List all snapshots of a disk volume. Optionally lists snapshots created by specified interval
|
||||
|
|
@ -16,7 +16,7 @@
|
|||
// under the License.
|
||||
package com.cloud.storage.template;
|
||||
|
||||
public class TemplateInfo {
|
||||
public class TemplateProp {
|
||||
String templateName;
|
||||
String installPath;
|
||||
long size;
|
||||
|
|
@ -25,11 +25,11 @@ public class TemplateInfo {
|
|||
boolean isPublic;
|
||||
boolean isCorrupted;
|
||||
|
||||
protected TemplateInfo() {
|
||||
protected TemplateProp() {
|
||||
|
||||
}
|
||||
|
||||
public TemplateInfo(String templateName, String installPath, long size, long physicalSize, boolean isPublic, boolean isCorrupted) {
|
||||
public TemplateProp(String templateName, String installPath, long size, long physicalSize, boolean isPublic, boolean isCorrupted) {
|
||||
this.templateName = templateName;
|
||||
this.installPath = installPath;
|
||||
this.size = size;
|
||||
|
|
@ -38,7 +38,7 @@ public class TemplateInfo {
|
|||
this.isCorrupted = isCorrupted;
|
||||
}
|
||||
|
||||
public TemplateInfo(String templateName, String installPath, boolean isPublic, boolean isCorrupted) {
|
||||
public TemplateProp(String templateName, String installPath, boolean isPublic, boolean isCorrupted) {
|
||||
this(templateName, installPath, 0, 0, isPublic, isCorrupted);
|
||||
}
|
||||
|
||||
|
|
@ -24,19 +24,22 @@ import org.apache.cloudstack.api.BaseUpdateTemplateOrIsoPermissionsCmd;
|
|||
import org.apache.cloudstack.api.command.user.iso.DeleteIsoCmd;
|
||||
import org.apache.cloudstack.api.command.user.iso.ExtractIsoCmd;
|
||||
import org.apache.cloudstack.api.command.user.iso.RegisterIsoCmd;
|
||||
import org.apache.cloudstack.api.command.user.iso.UpdateIsoCmd;
|
||||
import org.apache.cloudstack.api.command.user.template.CopyTemplateCmd;
|
||||
import org.apache.cloudstack.api.command.user.template.CreateTemplateCmd;
|
||||
import org.apache.cloudstack.api.command.user.template.DeleteTemplateCmd;
|
||||
import org.apache.cloudstack.api.command.user.template.ExtractTemplateCmd;
|
||||
import org.apache.cloudstack.api.command.user.template.RegisterTemplateCmd;
|
||||
import org.apache.cloudstack.api.command.user.template.UpdateTemplateCmd;
|
||||
|
||||
import com.cloud.exception.InternalErrorException;
|
||||
import com.cloud.exception.ResourceAllocationException;
|
||||
import com.cloud.exception.StorageUnavailableException;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.utils.Pair;
|
||||
import com.cloud.utils.exception.CloudRuntimeException;
|
||||
|
||||
public interface TemplateService {
|
||||
public interface TemplateApiService {
|
||||
|
||||
VirtualMachineTemplate registerTemplate(RegisterTemplateCmd cmd) throws URISyntaxException, ResourceAllocationException;
|
||||
|
||||
|
|
@ -72,29 +75,32 @@ public interface TemplateService {
|
|||
*
|
||||
* @param cmd
|
||||
* - the command specifying the mode and id of the ISO
|
||||
* @return extractId.
|
||||
* @return extractUrl extract url.
|
||||
*/
|
||||
Long extract(ExtractIsoCmd cmd) throws InternalErrorException;
|
||||
String extract(ExtractIsoCmd cmd) throws InternalErrorException;
|
||||
|
||||
/**
|
||||
* Extracts a Template
|
||||
*
|
||||
* @param cmd
|
||||
* - the command specifying the mode and id of the template
|
||||
* @return extractId
|
||||
* @return extractUrl extract url
|
||||
*/
|
||||
Long extract(ExtractTemplateCmd cmd) throws InternalErrorException;
|
||||
String extract(ExtractTemplateCmd cmd) throws InternalErrorException;
|
||||
|
||||
VirtualMachineTemplate getTemplate(long templateId);
|
||||
|
||||
List<String> listTemplatePermissions(BaseListTemplateOrIsoPermissionsCmd cmd);
|
||||
|
||||
boolean updateTemplateOrIsoPermissions(BaseUpdateTemplateOrIsoPermissionsCmd cmd);
|
||||
|
||||
|
||||
VirtualMachineTemplate createPrivateTemplateRecord(CreateTemplateCmd cmd,
|
||||
Account templateOwner) throws ResourceAllocationException;
|
||||
|
||||
VirtualMachineTemplate createPrivateTemplate(CreateTemplateCmd command)
|
||||
throws CloudRuntimeException;
|
||||
|
||||
VirtualMachineTemplate updateTemplate(UpdateIsoCmd cmd);
|
||||
|
||||
VirtualMachineTemplate updateTemplate(UpdateTemplateCmd cmd);
|
||||
}
|
||||
|
|
@ -92,4 +92,6 @@ public interface VirtualMachineTemplate extends ControlledEntity, Identity, Inte
|
|||
|
||||
String getTemplateTag();
|
||||
Map getDetails();
|
||||
|
||||
Boolean isDynamicallyScalable();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,22 +16,15 @@
|
|||
// under the License.
|
||||
package com.cloud.user;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.cloudstack.acl.ControlledEntity;
|
||||
import org.apache.cloudstack.acl.RoleType;
|
||||
import org.apache.cloudstack.acl.SecurityChecker.AccessType;
|
||||
import org.apache.cloudstack.api.command.admin.account.UpdateAccountCmd;
|
||||
import org.apache.cloudstack.api.command.admin.user.DeleteUserCmd;
|
||||
import org.apache.cloudstack.api.command.admin.user.RegisterCmd;
|
||||
import org.apache.cloudstack.api.command.admin.user.UpdateUserCmd;
|
||||
|
||||
import org.apache.cloudstack.api.command.admin.user.RegisterCmd;
|
||||
|
||||
import com.cloud.domain.Domain;
|
||||
import com.cloud.exception.PermissionDeniedException;
|
||||
import com.cloud.utils.Pair;
|
||||
|
||||
public interface AccountService {
|
||||
|
||||
|
|
@ -83,13 +76,11 @@ public interface AccountService {
|
|||
|
||||
Account finalizeOwner(Account caller, String accountName, Long domainId, Long projectId);
|
||||
|
||||
Pair<List<Long>, Long> finalizeAccountDomainForList(Account caller, String accountName, Long domainId, Long projectId);
|
||||
|
||||
Account getActiveAccountByName(String accountName, Long domainId);
|
||||
|
||||
Account getActiveAccountById(Long accountId);
|
||||
Account getActiveAccountById(long accountId);
|
||||
|
||||
Account getAccount(Long accountId);
|
||||
Account getAccount(long accountId);
|
||||
|
||||
User getActiveUser(long userId);
|
||||
|
||||
|
|
|
|||
|
|
@ -35,6 +35,10 @@ public class DiskProfile {
|
|||
private Long templateId;
|
||||
private long volumeId;
|
||||
private String path;
|
||||
private Long bytesReadRate;
|
||||
private Long bytesWriteRate;
|
||||
private Long iopsReadRate;
|
||||
private Long iopsWriteRate;
|
||||
|
||||
private HypervisorType hyperType;
|
||||
|
||||
|
|
@ -154,4 +158,36 @@ public class DiskProfile {
|
|||
public void setSize(long size) {
|
||||
this.size = size;
|
||||
}
|
||||
|
||||
public void setBytesReadRate(Long bytesReadRate) {
|
||||
this.bytesReadRate = bytesReadRate;
|
||||
}
|
||||
|
||||
public Long getBytesReadRate() {
|
||||
return bytesReadRate;
|
||||
}
|
||||
|
||||
public void setBytesWriteRate(Long bytesWriteRate) {
|
||||
this.bytesWriteRate = bytesWriteRate;
|
||||
}
|
||||
|
||||
public Long getBytesWriteRate() {
|
||||
return bytesWriteRate;
|
||||
}
|
||||
|
||||
public void setIopsReadRate(Long iopsReadRate) {
|
||||
this.iopsReadRate = iopsReadRate;
|
||||
}
|
||||
|
||||
public Long getIopsReadRate() {
|
||||
return iopsReadRate;
|
||||
}
|
||||
|
||||
public void setIopsWriteRate(Long iopsWriteRate) {
|
||||
this.iopsWriteRate = iopsWriteRate;
|
||||
}
|
||||
|
||||
public Long getIopsWriteRate() {
|
||||
return iopsWriteRate;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -158,6 +158,8 @@ public interface VirtualMachine extends RunningOn, ControlledEntity, Identity, I
|
|||
}
|
||||
}
|
||||
|
||||
public static final String IsDynamicScalingEnabled = "enable.dynamic.scaling";
|
||||
|
||||
public enum Event {
|
||||
CreateRequested,
|
||||
StartRequested,
|
||||
|
|
|
|||
|
|
@ -19,6 +19,8 @@ package com.cloud.vm;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.cloud.agent.api.to.DataTO;
|
||||
import com.cloud.agent.api.to.DiskTO;
|
||||
import com.cloud.agent.api.to.VolumeTO;
|
||||
import com.cloud.hypervisor.Hypervisor.HypervisorType;
|
||||
import com.cloud.offering.ServiceOffering;
|
||||
|
|
@ -111,11 +113,11 @@ public interface VirtualMachineProfile<T extends VirtualMachine> {
|
|||
|
||||
List<NicProfile> getNics();
|
||||
|
||||
List<VolumeTO> getDisks();
|
||||
List<DiskTO> getDisks();
|
||||
|
||||
void addNic(int index, NicProfile nic);
|
||||
|
||||
void addDisk(int index, VolumeTO disk);
|
||||
void addDisk(int index, DiskTO disk);
|
||||
|
||||
StringBuilder getBootArgsBuilder();
|
||||
|
||||
|
|
@ -125,7 +127,7 @@ public interface VirtualMachineProfile<T extends VirtualMachine> {
|
|||
|
||||
void addNic(NicProfile nic);
|
||||
|
||||
void addDisk(VolumeTO disk);
|
||||
void addDisk(DiskTO disk);
|
||||
|
||||
VirtualMachine.Type getType();
|
||||
|
||||
|
|
|
|||
|
|
@ -14,9 +14,17 @@
|
|||
// KIND, either express or implied. See the License for the
|
||||
// specific language governing permissions and limitations
|
||||
// under the License.
|
||||
package com.cloud.agent;
|
||||
import java.net.InetAddress;
|
||||
package com.cloud.vm;
|
||||
|
||||
public interface VmDiskStats {
|
||||
// vm related disk stats
|
||||
|
||||
public long getIORead();
|
||||
|
||||
public long getIOWrite();
|
||||
|
||||
public long getBytesRead();
|
||||
|
||||
public long getBytesWrite();
|
||||
|
||||
public interface MultiCasterListener {
|
||||
public void onMultiCasting(byte[] data, int off, int len, InetAddress addrFrom);
|
||||
}
|
||||
|
|
@ -23,5 +23,13 @@ public interface VmStats {
|
|||
public double getNetworkReadKBs();
|
||||
|
||||
public double getNetworkWriteKBs();
|
||||
|
||||
public double getDiskReadIOs();
|
||||
|
||||
public double getDiskWriteIOs();
|
||||
|
||||
public double getDiskReadKBs();
|
||||
|
||||
public double getDiskWriteKBs();
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@ package org.apache.cloudstack.affinity;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import com.cloud.exception.ResourceInUseException;
|
||||
import com.cloud.uservm.UserVm;
|
||||
import com.cloud.utils.Pair;
|
||||
|
||||
|
|
@ -45,10 +44,8 @@ public interface AffinityGroupService {
|
|||
* @param account
|
||||
* @param domainId
|
||||
* @param affinityGroupName
|
||||
* @throws ResourceInUseException
|
||||
*/
|
||||
boolean deleteAffinityGroup(Long affinityGroupId, String account, Long domainId, String affinityGroupName)
|
||||
throws ResourceInUseException;
|
||||
boolean deleteAffinityGroup(Long affinityGroupId, String account, Long domainId, String affinityGroupName);
|
||||
|
||||
/** Lists Affinity Groups in your account
|
||||
* @param account
|
||||
|
|
|
|||
|
|
@ -0,0 +1,52 @@
|
|||
// Licensed to the Apache Software Foundation (ASF) under one
|
||||
// or more contributor license agreements. See the NOTICE file
|
||||
// distributed with this work for additional information
|
||||
// regarding copyright ownership. The ASF licenses this file
|
||||
// to you under the Apache License, Version 2.0 (the
|
||||
// "License"); you may not use this file except in compliance
|
||||
// with the License. You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing,
|
||||
// software distributed under the License is distributed on an
|
||||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
// KIND, either express or implied. See the License for the
|
||||
// specific language governing permissions and limitations
|
||||
// under the License.
|
||||
package org.apache.cloudstack.api;
|
||||
|
||||
public enum ApiCommandJobType {
|
||||
None,
|
||||
VirtualMachine,
|
||||
DomainRouter,
|
||||
Volume,
|
||||
ConsoleProxy,
|
||||
Snapshot,
|
||||
Template,
|
||||
Iso,
|
||||
SystemVm,
|
||||
Host,
|
||||
StoragePool,
|
||||
IpAddress,
|
||||
PortableIpAddress,
|
||||
SecurityGroup,
|
||||
PhysicalNetwork,
|
||||
TrafficType,
|
||||
PhysicalNetworkServiceProvider,
|
||||
FirewallRule,
|
||||
Account,
|
||||
User,
|
||||
PrivateGateway,
|
||||
StaticRoute,
|
||||
Counter,
|
||||
Condition,
|
||||
AutoScalePolicy,
|
||||
AutoScaleVmProfile,
|
||||
AutoScaleVmGroup,
|
||||
GlobalLoadBalancerRule,
|
||||
LoadBalancerRule,
|
||||
AffinityGroup,
|
||||
InternalLbVm,
|
||||
DedicatedGuestVlanRange
|
||||
}
|
||||
|
|
@ -31,6 +31,8 @@ public class ApiConstants {
|
|||
public static final String BOOTABLE = "bootable";
|
||||
public static final String BIND_DN = "binddn";
|
||||
public static final String BIND_PASSWORD = "bindpass";
|
||||
public static final String BYTES_READ_RATE = "bytesreadrate";
|
||||
public static final String BYTES_WRITE_RATE = "byteswriterate";
|
||||
public static final String CATEGORY = "category";
|
||||
public static final String CERTIFICATE = "certificate";
|
||||
public static final String PRIVATE_KEY = "privatekey";
|
||||
|
|
@ -49,6 +51,9 @@ public class ApiConstants {
|
|||
public static final String CPU_OVERCOMMIT_RATIO="cpuovercommitratio";
|
||||
public static final String CREATED = "created";
|
||||
public static final String CUSTOMIZED = "customized";
|
||||
public static final String CUSTOMIZED_IOPS = "customizediops";
|
||||
public static final String MIN_IOPS = "miniops";
|
||||
public static final String MAX_IOPS = "maxiops";
|
||||
public static final String DESCRIPTION = "description";
|
||||
public static final String DESTINATION_ZONE_ID = "destzoneid";
|
||||
public static final String DETAILS = "details";
|
||||
|
|
@ -89,6 +94,7 @@ public class ApiConstants {
|
|||
public static final String GSLB_SERVICE_DOMAIN_NAME = "gslbdomainname";
|
||||
public static final String GSLB_SERVICE_TYPE = "gslbservicetype";
|
||||
public static final String GSLB_STICKY_SESSION_METHOD = "gslbstickysessionmethodname";
|
||||
public static final String GSLB_LBRULE_WEIGHT_MAP = "gslblbruleweightsmap";
|
||||
public static final String GUEST_CIDR_ADDRESS = "guestcidraddress";
|
||||
public static final String GUEST_VLAN_RANGE = "guestvlanrange";
|
||||
public static final String HA_ENABLE = "haenable";
|
||||
|
|
@ -104,6 +110,8 @@ public class ApiConstants {
|
|||
public static final String INTERNAL_DNS1 = "internaldns1";
|
||||
public static final String INTERNAL_DNS2 = "internaldns2";
|
||||
public static final String INTERVAL_TYPE = "intervaltype";
|
||||
public static final String IOPS_READ_RATE = "iopsreadrate";
|
||||
public static final String IOPS_WRITE_RATE = "iopswriterate";
|
||||
public static final String IP_ADDRESS = "ipaddress";
|
||||
public static final String IP6_ADDRESS = "ip6address";
|
||||
public static final String IP_ADDRESS_ID = "ipaddressid";
|
||||
|
|
@ -114,8 +122,10 @@ public class ApiConstants {
|
|||
public static final String IS_CLEANUP_REQUIRED = "iscleanuprequired";
|
||||
public static final String IS_EXTRACTABLE = "isextractable";
|
||||
public static final String IS_FEATURED = "isfeatured";
|
||||
public static final String IS_PORTABLE = "isportable";
|
||||
public static final String IS_PUBLIC = "ispublic";
|
||||
public static final String IS_PERSISTENT = "ispersistent";
|
||||
public static final String EGRESS_DEFAULT_POLICY = "egressdefaultpolicy";
|
||||
public static final String IS_READY = "isready";
|
||||
public static final String IS_RECURSIVE = "isrecursive";
|
||||
public static final String ISO_FILTER = "isofilter";
|
||||
|
|
@ -158,6 +168,7 @@ public class ApiConstants {
|
|||
public static final String POLICY_ID = "policyid";
|
||||
public static final String PORT = "port";
|
||||
public static final String PORTAL = "portal";
|
||||
public static final String PORTABLE_IP_ADDRESS = "portableipaddress";
|
||||
public static final String PORT_FORWARDING_SERVICE_ID = "portforwardingserviceid";
|
||||
public static final String PRIVATE_INTERFACE = "privateinterface";
|
||||
public static final String PRIVATE_IP = "privateip";
|
||||
|
|
@ -204,6 +215,7 @@ public class ApiConstants {
|
|||
public static final String STATE = "state";
|
||||
public static final String STATUS = "status";
|
||||
public static final String STORAGE_TYPE = "storagetype";
|
||||
public static final String STORAGE_MOTION_ENABLED = "storagemotionenabled";
|
||||
public static final String SYSTEM_VM_TYPE = "systemvmtype";
|
||||
public static final String TAGS = "tags";
|
||||
public static final String TARGET_IQN = "targetiqn";
|
||||
|
|
@ -238,8 +250,7 @@ public class ApiConstants {
|
|||
public static final String IS_VOLATILE = "isvolatile";
|
||||
public static final String VOLUME_ID = "volumeid";
|
||||
public static final String ZONE_ID = "zoneid";
|
||||
public static final String ZONE_NAME = "zonename";
|
||||
public static final String ZONE_TYPE = "zonetype";
|
||||
public static final String ZONE_NAME = "zonename";
|
||||
public static final String NETWORK_TYPE = "networktype";
|
||||
public static final String PAGE = "page";
|
||||
public static final String PAGE_SIZE = "pagesize";
|
||||
|
|
@ -302,6 +313,8 @@ public class ApiConstants {
|
|||
public static final String TEMPLATE_TAG = "templatetag";
|
||||
public static final String HYPERVISOR_VERSION = "hypervisorversion";
|
||||
public static final String MAX_GUESTS_LIMIT = "maxguestslimit";
|
||||
public static final String MAX_DATA_VOLUMES_LIMIT = "maxdatavolumeslimit";
|
||||
public static final String MAX_HOSTS_PER_CLUSTER = "maxhostspercluster";
|
||||
public static final String PROJECT_ID = "projectid";
|
||||
public static final String PROJECT_IDS = "projectids";
|
||||
public static final String PROJECT = "project";
|
||||
|
|
@ -317,6 +330,9 @@ public class ApiConstants {
|
|||
public static final String SERVICE_CAPABILITY_LIST = "servicecapabilitylist";
|
||||
public static final String CAN_CHOOSE_SERVICE_CAPABILITY = "canchooseservicecapability";
|
||||
public static final String PROVIDER = "provider";
|
||||
public static final String MANAGED = "managed";
|
||||
public static final String CAPACITY_BYTES = "capacitybytes";
|
||||
public static final String CAPACITY_IOPS = "capacityiops";
|
||||
public static final String NETWORK_SPEED = "networkspeed";
|
||||
public static final String BROADCAST_DOMAIN_RANGE = "broadcastdomainrange";
|
||||
public static final String ISOLATION_METHODS = "isolationmethods";
|
||||
|
|
@ -400,6 +416,7 @@ public class ApiConstants {
|
|||
public static final String VSM_CONFIG_MODE = "vsmconfigmode";
|
||||
public static final String VSM_CONFIG_STATE = "vsmconfigstate";
|
||||
public static final String VSM_DEVICE_STATE = "vsmdevicestate";
|
||||
public static final String VCENTER = "vcenter";
|
||||
public static final String ADD_VSM_FLAG = "addvsmflag";
|
||||
public static final String END_POINT = "endpoint";
|
||||
public static final String REGION_ID = "regionid";
|
||||
|
|
@ -500,6 +517,8 @@ public class ApiConstants {
|
|||
public static final String DEPLOYMENT_PLANNER = "deploymentplanner";
|
||||
public static final String ACL_ID = "aclid";
|
||||
public static final String NUMBER = "number";
|
||||
public static final String IS_DYNAMICALLY_SCALABLE = "isdynamicallyscalable";
|
||||
public static final String ROUTING = "isrouting";
|
||||
|
||||
public enum HostDetails {
|
||||
all, capacity, events, stats, min;
|
||||
|
|
|
|||
|
|
@ -88,8 +88,8 @@ public abstract class BaseAsyncCmd extends BaseCmd {
|
|||
return null;
|
||||
}
|
||||
|
||||
public AsyncJob.Type getInstanceType() {
|
||||
return AsyncJob.Type.None;
|
||||
public ApiCommandJobType getInstanceType() {
|
||||
return ApiCommandJobType.None;
|
||||
}
|
||||
|
||||
public String getSyncObjType() {
|
||||
|
|
|
|||
|
|
@ -69,8 +69,8 @@ import com.cloud.server.TaggedResourceService;
|
|||
import com.cloud.storage.DataStoreProviderApiService;
|
||||
import com.cloud.storage.StorageService;
|
||||
import com.cloud.storage.VolumeApiService;
|
||||
import com.cloud.storage.snapshot.SnapshotService;
|
||||
import com.cloud.template.TemplateService;
|
||||
import com.cloud.storage.snapshot.SnapshotApiService;
|
||||
import com.cloud.template.TemplateApiService;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.user.AccountService;
|
||||
import com.cloud.user.DomainService;
|
||||
|
|
@ -116,9 +116,9 @@ public abstract class BaseCmd {
|
|||
@Inject public VolumeApiService _volumeService;
|
||||
@Inject public ResourceService _resourceService;
|
||||
@Inject public NetworkService _networkService;
|
||||
@Inject public TemplateService _templateService;
|
||||
@Inject public TemplateApiService _templateService;
|
||||
@Inject public SecurityGroupService _securityGroupService;
|
||||
@Inject public SnapshotService _snapshotService;
|
||||
@Inject public SnapshotApiService _snapshotService;
|
||||
@Inject public VpcVirtualNetworkApplianceService _routerService;
|
||||
@Inject public ResponseGenerator _responseGenerator;
|
||||
@Inject public EntityManager _entityMgr;
|
||||
|
|
@ -521,7 +521,7 @@ public abstract class BaseCmd {
|
|||
return project.getProjectAccountId();
|
||||
} else {
|
||||
PermissionDeniedException ex = new PermissionDeniedException("Can't add resources to the project with specified projectId in state=" + project.getState() + " as it's no longer active");
|
||||
ex.addProxyObject(project, projectId, "projectId");
|
||||
ex.addProxyObject(project.getUuid(), "projectId");
|
||||
throw ex;
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@
|
|||
// under the License.
|
||||
package org.apache.cloudstack.api;
|
||||
|
||||
import com.cloud.async.AsyncJob;
|
||||
import com.cloud.exception.InvalidParameterValueException;
|
||||
|
||||
public abstract class BaseListCmd extends BaseCmd {
|
||||
|
|
@ -109,7 +108,7 @@ public abstract class BaseListCmd extends BaseCmd {
|
|||
return startIndex;
|
||||
}
|
||||
|
||||
public AsyncJob.Type getInstanceType() {
|
||||
return AsyncJob.Type.None;
|
||||
public ApiCommandJobType getInstanceType() {
|
||||
return ApiCommandJobType.None;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,6 +54,12 @@ public abstract class BaseUpdateTemplateOrIsoCmd extends BaseCmd {
|
|||
@Parameter(name=ApiConstants.SORT_KEY, type=CommandType.INTEGER, description="sort key of the template, integer")
|
||||
private Integer sortKey;
|
||||
|
||||
@Parameter(name = ApiConstants.IS_DYNAMICALLY_SCALABLE, type = CommandType.BOOLEAN, description = "true if template/ISO contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory")
|
||||
private Boolean isDynamicallyScalable;
|
||||
|
||||
@Parameter(name = ApiConstants.ROUTING, type = CommandType.BOOLEAN, description = "true if the template type is routing i.e., if template is used to deploy router")
|
||||
protected Boolean isRoutingType;
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////////// Accessors ///////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
|
@ -89,4 +95,12 @@ public abstract class BaseUpdateTemplateOrIsoCmd extends BaseCmd {
|
|||
public Integer getSortKey() {
|
||||
return sortKey;
|
||||
}
|
||||
|
||||
public Boolean isDynamicallyScalable() {
|
||||
return isDynamicallyScalable;
|
||||
}
|
||||
|
||||
public Boolean isRoutingType() {
|
||||
return isRoutingType;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,111 +16,6 @@
|
|||
// under the License.
|
||||
package org.apache.cloudstack.api;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.cloud.vm.NicSecondaryIp;
|
||||
import org.apache.cloudstack.affinity.AffinityGroup;
|
||||
import org.apache.cloudstack.affinity.AffinityGroupResponse;
|
||||
import com.cloud.network.vpc.NetworkACL;
|
||||
import com.cloud.network.vpc.NetworkACLItem;
|
||||
import com.cloud.network.vpc.PrivateGateway;
|
||||
import com.cloud.network.vpc.StaticRoute;
|
||||
import com.cloud.network.vpc.Vpc;
|
||||
import com.cloud.network.vpc.VpcOffering;
|
||||
import org.apache.cloudstack.api.ApiConstants.HostDetails;
|
||||
import org.apache.cloudstack.api.ApiConstants.VMDetails;
|
||||
import org.apache.cloudstack.api.command.user.job.QueryAsyncJobResultCmd;
|
||||
import org.apache.cloudstack.api.response.AccountResponse;
|
||||
import org.apache.cloudstack.api.response.ApplicationLoadBalancerResponse;
|
||||
import org.apache.cloudstack.api.response.AsyncJobResponse;
|
||||
import org.apache.cloudstack.api.response.AutoScalePolicyResponse;
|
||||
import org.apache.cloudstack.api.response.AutoScaleVmGroupResponse;
|
||||
import org.apache.cloudstack.api.response.AutoScaleVmProfileResponse;
|
||||
import org.apache.cloudstack.api.response.CapacityResponse;
|
||||
import org.apache.cloudstack.api.response.ClusterResponse;
|
||||
import org.apache.cloudstack.api.response.ConditionResponse;
|
||||
import org.apache.cloudstack.api.response.ConfigurationResponse;
|
||||
import org.apache.cloudstack.api.response.CounterResponse;
|
||||
import org.apache.cloudstack.api.response.CreateCmdResponse;
|
||||
import org.apache.cloudstack.api.response.DiskOfferingResponse;
|
||||
import org.apache.cloudstack.api.response.DomainResponse;
|
||||
import org.apache.cloudstack.api.response.DomainRouterResponse;
|
||||
import org.apache.cloudstack.api.response.EventResponse;
|
||||
import org.apache.cloudstack.api.response.ExtractResponse;
|
||||
import org.apache.cloudstack.api.response.FirewallResponse;
|
||||
import org.apache.cloudstack.api.response.FirewallRuleResponse;
|
||||
import org.apache.cloudstack.api.response.GlobalLoadBalancerResponse;
|
||||
import org.apache.cloudstack.api.response.GuestOSResponse;
|
||||
import org.apache.cloudstack.api.response.GuestVlanRangeResponse;
|
||||
import org.apache.cloudstack.api.response.HostForMigrationResponse;
|
||||
import org.apache.cloudstack.api.response.HostResponse;
|
||||
import org.apache.cloudstack.api.response.HypervisorCapabilitiesResponse;
|
||||
import org.apache.cloudstack.api.response.IPAddressResponse;
|
||||
import org.apache.cloudstack.api.response.InstanceGroupResponse;
|
||||
import org.apache.cloudstack.api.response.InternalLoadBalancerElementResponse;
|
||||
import org.apache.cloudstack.api.response.IpForwardingRuleResponse;
|
||||
import org.apache.cloudstack.api.response.IsolationMethodResponse;
|
||||
import org.apache.cloudstack.api.response.LBHealthCheckResponse;
|
||||
import org.apache.cloudstack.api.response.LBStickinessResponse;
|
||||
import org.apache.cloudstack.api.response.LDAPConfigResponse;
|
||||
import org.apache.cloudstack.api.response.LoadBalancerResponse;
|
||||
import org.apache.cloudstack.api.response.NetworkACLResponse;
|
||||
import org.apache.cloudstack.api.response.NetworkOfferingResponse;
|
||||
import org.apache.cloudstack.api.response.NetworkResponse;
|
||||
import org.apache.cloudstack.api.response.NicResponse;
|
||||
import org.apache.cloudstack.api.response.NicSecondaryIpResponse;
|
||||
import org.apache.cloudstack.api.response.PhysicalNetworkResponse;
|
||||
import org.apache.cloudstack.api.response.PodResponse;
|
||||
import org.apache.cloudstack.api.response.PrivateGatewayResponse;
|
||||
import org.apache.cloudstack.api.response.ProjectAccountResponse;
|
||||
import org.apache.cloudstack.api.response.ProjectInvitationResponse;
|
||||
import org.apache.cloudstack.api.response.ProjectResponse;
|
||||
import org.apache.cloudstack.api.response.ProviderResponse;
|
||||
import org.apache.cloudstack.api.response.RegionResponse;
|
||||
import org.apache.cloudstack.api.response.RemoteAccessVpnResponse;
|
||||
import org.apache.cloudstack.api.response.ResourceCountResponse;
|
||||
import org.apache.cloudstack.api.response.ResourceLimitResponse;
|
||||
import org.apache.cloudstack.api.response.ResourceTagResponse;
|
||||
import org.apache.cloudstack.api.response.S3Response;
|
||||
import org.apache.cloudstack.api.response.SecurityGroupResponse;
|
||||
import org.apache.cloudstack.api.response.ServiceOfferingResponse;
|
||||
import org.apache.cloudstack.api.response.ServiceResponse;
|
||||
import org.apache.cloudstack.api.response.Site2SiteCustomerGatewayResponse;
|
||||
import org.apache.cloudstack.api.response.Site2SiteVpnConnectionResponse;
|
||||
import org.apache.cloudstack.api.response.Site2SiteVpnGatewayResponse;
|
||||
import org.apache.cloudstack.api.response.SnapshotPolicyResponse;
|
||||
import org.apache.cloudstack.api.response.SnapshotResponse;
|
||||
import org.apache.cloudstack.api.response.SnapshotScheduleResponse;
|
||||
import org.apache.cloudstack.api.response.StaticRouteResponse;
|
||||
import org.apache.cloudstack.api.response.StorageNetworkIpRangeResponse;
|
||||
import org.apache.cloudstack.api.response.StoragePoolForMigrationResponse;
|
||||
import org.apache.cloudstack.api.response.StoragePoolResponse;
|
||||
import org.apache.cloudstack.api.response.SwiftResponse;
|
||||
import org.apache.cloudstack.api.response.SystemVmInstanceResponse;
|
||||
import org.apache.cloudstack.api.response.SystemVmResponse;
|
||||
import org.apache.cloudstack.api.response.TemplatePermissionsResponse;
|
||||
import org.apache.cloudstack.api.response.TemplateResponse;
|
||||
import org.apache.cloudstack.api.response.TrafficMonitorResponse;
|
||||
import org.apache.cloudstack.api.response.TrafficTypeResponse;
|
||||
import org.apache.cloudstack.api.response.UsageRecordResponse;
|
||||
import org.apache.cloudstack.api.response.UserResponse;
|
||||
import org.apache.cloudstack.api.response.UserVmResponse;
|
||||
import org.apache.cloudstack.api.response.VMSnapshotResponse;
|
||||
import org.apache.cloudstack.api.response.VirtualRouterProviderResponse;
|
||||
import org.apache.cloudstack.api.response.VlanIpRangeResponse;
|
||||
import org.apache.cloudstack.api.response.VolumeResponse;
|
||||
import org.apache.cloudstack.api.response.VpcOfferingResponse;
|
||||
import org.apache.cloudstack.api.response.VpcResponse;
|
||||
import org.apache.cloudstack.api.response.VpnUsersResponse;
|
||||
import org.apache.cloudstack.api.response.ZoneResponse;
|
||||
import org.apache.cloudstack.api.response.*;
|
||||
import org.apache.cloudstack.network.lb.ApplicationLoadBalancerRule;
|
||||
import org.apache.cloudstack.region.Region;
|
||||
import org.apache.cloudstack.usage.Usage;
|
||||
|
||||
import com.cloud.async.AsyncJob;
|
||||
import com.cloud.capacity.Capacity;
|
||||
import com.cloud.configuration.Configuration;
|
||||
|
|
@ -162,6 +57,12 @@ import com.cloud.network.rules.StaticNatRule;
|
|||
import com.cloud.network.rules.StickinessPolicy;
|
||||
import com.cloud.network.security.SecurityGroup;
|
||||
import com.cloud.network.security.SecurityRule;
|
||||
import com.cloud.network.vpc.NetworkACL;
|
||||
import com.cloud.network.vpc.NetworkACLItem;
|
||||
import com.cloud.network.vpc.PrivateGateway;
|
||||
import com.cloud.network.vpc.StaticRoute;
|
||||
import com.cloud.network.vpc.Vpc;
|
||||
import com.cloud.network.vpc.VpcOffering;
|
||||
import com.cloud.offering.DiskOffering;
|
||||
import com.cloud.offering.NetworkOffering;
|
||||
import com.cloud.offering.ServiceOffering;
|
||||
|
|
@ -190,6 +91,108 @@ import com.cloud.vm.Nic;
|
|||
import com.cloud.vm.NicSecondaryIp;
|
||||
import com.cloud.vm.VirtualMachine;
|
||||
import com.cloud.vm.snapshot.VMSnapshot;
|
||||
import org.apache.cloudstack.affinity.AffinityGroup;
|
||||
import org.apache.cloudstack.affinity.AffinityGroupResponse;
|
||||
import org.apache.cloudstack.api.ApiConstants.HostDetails;
|
||||
import org.apache.cloudstack.api.ApiConstants.VMDetails;
|
||||
import org.apache.cloudstack.api.command.user.job.QueryAsyncJobResultCmd;
|
||||
import org.apache.cloudstack.api.response.AccountResponse;
|
||||
import org.apache.cloudstack.api.response.ApplicationLoadBalancerResponse;
|
||||
import org.apache.cloudstack.api.response.AsyncJobResponse;
|
||||
import org.apache.cloudstack.api.response.AutoScalePolicyResponse;
|
||||
import org.apache.cloudstack.api.response.AutoScaleVmGroupResponse;
|
||||
import org.apache.cloudstack.api.response.AutoScaleVmProfileResponse;
|
||||
import org.apache.cloudstack.api.response.CapacityResponse;
|
||||
import org.apache.cloudstack.api.response.ClusterResponse;
|
||||
import org.apache.cloudstack.api.response.ConditionResponse;
|
||||
import org.apache.cloudstack.api.response.ConfigurationResponse;
|
||||
import org.apache.cloudstack.api.response.CounterResponse;
|
||||
import org.apache.cloudstack.api.response.CreateCmdResponse;
|
||||
import org.apache.cloudstack.api.response.DiskOfferingResponse;
|
||||
import org.apache.cloudstack.api.response.DomainResponse;
|
||||
import org.apache.cloudstack.api.response.DomainRouterResponse;
|
||||
import org.apache.cloudstack.api.response.EventResponse;
|
||||
import org.apache.cloudstack.api.response.ExtractResponse;
|
||||
import org.apache.cloudstack.api.response.FirewallResponse;
|
||||
import org.apache.cloudstack.api.response.FirewallRuleResponse;
|
||||
import org.apache.cloudstack.api.response.GlobalLoadBalancerResponse;
|
||||
import org.apache.cloudstack.api.response.GuestOSResponse;
|
||||
import org.apache.cloudstack.api.response.GuestVlanRangeResponse;
|
||||
import org.apache.cloudstack.api.response.HostForMigrationResponse;
|
||||
import org.apache.cloudstack.api.response.HostResponse;
|
||||
import org.apache.cloudstack.api.response.HypervisorCapabilitiesResponse;
|
||||
import org.apache.cloudstack.api.response.IPAddressResponse;
|
||||
import org.apache.cloudstack.api.response.ImageStoreResponse;
|
||||
import org.apache.cloudstack.api.response.InstanceGroupResponse;
|
||||
import org.apache.cloudstack.api.response.InternalLoadBalancerElementResponse;
|
||||
import org.apache.cloudstack.api.response.IpForwardingRuleResponse;
|
||||
import org.apache.cloudstack.api.response.IsolationMethodResponse;
|
||||
import org.apache.cloudstack.api.response.LBHealthCheckResponse;
|
||||
import org.apache.cloudstack.api.response.LBStickinessResponse;
|
||||
import org.apache.cloudstack.api.response.LDAPConfigResponse;
|
||||
import org.apache.cloudstack.api.response.LoadBalancerResponse;
|
||||
import org.apache.cloudstack.api.response.NetworkACLItemResponse;
|
||||
import org.apache.cloudstack.api.response.NetworkACLResponse;
|
||||
import org.apache.cloudstack.api.response.NetworkOfferingResponse;
|
||||
import org.apache.cloudstack.api.response.NetworkResponse;
|
||||
import org.apache.cloudstack.api.response.NicResponse;
|
||||
import org.apache.cloudstack.api.response.NicSecondaryIpResponse;
|
||||
import org.apache.cloudstack.api.response.PhysicalNetworkResponse;
|
||||
import org.apache.cloudstack.api.response.PodResponse;
|
||||
import org.apache.cloudstack.api.response.PortableIpRangeResponse;
|
||||
import org.apache.cloudstack.api.response.PortableIpResponse;
|
||||
import org.apache.cloudstack.api.response.PrivateGatewayResponse;
|
||||
import org.apache.cloudstack.api.response.ProjectAccountResponse;
|
||||
import org.apache.cloudstack.api.response.ProjectInvitationResponse;
|
||||
import org.apache.cloudstack.api.response.ProjectResponse;
|
||||
import org.apache.cloudstack.api.response.ProviderResponse;
|
||||
import org.apache.cloudstack.api.response.RegionResponse;
|
||||
import org.apache.cloudstack.api.response.RemoteAccessVpnResponse;
|
||||
import org.apache.cloudstack.api.response.ResourceCountResponse;
|
||||
import org.apache.cloudstack.api.response.ResourceLimitResponse;
|
||||
import org.apache.cloudstack.api.response.ResourceTagResponse;
|
||||
import org.apache.cloudstack.api.response.S3Response;
|
||||
import org.apache.cloudstack.api.response.SecurityGroupResponse;
|
||||
import org.apache.cloudstack.api.response.ServiceOfferingResponse;
|
||||
import org.apache.cloudstack.api.response.ServiceResponse;
|
||||
import org.apache.cloudstack.api.response.Site2SiteCustomerGatewayResponse;
|
||||
import org.apache.cloudstack.api.response.Site2SiteVpnConnectionResponse;
|
||||
import org.apache.cloudstack.api.response.Site2SiteVpnGatewayResponse;
|
||||
import org.apache.cloudstack.api.response.SnapshotPolicyResponse;
|
||||
import org.apache.cloudstack.api.response.SnapshotResponse;
|
||||
import org.apache.cloudstack.api.response.SnapshotScheduleResponse;
|
||||
import org.apache.cloudstack.api.response.StaticRouteResponse;
|
||||
import org.apache.cloudstack.api.response.StorageNetworkIpRangeResponse;
|
||||
import org.apache.cloudstack.api.response.StoragePoolResponse;
|
||||
import org.apache.cloudstack.api.response.SwiftResponse;
|
||||
import org.apache.cloudstack.api.response.SystemVmInstanceResponse;
|
||||
import org.apache.cloudstack.api.response.SystemVmResponse;
|
||||
import org.apache.cloudstack.api.response.TemplatePermissionsResponse;
|
||||
import org.apache.cloudstack.api.response.TemplateResponse;
|
||||
import org.apache.cloudstack.api.response.TrafficMonitorResponse;
|
||||
import org.apache.cloudstack.api.response.TrafficTypeResponse;
|
||||
import org.apache.cloudstack.api.response.UsageRecordResponse;
|
||||
import org.apache.cloudstack.api.response.UserResponse;
|
||||
import org.apache.cloudstack.api.response.UserVmResponse;
|
||||
import org.apache.cloudstack.api.response.VMSnapshotResponse;
|
||||
import org.apache.cloudstack.api.response.VirtualRouterProviderResponse;
|
||||
import org.apache.cloudstack.api.response.VlanIpRangeResponse;
|
||||
import org.apache.cloudstack.api.response.VolumeResponse;
|
||||
import org.apache.cloudstack.api.response.VpcOfferingResponse;
|
||||
import org.apache.cloudstack.api.response.VpcResponse;
|
||||
import org.apache.cloudstack.api.response.VpnUsersResponse;
|
||||
import org.apache.cloudstack.api.response.ZoneResponse;
|
||||
import org.apache.cloudstack.network.lb.ApplicationLoadBalancerRule;
|
||||
import org.apache.cloudstack.region.PortableIp;
|
||||
import org.apache.cloudstack.region.PortableIpRange;
|
||||
import org.apache.cloudstack.region.Region;
|
||||
import org.apache.cloudstack.usage.Usage;
|
||||
|
||||
import com.cloud.storage.ImageStore;
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface ResponseGenerator {
|
||||
UserResponse createUserResponse(UserAccount user);
|
||||
|
|
@ -257,7 +260,7 @@ public interface ResponseGenerator {
|
|||
|
||||
StoragePoolResponse createStoragePoolResponse(StoragePool pool);
|
||||
|
||||
StoragePoolForMigrationResponse createStoragePoolForMigrationResponse(StoragePool pool);
|
||||
StoragePoolResponse createStoragePoolForMigrationResponse(StoragePool pool);
|
||||
|
||||
ClusterResponse createClusterResponse(Cluster cluster, Boolean showCapacities);
|
||||
|
||||
|
|
@ -277,7 +280,7 @@ public interface ResponseGenerator {
|
|||
|
||||
Host findHostById(Long hostId);
|
||||
|
||||
List<TemplateResponse> createTemplateResponses(long templateId, long zoneId, boolean readyOnly);
|
||||
//List<TemplateResponse> createTemplateResponses(long templateId, long zoneId, boolean readyOnly);
|
||||
|
||||
VpnUsersResponse createVpnUserResponse(VpnUser user);
|
||||
|
||||
|
|
@ -293,7 +296,9 @@ public interface ResponseGenerator {
|
|||
|
||||
SecurityGroupResponse createSecurityGroupResponse(SecurityGroup group);
|
||||
|
||||
ExtractResponse createExtractResponse(Long uploadId, Long id, Long zoneId, Long accountId, String mode);
|
||||
ExtractResponse createExtractResponse(Long uploadId, Long id, Long zoneId, Long accountId, String mode, String url);
|
||||
|
||||
ExtractResponse createExtractResponse(Long id, Long zoneId, Long accountId, String mode, String url);
|
||||
|
||||
String toSerializedString(CreateCmdResponse response, String responseType);
|
||||
|
||||
|
|
@ -303,7 +308,9 @@ public interface ResponseGenerator {
|
|||
|
||||
//List<EventResponse> createEventResponse(EventJoinVO... events);
|
||||
|
||||
TemplateResponse createIsoResponse(VirtualMachineTemplate result);
|
||||
TemplateResponse createTemplateUpdateResponse(VirtualMachineTemplate result);
|
||||
|
||||
List<TemplateResponse> createTemplateResponses(VirtualMachineTemplate result, Long zoneId, boolean readyOnly);
|
||||
|
||||
List<CapacityResponse> createCapacityResponse(List<? extends Capacity> result, DecimalFormat format);
|
||||
|
||||
|
|
@ -323,13 +330,13 @@ public interface ResponseGenerator {
|
|||
|
||||
Long getSecurityGroupId(String groupName, long accountId);
|
||||
|
||||
List<TemplateResponse> createIsoResponses(long isoId, Long zoneId, boolean readyOnly);
|
||||
List<TemplateResponse> createIsoResponses(VirtualMachineTemplate iso, Long zoneId, boolean readyOnly);
|
||||
|
||||
// List<TemplateResponse> createIsoResponses(long isoId, Long zoneId, boolean readyOnly);
|
||||
//List<TemplateResponse> createIsoResponses(VirtualMachineTemplate iso, long zoneId, boolean readyOnly);
|
||||
|
||||
ProjectResponse createProjectResponse(Project project);
|
||||
|
||||
|
||||
List<TemplateResponse> createIsoResponses(VirtualMachineTemplate iso, long zoneId, boolean readyOnly);
|
||||
|
||||
List<TemplateResponse> createTemplateResponses(long templateId, Long vmId);
|
||||
|
||||
FirewallResponse createFirewallResponse(FirewallRule fwRule);
|
||||
|
|
@ -362,6 +369,8 @@ public interface ResponseGenerator {
|
|||
|
||||
RegionResponse createRegionResponse(Region region);
|
||||
|
||||
ImageStoreResponse createImageStoreResponse(ImageStore os);
|
||||
|
||||
/**
|
||||
* @param resourceTag
|
||||
* @param keyValueOnly TODO
|
||||
|
|
@ -436,12 +445,17 @@ public interface ResponseGenerator {
|
|||
public NicResponse createNicResponse(Nic result);
|
||||
|
||||
ApplicationLoadBalancerResponse createLoadBalancerContainerReponse(ApplicationLoadBalancerRule lb, Map<Ip, UserVm> lbInstances);
|
||||
|
||||
|
||||
AffinityGroupResponse createAffinityGroupResponse(AffinityGroup group);
|
||||
|
||||
Long getAffinityGroupId(String name, long entityOwnerId);
|
||||
|
||||
PortableIpRangeResponse createPortableIPRangeResponse(PortableIpRange range);
|
||||
|
||||
PortableIpResponse createPortableIPResponse(PortableIp portableIp);
|
||||
|
||||
InternalLoadBalancerElementResponse createInternalLbElementResponse(VirtualRouterProvider result);
|
||||
|
||||
|
||||
IsolationMethodResponse createIsolationMethodResponse(IsolationType method);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ import java.util.ArrayList;
|
|||
import com.cloud.exception.CloudException;
|
||||
import com.cloud.utils.exception.CSExceptionErrorCode;
|
||||
import com.cloud.utils.exception.CloudRuntimeException;
|
||||
import com.cloud.utils.exception.ExceptionProxyObject;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public class ServerApiException extends CloudRuntimeException {
|
||||
|
|
@ -45,7 +46,7 @@ public class ServerApiException extends CloudRuntimeException {
|
|||
_description = description;
|
||||
if (cause instanceof CloudRuntimeException) {
|
||||
CloudRuntimeException rt = (CloudRuntimeException) cause;
|
||||
ArrayList<String> idList = rt.getIdProxyList();
|
||||
ArrayList<ExceptionProxyObject> idList = rt.getIdProxyList();
|
||||
if (idList != null) {
|
||||
for (int i = 0; i < idList.size(); i++) {
|
||||
addProxyObject(idList.get(i));
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ package org.apache.cloudstack.api.command.admin.account;
|
|||
import javax.inject.Inject;
|
||||
|
||||
import org.apache.cloudstack.api.APICommand;
|
||||
import org.apache.cloudstack.api.ApiCommandJobType;
|
||||
import org.apache.cloudstack.api.ApiConstants;
|
||||
import org.apache.cloudstack.api.ApiErrorCode;
|
||||
import org.apache.cloudstack.api.BaseAsyncCmd;
|
||||
|
|
@ -29,7 +30,6 @@ import org.apache.cloudstack.api.response.SuccessResponse;
|
|||
import org.apache.cloudstack.region.RegionService;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.async.AsyncJob;
|
||||
import com.cloud.event.EventTypes;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.user.User;
|
||||
|
|
@ -107,7 +107,7 @@ public class DeleteAccountCmd extends BaseAsyncCmd {
|
|||
}
|
||||
|
||||
@Override
|
||||
public AsyncJob.Type getInstanceType() {
|
||||
return AsyncJob.Type.Account;
|
||||
public ApiCommandJobType getInstanceType() {
|
||||
return ApiCommandJobType.Account;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ package org.apache.cloudstack.api.command.admin.account;
|
|||
import javax.inject.Inject;
|
||||
|
||||
import org.apache.cloudstack.api.APICommand;
|
||||
import org.apache.cloudstack.api.ApiCommandJobType;
|
||||
import org.apache.cloudstack.api.ApiConstants;
|
||||
import org.apache.cloudstack.api.ApiErrorCode;
|
||||
import org.apache.cloudstack.api.BaseAsyncCmd;
|
||||
|
|
@ -29,7 +30,6 @@ import org.apache.cloudstack.api.response.DomainResponse;
|
|||
import org.apache.cloudstack.region.RegionService;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.async.AsyncJob;
|
||||
import com.cloud.event.EventTypes;
|
||||
import com.cloud.exception.ConcurrentOperationException;
|
||||
import com.cloud.exception.ResourceUnavailableException;
|
||||
|
|
@ -128,7 +128,7 @@ public class DisableAccountCmd extends BaseAsyncCmd {
|
|||
}
|
||||
|
||||
@Override
|
||||
public AsyncJob.Type getInstanceType() {
|
||||
return AsyncJob.Type.Account;
|
||||
public ApiCommandJobType getInstanceType() {
|
||||
return ApiCommandJobType.Account;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@
|
|||
package org.apache.cloudstack.api.command.admin.autoscale;
|
||||
|
||||
import org.apache.cloudstack.api.APICommand;
|
||||
import org.apache.cloudstack.api.ApiCommandJobType;
|
||||
import org.apache.cloudstack.api.ApiConstants;
|
||||
import org.apache.cloudstack.api.ApiErrorCode;
|
||||
import org.apache.cloudstack.api.BaseAsyncCreateCmd;
|
||||
|
|
@ -26,7 +27,6 @@ import org.apache.cloudstack.api.ServerApiException;
|
|||
import org.apache.cloudstack.api.response.CounterResponse;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.async.AsyncJob;
|
||||
import com.cloud.event.EventTypes;
|
||||
import com.cloud.network.as.Counter;
|
||||
import com.cloud.user.Account;
|
||||
|
|
@ -95,8 +95,8 @@ public class CreateCounterCmd extends BaseAsyncCreateCmd {
|
|||
}
|
||||
|
||||
@Override
|
||||
public AsyncJob.Type getInstanceType() {
|
||||
return AsyncJob.Type.Counter;
|
||||
public ApiCommandJobType getInstanceType() {
|
||||
return ApiCommandJobType.Counter;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@
|
|||
package org.apache.cloudstack.api.command.admin.autoscale;
|
||||
|
||||
import org.apache.cloudstack.api.APICommand;
|
||||
import org.apache.cloudstack.api.ApiCommandJobType;
|
||||
import org.apache.cloudstack.api.ApiConstants;
|
||||
import org.apache.cloudstack.api.ApiErrorCode;
|
||||
import org.apache.cloudstack.api.BaseAsyncCmd;
|
||||
|
|
@ -27,7 +28,6 @@ import org.apache.cloudstack.api.response.CounterResponse;
|
|||
import org.apache.cloudstack.api.response.SuccessResponse;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.async.AsyncJob;
|
||||
import com.cloud.event.EventTypes;
|
||||
import com.cloud.exception.ResourceInUseException;
|
||||
import com.cloud.user.Account;
|
||||
|
|
@ -82,8 +82,8 @@ public class DeleteCounterCmd extends BaseAsyncCmd {
|
|||
}
|
||||
|
||||
@Override
|
||||
public AsyncJob.Type getInstanceType() {
|
||||
return AsyncJob.Type.Counter;
|
||||
public ApiCommandJobType getInstanceType() {
|
||||
return ApiCommandJobType.Counter;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -17,13 +17,11 @@
|
|||
|
||||
package org.apache.cloudstack.api.command.admin.cluster;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.cloud.exception.DiscoveryException;
|
||||
import com.cloud.exception.InvalidParameterValueException;
|
||||
import org.apache.cloudstack.api.*;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.exception.ResourceInUseException;
|
||||
import com.cloud.org.Cluster;
|
||||
import com.cloud.user.Account;
|
||||
import org.apache.cloudstack.api.APICommand;
|
||||
import org.apache.cloudstack.api.ApiConstants;
|
||||
import org.apache.cloudstack.api.ApiErrorCode;
|
||||
|
|
@ -36,10 +34,8 @@ import org.apache.cloudstack.api.response.PodResponse;
|
|||
import org.apache.cloudstack.api.response.ZoneResponse;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.exception.DiscoveryException;
|
||||
import com.cloud.exception.ResourceInUseException;
|
||||
import com.cloud.org.Cluster;
|
||||
import com.cloud.user.Account;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@APICommand(name = "addCluster", description="Adds a new cluster", responseObject=ClusterResponse.class)
|
||||
public class AddClusterCmd extends BaseCmd {
|
||||
|
|
@ -86,10 +82,10 @@ public class AddClusterCmd extends BaseCmd {
|
|||
private String vsmipaddress;
|
||||
|
||||
@Parameter (name=ApiConstants.CPU_OVERCOMMIT_RATIO, type = CommandType.STRING, required = false , description = "value of the cpu overcommit ratio, defaults to 1")
|
||||
private String cpuovercommitRatio;
|
||||
private String cpuOvercommitRatio;
|
||||
|
||||
@Parameter(name = ApiConstants.MEMORY_OVERCOMMIT_RATIO, type = CommandType.STRING, required = false ,description = "value of the default ram overcommit ratio, defaults to 1")
|
||||
private String memoryovercommitratio;
|
||||
@Parameter(name = ApiConstants.MEMORY_OVERCOMMIT_RATIO, type = CommandType.STRING, required = false, description = "value of the default memory overcommit ratio, defaults to 1")
|
||||
private String memoryOvercommitRatio;
|
||||
|
||||
@Parameter(name = ApiConstants.VSWITCH_TYPE_GUEST_TRAFFIC, type = CommandType.STRING, required = false, description = "Type of virtual switch used for guest traffic in the cluster. Allowed values are, vmwaresvs (for VMware standard vSwitch) and vmwaredvs (for VMware distributed vSwitch)")
|
||||
private String vSwitchTypeGuestTraffic;
|
||||
|
|
@ -186,15 +182,15 @@ public class AddClusterCmd extends BaseCmd {
|
|||
}
|
||||
|
||||
public Float getCpuOvercommitRatio (){
|
||||
if(cpuovercommitRatio != null){
|
||||
return Float.parseFloat(cpuovercommitRatio);
|
||||
if(cpuOvercommitRatio != null){
|
||||
return Float.parseFloat(cpuOvercommitRatio);
|
||||
}
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
public Float getMemoryOvercommitRaito (){
|
||||
if (memoryovercommitratio != null){
|
||||
return Float.parseFloat(memoryovercommitratio);
|
||||
public Float getMemoryOvercommitRatio(){
|
||||
if (memoryOvercommitRatio != null){
|
||||
return Float.parseFloat(memoryOvercommitRatio);
|
||||
}
|
||||
return 1.0f;
|
||||
}
|
||||
|
|
@ -202,8 +198,8 @@ public class AddClusterCmd extends BaseCmd {
|
|||
@Override
|
||||
public void execute(){
|
||||
try {
|
||||
if ((getMemoryOvercommitRaito().compareTo(1f) < 0) | (getCpuOvercommitRatio().compareTo(1f) < 0)) {
|
||||
throw new InvalidParameterValueException("Cpu and ram overcommit ratios should not be less than 1");
|
||||
if (getMemoryOvercommitRatio().compareTo(1f) < 0 || getCpuOvercommitRatio().compareTo(1f) < 0) {
|
||||
throw new InvalidParameterValueException("cpu and memory overcommit ratios should be greater than or equal to one");
|
||||
}
|
||||
List<? extends Cluster> result = _resourceService.discoverCluster(this);
|
||||
ListResponse<ClusterResponse> response = new ListResponse<ClusterResponse>();
|
||||
|
|
|
|||
|
|
@ -70,9 +70,6 @@ public class ListClustersCmd extends BaseListCmd {
|
|||
@Parameter(name=ApiConstants.MANAGED_STATE, type=CommandType.STRING, description="whether this cluster is managed by cloudstack")
|
||||
private String managedState;
|
||||
|
||||
@Parameter(name=ApiConstants.ZONE_TYPE, type=CommandType.STRING, description="the network type of the zone that the virtual machine belongs to")
|
||||
private String zoneType;
|
||||
|
||||
@Parameter(name=ApiConstants.SHOW_CAPACITIES, type=CommandType.BOOLEAN, description="flag to display the capacity of the clusters")
|
||||
private Boolean showCapacities;
|
||||
|
||||
|
|
@ -117,10 +114,7 @@ public class ListClustersCmd extends BaseListCmd {
|
|||
this.managedState = managedstate;
|
||||
}
|
||||
|
||||
public String getZoneType() {
|
||||
return zoneType;
|
||||
}
|
||||
|
||||
|
||||
public Boolean getShowCapacities() {
|
||||
return showCapacities;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ public class UpdateClusterCmd extends BaseCmd {
|
|||
@Parameter(name=ApiConstants.CPU_OVERCOMMIT_RATIO, type = CommandType.STRING, description = "Value of cpu overcommit ratio")
|
||||
private String cpuovercommitratio;
|
||||
|
||||
@Parameter(name=ApiConstants.MEMORY_OVERCOMMIT_RATIO, type = CommandType.STRING, description = "Value of ram overcommit ratio")
|
||||
@Parameter(name=ApiConstants.MEMORY_OVERCOMMIT_RATIO, type = CommandType.STRING, description = "Value of memory overcommit ratio")
|
||||
private String memoryovercommitratio;
|
||||
|
||||
|
||||
|
|
@ -129,13 +129,13 @@ public class UpdateClusterCmd extends BaseCmd {
|
|||
}
|
||||
if (getMemoryOvercommitRaito() !=null){
|
||||
if ((getMemoryOvercommitRaito().compareTo(1f) < 0)) {
|
||||
throw new InvalidParameterValueException("Memory overcommit ratio should be greater than or equal to one");
|
||||
throw new InvalidParameterValueException("Memory overcommit ratio should be greater than or equal to one");
|
||||
}
|
||||
}
|
||||
|
||||
if (getCpuOvercommitRatio() !=null){
|
||||
if (getCpuOvercommitRatio().compareTo(1f) < 0) {
|
||||
throw new InvalidParameterValueException("Cpu overcommit ratio should be greater than or equal to one");
|
||||
throw new InvalidParameterValueException("Cpu overcommit ratio should be greater than or equal to one");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,6 +16,8 @@
|
|||
// under the License.
|
||||
package org.apache.cloudstack.api.command.admin.config;
|
||||
|
||||
import com.cloud.hypervisor.HypervisorCapabilities;
|
||||
import com.cloud.user.Account;
|
||||
import org.apache.cloudstack.api.APICommand;
|
||||
import org.apache.cloudstack.api.ApiConstants;
|
||||
import org.apache.cloudstack.api.ApiErrorCode;
|
||||
|
|
@ -23,13 +25,9 @@ import org.apache.cloudstack.api.BaseCmd;
|
|||
import org.apache.cloudstack.api.Parameter;
|
||||
import org.apache.cloudstack.api.ServerApiException;
|
||||
import org.apache.cloudstack.api.response.HypervisorCapabilitiesResponse;
|
||||
import org.apache.cloudstack.api.response.ServiceOfferingResponse;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.hypervisor.HypervisorCapabilities;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
@APICommand(name = "updateHypervisorCapabilities", description="Updates a hypervisor capabilities.", responseObject=ServiceOfferingResponse.class, since="3.0.0")
|
||||
@APICommand(name = "updateHypervisorCapabilities", description="Updates a hypervisor capabilities.", responseObject=HypervisorCapabilitiesResponse.class, since="3.0.0")
|
||||
public class UpdateHypervisorCapabilitiesCmd extends BaseCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(UpdateHypervisorCapabilitiesCmd.class.getName());
|
||||
private static final String s_name = "updatehypervisorcapabilitiesresponse";
|
||||
|
|
|
|||
|
|
@ -16,23 +16,22 @@
|
|||
// under the License.
|
||||
package org.apache.cloudstack.api.command.admin.host;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.cloudstack.api.APICommand;
|
||||
import org.apache.cloudstack.api.ApiConstants;
|
||||
import org.apache.cloudstack.api.ApiErrorCode;
|
||||
import org.apache.cloudstack.api.BaseCmd;
|
||||
import org.apache.cloudstack.api.Parameter;
|
||||
import org.apache.cloudstack.api.ServerApiException;
|
||||
import org.apache.cloudstack.api.response.HostResponse;
|
||||
import org.apache.cloudstack.api.command.admin.storage.AddImageStoreCmd;
|
||||
import org.apache.cloudstack.api.response.ImageStoreResponse;
|
||||
import org.apache.cloudstack.api.response.ZoneResponse;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.exception.DiscoveryException;
|
||||
import com.cloud.host.Host;
|
||||
import com.cloud.storage.ImageStore;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
@APICommand(name = "addSecondaryStorage", description="Adds secondary storage.", responseObject=HostResponse.class)
|
||||
@APICommand(name = "addSecondaryStorage", description="Adds secondary storage.", responseObject=ImageStoreResponse.class)
|
||||
public class AddSecondaryStorageCmd extends BaseCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(AddSecondaryStorageCmd.class.getName());
|
||||
private static final String s_name = "addsecondarystorageresponse";
|
||||
|
|
@ -42,11 +41,13 @@ public class AddSecondaryStorageCmd extends BaseCmd {
|
|||
/////////////////////////////////////////////////////
|
||||
|
||||
@Parameter(name=ApiConstants.URL, type=CommandType.STRING, required=true, description="the URL for the secondary storage")
|
||||
private String url;
|
||||
protected String url;
|
||||
|
||||
@Parameter(name=ApiConstants.ZONE_ID, type=CommandType.UUID, entityType=ZoneResponse.class,
|
||||
description="the Zone ID for the secondary storage")
|
||||
private Long zoneId;
|
||||
protected Long zoneId;
|
||||
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////////// Accessors ///////////////////////
|
||||
|
|
@ -60,6 +61,7 @@ public class AddSecondaryStorageCmd extends BaseCmd {
|
|||
return zoneId;
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////// API Implementation///////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
|
@ -76,17 +78,19 @@ public class AddSecondaryStorageCmd extends BaseCmd {
|
|||
|
||||
@Override
|
||||
public void execute(){
|
||||
try {
|
||||
List<? extends Host> result = _resourceService.discoverHosts(this);
|
||||
HostResponse hostResponse = null;
|
||||
if (result != null && result.size() > 0) {
|
||||
for (Host host : result) {
|
||||
// There should only be one secondary storage host per add
|
||||
hostResponse = _responseGenerator.createHostResponse(host);
|
||||
hostResponse.setResponseName(getCommandName());
|
||||
hostResponse.setObjectName("secondarystorage");
|
||||
this.setResponseObject(hostResponse);
|
||||
}
|
||||
AddImageStoreCmd cmd = new AddImageStoreCmd();
|
||||
cmd.setUrl(this.getUrl());
|
||||
cmd.setZoneId(this.getZoneId());
|
||||
cmd.setProviderName("NFS");
|
||||
|
||||
try{
|
||||
ImageStore result = _storageService.discoverImageStore(cmd);
|
||||
ImageStoreResponse storeResponse = null;
|
||||
if (result != null ) {
|
||||
storeResponse = _responseGenerator.createImageStoreResponse(result);
|
||||
storeResponse.setResponseName(getCommandName());
|
||||
storeResponse.setObjectName("secondarystorage");
|
||||
this.setResponseObject(storeResponse);
|
||||
} else {
|
||||
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to add secondary storage");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
package org.apache.cloudstack.api.command.admin.host;
|
||||
|
||||
import org.apache.cloudstack.api.APICommand;
|
||||
import org.apache.cloudstack.api.ApiCommandJobType;
|
||||
import org.apache.cloudstack.api.ApiConstants;
|
||||
import org.apache.cloudstack.api.ApiErrorCode;
|
||||
import org.apache.cloudstack.api.BaseAsyncCmd;
|
||||
|
|
@ -25,7 +26,6 @@ import org.apache.cloudstack.api.ServerApiException;
|
|||
import org.apache.cloudstack.api.response.HostResponse;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.async.AsyncJob;
|
||||
import com.cloud.event.EventTypes;
|
||||
import com.cloud.host.Host;
|
||||
import com.cloud.user.Account;
|
||||
|
|
@ -87,8 +87,8 @@ public class CancelMaintenanceCmd extends BaseAsyncCmd {
|
|||
}
|
||||
|
||||
@Override
|
||||
public AsyncJob.Type getInstanceType() {
|
||||
return AsyncJob.Type.Host;
|
||||
public ApiCommandJobType getInstanceType() {
|
||||
return ApiCommandJobType.Host;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -70,13 +70,12 @@ public class FindHostsForMigrationCmd extends BaseListCmd {
|
|||
public void execute() {
|
||||
ListResponse<HostForMigrationResponse> response = null;
|
||||
Pair<List<? extends Host>,Integer> result;
|
||||
List<? extends Host> hostsWithCapacity = new ArrayList<Host>();
|
||||
Map<Host, Boolean> hostsRequiringStorageMotion;
|
||||
|
||||
Ternary<Pair<List<? extends Host>,Integer>, List<? extends Host>, Map<Host, Boolean>> hostsForMigration =
|
||||
_mgr.listHostsForMigrationOfVM(getVirtualMachineId(), this.getStartIndex(), this.getPageSizeVal());
|
||||
result = hostsForMigration.first();
|
||||
hostsWithCapacity = hostsForMigration.second();
|
||||
List<? extends Host> hostsWithCapacity = hostsForMigration.second();
|
||||
hostsRequiringStorageMotion = hostsForMigration.third();
|
||||
|
||||
response = new ListResponse<HostForMigrationResponse>();
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
|
||||
import org.apache.cloudstack.api.APICommand;
|
||||
import org.apache.cloudstack.api.ApiCommandJobType;
|
||||
import org.apache.cloudstack.api.ApiConstants;
|
||||
import org.apache.cloudstack.api.ApiConstants.HostDetails;
|
||||
import org.apache.cloudstack.api.BaseListCmd;
|
||||
|
|
@ -34,7 +35,6 @@ import org.apache.cloudstack.api.response.UserVmResponse;
|
|||
import org.apache.cloudstack.api.response.ZoneResponse;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.async.AsyncJob;
|
||||
import com.cloud.exception.InvalidParameterValueException;
|
||||
import com.cloud.host.Host;
|
||||
import com.cloud.utils.Pair;
|
||||
|
|
@ -74,9 +74,6 @@ public class ListHostsCmd extends BaseListCmd {
|
|||
@Parameter(name=ApiConstants.ZONE_ID, type=CommandType.UUID, entityType = ZoneResponse.class,
|
||||
description="the Zone ID for the host")
|
||||
private Long zoneId;
|
||||
|
||||
@Parameter(name=ApiConstants.ZONE_TYPE, type=CommandType.STRING, description="the network type of the zone that the virtual machine belongs to")
|
||||
private String zoneType;
|
||||
|
||||
@Parameter(name=ApiConstants.VIRTUAL_MACHINE_ID, type=CommandType.UUID, entityType = UserVmResponse.class,
|
||||
required=false, description="lists hosts in the same cluster as this VM and flag hosts with enough CPU/RAm to host this VM")
|
||||
|
|
@ -126,10 +123,6 @@ public class ListHostsCmd extends BaseListCmd {
|
|||
public Long getZoneId() {
|
||||
return zoneId;
|
||||
}
|
||||
|
||||
public String getZoneType() {
|
||||
return zoneType;
|
||||
}
|
||||
|
||||
public Long getVirtualMachineId() {
|
||||
return virtualMachineId;
|
||||
|
|
@ -167,8 +160,8 @@ public class ListHostsCmd extends BaseListCmd {
|
|||
return s_name;
|
||||
}
|
||||
|
||||
public AsyncJob.Type getInstanceType() {
|
||||
return AsyncJob.Type.Host;
|
||||
public ApiCommandJobType getInstanceType() {
|
||||
return ApiCommandJobType.Host;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -178,11 +171,10 @@ public class ListHostsCmd extends BaseListCmd {
|
|||
response = _queryService.searchForServers(this);
|
||||
} else {
|
||||
Pair<List<? extends Host>,Integer> result;
|
||||
List<? extends Host> hostsWithCapacity = new ArrayList<Host>();
|
||||
Ternary<Pair<List<? extends Host>,Integer>, List<? extends Host>, Map<Host, Boolean>> hostsForMigration =
|
||||
_mgr.listHostsForMigrationOfVM(getVirtualMachineId(), this.getStartIndex(), this.getPageSizeVal());
|
||||
result = hostsForMigration.first();
|
||||
hostsWithCapacity = hostsForMigration.second();
|
||||
List<? extends Host> hostsWithCapacity = hostsForMigration.second();
|
||||
|
||||
response = new ListResponse<HostResponse>();
|
||||
List<HostResponse> hostResponses = new ArrayList<HostResponse>();
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
package org.apache.cloudstack.api.command.admin.host;
|
||||
|
||||
import org.apache.cloudstack.api.APICommand;
|
||||
import org.apache.cloudstack.api.ApiCommandJobType;
|
||||
import org.apache.cloudstack.api.ApiConstants;
|
||||
import org.apache.cloudstack.api.ApiErrorCode;
|
||||
import org.apache.cloudstack.api.BaseAsyncCmd;
|
||||
|
|
@ -25,7 +26,6 @@ import org.apache.cloudstack.api.ServerApiException;
|
|||
import org.apache.cloudstack.api.response.HostResponse;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.async.AsyncJob;
|
||||
import com.cloud.event.EventTypes;
|
||||
import com.cloud.host.Host;
|
||||
import com.cloud.user.Account;
|
||||
|
|
@ -87,8 +87,8 @@ public class PrepareForMaintenanceCmd extends BaseAsyncCmd {
|
|||
}
|
||||
|
||||
@Override
|
||||
public AsyncJob.Type getInstanceType() {
|
||||
return AsyncJob.Type.Host;
|
||||
public ApiCommandJobType getInstanceType() {
|
||||
return ApiCommandJobType.Host;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
package org.apache.cloudstack.api.command.admin.host;
|
||||
|
||||
import org.apache.cloudstack.api.APICommand;
|
||||
import org.apache.cloudstack.api.ApiCommandJobType;
|
||||
import org.apache.cloudstack.api.ApiConstants;
|
||||
import org.apache.cloudstack.api.ApiErrorCode;
|
||||
import org.apache.cloudstack.api.BaseAsyncCmd;
|
||||
|
|
@ -25,7 +26,6 @@ import org.apache.cloudstack.api.ServerApiException;
|
|||
import org.apache.cloudstack.api.response.HostResponse;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.async.AsyncJob;
|
||||
import com.cloud.event.EventTypes;
|
||||
import com.cloud.host.Host;
|
||||
import com.cloud.user.Account;
|
||||
|
|
@ -86,8 +86,8 @@ public class ReconnectHostCmd extends BaseAsyncCmd {
|
|||
return "reconnecting host: " + getId();
|
||||
}
|
||||
|
||||
public AsyncJob.Type getInstanceType() {
|
||||
return AsyncJob.Type.Host;
|
||||
public ApiCommandJobType getInstanceType() {
|
||||
return ApiCommandJobType.Host;
|
||||
}
|
||||
|
||||
public Long getInstanceId() {
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
package org.apache.cloudstack.api.command.admin.host;
|
||||
|
||||
import org.apache.cloudstack.api.APICommand;
|
||||
import org.apache.cloudstack.api.ApiCommandJobType;
|
||||
import org.apache.cloudstack.api.ApiConstants;
|
||||
import org.apache.cloudstack.api.ApiErrorCode;
|
||||
import org.apache.cloudstack.api.BaseAsyncCmd;
|
||||
|
|
@ -26,7 +27,6 @@ import org.apache.cloudstack.api.response.HostResponse;
|
|||
import org.apache.cloudstack.api.response.SuccessResponse;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.async.AsyncJob;
|
||||
import com.cloud.event.EventTypes;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.user.UserContext;
|
||||
|
|
@ -83,8 +83,8 @@ public class ReleaseHostReservationCmd extends BaseAsyncCmd {
|
|||
}
|
||||
|
||||
@Override
|
||||
public AsyncJob.Type getInstanceType() {
|
||||
return AsyncJob.Type.Host;
|
||||
public ApiCommandJobType getInstanceType() {
|
||||
return ApiCommandJobType.Host;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -17,10 +17,13 @@
|
|||
|
||||
package org.apache.cloudstack.api.command.admin.internallb;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import com.cloud.event.EventTypes;
|
||||
import com.cloud.exception.ConcurrentOperationException;
|
||||
import com.cloud.exception.InsufficientCapacityException;
|
||||
import com.cloud.exception.ResourceUnavailableException;
|
||||
import com.cloud.network.VirtualRouterProvider;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.user.UserContext;
|
||||
import org.apache.cloudstack.api.APICommand;
|
||||
import org.apache.cloudstack.api.ApiConstants;
|
||||
import org.apache.cloudstack.api.ApiErrorCode;
|
||||
|
|
@ -31,13 +34,8 @@ import org.apache.cloudstack.api.response.InternalLoadBalancerElementResponse;
|
|||
import org.apache.cloudstack.network.element.InternalLoadBalancerElementService;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.event.EventTypes;
|
||||
import com.cloud.exception.ConcurrentOperationException;
|
||||
import com.cloud.exception.InsufficientCapacityException;
|
||||
import com.cloud.exception.ResourceUnavailableException;
|
||||
import com.cloud.network.VirtualRouterProvider;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.user.UserContext;
|
||||
import javax.inject.Inject;
|
||||
import java.util.List;
|
||||
|
||||
@APICommand(name = "configureInternalLoadBalancerElement", responseObject=InternalLoadBalancerElementResponse.class,
|
||||
description="Configures an Internal Load Balancer element.", since="4.2.0")
|
||||
|
|
@ -98,11 +96,8 @@ public class ConfigureInternalLoadBalancerElementCmd extends BaseAsyncCmd {
|
|||
|
||||
@Override
|
||||
public void execute() throws ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException{
|
||||
s_logger.debug("hello alena");
|
||||
UserContext.current().setEventDetails("Internal load balancer element: " + id);
|
||||
s_logger.debug("hello alena");
|
||||
VirtualRouterProvider result = _service.get(0).configureInternalLoadBalancerElement(getId(), getEnabled());
|
||||
s_logger.debug("hello alena");
|
||||
if (result != null){
|
||||
InternalLoadBalancerElementResponse routerResponse = _responseGenerator.createInternalLbElementResponse(result);
|
||||
routerResponse.setResponseName(getCommandName());
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
package org.apache.cloudstack.api.command.admin.internallb;
|
||||
|
||||
import org.apache.cloudstack.api.APICommand;
|
||||
import org.apache.cloudstack.api.ApiCommandJobType;
|
||||
import org.apache.cloudstack.api.ApiConstants;
|
||||
import org.apache.cloudstack.api.BaseListProjectAndAccountResourcesCmd;
|
||||
import org.apache.cloudstack.api.Parameter;
|
||||
|
|
@ -30,7 +31,6 @@ import org.apache.cloudstack.api.response.VpcResponse;
|
|||
import org.apache.cloudstack.api.response.ZoneResponse;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.async.AsyncJob;
|
||||
import com.cloud.network.router.VirtualRouter.Role;
|
||||
|
||||
@APICommand(name = "listInternalLoadBalancerVMs", description="List internal LB VMs.", responseObject=DomainRouterResponse.class)
|
||||
|
|
@ -75,10 +75,7 @@ public class ListInternalLBVMsCmd extends BaseListProjectAndAccountResourcesCmd
|
|||
|
||||
@Parameter(name=ApiConstants.FOR_VPC, type=CommandType.BOOLEAN, description="if true is passed for this parameter, list only VPC Internal LB VMs")
|
||||
private Boolean forVpc;
|
||||
|
||||
@Parameter(name=ApiConstants.ZONE_TYPE, type=CommandType.STRING, description="the network type of the zone that the virtual machine belongs to")
|
||||
private String zoneType;
|
||||
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////////// Accessors ///////////////////////
|
||||
|
|
@ -123,10 +120,7 @@ public class ListInternalLBVMsCmd extends BaseListProjectAndAccountResourcesCmd
|
|||
public String getRole() {
|
||||
return Role.INTERNAL_LB_VM.toString();
|
||||
}
|
||||
|
||||
public String getZoneType() {
|
||||
return zoneType;
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////// API Implementation///////////////////
|
||||
|
|
@ -138,8 +132,8 @@ public class ListInternalLBVMsCmd extends BaseListProjectAndAccountResourcesCmd
|
|||
}
|
||||
|
||||
@Override
|
||||
public AsyncJob.Type getInstanceType() {
|
||||
return AsyncJob.Type.DomainRouter;
|
||||
public ApiCommandJobType getInstanceType() {
|
||||
return ApiCommandJobType.DomainRouter;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
package org.apache.cloudstack.api.command.admin.internallb;
|
||||
|
||||
import org.apache.cloudstack.api.APICommand;
|
||||
import org.apache.cloudstack.api.ApiCommandJobType;
|
||||
import org.apache.cloudstack.api.ApiConstants;
|
||||
import org.apache.cloudstack.api.ApiErrorCode;
|
||||
import org.apache.cloudstack.api.BaseAsyncCmd;
|
||||
|
|
@ -25,7 +26,6 @@ import org.apache.cloudstack.api.ServerApiException;
|
|||
import org.apache.cloudstack.api.response.DomainRouterResponse;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.async.AsyncJob;
|
||||
import com.cloud.event.EventTypes;
|
||||
import com.cloud.exception.ConcurrentOperationException;
|
||||
import com.cloud.exception.InsufficientCapacityException;
|
||||
|
|
@ -90,8 +90,8 @@ public class StartInternalLBVMCmd extends BaseAsyncCmd {
|
|||
return "starting internal lb vm: " + getId();
|
||||
}
|
||||
|
||||
public AsyncJob.Type getInstanceType() {
|
||||
return AsyncJob.Type.InternalLbVm;
|
||||
public ApiCommandJobType getInstanceType() {
|
||||
return ApiCommandJobType.InternalLbVm;
|
||||
}
|
||||
|
||||
public Long getInstanceId() {
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
package org.apache.cloudstack.api.command.admin.internallb;
|
||||
|
||||
import org.apache.cloudstack.api.APICommand;
|
||||
import org.apache.cloudstack.api.ApiCommandJobType;
|
||||
import org.apache.cloudstack.api.ApiConstants;
|
||||
import org.apache.cloudstack.api.ApiErrorCode;
|
||||
import org.apache.cloudstack.api.BaseAsyncCmd;
|
||||
|
|
@ -25,7 +26,6 @@ import org.apache.cloudstack.api.ServerApiException;
|
|||
import org.apache.cloudstack.api.response.DomainRouterResponse;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.async.AsyncJob;
|
||||
import com.cloud.event.EventTypes;
|
||||
import com.cloud.exception.ConcurrentOperationException;
|
||||
import com.cloud.exception.InvalidParameterValueException;
|
||||
|
|
@ -88,8 +88,8 @@ public class StopInternalLBVMCmd extends BaseAsyncCmd {
|
|||
}
|
||||
|
||||
@Override
|
||||
public AsyncJob.Type getInstanceType() {
|
||||
return AsyncJob.Type.InternalLbVm;
|
||||
public ApiCommandJobType getInstanceType() {
|
||||
return ApiCommandJobType.InternalLbVm;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -17,6 +17,9 @@
|
|||
package org.apache.cloudstack.api.command.admin.ldap;
|
||||
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.naming.NamingException;
|
||||
|
||||
import org.apache.cloudstack.api.APICommand;
|
||||
|
|
@ -25,6 +28,7 @@ import org.apache.cloudstack.api.BaseCmd;
|
|||
import org.apache.cloudstack.api.Parameter;
|
||||
import org.apache.cloudstack.api.ServerApiException;
|
||||
import org.apache.cloudstack.api.response.LDAPConfigResponse;
|
||||
import org.apache.cloudstack.api.response.ListResponse;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.exception.ConcurrentOperationException;
|
||||
|
|
@ -43,10 +47,9 @@ public class LDAPConfigCmd extends BaseCmd {
|
|||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Parameter(name=ApiConstants.LIST_ALL, type=CommandType.STRING, description="Hostname or ip address of the ldap server eg: my.ldap.com")
|
||||
private String listall;
|
||||
|
||||
@Parameter(name=ApiConstants.LIST_ALL, type=CommandType.BOOLEAN, description="If true return current LDAP configuration")
|
||||
private Boolean listAll;
|
||||
|
||||
@Parameter(name=ApiConstants.HOST_NAME, type=CommandType.STRING, description="Hostname or ip address of the ldap server eg: my.ldap.com")
|
||||
private String hostname;
|
||||
|
||||
|
|
@ -78,10 +81,10 @@ public class LDAPConfigCmd extends BaseCmd {
|
|||
/////////////////// Accessors ///////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
public String getListAll() {
|
||||
return listall == null ? "false" : listall;
|
||||
public Boolean getListAll() {
|
||||
return listAll == null ? Boolean.FALSE : listAll;
|
||||
}
|
||||
|
||||
|
||||
public String getBindPassword() {
|
||||
return bindPassword;
|
||||
}
|
||||
|
|
@ -156,16 +159,22 @@ public class LDAPConfigCmd extends BaseCmd {
|
|||
InsufficientCapacityException, ServerApiException,
|
||||
ConcurrentOperationException, ResourceAllocationException {
|
||||
try {
|
||||
if ("true".equalsIgnoreCase(getListAll())){
|
||||
if (getListAll()){
|
||||
// return the existing conf
|
||||
LDAPConfigCmd cmd = _configService.listLDAPConfig(this);
|
||||
LDAPConfigResponse lr = _responseGenerator.createLDAPConfigResponse(cmd.getHostname(), cmd.getPort(), cmd.getUseSSL(),
|
||||
cmd.getQueryFilter(), cmd.getSearchBase(), cmd.getBindDN());
|
||||
lr.setResponseName(getCommandName());
|
||||
this.setResponseObject(lr);
|
||||
ListResponse<LDAPConfigResponse> response = new ListResponse<LDAPConfigResponse>();
|
||||
List<LDAPConfigResponse> responses = new ArrayList<LDAPConfigResponse>();
|
||||
|
||||
if(!cmd.getHostname().equals("")) {
|
||||
responses.add(_responseGenerator.createLDAPConfigResponse(cmd.getHostname(), cmd.getPort(), cmd.getUseSSL(), cmd.getQueryFilter(), cmd.getSearchBase(), cmd.getBindDN()));
|
||||
}
|
||||
|
||||
response.setResponses(responses);
|
||||
response.setResponseName(getCommandName());
|
||||
this.setResponseObject(response);
|
||||
}
|
||||
else if (getHostname()==null || getSearchBase() == null || getQueryFilter() == null) {
|
||||
throw new InvalidParameterValueException("You need to provide hostname, serachbase and queryfilter to configure your LDAP server");
|
||||
throw new InvalidParameterValueException("You need to provide hostname, searchbase and queryfilter to configure your LDAP server");
|
||||
}
|
||||
else {
|
||||
boolean result = _configService.updateLDAP(this);
|
||||
|
|
@ -193,4 +202,4 @@ public class LDAPConfigCmd extends BaseCmd {
|
|||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -19,6 +19,7 @@ package org.apache.cloudstack.api.command.admin.network;
|
|||
import java.util.List;
|
||||
|
||||
import org.apache.cloudstack.api.APICommand;
|
||||
import org.apache.cloudstack.api.ApiCommandJobType;
|
||||
import org.apache.cloudstack.api.ApiConstants;
|
||||
import org.apache.cloudstack.api.ApiErrorCode;
|
||||
import org.apache.cloudstack.api.BaseAsyncCreateCmd;
|
||||
|
|
@ -28,7 +29,6 @@ import org.apache.cloudstack.api.response.PhysicalNetworkResponse;
|
|||
import org.apache.cloudstack.api.response.ProviderResponse;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.async.AsyncJob;
|
||||
import com.cloud.event.EventTypes;
|
||||
import com.cloud.exception.ResourceAllocationException;
|
||||
import com.cloud.network.PhysicalNetworkServiceProvider;
|
||||
|
|
@ -129,7 +129,7 @@ public class AddNetworkServiceProviderCmd extends BaseAsyncCreateCmd {
|
|||
}
|
||||
|
||||
@Override
|
||||
public AsyncJob.Type getInstanceType() {
|
||||
return AsyncJob.Type.PhysicalNetworkServiceProvider;
|
||||
public ApiCommandJobType getInstanceType() {
|
||||
return ApiCommandJobType.PhysicalNetworkServiceProvider;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -95,10 +95,13 @@ public class CreateNetworkOfferingCmd extends BaseCmd {
|
|||
@Parameter(name=ApiConstants.IS_PERSISTENT, type=CommandType.BOOLEAN, description="true if network offering supports persistent networks; defaulted to false if not specified")
|
||||
private Boolean isPersistent;
|
||||
|
||||
@Parameter(name=ApiConstants.DETAILS, type=CommandType.MAP, since="4.2.0", description="Template details in key/value pairs." +
|
||||
@Parameter(name=ApiConstants.DETAILS, type=CommandType.MAP, since="4.2.0", description="Network offering details in key/value pairs." +
|
||||
" Supported keys are internallbprovider/publiclbprovider with service provider as a value")
|
||||
protected Map details;
|
||||
|
||||
@Parameter(name=ApiConstants.EGRESS_DEFAULT_POLICY, type=CommandType.BOOLEAN, description="true if default guest network egress policy is allow; false if default egress policy is deny")
|
||||
private Boolean egressDefaultPolicy;
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////////// Accessors ///////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
|
@ -162,6 +165,13 @@ public class CreateNetworkOfferingCmd extends BaseCmd {
|
|||
return isPersistent == null ? false : isPersistent;
|
||||
}
|
||||
|
||||
public Boolean getEgressDefaultPolicy() {
|
||||
if (egressDefaultPolicy == null) {
|
||||
return true;
|
||||
}
|
||||
return egressDefaultPolicy;
|
||||
}
|
||||
|
||||
public Map<String, List<String>> getServiceProviders() {
|
||||
Map<String, List<String>> serviceProviderMap = null;
|
||||
if (serviceProviderList != null && !serviceProviderList.isEmpty()) {
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ package org.apache.cloudstack.api.command.admin.network;
|
|||
import java.util.List;
|
||||
|
||||
import org.apache.cloudstack.api.APICommand;
|
||||
import org.apache.cloudstack.api.ApiCommandJobType;
|
||||
import org.apache.cloudstack.api.ApiConstants;
|
||||
import org.apache.cloudstack.api.ApiErrorCode;
|
||||
import org.apache.cloudstack.api.BaseAsyncCreateCmd;
|
||||
|
|
@ -29,7 +30,6 @@ import org.apache.cloudstack.api.response.PhysicalNetworkResponse;
|
|||
import org.apache.cloudstack.api.response.ZoneResponse;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.async.AsyncJob;
|
||||
import com.cloud.event.EventTypes;
|
||||
import com.cloud.exception.ResourceAllocationException;
|
||||
import com.cloud.network.PhysicalNetwork;
|
||||
|
|
@ -167,7 +167,7 @@ public class CreatePhysicalNetworkCmd extends BaseAsyncCreateCmd {
|
|||
}
|
||||
|
||||
@Override
|
||||
public AsyncJob.Type getInstanceType() {
|
||||
return AsyncJob.Type.PhysicalNetwork;
|
||||
public ApiCommandJobType getInstanceType() {
|
||||
return ApiCommandJobType.PhysicalNetwork;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
package org.apache.cloudstack.api.command.admin.network;
|
||||
|
||||
import org.apache.cloudstack.api.APICommand;
|
||||
import org.apache.cloudstack.api.ApiCommandJobType;
|
||||
import org.apache.cloudstack.api.ApiConstants;
|
||||
import org.apache.cloudstack.api.ApiErrorCode;
|
||||
import org.apache.cloudstack.api.BaseAsyncCmd;
|
||||
|
|
@ -26,7 +27,6 @@ import org.apache.cloudstack.api.response.ProviderResponse;
|
|||
import org.apache.cloudstack.api.response.SuccessResponse;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.async.AsyncJob;
|
||||
import com.cloud.event.EventTypes;
|
||||
import com.cloud.exception.ConcurrentOperationException;
|
||||
import com.cloud.exception.ResourceUnavailableException;
|
||||
|
|
@ -100,7 +100,7 @@ public class DeleteNetworkServiceProviderCmd extends BaseAsyncCmd {
|
|||
}
|
||||
|
||||
@Override
|
||||
public AsyncJob.Type getInstanceType() {
|
||||
return AsyncJob.Type.PhysicalNetworkServiceProvider;
|
||||
public ApiCommandJobType getInstanceType() {
|
||||
return ApiCommandJobType.PhysicalNetworkServiceProvider;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
package org.apache.cloudstack.api.command.admin.network;
|
||||
|
||||
import org.apache.cloudstack.api.APICommand;
|
||||
import org.apache.cloudstack.api.ApiCommandJobType;
|
||||
import org.apache.cloudstack.api.ApiConstants;
|
||||
import org.apache.cloudstack.api.ApiErrorCode;
|
||||
import org.apache.cloudstack.api.BaseAsyncCmd;
|
||||
|
|
@ -26,7 +27,6 @@ import org.apache.cloudstack.api.response.PhysicalNetworkResponse;
|
|||
import org.apache.cloudstack.api.response.SuccessResponse;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.async.AsyncJob;
|
||||
import com.cloud.event.EventTypes;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.user.UserContext;
|
||||
|
|
@ -90,7 +90,7 @@ public class DeletePhysicalNetworkCmd extends BaseAsyncCmd {
|
|||
}
|
||||
|
||||
@Override
|
||||
public AsyncJob.Type getInstanceType() {
|
||||
return AsyncJob.Type.PhysicalNetwork;
|
||||
public ApiCommandJobType getInstanceType() {
|
||||
return ApiCommandJobType.PhysicalNetwork;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@
|
|||
|
||||
package org.apache.cloudstack.api.command.admin.network;
|
||||
|
||||
import com.cloud.async.AsyncJob;
|
||||
import com.cloud.event.EventTypes;
|
||||
import com.cloud.exception.ResourceInUseException;
|
||||
import com.cloud.user.Account;
|
||||
|
|
@ -55,8 +54,8 @@ public class ReleaseDedicatedGuestVlanRangeCmd extends BaseAsyncCmd {
|
|||
}
|
||||
|
||||
@Override
|
||||
public AsyncJob.Type getInstanceType() {
|
||||
return AsyncJob.Type.DedicatedGuestVlanRange;
|
||||
public ApiCommandJobType getInstanceType() {
|
||||
return ApiCommandJobType.DedicatedGuestVlanRange;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ package org.apache.cloudstack.api.command.admin.network;
|
|||
import java.util.List;
|
||||
|
||||
import org.apache.cloudstack.api.APICommand;
|
||||
import org.apache.cloudstack.api.ApiCommandJobType;
|
||||
import org.apache.cloudstack.api.ApiConstants;
|
||||
import org.apache.cloudstack.api.ApiErrorCode;
|
||||
import org.apache.cloudstack.api.BaseAsyncCmd;
|
||||
|
|
@ -27,7 +28,6 @@ import org.apache.cloudstack.api.ServerApiException;
|
|||
import org.apache.cloudstack.api.response.ProviderResponse;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.async.AsyncJob;
|
||||
import com.cloud.event.EventTypes;
|
||||
import com.cloud.network.PhysicalNetworkServiceProvider;
|
||||
import com.cloud.user.Account;
|
||||
|
|
@ -103,8 +103,8 @@ public class UpdateNetworkServiceProviderCmd extends BaseAsyncCmd {
|
|||
}
|
||||
|
||||
@Override
|
||||
public AsyncJob.Type getInstanceType() {
|
||||
return AsyncJob.Type.PhysicalNetworkServiceProvider;
|
||||
public ApiCommandJobType getInstanceType() {
|
||||
return ApiCommandJobType.PhysicalNetworkServiceProvider;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,13 +19,13 @@ package org.apache.cloudstack.api.command.admin.network;
|
|||
import java.util.List;
|
||||
|
||||
import org.apache.cloudstack.api.APICommand;
|
||||
import org.apache.cloudstack.api.ApiCommandJobType;
|
||||
import org.apache.cloudstack.api.ApiConstants;
|
||||
import org.apache.cloudstack.api.BaseAsyncCmd;
|
||||
import org.apache.cloudstack.api.Parameter;
|
||||
import org.apache.cloudstack.api.response.PhysicalNetworkResponse;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.async.AsyncJob;
|
||||
import com.cloud.event.EventTypes;
|
||||
import com.cloud.network.PhysicalNetwork;
|
||||
import com.cloud.user.Account;
|
||||
|
|
@ -118,7 +118,7 @@ public class UpdatePhysicalNetworkCmd extends BaseAsyncCmd {
|
|||
}
|
||||
|
||||
@Override
|
||||
public AsyncJob.Type getInstanceType() {
|
||||
return AsyncJob.Type.PhysicalNetwork;
|
||||
public ApiCommandJobType getInstanceType() {
|
||||
return ApiCommandJobType.PhysicalNetwork;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue