mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Merge branch 'master' into rbac.
This commit is contained in:
commit
2ef4d5200c
39
INSTALL.md
39
INSTALL.md
@ -96,25 +96,22 @@ Clean and build:
|
|||||||
|
|
||||||
$ mvn clean install -P systemvm,developer
|
$ mvn clean install -P systemvm,developer
|
||||||
|
|
||||||
In case you want support for VMWare, SRX and other non-Apache (referred to as nonoss)
|
CloudStack supports several plugins that depend on libraries with distribution restrictions.
|
||||||
compliant libs, you may download the following jar artifacts from respective vendors:
|
Because of this they are not included in the default build. Enable these additional plugins
|
||||||
|
activate their respective profiles. For convenience adding -Dnoredist will enable all plugins
|
||||||
|
that depend on libraries with distribution restrictions. The build procedure expects that the
|
||||||
|
required libraries are present in the maven repository.
|
||||||
|
|
||||||
deps/cloud-iControl.jar
|
The following procedure can be used to add the libraries to the local maven repository. Details
|
||||||
deps/cloud-manageontap.jar
|
on obtaining the required libraries can be found in this file. Note that this will vary between
|
||||||
deps/cloud-netscaler-sdx.jar
|
releases of cloudstack
|
||||||
deps/cloud-netscaler.jar
|
|
||||||
deps/vmware-apputils.jar
|
|
||||||
deps/vmware-vim.jar
|
|
||||||
deps/vmware-vim25.jar
|
|
||||||
|
|
||||||
Install them to ~/.m2 so maven can get them as dependencies:
|
|
||||||
|
|
||||||
$ cd deps
|
$ cd deps
|
||||||
$ ./install-non-oss.sh
|
$ ./install-non-oss.sh
|
||||||
|
|
||||||
To build with nonoss components, use the build command with the nonoss flag:
|
To build all non redistributable components, add the noredist flag to the build command:
|
||||||
|
|
||||||
$ mvn clean install -P systemvm,developer -Dnonoss
|
$ mvn clean install -P systemvm,developer -Dnoredist
|
||||||
|
|
||||||
Clear old database (if any) and deploy the database schema:
|
Clear old database (if any) and deploy the database schema:
|
||||||
|
|
||||||
@ -153,7 +150,7 @@ This section describes packaging and installation.
|
|||||||
|
|
||||||
To create debs:
|
To create debs:
|
||||||
|
|
||||||
$ mvn -P deps # -D nonoss, for nonoss as described in the "Building" section above
|
$ mvn -P deps # -D noredist, for noredist as described in the "Building" section above
|
||||||
$ dpkg-buildpackage
|
$ dpkg-buildpackage
|
||||||
|
|
||||||
All the deb packages will be created in ../$PWD
|
All the deb packages will be created in ../$PWD
|
||||||
@ -183,15 +180,15 @@ Install needed packages, apt-get upgrade for upgrading:
|
|||||||
|
|
||||||
To create rpms:
|
To create rpms:
|
||||||
|
|
||||||
$ mvn -P deps # -D nonoss, for nonoss as described in the "Building" section above
|
$ cd packaging/centos63
|
||||||
$ ./waf rpm
|
$ bash packaging.sh [ -p NOREDIST ]
|
||||||
|
|
||||||
All the rpm packages will be create in artifacts/rpmbuild/RPMS/x86_64
|
All the rpm packages will be create in dist/rpmbuild/RPMS/x86_64
|
||||||
|
|
||||||
To create a yum repo: (assuming appropriate user privileges)
|
To create a yum repo: (assuming appropriate user privileges)
|
||||||
|
|
||||||
$ path=/path/to/your/webserver/cloudstack
|
$ path=/path/to/your/webserver/cloudstack
|
||||||
$ cd artifacts/rpmbuild/RPMS/x86_64
|
$ cd dist/rpmbuild/RPMS/x86_64
|
||||||
$ mv *.rpm $path
|
$ mv *.rpm $path
|
||||||
$ createrepo $path
|
$ createrepo $path
|
||||||
|
|
||||||
@ -208,10 +205,10 @@ Installation:
|
|||||||
Install needed packages:
|
Install needed packages:
|
||||||
|
|
||||||
$ yum update
|
$ yum update
|
||||||
$ yum install cloud-client # management server
|
$ yum install cloudstack-management # management server
|
||||||
$ yum install mysql-server # mysql server
|
$ yum install mysql-server # mysql server
|
||||||
$ yum install cloud-agent # agent (kvm)
|
$ yum install cloudstack-agent # agent (kvm)
|
||||||
$ yum install cloud-usage # usage server
|
$ yum install cloudstack-usage # usage server
|
||||||
|
|
||||||
## Installing CloudMonkey CLI
|
## Installing CloudMonkey CLI
|
||||||
|
|
||||||
|
|||||||
63
agent/bindir/cloudstack-agent-upgrade.in
Normal file
63
agent/bindir/cloudstack-agent-upgrade.in
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
#!/usr/bin/python
|
||||||
|
# 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.
|
||||||
|
from cloudutils.networkConfig import networkConfig
|
||||||
|
from cloudutils.utilities import bash
|
||||||
|
import logging
|
||||||
|
import re
|
||||||
|
def isOldStyleBridge(brName):
|
||||||
|
if brName.find("cloudVirBr") == 0:
|
||||||
|
return True
|
||||||
|
else:
|
||||||
|
return False
|
||||||
|
def upgradeBridgeName(brName, enslavedDev):
|
||||||
|
print("upgrade bridge: %s, %s"%(brName, enslavedDev))
|
||||||
|
vlanId = brName.replace("cloudVirBr", "")
|
||||||
|
print("find vlan Id: %s"%vlanId)
|
||||||
|
phyDev = enslavedDev.split(".")[0]
|
||||||
|
print("find physical device %s"%phyDev)
|
||||||
|
newBrName = "br" + phyDev + "-" + vlanId
|
||||||
|
print("new bridge name %s"%newBrName)
|
||||||
|
bash("ip link set %s down"%brName)
|
||||||
|
bash("ip link set %s name %s"%(brName, newBrName))
|
||||||
|
bash("ip link set %s up" %newBrName)
|
||||||
|
cmd = "iptables-save | grep FORWARD | grep -w " + brName
|
||||||
|
rules = bash(cmd).stdout.split('\n')
|
||||||
|
rules.pop()
|
||||||
|
for rule in rules:
|
||||||
|
try:
|
||||||
|
delrule = re.sub("-A", "-D", rule)
|
||||||
|
newrule = re.sub(" " + brName + " ", " " + newBrName + " ", rule)
|
||||||
|
bash("iptables " + delrule)
|
||||||
|
bash("iptables " + newrule)
|
||||||
|
except:
|
||||||
|
logging.exception("Ignoring failure to update rules for rule " + rule + " on bridge " + brName)
|
||||||
|
if __name__ == '__main__':
|
||||||
|
netlib = networkConfig()
|
||||||
|
bridges = netlib.listNetworks()
|
||||||
|
bridges = filter(isOldStyleBridge, bridges)
|
||||||
|
for br in bridges:
|
||||||
|
enslavedDev = netlib.getEnslavedDev(br, 1)
|
||||||
|
if enslavedDev is not None:
|
||||||
|
upgradeBridgeName(br, enslavedDev)
|
||||||
|
|
||||||
|
bridges = netlib.listNetworks()
|
||||||
|
bridges = filter(isOldStyleBridge, bridges)
|
||||||
|
if len(bridges) > 0:
|
||||||
|
print("Warning: upgrade is not finished, still some bridges have the old style name:" + str(bridges))
|
||||||
|
else:
|
||||||
|
print("Upgrade succeed")
|
||||||
53
agent/bindir/libvirtqemuhook.in
Executable file
53
agent/bindir/libvirtqemuhook.in
Executable file
@ -0,0 +1,53 @@
|
|||||||
|
#!/usr/bin/python
|
||||||
|
# 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.
|
||||||
|
import sys
|
||||||
|
from xml.dom.minidom import parse
|
||||||
|
from cloudutils.configFileOps import configFileOps
|
||||||
|
from cloudutils.networkConfig import networkConfig
|
||||||
|
def isOldStyleBridge(brName):
|
||||||
|
if brName.find("cloudVirBr") == 0:
|
||||||
|
return True
|
||||||
|
else:
|
||||||
|
return False
|
||||||
|
def getGuestNetworkDevice():
|
||||||
|
netlib = networkConfig()
|
||||||
|
cfo = configFileOps("/etc/cloudstack/agent/agent.properties")
|
||||||
|
guestDev = cfo.getEntry("guest.network.device")
|
||||||
|
enslavedDev = netlib.getEnslavedDev(guestDev, 1)
|
||||||
|
return enslavedDev
|
||||||
|
def handleMigrateBegin():
|
||||||
|
try:
|
||||||
|
domain = parse(sys.stdin)
|
||||||
|
for interface in domain.getElementsByTagName("interface"):
|
||||||
|
source = interface.getElementsByTagName("source")[0]
|
||||||
|
bridge = source.getAttribute("bridge")
|
||||||
|
if not isOldStyleBridge(bridge):
|
||||||
|
continue
|
||||||
|
vlanId = bridge.replace("cloudVirBr","")
|
||||||
|
phyDev = getGuestNetworkDevice()
|
||||||
|
newBrName="br" + phyDev + "-" + vlanId
|
||||||
|
source.setAttribute("bridge", newBrName)
|
||||||
|
print(domain.toxml())
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
if __name__ == '__main__':
|
||||||
|
if len(sys.argv) != 5:
|
||||||
|
sys.exit(0)
|
||||||
|
|
||||||
|
if sys.argv[2] == "migrate" and sys.argv[3] == "begin":
|
||||||
|
handleMigrateBegin()
|
||||||
@ -36,6 +36,10 @@
|
|||||||
<artifactId>cloud-utils</artifactId>
|
<artifactId>cloud-utils</artifactId>
|
||||||
<version>${project.version}</version>
|
<version>${project.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>commons-io</groupId>
|
||||||
|
<artifactId>commons-io</artifactId>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>commons-daemon</groupId>
|
<groupId>commons-daemon</groupId>
|
||||||
<artifactId>commons-daemon</artifactId>
|
<artifactId>commons-daemon</artifactId>
|
||||||
|
|||||||
@ -1,20 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
# 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.
|
|
||||||
|
|
||||||
#run.sh runs the agent client.
|
|
||||||
java $1 -Xms128M -Xmx384M -cp cglib-nodep-2.2.jar:trilead-ssh2-build213.jar:cloud-api.jar:cloud-core-extras.jar:cloud-utils.jar:cloud-agent.jar:cloud-console-proxy.jar:cloud-console-common.jar:freemarker.jar:log4j-1.2.15.jar:ws-commons-util-1.0.2.jar:xmlrpc-client-3.1.3.jar:cloud-core.jar:xmlrpc-common-3.1.3.jar:javaee-api-5.0-1.jar:gson-1.3.jar:commons-httpclient-3.1.jar:commons-logging-1.1.1.jar:commons-codec-1.4.jar:commons-collections-3.2.1.jar:commons-pool-1.4.jar:apache-log4j-extras-1.0.jar:libvirt-0.4.5.jar:jna.jar:.:/etc/cloud:./*:/usr/share/java/*:./conf com.cloud.agent.AgentShell
|
|
||||||
@ -26,7 +26,6 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Timer;
|
import java.util.Timer;
|
||||||
import java.util.TimerTask;
|
|
||||||
import java.util.concurrent.ExecutorService;
|
import java.util.concurrent.ExecutorService;
|
||||||
import java.util.concurrent.LinkedBlockingQueue;
|
import java.util.concurrent.LinkedBlockingQueue;
|
||||||
import java.util.concurrent.SynchronousQueue;
|
import java.util.concurrent.SynchronousQueue;
|
||||||
@ -36,6 +35,7 @@ import java.util.concurrent.atomic.AtomicInteger;
|
|||||||
|
|
||||||
import javax.naming.ConfigurationException;
|
import javax.naming.ConfigurationException;
|
||||||
|
|
||||||
|
import org.apache.cloudstack.managed.context.ManagedContextTimerTask;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
import com.cloud.agent.api.AgentControlAnswer;
|
import com.cloud.agent.api.AgentControlAnswer;
|
||||||
@ -45,7 +45,6 @@ import com.cloud.agent.api.Command;
|
|||||||
import com.cloud.agent.api.CronCommand;
|
import com.cloud.agent.api.CronCommand;
|
||||||
import com.cloud.agent.api.MaintainAnswer;
|
import com.cloud.agent.api.MaintainAnswer;
|
||||||
import com.cloud.agent.api.MaintainCommand;
|
import com.cloud.agent.api.MaintainCommand;
|
||||||
import com.cloud.agent.api.ModifySshKeysCommand;
|
|
||||||
import com.cloud.agent.api.PingCommand;
|
import com.cloud.agent.api.PingCommand;
|
||||||
import com.cloud.agent.api.ReadyCommand;
|
import com.cloud.agent.api.ReadyCommand;
|
||||||
import com.cloud.agent.api.ShutdownCommand;
|
import com.cloud.agent.api.ShutdownCommand;
|
||||||
@ -731,7 +730,7 @@ public class Agent implements HandlerFactory, IAgentControl {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class WatchTask extends TimerTask {
|
public class WatchTask extends ManagedContextTimerTask {
|
||||||
protected Request _request;
|
protected Request _request;
|
||||||
protected Agent _agent;
|
protected Agent _agent;
|
||||||
protected Link _link;
|
protected Link _link;
|
||||||
@ -744,7 +743,7 @@ public class Agent implements HandlerFactory, IAgentControl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
protected void runInContext() {
|
||||||
if (s_logger.isTraceEnabled()) {
|
if (s_logger.isTraceEnabled()) {
|
||||||
s_logger.trace("Scheduling " + (_request instanceof Response ? "Ping" : "Watch Task"));
|
s_logger.trace("Scheduling " + (_request instanceof Response ? "Ping" : "Watch Task"));
|
||||||
}
|
}
|
||||||
@ -760,7 +759,7 @@ public class Agent implements HandlerFactory, IAgentControl {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class StartupTask extends TimerTask {
|
public class StartupTask extends ManagedContextTimerTask {
|
||||||
protected Link _link;
|
protected Link _link;
|
||||||
protected volatile boolean cancelled = false;
|
protected volatile boolean cancelled = false;
|
||||||
|
|
||||||
@ -782,7 +781,7 @@ public class Agent implements HandlerFactory, IAgentControl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public synchronized void run() {
|
protected synchronized void runInContext() {
|
||||||
if (!cancelled) {
|
if (!cancelled) {
|
||||||
if (s_logger.isInfoEnabled()) {
|
if (s_logger.isInfoEnabled()) {
|
||||||
s_logger.info("The startup command is now cancelled");
|
s_logger.info("The startup command is now cancelled");
|
||||||
|
|||||||
@ -19,14 +19,12 @@ package com.cloud.agent;
|
|||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileInputStream;
|
import java.io.FileInputStream;
|
||||||
import java.io.FileNotFoundException;
|
import java.io.FileNotFoundException;
|
||||||
import java.io.FileOutputStream;
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.lang.reflect.Constructor;
|
import java.lang.reflect.Constructor;
|
||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Date;
|
|
||||||
import java.util.Enumeration;
|
import java.util.Enumeration;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -39,9 +37,8 @@ import javax.naming.ConfigurationException;
|
|||||||
import org.apache.commons.daemon.Daemon;
|
import org.apache.commons.daemon.Daemon;
|
||||||
import org.apache.commons.daemon.DaemonContext;
|
import org.apache.commons.daemon.DaemonContext;
|
||||||
import org.apache.commons.daemon.DaemonInitException;
|
import org.apache.commons.daemon.DaemonInitException;
|
||||||
import org.apache.commons.httpclient.HttpClient;
|
import org.apache.commons.io.IOUtils;
|
||||||
import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager;
|
import org.apache.commons.lang.math.NumberUtils;
|
||||||
import org.apache.commons.httpclient.methods.GetMethod;
|
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import org.apache.log4j.xml.DOMConfigurator;
|
import org.apache.log4j.xml.DOMConfigurator;
|
||||||
|
|
||||||
@ -56,12 +53,10 @@ import com.cloud.utils.PropertiesUtil;
|
|||||||
import com.cloud.utils.backoff.BackoffAlgorithm;
|
import com.cloud.utils.backoff.BackoffAlgorithm;
|
||||||
import com.cloud.utils.backoff.impl.ConstantTimeBackoff;
|
import com.cloud.utils.backoff.impl.ConstantTimeBackoff;
|
||||||
import com.cloud.utils.exception.CloudRuntimeException;
|
import com.cloud.utils.exception.CloudRuntimeException;
|
||||||
import com.cloud.utils.script.Script;
|
|
||||||
|
|
||||||
public class AgentShell implements IAgentShell, Daemon {
|
public class AgentShell implements IAgentShell, Daemon {
|
||||||
private static final Logger s_logger = Logger.getLogger(AgentShell.class
|
private static final Logger s_logger = Logger.getLogger(AgentShell.class
|
||||||
.getName());
|
.getName());
|
||||||
private static final MultiThreadedHttpConnectionManager s_httpClientManager = new MultiThreadedHttpConnectionManager();
|
|
||||||
|
|
||||||
private final Properties _properties = new Properties();
|
private final Properties _properties = new Properties();
|
||||||
private final Map<String, Object> _cmdLineProperties = new HashMap<String, Object>();
|
private final Map<String, Object> _cmdLineProperties = new HashMap<String, Object>();
|
||||||
@ -172,7 +167,7 @@ public class AgentShell implements IAgentShell, Daemon {
|
|||||||
_storage.persist(name, value);
|
_storage.persist(name, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void loadProperties() throws ConfigurationException {
|
void loadProperties() throws ConfigurationException {
|
||||||
final File file = PropertiesUtil.findConfigFile("agent.properties");
|
final File file = PropertiesUtil.findConfigFile("agent.properties");
|
||||||
if (file == null) {
|
if (file == null) {
|
||||||
throw new ConfigurationException("Unable to find agent.properties.");
|
throw new ConfigurationException("Unable to find agent.properties.");
|
||||||
@ -180,14 +175,18 @@ public class AgentShell implements IAgentShell, Daemon {
|
|||||||
|
|
||||||
s_logger.info("agent.properties found at " + file.getAbsolutePath());
|
s_logger.info("agent.properties found at " + file.getAbsolutePath());
|
||||||
|
|
||||||
|
InputStream propertiesStream = null;
|
||||||
try {
|
try {
|
||||||
_properties.load(new FileInputStream(file));
|
propertiesStream = new FileInputStream(file);
|
||||||
|
_properties.load(propertiesStream);
|
||||||
} catch (final FileNotFoundException ex) {
|
} catch (final FileNotFoundException ex) {
|
||||||
throw new CloudRuntimeException("Cannot find the file: "
|
throw new CloudRuntimeException("Cannot find the file: "
|
||||||
+ file.getAbsolutePath(), ex);
|
+ file.getAbsolutePath(), ex);
|
||||||
} catch (final IOException ex) {
|
} catch (final IOException ex) {
|
||||||
throw new CloudRuntimeException("IOException in reading "
|
throw new CloudRuntimeException("IOException in reading "
|
||||||
+ file.getAbsolutePath(), ex);
|
+ file.getAbsolutePath(), ex);
|
||||||
|
} finally {
|
||||||
|
IOUtils.closeQuietly(propertiesStream);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -199,30 +198,32 @@ public class AgentShell implements IAgentShell, Daemon {
|
|||||||
String zone = null;
|
String zone = null;
|
||||||
String pod = null;
|
String pod = null;
|
||||||
String guid = null;
|
String guid = null;
|
||||||
for (int i = 0; i < args.length; i++) {
|
for (String param : args) {
|
||||||
final String[] tokens = args[i].split("=");
|
final String[] tokens = param.split("=");
|
||||||
if (tokens.length != 2) {
|
if (tokens.length != 2) {
|
||||||
System.out.println("Invalid Parameter: " + args[i]);
|
System.out.println("Invalid Parameter: " + param);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
final String paramName = tokens[0];
|
||||||
|
final String paramValue = tokens[1];
|
||||||
|
|
||||||
// save command line properties
|
// save command line properties
|
||||||
_cmdLineProperties.put(tokens[0], tokens[1]);
|
_cmdLineProperties.put(paramName, paramValue);
|
||||||
|
|
||||||
if (tokens[0].equalsIgnoreCase("port")) {
|
if (paramName.equalsIgnoreCase("port")) {
|
||||||
port = tokens[1];
|
port = paramValue;
|
||||||
} else if (tokens[0].equalsIgnoreCase("threads") || tokens[0].equalsIgnoreCase("workers")) {
|
} else if (paramName.equalsIgnoreCase("threads") || paramName.equalsIgnoreCase("workers")) {
|
||||||
workers = tokens[1];
|
workers = paramValue;
|
||||||
} else if (tokens[0].equalsIgnoreCase("host")) {
|
} else if (paramName.equalsIgnoreCase("host")) {
|
||||||
host = tokens[1];
|
host = paramValue;
|
||||||
} else if (tokens[0].equalsIgnoreCase("zone")) {
|
} else if (paramName.equalsIgnoreCase("zone")) {
|
||||||
zone = tokens[1];
|
zone = paramValue;
|
||||||
} else if (tokens[0].equalsIgnoreCase("pod")) {
|
} else if (paramName.equalsIgnoreCase("pod")) {
|
||||||
pod = tokens[1];
|
pod = paramValue;
|
||||||
} else if (tokens[0].equalsIgnoreCase("guid")) {
|
} else if (paramName.equalsIgnoreCase("guid")) {
|
||||||
guid = tokens[1];
|
guid = paramValue;
|
||||||
} else if (tokens[0].equalsIgnoreCase("eth1ip")) {
|
} else if (paramName.equalsIgnoreCase("eth1ip")) {
|
||||||
_privateIp = tokens[1];
|
_privateIp = paramValue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -230,16 +231,16 @@ public class AgentShell implements IAgentShell, Daemon {
|
|||||||
port = getProperty(null, "port");
|
port = getProperty(null, "port");
|
||||||
}
|
}
|
||||||
|
|
||||||
_port = NumbersUtil.parseInt(port, 8250);
|
_port = NumberUtils.toInt(port, 8250);
|
||||||
|
|
||||||
_proxyPort = NumbersUtil.parseInt(
|
_proxyPort = NumberUtils.toInt(
|
||||||
getProperty(null, "consoleproxy.httpListenPort"), 443);
|
getProperty(null, "consoleproxy.httpListenPort"), 443);
|
||||||
|
|
||||||
if (workers == null) {
|
if (workers == null) {
|
||||||
workers = getProperty(null, "workers");
|
workers = getProperty(null, "workers");
|
||||||
}
|
}
|
||||||
|
|
||||||
_workers = NumbersUtil.parseInt(workers, 5);
|
_workers = NumberUtils.toInt(workers, 5);
|
||||||
|
|
||||||
if (host == null) {
|
if (host == null) {
|
||||||
host = getProperty(null, "host");
|
host = getProperty(null, "host");
|
||||||
@ -309,7 +310,7 @@ public class AgentShell implements IAgentShell, Daemon {
|
|||||||
// For KVM agent, do it specially here
|
// For KVM agent, do it specially here
|
||||||
|
|
||||||
File file = new File("/etc/cloudstack/agent/log4j-cloud.xml");
|
File file = new File("/etc/cloudstack/agent/log4j-cloud.xml");
|
||||||
if(file == null || !file.exists()) {
|
if(!file.exists()) {
|
||||||
file = PropertiesUtil.findConfigFile("log4j-cloud.xml");
|
file = PropertiesUtil.findConfigFile("log4j-cloud.xml");
|
||||||
}
|
}
|
||||||
DOMConfigurator.configureAndWatch(file.getAbsolutePath());
|
DOMConfigurator.configureAndWatch(file.getAbsolutePath());
|
||||||
|
|||||||
@ -17,7 +17,6 @@
|
|||||||
package com.cloud.agent.dao.impl;
|
package com.cloud.agent.dao.impl;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileInputStream;
|
|
||||||
import java.io.FileNotFoundException;
|
import java.io.FileNotFoundException;
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@ -26,6 +25,7 @@ import java.util.Properties;
|
|||||||
|
|
||||||
import javax.ejb.Local;
|
import javax.ejb.Local;
|
||||||
|
|
||||||
|
import org.apache.commons.io.IOUtils;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
import com.cloud.agent.dao.StorageComponent;
|
import com.cloud.agent.dao.StorageComponent;
|
||||||
@ -59,18 +59,10 @@ public class PropertiesStorage implements StorageComponent {
|
|||||||
_properties.store(output, _name);
|
_properties.store(output, _name);
|
||||||
output.flush();
|
output.flush();
|
||||||
output.close();
|
output.close();
|
||||||
} catch (FileNotFoundException e) {
|
|
||||||
s_logger.error("Who deleted the file? ", e);
|
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
s_logger.error("Uh-oh: ", e);
|
s_logger.error("Uh-oh: ", e);
|
||||||
} finally {
|
} finally {
|
||||||
if (output != null) {
|
IOUtils.closeQuietly(output);
|
||||||
try {
|
|
||||||
output.close();
|
|
||||||
} catch (IOException e) {
|
|
||||||
// ignore.
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -99,7 +91,7 @@ public class PropertiesStorage implements StorageComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
_properties.load(new FileInputStream(file));
|
PropertiesUtil.loadFromFile(_properties, file);
|
||||||
_file = file;
|
_file = file;
|
||||||
} catch (FileNotFoundException e) {
|
} catch (FileNotFoundException e) {
|
||||||
s_logger.error("How did we get here? ", e);
|
s_logger.error("How did we get here? ", e);
|
||||||
|
|||||||
@ -32,6 +32,7 @@ import java.util.Properties;
|
|||||||
|
|
||||||
import javax.naming.ConfigurationException;
|
import javax.naming.ConfigurationException;
|
||||||
|
|
||||||
|
import org.apache.cloudstack.managed.context.ManagedContextRunnable;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
import com.cloud.agent.Agent.ExitStatus;
|
import com.cloud.agent.Agent.ExitStatus;
|
||||||
@ -357,8 +358,9 @@ public class ConsoleProxyResource extends ServerResourceBase implements
|
|||||||
private void launchConsoleProxy(final byte[] ksBits, final String ksPassword, final String encryptorPassword) {
|
private void launchConsoleProxy(final byte[] ksBits, final String ksPassword, final String encryptorPassword) {
|
||||||
final Object resource = this;
|
final Object resource = this;
|
||||||
if (_consoleProxyMain == null) {
|
if (_consoleProxyMain == null) {
|
||||||
_consoleProxyMain = new Thread(new Runnable() {
|
_consoleProxyMain = new Thread(new ManagedContextRunnable() {
|
||||||
public void run() {
|
@Override
|
||||||
|
protected void runInContext() {
|
||||||
try {
|
try {
|
||||||
Class<?> consoleProxyClazz = Class.forName("com.cloud.consoleproxy.ConsoleProxy");
|
Class<?> consoleProxyClazz = Class.forName("com.cloud.consoleproxy.ConsoleProxy");
|
||||||
try {
|
try {
|
||||||
|
|||||||
48
agent/test/com/cloud/agent/AgentShellTest.java
Normal file
48
agent/test/com/cloud/agent/AgentShellTest.java
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
// Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
// or more contributor license agreements. See the NOTICE file
|
||||||
|
// distributed with this work for additional information
|
||||||
|
// regarding copyright ownership. The ASF licenses this file
|
||||||
|
// to you under the Apache License, Version 2.0 (the
|
||||||
|
// "License"); you may not use this file except in compliance
|
||||||
|
// with the License. You may obtain a copy of the License at
|
||||||
|
//
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
//
|
||||||
|
// Unless required by applicable law or agreed to in writing,
|
||||||
|
// software distributed under the License is distributed on an
|
||||||
|
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
// KIND, either express or implied. See the License for the
|
||||||
|
// specific language governing permissions and limitations
|
||||||
|
// under the License.
|
||||||
|
package com.cloud.agent;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
import javax.naming.ConfigurationException;
|
||||||
|
|
||||||
|
import junit.framework.Assert;
|
||||||
|
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
public class AgentShellTest {
|
||||||
|
@Test
|
||||||
|
public void parseCommand() throws ConfigurationException {
|
||||||
|
AgentShell shell = new AgentShell();
|
||||||
|
UUID anyUuid = UUID.randomUUID();
|
||||||
|
shell.parseCommand(new String[] { "port=55555", "threads=4",
|
||||||
|
"host=localhost", "pod=pod1", "guid=" + anyUuid, "zone=zone1" });
|
||||||
|
Assert.assertEquals(55555, shell.getPort());
|
||||||
|
Assert.assertEquals(4, shell.getWorkers());
|
||||||
|
Assert.assertEquals("localhost", shell.getHost());
|
||||||
|
Assert.assertEquals(anyUuid.toString(), shell.getGuid());
|
||||||
|
Assert.assertEquals("pod1", shell.getPod());
|
||||||
|
Assert.assertEquals("zone1", shell.getZone());
|
||||||
|
}
|
||||||
|
@Test
|
||||||
|
public void loadProperties() throws ConfigurationException {
|
||||||
|
AgentShell shell = new AgentShell();
|
||||||
|
shell.loadProperties();
|
||||||
|
Assert.assertNotNull(shell.getProperties());
|
||||||
|
Assert.assertFalse(shell.getProperties().entrySet().isEmpty());
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,69 @@
|
|||||||
|
/*
|
||||||
|
* 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.dao.impl;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.HashMap;
|
||||||
|
|
||||||
|
import junit.framework.Assert;
|
||||||
|
|
||||||
|
import org.apache.commons.io.FileUtils;
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
public class PropertiesStorageTest {
|
||||||
|
@Test
|
||||||
|
public void configureWithNotExistingFile() {
|
||||||
|
String fileName = "target/notyetexistingfile"
|
||||||
|
+ System.currentTimeMillis();
|
||||||
|
File file = new File(fileName);
|
||||||
|
|
||||||
|
PropertiesStorage storage = new PropertiesStorage();
|
||||||
|
HashMap<String, Object> params = new HashMap<String, Object>();
|
||||||
|
params.put("path", fileName);
|
||||||
|
Assert.assertTrue(storage.configure("test", params));
|
||||||
|
Assert.assertTrue(file.exists());
|
||||||
|
storage.persist("foo", "bar");
|
||||||
|
Assert.assertEquals("bar", storage.get("foo"));
|
||||||
|
|
||||||
|
storage.stop();
|
||||||
|
file.delete();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void configureWithExistingFile() throws IOException {
|
||||||
|
String fileName = "target/existingfile"
|
||||||
|
+ System.currentTimeMillis();
|
||||||
|
File file = new File(fileName);
|
||||||
|
|
||||||
|
FileUtils.writeStringToFile(file, "a=b\n\n");
|
||||||
|
|
||||||
|
PropertiesStorage storage = new PropertiesStorage();
|
||||||
|
HashMap<String, Object> params = new HashMap<String, Object>();
|
||||||
|
params.put("path", fileName);
|
||||||
|
Assert.assertTrue(storage.configure("test", params));
|
||||||
|
Assert.assertEquals("b", storage.get("a"));
|
||||||
|
Assert.assertTrue(file.exists());
|
||||||
|
storage.persist("foo", "bar");
|
||||||
|
Assert.assertEquals("bar", storage.get("foo"));
|
||||||
|
|
||||||
|
storage.stop();
|
||||||
|
file.delete();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,12 +1,11 @@
|
|||||||
# Config::Simple 4.59
|
|
||||||
# Fri May 25 12:50:59 2012
|
|
||||||
# Licensed to the Apache Software Foundation (ASF) under one
|
# Licensed to the Apache Software Foundation (ASF) under one
|
||||||
# or more contributor license agreements. See the NOTICE file
|
# or more contributor license agreements. See the NOTICE file
|
||||||
# distributed with this work for additional information#
|
# distributed with this work for additional information
|
||||||
# regarding copyright ownership. The ASF licenses this file
|
# regarding copyright ownership. The ASF licenses this file
|
||||||
# to you under the Apache License, Version 2.0 (the
|
# to you under the Apache License, Version 2.0 (the
|
||||||
# "License"); you may not use this file except in compliance
|
# "License"); you may not use this file except in compliance
|
||||||
# with the License. You may obtain a copy of the License at
|
# with the License. You may obtain a copy of the License at
|
||||||
|
#
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
#
|
#
|
||||||
# Unless required by applicable law or agreed to in writing,
|
# Unless required by applicable law or agreed to in writing,
|
||||||
@ -15,8 +14,5 @@
|
|||||||
# KIND, either express or implied. See the License for the
|
# KIND, either express or implied. See the License for the
|
||||||
# specific language governing permissions and limitations
|
# specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
name=api-planner
|
||||||
xml_lang: "en-US"
|
parent=planner
|
||||||
type: Book
|
|
||||||
brand: cloudstack
|
|
||||||
|
|
||||||
@ -0,0 +1,34 @@
|
|||||||
|
<!--
|
||||||
|
Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
or more contributor license agreements. See the NOTICE file
|
||||||
|
distributed with this work for additional information
|
||||||
|
regarding copyright ownership. The ASF licenses this file
|
||||||
|
to you under the Apache License, Version 2.0 (the
|
||||||
|
"License"); you may not use this file except in compliance
|
||||||
|
with the License. You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing,
|
||||||
|
software distributed under the License is distributed on an
|
||||||
|
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
KIND, either express or implied. See the License for the
|
||||||
|
specific language governing permissions and limitations
|
||||||
|
under the License.
|
||||||
|
-->
|
||||||
|
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xmlns:context="http://www.springframework.org/schema/context"
|
||||||
|
xmlns:aop="http://www.springframework.org/schema/aop"
|
||||||
|
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||||
|
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
|
||||||
|
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
|
||||||
|
http://www.springframework.org/schema/context
|
||||||
|
http://www.springframework.org/schema/context/spring-context-3.0.xsd"
|
||||||
|
>
|
||||||
|
|
||||||
|
<bean id="UserDispersingPlanner" class="com.cloud.deploy.UserDispersingPlanner">
|
||||||
|
<property name="name" value="UserDispersingPlanner" />
|
||||||
|
</bean>
|
||||||
|
|
||||||
|
</beans>
|
||||||
@ -20,7 +20,7 @@ package com.cloud.agent.api.to;
|
|||||||
|
|
||||||
import com.cloud.storage.DataStoreRole;
|
import com.cloud.storage.DataStoreRole;
|
||||||
|
|
||||||
|
|
||||||
public interface DataStoreTO {
|
public interface DataStoreTO {
|
||||||
public DataStoreRole getRole();
|
public DataStoreRole getRole();
|
||||||
|
public String getUuid();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -18,21 +18,35 @@
|
|||||||
*/
|
*/
|
||||||
package com.cloud.agent.api.to;
|
package com.cloud.agent.api.to;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import com.cloud.storage.Volume;
|
import com.cloud.storage.Volume;
|
||||||
|
|
||||||
public class DiskTO {
|
public class DiskTO {
|
||||||
|
public static final String CHAP_INITIATOR_USERNAME = "chapInitiatorUsername";
|
||||||
|
public static final String CHAP_INITIATOR_SECRET = "chapInitiatorSecret";
|
||||||
|
public static final String CHAP_TARGET_USERNAME = "chapTargetUsername";
|
||||||
|
public static final String CHAP_TARGET_SECRET = "chapTargetSecret";
|
||||||
|
public static final String MANAGED = "managed";
|
||||||
|
public static final String IQN = "iqn";
|
||||||
|
public static final String STORAGE_HOST = "storageHost";
|
||||||
|
public static final String STORAGE_PORT = "storagePort";
|
||||||
|
public static final String VOLUME_SIZE = "volumeSize";
|
||||||
|
|
||||||
private DataTO data;
|
private DataTO data;
|
||||||
private Long diskSeq;
|
private Long diskSeq;
|
||||||
private String vdiUuid;
|
private String path;
|
||||||
private Volume.Type type;
|
private Volume.Type type;
|
||||||
|
private Map<String, String> _details;
|
||||||
|
|
||||||
public DiskTO() {
|
public DiskTO() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public DiskTO(DataTO data, Long diskSeq, String vdiUuid, Volume.Type type) {
|
public DiskTO(DataTO data, Long diskSeq, String path, Volume.Type type) {
|
||||||
this.data = data;
|
this.data = data;
|
||||||
this.diskSeq = diskSeq;
|
this.diskSeq = diskSeq;
|
||||||
this.vdiUuid = vdiUuid;
|
this.path = path;
|
||||||
this.type = type;
|
this.type = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -52,12 +66,12 @@ public class DiskTO {
|
|||||||
this.diskSeq = diskSeq;
|
this.diskSeq = diskSeq;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getVdiUuid() {
|
public String getPath() {
|
||||||
return vdiUuid;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setVdiUuid(String vdiUuid) {
|
public void setPath(String path) {
|
||||||
this.vdiUuid = vdiUuid;
|
this.path = path;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Volume.Type getType() {
|
public Volume.Type getType() {
|
||||||
@ -67,4 +81,12 @@ public class DiskTO {
|
|||||||
public void setType(Volume.Type type) {
|
public void setType(Volume.Type type) {
|
||||||
this.type = type;
|
this.type = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setDetails(Map<String, String> details) {
|
||||||
|
_details = details;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Map<String, String> getDetails() {
|
||||||
|
return _details;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,6 +22,7 @@ public class NfsTO implements DataStoreTO {
|
|||||||
|
|
||||||
private String _url;
|
private String _url;
|
||||||
private DataStoreRole _role;
|
private DataStoreRole _role;
|
||||||
|
private String uuid;
|
||||||
|
|
||||||
public NfsTO() {
|
public NfsTO() {
|
||||||
|
|
||||||
@ -55,6 +56,12 @@ public class NfsTO implements DataStoreTO {
|
|||||||
this._role = _role;
|
this._role = _role;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getUuid() {
|
||||||
|
return uuid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUuid(String uuid) {
|
||||||
|
this.uuid = uuid;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -39,6 +39,7 @@ public final class S3TO implements S3Utils.ClientOptions, DataStoreTO {
|
|||||||
private Integer socketTimeout;
|
private Integer socketTimeout;
|
||||||
private Date created;
|
private Date created;
|
||||||
private boolean enableRRS;
|
private boolean enableRRS;
|
||||||
|
private long maxSingleUploadSizeInBytes;
|
||||||
|
|
||||||
public S3TO() {
|
public S3TO() {
|
||||||
|
|
||||||
@ -50,7 +51,7 @@ public final class S3TO implements S3Utils.ClientOptions, DataStoreTO {
|
|||||||
final String secretKey, final String endPoint,
|
final String secretKey, final String endPoint,
|
||||||
final String bucketName, final Boolean httpsFlag,
|
final String bucketName, final Boolean httpsFlag,
|
||||||
final Integer connectionTimeout, final Integer maxErrorRetry,
|
final Integer connectionTimeout, final Integer maxErrorRetry,
|
||||||
final Integer socketTimeout, final Date created, final boolean enableRRS) {
|
final Integer socketTimeout, final Date created, final boolean enableRRS, final long maxUploadSize) {
|
||||||
|
|
||||||
super();
|
super();
|
||||||
|
|
||||||
@ -66,6 +67,7 @@ public final class S3TO implements S3Utils.ClientOptions, DataStoreTO {
|
|||||||
this.socketTimeout = socketTimeout;
|
this.socketTimeout = socketTimeout;
|
||||||
this.created = created;
|
this.created = created;
|
||||||
this.enableRRS = enableRRS;
|
this.enableRRS = enableRRS;
|
||||||
|
this.maxSingleUploadSizeInBytes = maxUploadSize;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -268,7 +270,6 @@ public final class S3TO implements S3Utils.ClientOptions, DataStoreTO {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public boolean getEnableRRS() {
|
public boolean getEnableRRS() {
|
||||||
return enableRRS;
|
return enableRRS;
|
||||||
}
|
}
|
||||||
@ -277,5 +278,28 @@ public final class S3TO implements S3Utils.ClientOptions, DataStoreTO {
|
|||||||
this.enableRRS = enableRRS;
|
this.enableRRS = enableRRS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public long getMaxSingleUploadSizeInBytes() {
|
||||||
|
return maxSingleUploadSizeInBytes;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMaxSingleUploadSizeInBytes(long maxSingleUploadSizeInBytes) {
|
||||||
|
this.maxSingleUploadSizeInBytes = maxSingleUploadSizeInBytes;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getSingleUpload(long objSize){
|
||||||
|
if ( maxSingleUploadSizeInBytes < 0 ){
|
||||||
|
// always use single part upload
|
||||||
|
return true;
|
||||||
|
} else if ( maxSingleUploadSizeInBytes == 0 ){
|
||||||
|
// always use multi part upload
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
// check object size to set flag
|
||||||
|
if (objSize < maxSingleUploadSizeInBytes){
|
||||||
|
return true;
|
||||||
|
} else{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -29,8 +29,7 @@ public class SwiftTO implements DataStoreTO, SwiftUtil.SwiftClientCfg {
|
|||||||
|
|
||||||
public SwiftTO() { }
|
public SwiftTO() { }
|
||||||
|
|
||||||
public SwiftTO(Long id, String url, String account, String userName, String key
|
public SwiftTO(Long id, String url, String account, String userName, String key) {
|
||||||
) {
|
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.url = url;
|
this.url = url;
|
||||||
this.account = account;
|
this.account = account;
|
||||||
@ -46,14 +45,17 @@ public class SwiftTO implements DataStoreTO, SwiftUtil.SwiftClientCfg {
|
|||||||
return url;
|
return url;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String getAccount() {
|
public String getAccount() {
|
||||||
return account;
|
return account;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String getUserName() {
|
public String getUserName() {
|
||||||
return userName;
|
return userName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String getKey() {
|
public String getKey() {
|
||||||
return key;
|
return key;
|
||||||
}
|
}
|
||||||
@ -67,4 +69,9 @@ public class SwiftTO implements DataStoreTO, SwiftUtil.SwiftClientCfg {
|
|||||||
public String getEndPoint() {
|
public String getEndPoint() {
|
||||||
return this.url;
|
return this.url;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getUuid() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -76,6 +76,7 @@ public class EventTypes {
|
|||||||
public static final String EVENT_VM_MIGRATE = "VM.MIGRATE";
|
public static final String EVENT_VM_MIGRATE = "VM.MIGRATE";
|
||||||
public static final String EVENT_VM_MOVE = "VM.MOVE";
|
public static final String EVENT_VM_MOVE = "VM.MOVE";
|
||||||
public static final String EVENT_VM_RESTORE = "VM.RESTORE";
|
public static final String EVENT_VM_RESTORE = "VM.RESTORE";
|
||||||
|
public static final String EVENT_VM_EXPUNGE = "VM.EXPUNGE";
|
||||||
|
|
||||||
// Domain Router
|
// Domain Router
|
||||||
public static final String EVENT_ROUTER_CREATE = "ROUTER.CREATE";
|
public static final String EVENT_ROUTER_CREATE = "ROUTER.CREATE";
|
||||||
@ -188,6 +189,8 @@ public class EventTypes {
|
|||||||
public static final String EVENT_VOLUME_DETAIL_UPDATE = "VOLUME.DETAIL.UPDATE";
|
public static final String EVENT_VOLUME_DETAIL_UPDATE = "VOLUME.DETAIL.UPDATE";
|
||||||
public static final String EVENT_VOLUME_DETAIL_ADD = "VOLUME.DETAIL.ADD";
|
public static final String EVENT_VOLUME_DETAIL_ADD = "VOLUME.DETAIL.ADD";
|
||||||
public static final String EVENT_VOLUME_DETAIL_REMOVE = "VOLUME.DETAIL.REMOVE";
|
public static final String EVENT_VOLUME_DETAIL_REMOVE = "VOLUME.DETAIL.REMOVE";
|
||||||
|
public static final String EVENT_VOLUME_UPDATE = "VOLUME.UPDATE";
|
||||||
|
|
||||||
|
|
||||||
// Domains
|
// Domains
|
||||||
public static final String EVENT_DOMAIN_CREATE = "DOMAIN.CREATE";
|
public static final String EVENT_DOMAIN_CREATE = "DOMAIN.CREATE";
|
||||||
@ -197,6 +200,7 @@ public class EventTypes {
|
|||||||
// Snapshots
|
// Snapshots
|
||||||
public static final String EVENT_SNAPSHOT_CREATE = "SNAPSHOT.CREATE";
|
public static final String EVENT_SNAPSHOT_CREATE = "SNAPSHOT.CREATE";
|
||||||
public static final String EVENT_SNAPSHOT_DELETE = "SNAPSHOT.DELETE";
|
public static final String EVENT_SNAPSHOT_DELETE = "SNAPSHOT.DELETE";
|
||||||
|
public static final String EVENT_SNAPSHOT_REVERT = "SNAPSHOT.REVERT";
|
||||||
public static final String EVENT_SNAPSHOT_POLICY_CREATE = "SNAPSHOTPOLICY.CREATE";
|
public static final String EVENT_SNAPSHOT_POLICY_CREATE = "SNAPSHOTPOLICY.CREATE";
|
||||||
public static final String EVENT_SNAPSHOT_POLICY_UPDATE = "SNAPSHOTPOLICY.UPDATE";
|
public static final String EVENT_SNAPSHOT_POLICY_UPDATE = "SNAPSHOTPOLICY.UPDATE";
|
||||||
public static final String EVENT_SNAPSHOT_POLICY_DELETE = "SNAPSHOTPOLICY.DELETE";
|
public static final String EVENT_SNAPSHOT_POLICY_DELETE = "SNAPSHOTPOLICY.DELETE";
|
||||||
@ -456,6 +460,9 @@ public class EventTypes {
|
|||||||
public static final String EVENT_ACL_GROUP_GRANT = "ACLGROUP.GRANT";
|
public static final String EVENT_ACL_GROUP_GRANT = "ACLGROUP.GRANT";
|
||||||
public static final String EVENT_ACL_GROUP_REVOKE = "ACLGROUP.REVOKE";
|
public static final String EVENT_ACL_GROUP_REVOKE = "ACLGROUP.REVOKE";
|
||||||
|
|
||||||
|
// Object store migration
|
||||||
|
public static final String EVENT_MIGRATE_PREPARE_SECONDARY_STORAGE = "MIGRATE.PREPARE.SS";
|
||||||
|
|
||||||
static {
|
static {
|
||||||
|
|
||||||
// TODO: need a way to force author adding event types to declare the entity details as well, with out braking
|
// TODO: need a way to force author adding event types to declare the entity details as well, with out braking
|
||||||
|
|||||||
@ -17,8 +17,9 @@
|
|||||||
package com.cloud.exception;
|
package com.cloud.exception;
|
||||||
|
|
||||||
import com.cloud.utils.SerialVersionUID;
|
import com.cloud.utils.SerialVersionUID;
|
||||||
|
import com.cloud.utils.exception.CloudRuntimeException;
|
||||||
|
|
||||||
public class ConcurrentOperationException extends CloudException {
|
public class ConcurrentOperationException extends CloudRuntimeException {
|
||||||
|
|
||||||
private static final long serialVersionUID = SerialVersionUID.ConcurrentOperationException;
|
private static final long serialVersionUID = SerialVersionUID.ConcurrentOperationException;
|
||||||
|
|
||||||
|
|||||||
@ -108,6 +108,7 @@ public class Networks {
|
|||||||
},
|
},
|
||||||
Mido("mido", String.class),
|
Mido("mido", String.class),
|
||||||
Pvlan("pvlan", String.class),
|
Pvlan("pvlan", String.class),
|
||||||
|
Vxlan("vxlan", Long.class),
|
||||||
UnDecided(null, null);
|
UnDecided(null, null);
|
||||||
|
|
||||||
private final String scheme;
|
private final String scheme;
|
||||||
|
|||||||
@ -39,7 +39,8 @@ public interface PhysicalNetwork extends Identity, InternalIdentity {
|
|||||||
STT,
|
STT,
|
||||||
VNS,
|
VNS,
|
||||||
MIDO,
|
MIDO,
|
||||||
SSP;
|
SSP,
|
||||||
|
VXLAN;
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum BroadcastDomainRange {
|
public enum BroadcastDomainRange {
|
||||||
|
|||||||
@ -31,6 +31,7 @@ public interface RemoteAccessVpn extends ControlledEntity, InternalIdentity, Ide
|
|||||||
String getIpRange();
|
String getIpRange();
|
||||||
String getIpsecPresharedKey();
|
String getIpsecPresharedKey();
|
||||||
String getLocalIp();
|
String getLocalIp();
|
||||||
long getNetworkId();
|
Long getNetworkId();
|
||||||
|
Long getVpcId();
|
||||||
State getState();
|
State getState();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -20,14 +20,14 @@ import org.apache.cloudstack.api.Identity;
|
|||||||
import org.apache.cloudstack.api.InternalIdentity;
|
import org.apache.cloudstack.api.InternalIdentity;
|
||||||
|
|
||||||
public interface VirtualRouterProvider extends InternalIdentity, Identity {
|
public interface VirtualRouterProvider extends InternalIdentity, Identity {
|
||||||
public enum VirtualRouterProviderType {
|
public enum Type {
|
||||||
VirtualRouter,
|
VirtualRouter,
|
||||||
ElasticLoadBalancerVm,
|
ElasticLoadBalancerVm,
|
||||||
VPCVirtualRouter,
|
VPCVirtualRouter,
|
||||||
InternalLbVm
|
InternalLbVm
|
||||||
}
|
}
|
||||||
|
|
||||||
public VirtualRouterProviderType getType();
|
public Type getType();
|
||||||
|
|
||||||
public boolean isEnabled();
|
public boolean isEnabled();
|
||||||
|
|
||||||
|
|||||||
@ -19,7 +19,6 @@ package com.cloud.network.element;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.cloud.exception.ResourceUnavailableException;
|
import com.cloud.exception.ResourceUnavailableException;
|
||||||
import com.cloud.network.Network;
|
|
||||||
import com.cloud.network.RemoteAccessVpn;
|
import com.cloud.network.RemoteAccessVpn;
|
||||||
import com.cloud.network.VpnUser;
|
import com.cloud.network.VpnUser;
|
||||||
import com.cloud.utils.component.Adapter;
|
import com.cloud.utils.component.Adapter;
|
||||||
@ -27,7 +26,7 @@ import com.cloud.utils.component.Adapter;
|
|||||||
public interface RemoteAccessVPNServiceProvider extends Adapter {
|
public interface RemoteAccessVPNServiceProvider extends Adapter {
|
||||||
String[] applyVpnUsers(RemoteAccessVpn vpn, List<? extends VpnUser> users) throws ResourceUnavailableException;
|
String[] applyVpnUsers(RemoteAccessVpn vpn, List<? extends VpnUser> users) throws ResourceUnavailableException;
|
||||||
|
|
||||||
boolean startVpn(Network network, RemoteAccessVpn vpn) throws ResourceUnavailableException;
|
boolean startVpn(RemoteAccessVpn vpn) throws ResourceUnavailableException;
|
||||||
|
|
||||||
boolean stopVpn(Network network, RemoteAccessVpn vpn) throws ResourceUnavailableException;
|
boolean stopVpn(RemoteAccessVpn vpn) throws ResourceUnavailableException;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,12 +22,12 @@ import org.apache.cloudstack.api.command.admin.router.ConfigureVirtualRouterElem
|
|||||||
import org.apache.cloudstack.api.command.admin.router.ListVirtualRouterElementsCmd;
|
import org.apache.cloudstack.api.command.admin.router.ListVirtualRouterElementsCmd;
|
||||||
|
|
||||||
import com.cloud.network.VirtualRouterProvider;
|
import com.cloud.network.VirtualRouterProvider;
|
||||||
import com.cloud.network.VirtualRouterProvider.VirtualRouterProviderType;
|
import com.cloud.network.VirtualRouterProvider.Type;
|
||||||
import com.cloud.utils.component.PluggableService;
|
import com.cloud.utils.component.PluggableService;
|
||||||
|
|
||||||
public interface VirtualRouterElementService extends PluggableService{
|
public interface VirtualRouterElementService extends PluggableService{
|
||||||
VirtualRouterProvider configure(ConfigureVirtualRouterElementCmd cmd);
|
VirtualRouterProvider configure(ConfigureVirtualRouterElementCmd cmd);
|
||||||
VirtualRouterProvider addElement(Long nspId, VirtualRouterProviderType providerType);
|
VirtualRouterProvider addElement(Long nspId, Type providerType);
|
||||||
VirtualRouterProvider getCreatedElement(long id);
|
VirtualRouterProvider getCreatedElement(long id);
|
||||||
List<? extends VirtualRouterProvider> searchForVirtualRouterElement(ListVirtualRouterElementsCmd cmd);
|
List<? extends VirtualRouterProvider> searchForVirtualRouterElement(ListVirtualRouterElementsCmd cmd);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -31,7 +31,7 @@ import com.cloud.utils.Pair;
|
|||||||
public interface RemoteAccessVpnService {
|
public interface RemoteAccessVpnService {
|
||||||
static final String RemoteAccessVpnClientIpRangeCK = "remote.access.vpn.client.iprange";
|
static final String RemoteAccessVpnClientIpRangeCK = "remote.access.vpn.client.iprange";
|
||||||
|
|
||||||
RemoteAccessVpn createRemoteAccessVpn(long vpnServerAddressId, String ipRange, boolean openFirewall, long networkId)
|
RemoteAccessVpn createRemoteAccessVpn(long vpnServerAddressId, String ipRange, boolean openFirewall)
|
||||||
throws NetworkRuleConflictException;
|
throws NetworkRuleConflictException;
|
||||||
void destroyRemoteAccessVpnForIp(long vpnServerAddressId, Account caller) throws ResourceUnavailableException;
|
void destroyRemoteAccessVpnForIp(long vpnServerAddressId, Account caller) throws ResourceUnavailableException;
|
||||||
RemoteAccessVpn startRemoteAccessVpn(long vpnServerAddressId, boolean openFirewall) throws ResourceUnavailableException;
|
RemoteAccessVpn startRemoteAccessVpn(long vpnServerAddressId, boolean openFirewall) throws ResourceUnavailableException;
|
||||||
@ -47,5 +47,4 @@ public interface RemoteAccessVpnService {
|
|||||||
List<? extends RemoteAccessVpn> listRemoteAccessVpns(long networkId);
|
List<? extends RemoteAccessVpn> listRemoteAccessVpns(long networkId);
|
||||||
|
|
||||||
RemoteAccessVpn getRemoteAccessVpn(long vpnAddrId);
|
RemoteAccessVpn getRemoteAccessVpn(long vpnAddrId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -130,4 +130,6 @@ public interface NetworkOffering extends InfrastructureEntity, InternalIdentity,
|
|||||||
boolean getEgressDefaultPolicy();
|
boolean getEgressDefaultPolicy();
|
||||||
|
|
||||||
Integer getConcurrentConnections();
|
Integer getConcurrentConnections();
|
||||||
|
|
||||||
|
boolean isKeepAliveEnabled();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -19,19 +19,19 @@ package com.cloud.server;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import com.cloud.server.ResourceTag.TaggedResourceType;
|
import org.apache.cloudstack.api.ResourceDetail;
|
||||||
|
|
||||||
|
import com.cloud.server.ResourceTag.ResourceObjectType;
|
||||||
|
|
||||||
public interface ResourceMetaDataService {
|
public interface ResourceMetaDataService {
|
||||||
|
|
||||||
TaggedResourceType getResourceType (String resourceTypeStr);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param resourceId TODO
|
* @param resourceId TODO
|
||||||
* @param resourceType
|
* @param resourceType
|
||||||
* @param details
|
* @param details
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
boolean addResourceMetaData(String resourceId, TaggedResourceType resourceType, Map<String, String> details);
|
boolean addResourceMetaData(String resourceId, ResourceObjectType resourceType, Map<String, String> details);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -41,7 +41,14 @@ public interface ResourceMetaDataService {
|
|||||||
* @param key
|
* @param key
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public boolean deleteResourceMetaData(String resourceId, TaggedResourceType resourceType, String key);
|
public boolean deleteResourceMetaData(String resourceId, ResourceObjectType resourceType, String key);
|
||||||
|
|
||||||
|
|
||||||
|
ResourceDetail getDetail(long resourceId, ResourceObjectType resourceType, String key);
|
||||||
|
|
||||||
|
|
||||||
|
Map<String, String> getDetailsMap(long resourceId, ResourceObjectType resourceType, Boolean forDisplay);
|
||||||
|
|
||||||
|
List<? extends ResourceDetail> getDetailsList(long resourceId, ResourceObjectType resourceType, Boolean forDisplay);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,25 +22,45 @@ import org.apache.cloudstack.api.InternalIdentity;
|
|||||||
|
|
||||||
public interface ResourceTag extends ControlledEntity, Identity, InternalIdentity {
|
public interface ResourceTag extends ControlledEntity, Identity, InternalIdentity {
|
||||||
|
|
||||||
public enum TaggedResourceType {
|
//FIXME - extract enum to another interface as its used both by resourceTags and resourceMetaData code
|
||||||
UserVm,
|
public enum ResourceObjectType {
|
||||||
Template,
|
UserVm (true, true),
|
||||||
ISO,
|
Template (true, true),
|
||||||
Volume,
|
ISO (true, false),
|
||||||
Snapshot,
|
Volume (true, true),
|
||||||
Network,
|
Snapshot (true, false),
|
||||||
Nic,
|
Network (true, true),
|
||||||
LoadBalancer,
|
Nic (false, true),
|
||||||
PortForwardingRule,
|
LoadBalancer (true, false),
|
||||||
FirewallRule,
|
PortForwardingRule (true, false),
|
||||||
SecurityGroup,
|
FirewallRule (true, true),
|
||||||
PublicIpAddress,
|
SecurityGroup (true, false),
|
||||||
Project,
|
PublicIpAddress (true, false),
|
||||||
Vpc,
|
Project (true, false),
|
||||||
NetworkACL,
|
Vpc (true, false),
|
||||||
StaticRoute,
|
NetworkACL (true, false),
|
||||||
VMSnapshot,
|
StaticRoute (true, false),
|
||||||
RemoteAccessVpn
|
VMSnapshot (true, false),
|
||||||
|
RemoteAccessVpn (true, false),
|
||||||
|
Zone (false, true),
|
||||||
|
ServiceOffering (false, true),
|
||||||
|
Storage(false, true);
|
||||||
|
|
||||||
|
ResourceObjectType(boolean resourceTagsSupport, boolean resourceMetadataSupport) {
|
||||||
|
this.resourceTagsSupport = resourceTagsSupport;
|
||||||
|
this.metadataSupport = resourceMetadataSupport;
|
||||||
|
}
|
||||||
|
|
||||||
|
private final boolean resourceTagsSupport;
|
||||||
|
private final boolean metadataSupport;
|
||||||
|
|
||||||
|
public boolean resourceTagsSupport() {
|
||||||
|
return this.resourceTagsSupport;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean resourceMetadataSupport() {
|
||||||
|
return this.metadataSupport;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -61,7 +81,7 @@ public interface ResourceTag extends ControlledEntity, Identity, InternalIdentit
|
|||||||
/**
|
/**
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
TaggedResourceType getResourceType();
|
ResourceObjectType getResourceType();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return
|
* @return
|
||||||
|
|||||||
@ -19,12 +19,10 @@ package com.cloud.server;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import com.cloud.server.ResourceTag.TaggedResourceType;
|
import com.cloud.server.ResourceTag.ResourceObjectType;
|
||||||
|
|
||||||
public interface TaggedResourceService {
|
public interface TaggedResourceService {
|
||||||
|
|
||||||
TaggedResourceType getResourceType (String resourceTypeStr);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param resourceIds TODO
|
* @param resourceIds TODO
|
||||||
* @param resourceType
|
* @param resourceType
|
||||||
@ -32,14 +30,7 @@ public interface TaggedResourceService {
|
|||||||
* @param customer TODO
|
* @param customer TODO
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<ResourceTag> createTags(List<String> resourceIds, TaggedResourceType resourceType, Map<String, String> tags, String customer);
|
List<ResourceTag> createTags(List<String> resourceIds, ResourceObjectType resourceType, Map<String, String> tags, String customer);
|
||||||
|
|
||||||
/**
|
|
||||||
* @param resourceId
|
|
||||||
* @param resourceType
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
String getUuid(String resourceId, TaggedResourceType resourceType);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -48,10 +39,19 @@ public interface TaggedResourceService {
|
|||||||
* @param tags
|
* @param tags
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
boolean deleteTags(List<String> resourceIds, TaggedResourceType resourceType, Map<String, String> tags);
|
boolean deleteTags(List<String> resourceIds, ResourceObjectType resourceType, Map<String, String> tags);
|
||||||
|
|
||||||
List<? extends ResourceTag> listByResourceTypeAndId(TaggedResourceType type, long resourceId);
|
List<? extends ResourceTag> listByResourceTypeAndId(ResourceObjectType type, long resourceId);
|
||||||
|
|
||||||
public Long getResourceId(String resourceId, TaggedResourceType resourceType);
|
//FIXME - the methods below should be extracted to its separate manager/service responsible just for retrieving object details
|
||||||
|
ResourceObjectType getResourceType (String resourceTypeStr);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param resourceId
|
||||||
|
* @param resourceType
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
String getUuid(String resourceId, ResourceObjectType resourceType);
|
||||||
|
|
||||||
|
public long getResourceId(String resourceId, ResourceObjectType resourceType);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,9 +22,9 @@ 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.CancelPrimaryStorageMaintenanceCmd;
|
||||||
import org.apache.cloudstack.api.command.admin.storage.CreateSecondaryStagingStoreCmd;
|
import org.apache.cloudstack.api.command.admin.storage.CreateSecondaryStagingStoreCmd;
|
||||||
import org.apache.cloudstack.api.command.admin.storage.CreateStoragePoolCmd;
|
import org.apache.cloudstack.api.command.admin.storage.CreateStoragePoolCmd;
|
||||||
import org.apache.cloudstack.api.command.admin.storage.DeleteSecondaryStagingStoreCmd;
|
|
||||||
import org.apache.cloudstack.api.command.admin.storage.DeleteImageStoreCmd;
|
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.DeletePoolCmd;
|
||||||
|
import org.apache.cloudstack.api.command.admin.storage.DeleteSecondaryStagingStoreCmd;
|
||||||
import org.apache.cloudstack.api.command.admin.storage.UpdateStoragePoolCmd;
|
import org.apache.cloudstack.api.command.admin.storage.UpdateStoragePoolCmd;
|
||||||
|
|
||||||
import com.cloud.exception.DiscoveryException;
|
import com.cloud.exception.DiscoveryException;
|
||||||
@ -97,4 +97,18 @@ public interface StorageService{
|
|||||||
|
|
||||||
ImageStore discoverImageStore(AddImageStoreCmd cmd) throws IllegalArgumentException, DiscoveryException, InvalidParameterValueException;
|
ImageStore discoverImageStore(AddImageStoreCmd cmd) throws IllegalArgumentException, DiscoveryException, InvalidParameterValueException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Prepare NFS secondary storage for object store migration
|
||||||
|
*
|
||||||
|
* @param cmd
|
||||||
|
* - the command specifying secondaryStorageId
|
||||||
|
* @return the storage pool
|
||||||
|
* @throws ResourceUnavailableException
|
||||||
|
* TODO
|
||||||
|
* @throws InsufficientCapacityException
|
||||||
|
* TODO
|
||||||
|
*/
|
||||||
|
public ImageStore prepareSecondaryStorageForObjectStoreMigration(Long storeId) throws ResourceUnavailableException,
|
||||||
|
InsufficientCapacityException;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -84,7 +84,7 @@ public interface VolumeApiService {
|
|||||||
|
|
||||||
Snapshot allocSnapshot(Long volumeId, Long policyId)
|
Snapshot allocSnapshot(Long volumeId, Long policyId)
|
||||||
throws ResourceAllocationException;
|
throws ResourceAllocationException;
|
||||||
Volume updateVolume(UpdateVolumeCmd updateVolumeCmd);
|
Volume updateVolume(long volumeId, String path, String state, Long storageId, Boolean displayVolume);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Extracts the volume to a particular location.
|
* Extracts the volume to a particular location.
|
||||||
|
|||||||
@ -106,4 +106,6 @@ public interface SnapshotApiService {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
Long getHostIdForSnapshotOperation(Volume vol);
|
Long getHostIdForSnapshotOperation(Volume vol);
|
||||||
|
|
||||||
|
boolean revertSnapshot(Long snapshotId);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -33,6 +33,9 @@ public interface DomainService {
|
|||||||
|
|
||||||
Domain getDomain(String uuid);
|
Domain getDomain(String uuid);
|
||||||
|
|
||||||
|
Domain getDomainByName(String name, long parentId);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return whether a domain is a child domain of a given domain.
|
* Return whether a domain is a child domain of a given domain.
|
||||||
*
|
*
|
||||||
|
|||||||
@ -23,6 +23,7 @@ import javax.naming.InsufficientResourcesException;
|
|||||||
|
|
||||||
import org.apache.cloudstack.api.BaseCmd.HTTPMethod;
|
import org.apache.cloudstack.api.BaseCmd.HTTPMethod;
|
||||||
import org.apache.cloudstack.api.command.admin.vm.AssignVMCmd;
|
import org.apache.cloudstack.api.command.admin.vm.AssignVMCmd;
|
||||||
|
import org.apache.cloudstack.api.command.admin.vm.ExpungeVMCmd;
|
||||||
import org.apache.cloudstack.api.command.admin.vm.RecoverVMCmd;
|
import org.apache.cloudstack.api.command.admin.vm.RecoverVMCmd;
|
||||||
import org.apache.cloudstack.api.command.user.vm.AddNicToVMCmd;
|
import org.apache.cloudstack.api.command.user.vm.AddNicToVMCmd;
|
||||||
import org.apache.cloudstack.api.command.user.vm.DeployVMCmd;
|
import org.apache.cloudstack.api.command.user.vm.DeployVMCmd;
|
||||||
@ -463,4 +464,8 @@ public interface UserVmService {
|
|||||||
|
|
||||||
UserVm upgradeVirtualMachine(ScaleVMCmd cmd) throws ResourceUnavailableException, ConcurrentOperationException, ManagementServerException, VirtualMachineMigrationException;
|
UserVm upgradeVirtualMachine(ScaleVMCmd cmd) throws ResourceUnavailableException, ConcurrentOperationException, ManagementServerException, VirtualMachineMigrationException;
|
||||||
|
|
||||||
|
UserVm expungeVm(ExpungeVMCmd cmd) throws ResourceUnavailableException, ConcurrentOperationException;
|
||||||
|
|
||||||
|
UserVm expungeVm(long vmId) throws ResourceUnavailableException, ConcurrentOperationException;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -21,4 +21,5 @@ public interface VmDetailConstants {
|
|||||||
public static final String NIC_ADAPTER = "nicAdapter";
|
public static final String NIC_ADAPTER = "nicAdapter";
|
||||||
public static final String ROOK_DISK_CONTROLLER = "rootDiskController";
|
public static final String ROOK_DISK_CONTROLLER = "rootDiskController";
|
||||||
public static final String NESTED_VIRTUALIZATION_FLAG = "nestedVirtualizationFlag";
|
public static final String NESTED_VIRTUALIZATION_FLAG = "nestedVirtualizationFlag";
|
||||||
|
public static final String HYPERVISOR_TOOLS_VERSION = "hypervisortoolsversion";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,6 +22,7 @@ import java.lang.annotation.Retention;
|
|||||||
import java.lang.annotation.RetentionPolicy;
|
import java.lang.annotation.RetentionPolicy;
|
||||||
import java.lang.annotation.Target;
|
import java.lang.annotation.Target;
|
||||||
|
|
||||||
|
import org.apache.cloudstack.acl.RoleType;
|
||||||
import org.apache.cloudstack.api.ResponseObject.ResponseView;
|
import org.apache.cloudstack.api.ResponseObject.ResponseView;
|
||||||
|
|
||||||
@Retention(RetentionPolicy.RUNTIME)
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
@ -40,4 +41,6 @@ public @interface APICommand {
|
|||||||
String since() default "";
|
String since() default "";
|
||||||
|
|
||||||
ResponseView responseView() default ResponseView.Admin;
|
ResponseView responseView() default ResponseView.Admin;
|
||||||
|
|
||||||
|
RoleType[] authorized() default {};
|
||||||
}
|
}
|
||||||
|
|||||||
@ -28,6 +28,7 @@ public enum ApiCommandJobType {
|
|||||||
SystemVm,
|
SystemVm,
|
||||||
Host,
|
Host,
|
||||||
StoragePool,
|
StoragePool,
|
||||||
|
ImageStore,
|
||||||
IpAddress,
|
IpAddress,
|
||||||
PortableIpAddress,
|
PortableIpAddress,
|
||||||
SecurityGroup,
|
SecurityGroup,
|
||||||
|
|||||||
@ -34,6 +34,7 @@ public class ApiConstants {
|
|||||||
public static final String BYTES_READ_RATE = "bytesreadrate";
|
public static final String BYTES_READ_RATE = "bytesreadrate";
|
||||||
public static final String BYTES_WRITE_RATE = "byteswriterate";
|
public static final String BYTES_WRITE_RATE = "byteswriterate";
|
||||||
public static final String CATEGORY = "category";
|
public static final String CATEGORY = "category";
|
||||||
|
public static final String CAN_REVERT = "canrevert";
|
||||||
public static final String CERTIFICATE = "certificate";
|
public static final String CERTIFICATE = "certificate";
|
||||||
public static final String PRIVATE_KEY = "privatekey";
|
public static final String PRIVATE_KEY = "privatekey";
|
||||||
public static final String DOMAIN_SUFFIX = "domainsuffix";
|
public static final String DOMAIN_SUFFIX = "domainsuffix";
|
||||||
@ -142,6 +143,7 @@ public class ApiConstants {
|
|||||||
public static final String MAX_SNAPS = "maxsnaps";
|
public static final String MAX_SNAPS = "maxsnaps";
|
||||||
public static final String MEMORY = "memory";
|
public static final String MEMORY = "memory";
|
||||||
public static final String MODE = "mode";
|
public static final String MODE = "mode";
|
||||||
|
public static final String KEEPALIVE_ENABLED = "keepaliveenabled";
|
||||||
public static final String NAME = "name";
|
public static final String NAME = "name";
|
||||||
public static final String METHOD_NAME = "methodname";
|
public static final String METHOD_NAME = "methodname";
|
||||||
public static final String NETWORK_DOMAIN = "networkdomain";
|
public static final String NETWORK_DOMAIN = "networkdomain";
|
||||||
@ -186,6 +188,7 @@ public class ApiConstants {
|
|||||||
public static final String REQUIRES_HVM = "requireshvm";
|
public static final String REQUIRES_HVM = "requireshvm";
|
||||||
public static final String RESOURCE_TYPE = "resourcetype";
|
public static final String RESOURCE_TYPE = "resourcetype";
|
||||||
public static final String RESPONSE = "response";
|
public static final String RESPONSE = "response";
|
||||||
|
public static final String REVERTABLE = "revertable";
|
||||||
public static final String QUERY_FILTER = "queryfilter";
|
public static final String QUERY_FILTER = "queryfilter";
|
||||||
public static final String SCHEDULE = "schedule";
|
public static final String SCHEDULE = "schedule";
|
||||||
public static final String SCOPE = "scope";
|
public static final String SCOPE = "scope";
|
||||||
@ -530,6 +533,11 @@ public class ApiConstants {
|
|||||||
public static final String ENTITY_ID = "entityid";
|
public static final String ENTITY_ID = "entityid";
|
||||||
public static final String ACCESS_TYPE = "accesstype";
|
public static final String ACCESS_TYPE = "accesstype";
|
||||||
|
|
||||||
|
public static final String RESOURCE_DETAILS = "resourcedetails";
|
||||||
|
public static final String EXPUNGE = "expunge";
|
||||||
|
public static final String FOR_DISPLAY = "fordisplay";
|
||||||
|
|
||||||
|
|
||||||
public enum HostDetails {
|
public enum HostDetails {
|
||||||
all, capacity, events, stats, min;
|
all, capacity, events, stats, min;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -21,7 +21,6 @@ import java.text.DateFormat;
|
|||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
@ -76,7 +75,6 @@ import com.cloud.user.Account;
|
|||||||
import com.cloud.user.AccountService;
|
import com.cloud.user.AccountService;
|
||||||
import com.cloud.user.DomainService;
|
import com.cloud.user.DomainService;
|
||||||
import com.cloud.user.ResourceLimitService;
|
import com.cloud.user.ResourceLimitService;
|
||||||
import com.cloud.utils.Pair;
|
|
||||||
import com.cloud.utils.db.EntityManager;
|
import com.cloud.utils.db.EntityManager;
|
||||||
import com.cloud.vm.UserVmService;
|
import com.cloud.vm.UserVmService;
|
||||||
import com.cloud.vm.snapshot.VMSnapshotService;
|
import com.cloud.vm.snapshot.VMSnapshotService;
|
||||||
@ -303,172 +301,6 @@ public abstract class BaseCmd {
|
|||||||
return lowercaseParams;
|
return lowercaseParams;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String buildResponse(ServerApiException apiException, String responseType) {
|
|
||||||
StringBuffer sb = new StringBuffer();
|
|
||||||
if (RESPONSE_TYPE_JSON.equalsIgnoreCase(responseType)) {
|
|
||||||
// JSON response
|
|
||||||
sb.append("{ \"" + getCommandName() + "\" : { " + "\"@attributes\":{\"cloud-stack-version\":\"" + _mgr.getVersion() + "\"},");
|
|
||||||
sb.append("\"errorcode\" : \"" + apiException.getErrorCode() + "\", \"description\" : \"" + apiException.getDescription() + "\" } }");
|
|
||||||
} else {
|
|
||||||
sb.append("<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>");
|
|
||||||
sb.append("<" + getCommandName() + ">");
|
|
||||||
sb.append("<errorcode>" + apiException.getErrorCode() + "</errorcode>");
|
|
||||||
sb.append("<description>" + escapeXml(apiException.getDescription()) + "</description>");
|
|
||||||
sb.append("</" + getCommandName() + " cloud-stack-version=\"" + _mgr.getVersion() + "\">");
|
|
||||||
}
|
|
||||||
return sb.toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
public String buildResponse(List<Pair<String, Object>> tagList, String responseType) {
|
|
||||||
StringBuffer prefixSb = new StringBuffer();
|
|
||||||
StringBuffer suffixSb = new StringBuffer();
|
|
||||||
|
|
||||||
// set up the return value with the name of the response
|
|
||||||
if (RESPONSE_TYPE_JSON.equalsIgnoreCase(responseType)) {
|
|
||||||
prefixSb.append("{ \"" + getCommandName() + "\" : { \"@attributes\":{\"cloud-stack-version\":\"" + _mgr.getVersion() + "\"},");
|
|
||||||
} else {
|
|
||||||
prefixSb.append("<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>");
|
|
||||||
prefixSb.append("<" + getCommandName() + " cloud-stack-version=\"" + _mgr.getVersion() + "\">");
|
|
||||||
}
|
|
||||||
|
|
||||||
int i = 0;
|
|
||||||
for (Pair<String, Object> tagData : tagList) {
|
|
||||||
String tagName = tagData.first();
|
|
||||||
Object tagValue = tagData.second();
|
|
||||||
if (tagValue instanceof Object[]) {
|
|
||||||
Object[] subObjects = (Object[]) tagValue;
|
|
||||||
if (subObjects.length < 1) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
writeObjectArray(responseType, suffixSb, i++, tagName, subObjects);
|
|
||||||
} else {
|
|
||||||
writeNameValuePair(suffixSb, tagName, tagValue, responseType, i++);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (suffixSb.length() > 0) {
|
|
||||||
if (RESPONSE_TYPE_JSON.equalsIgnoreCase(responseType)) { // append comma only if we have some suffix else
|
|
||||||
// not as per strict Json syntax.
|
|
||||||
prefixSb.append(",");
|
|
||||||
}
|
|
||||||
prefixSb.append(suffixSb);
|
|
||||||
}
|
|
||||||
// close the response
|
|
||||||
if (RESPONSE_TYPE_JSON.equalsIgnoreCase(responseType)) {
|
|
||||||
prefixSb.append("} }");
|
|
||||||
} else {
|
|
||||||
prefixSb.append("</" + getCommandName() + ">");
|
|
||||||
}
|
|
||||||
return prefixSb.toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void writeNameValuePair(StringBuffer sb, String tagName, Object tagValue, String responseType, int propertyCount) {
|
|
||||||
if (tagValue == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (tagValue instanceof Object[]) {
|
|
||||||
Object[] subObjects = (Object[]) tagValue;
|
|
||||||
if (subObjects.length < 1) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
writeObjectArray(responseType, sb, propertyCount, tagName, subObjects);
|
|
||||||
} else {
|
|
||||||
if (RESPONSE_TYPE_JSON.equalsIgnoreCase(responseType)) {
|
|
||||||
String seperator = ((propertyCount > 0) ? ", " : "");
|
|
||||||
sb.append(seperator + "\"" + tagName + "\" : \"" + escapeJSON(tagValue.toString()) + "\"");
|
|
||||||
} else {
|
|
||||||
sb.append("<" + tagName + ">" + escapeXml(tagValue.toString()) + "</" + tagName + ">");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@SuppressWarnings("rawtypes")
|
|
||||||
private void writeObjectArray(String responseType, StringBuffer sb, int propertyCount, String tagName, Object[] subObjects) {
|
|
||||||
if (RESPONSE_TYPE_JSON.equalsIgnoreCase(responseType)) {
|
|
||||||
String separator = ((propertyCount > 0) ? ", " : "");
|
|
||||||
sb.append(separator);
|
|
||||||
}
|
|
||||||
int j = 0;
|
|
||||||
for (Object subObject : subObjects) {
|
|
||||||
if (subObject instanceof List) {
|
|
||||||
List subObjList = (List) subObject;
|
|
||||||
writeSubObject(sb, tagName, subObjList, responseType, j++);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (RESPONSE_TYPE_JSON.equalsIgnoreCase(responseType)) {
|
|
||||||
sb.append("]");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@SuppressWarnings("rawtypes")
|
|
||||||
private void writeSubObject(StringBuffer sb, String tagName, List tagList, String responseType, int objectCount) {
|
|
||||||
if (RESPONSE_TYPE_JSON.equalsIgnoreCase(responseType)) {
|
|
||||||
sb.append(((objectCount == 0) ? "\"" + tagName + "\" : [ { " : ", { "));
|
|
||||||
} else {
|
|
||||||
sb.append("<" + tagName + ">");
|
|
||||||
}
|
|
||||||
|
|
||||||
int i = 0;
|
|
||||||
for (Object tag : tagList) {
|
|
||||||
if (tag instanceof Pair) {
|
|
||||||
Pair nameValuePair = (Pair) tag;
|
|
||||||
writeNameValuePair(sb, (String) nameValuePair.first(), nameValuePair.second(), responseType, i++);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (RESPONSE_TYPE_JSON.equalsIgnoreCase(responseType)) {
|
|
||||||
sb.append("}");
|
|
||||||
} else {
|
|
||||||
sb.append("</" + tagName + ">");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Escape xml response set to false by default. API commands to override this method to allow escaping
|
|
||||||
*/
|
|
||||||
public boolean requireXmlEscape() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
private String escapeXml(String xml) {
|
|
||||||
if (!requireXmlEscape()) {
|
|
||||||
return xml;
|
|
||||||
}
|
|
||||||
int iLen = xml.length();
|
|
||||||
if (iLen == 0) {
|
|
||||||
return xml;
|
|
||||||
}
|
|
||||||
StringBuffer sOUT = new StringBuffer(iLen + 256);
|
|
||||||
int i = 0;
|
|
||||||
for (; i < iLen; i++) {
|
|
||||||
char c = xml.charAt(i);
|
|
||||||
if (c == '<') {
|
|
||||||
sOUT.append("<");
|
|
||||||
} else if (c == '>') {
|
|
||||||
sOUT.append(">");
|
|
||||||
} else if (c == '&') {
|
|
||||||
sOUT.append("&");
|
|
||||||
} else if (c == '"') {
|
|
||||||
sOUT.append(""");
|
|
||||||
} else if (c == '\'') {
|
|
||||||
sOUT.append("'");
|
|
||||||
} else {
|
|
||||||
sOUT.append(c);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return sOUT.toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
private static String escapeJSON(String str) {
|
|
||||||
if (str == null) {
|
|
||||||
return str;
|
|
||||||
}
|
|
||||||
|
|
||||||
return str.replace("\"", "\\\"");
|
|
||||||
}
|
|
||||||
|
|
||||||
protected long getInstanceIdFromJobSuccessResult(String result) {
|
protected long getInstanceIdFromJobSuccessResult(String result) {
|
||||||
s_logger.debug("getInstanceIdFromJobSuccessResult not overridden in subclass " + this.getClass().getName());
|
s_logger.debug("getInstanceIdFromJobSuccessResult not overridden in subclass " + this.getClass().getName());
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
29
api/src/org/apache/cloudstack/api/ResourceDetail.java
Normal file
29
api/src/org/apache/cloudstack/api/ResourceDetail.java
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
// Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
// or more contributor license agreements. See the NOTICE file
|
||||||
|
// distributed with this work for additional information
|
||||||
|
// regarding copyright ownership. The ASF licenses this file
|
||||||
|
// to you under the Apache License, Version 2.0 (the
|
||||||
|
// "License"); you may not use this file except in compliance
|
||||||
|
// with the License. You may obtain a copy of the License at
|
||||||
|
//
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
//
|
||||||
|
// Unless required by applicable law or agreed to in writing,
|
||||||
|
// software distributed under the License is distributed on an
|
||||||
|
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
// KIND, either express or implied. See the License for the
|
||||||
|
// specific language governing permissions and limitations
|
||||||
|
// under the License.
|
||||||
|
package org.apache.cloudstack.api;
|
||||||
|
|
||||||
|
public interface ResourceDetail extends InternalIdentity{
|
||||||
|
|
||||||
|
public long getResourceId();
|
||||||
|
|
||||||
|
public String getName();
|
||||||
|
|
||||||
|
public String getValue();
|
||||||
|
|
||||||
|
public boolean isDisplay();
|
||||||
|
|
||||||
|
}
|
||||||
@ -102,6 +102,9 @@ public class CreateNetworkOfferingCmd extends BaseCmd {
|
|||||||
@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")
|
@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;
|
private Boolean egressDefaultPolicy;
|
||||||
|
|
||||||
|
@Parameter(name=ApiConstants.KEEPALIVE_ENABLED, type=CommandType.BOOLEAN, required=false, description="if true keepalive will be turned on in the loadbalancer. At the time of writing this has only an effect on haproxy; the mode http and httpclose options are unset in the haproxy conf file.")
|
||||||
|
private Boolean keepAliveEnabled;
|
||||||
|
|
||||||
@Parameter(name=ApiConstants.MAX_CONNECTIONS, type=CommandType.INTEGER, description="maximum number of concurrent connections supported by the network offering")
|
@Parameter(name=ApiConstants.MAX_CONNECTIONS, type=CommandType.INTEGER, description="maximum number of concurrent connections supported by the network offering")
|
||||||
private Integer maxConnections;
|
private Integer maxConnections;
|
||||||
|
|
||||||
@ -175,6 +178,10 @@ public class CreateNetworkOfferingCmd extends BaseCmd {
|
|||||||
return egressDefaultPolicy;
|
return egressDefaultPolicy;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Boolean getKeepAliveEnabled() {
|
||||||
|
return keepAliveEnabled;
|
||||||
|
}
|
||||||
|
|
||||||
public Integer getMaxconnections() {
|
public Integer getMaxconnections() {
|
||||||
return maxConnections;
|
return maxConnections;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -57,6 +57,9 @@ public class UpdateNetworkOfferingCmd extends BaseCmd {
|
|||||||
@Parameter(name=ApiConstants.STATE, type=CommandType.STRING, description="update state for the network offering")
|
@Parameter(name=ApiConstants.STATE, type=CommandType.STRING, description="update state for the network offering")
|
||||||
private String state;
|
private String state;
|
||||||
|
|
||||||
|
@Parameter(name=ApiConstants.KEEPALIVE_ENABLED, type=CommandType.BOOLEAN, required=false, description="if true keepalive will be turned on in the loadbalancer. At the time of writing this has only an effect on haproxy; the mode http and httpclose options are unset in the haproxy conf file.")
|
||||||
|
private Boolean keepAliveEnabled;
|
||||||
|
|
||||||
@Parameter(name=ApiConstants.MAX_CONNECTIONS, type=CommandType.INTEGER, description="maximum number of concurrent connections supported by the network offering")
|
@Parameter(name=ApiConstants.MAX_CONNECTIONS, type=CommandType.INTEGER, description="maximum number of concurrent connections supported by the network offering")
|
||||||
private Integer maxConnections;
|
private Integer maxConnections;
|
||||||
|
|
||||||
@ -91,6 +94,10 @@ public class UpdateNetworkOfferingCmd extends BaseCmd {
|
|||||||
public Integer getMaxconnections() {
|
public Integer getMaxconnections() {
|
||||||
return maxConnections;
|
return maxConnections;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Boolean getKeepAliveEnabled() {
|
||||||
|
return keepAliveEnabled;
|
||||||
|
}
|
||||||
/////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////
|
||||||
/////////////// API Implementation///////////////////
|
/////////////// API Implementation///////////////////
|
||||||
/////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////
|
||||||
|
|||||||
@ -49,6 +49,9 @@ public class UpdateDiskOfferingCmd extends BaseCmd{
|
|||||||
@Parameter(name=ApiConstants.SORT_KEY, type=CommandType.INTEGER, description="sort key of the disk offering, integer")
|
@Parameter(name=ApiConstants.SORT_KEY, type=CommandType.INTEGER, description="sort key of the disk offering, integer")
|
||||||
private Integer sortKey;
|
private Integer sortKey;
|
||||||
|
|
||||||
|
@Parameter(name=ApiConstants.DISPLAY_OFFERING, type=CommandType.BOOLEAN, description="an optional field, whether to display the offering to the end user or not.")
|
||||||
|
private Boolean displayOffering;
|
||||||
|
|
||||||
/////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////
|
||||||
/////////////////// Accessors ///////////////////////
|
/////////////////// Accessors ///////////////////////
|
||||||
/////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////
|
||||||
@ -69,6 +72,9 @@ public class UpdateDiskOfferingCmd extends BaseCmd{
|
|||||||
return sortKey;
|
return sortKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Boolean getDisplayOffering() {
|
||||||
|
return displayOffering;
|
||||||
|
}
|
||||||
|
|
||||||
/////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////
|
||||||
/////////////// API Implementation///////////////////
|
/////////////// API Implementation///////////////////
|
||||||
|
|||||||
@ -36,7 +36,7 @@ import com.cloud.event.EventTypes;
|
|||||||
import com.cloud.exception.InvalidParameterValueException;
|
import com.cloud.exception.InvalidParameterValueException;
|
||||||
import com.cloud.exception.ResourceAllocationException;
|
import com.cloud.exception.ResourceAllocationException;
|
||||||
import com.cloud.network.VirtualRouterProvider;
|
import com.cloud.network.VirtualRouterProvider;
|
||||||
import com.cloud.network.VirtualRouterProvider.VirtualRouterProviderType;
|
import com.cloud.network.VirtualRouterProvider.Type;
|
||||||
import com.cloud.network.element.VirtualRouterElementService;
|
import com.cloud.network.element.VirtualRouterElementService;
|
||||||
import com.cloud.user.Account;
|
import com.cloud.user.Account;
|
||||||
|
|
||||||
@ -70,15 +70,15 @@ public class CreateVirtualRouterElementCmd extends BaseAsyncCreateCmd {
|
|||||||
return nspId;
|
return nspId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public VirtualRouterProviderType getProviderType() {
|
public Type getProviderType() {
|
||||||
if (providerType != null) {
|
if (providerType != null) {
|
||||||
if (providerType.equalsIgnoreCase(VirtualRouterProviderType.VirtualRouter.toString())) {
|
if (providerType.equalsIgnoreCase(Type.VirtualRouter.toString())) {
|
||||||
return VirtualRouterProviderType.VirtualRouter;
|
return Type.VirtualRouter;
|
||||||
} else if (providerType.equalsIgnoreCase(VirtualRouterProviderType.VPCVirtualRouter.toString())) {
|
} else if (providerType.equalsIgnoreCase(Type.VPCVirtualRouter.toString())) {
|
||||||
return VirtualRouterProviderType.VPCVirtualRouter;
|
return Type.VPCVirtualRouter;
|
||||||
} else throw new InvalidParameterValueException("Invalid providerType specified");
|
} else throw new InvalidParameterValueException("Invalid providerType specified");
|
||||||
}
|
}
|
||||||
return VirtualRouterProviderType.VirtualRouter;
|
return Type.VirtualRouter;
|
||||||
}
|
}
|
||||||
|
|
||||||
/////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////
|
||||||
|
|||||||
@ -109,6 +109,7 @@ public class ListStoragePoolsCmd extends BaseListCmd {
|
|||||||
return s_name;
|
return s_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public ApiCommandJobType getInstanceType() {
|
public ApiCommandJobType getInstanceType() {
|
||||||
return ApiCommandJobType.StoragePool;
|
return ApiCommandJobType.StoragePool;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,109 @@
|
|||||||
|
// 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.command.admin.storage;
|
||||||
|
|
||||||
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
|
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;
|
||||||
|
import org.apache.cloudstack.api.Parameter;
|
||||||
|
import org.apache.cloudstack.api.ServerApiException;
|
||||||
|
import org.apache.cloudstack.api.response.ImageStoreResponse;
|
||||||
|
import org.apache.cloudstack.context.CallContext;
|
||||||
|
|
||||||
|
import com.cloud.event.EventTypes;
|
||||||
|
import com.cloud.exception.InsufficientCapacityException;
|
||||||
|
import com.cloud.exception.ResourceUnavailableException;
|
||||||
|
import com.cloud.storage.ImageStore;
|
||||||
|
import com.cloud.user.Account;
|
||||||
|
|
||||||
|
@APICommand(name = "prepareSecondaryStorageForMigration", description = "Prepare a NFS secondary storage to migrate to use object store like S3", responseObject = ImageStoreResponse.class)
|
||||||
|
public class PrepareSecondaryStorageForMigrationCmd extends BaseAsyncCmd {
|
||||||
|
public static final Logger s_logger = Logger.getLogger(PrepareSecondaryStorageForMigrationCmd.class.getName());
|
||||||
|
private static final String s_name = "preparesecondarystorageformigrationresponse";
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////
|
||||||
|
//////////////// API parameters /////////////////////
|
||||||
|
/////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
@Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = ImageStoreResponse.class,
|
||||||
|
required = true, description = "Secondary image store ID")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////
|
||||||
|
/////////////////// Accessors ///////////////////////
|
||||||
|
/////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
public Long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////
|
||||||
|
/////////////// API Implementation///////////////////
|
||||||
|
/////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getCommandName() {
|
||||||
|
return s_name;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ApiCommandJobType getInstanceType() {
|
||||||
|
return ApiCommandJobType.ImageStore;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long getInstanceId() {
|
||||||
|
return getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long getEntityOwnerId() {
|
||||||
|
Account account = CallContext.current().getCallingAccount();
|
||||||
|
if (account != null) {
|
||||||
|
return account.getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getEventType() {
|
||||||
|
return EventTypes.EVENT_MIGRATE_PREPARE_SECONDARY_STORAGE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getEventDescription() {
|
||||||
|
return "preparing secondary storage: " + getId() + " for object store migration";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void execute() throws ResourceUnavailableException, InsufficientCapacityException{
|
||||||
|
ImageStore result = _storageService.prepareSecondaryStorageForObjectStoreMigration(getId());
|
||||||
|
if (result != null){
|
||||||
|
ImageStoreResponse response = _responseGenerator.createImageStoreResponse(result);
|
||||||
|
response.setResponseName(getCommandName());
|
||||||
|
response.setResponseName("secondarystorage");
|
||||||
|
setResponseObject(response);
|
||||||
|
} else {
|
||||||
|
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to prepare secondary storage for object store migration");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -39,7 +39,7 @@ import com.cloud.uservm.UserVm;
|
|||||||
public class AssignVMCmd extends BaseCmd {
|
public class AssignVMCmd extends BaseCmd {
|
||||||
public static final Logger s_logger = Logger.getLogger(AssignVMCmd.class.getName());
|
public static final Logger s_logger = Logger.getLogger(AssignVMCmd.class.getName());
|
||||||
|
|
||||||
private static final String s_name = "moveuservmresponse";
|
private static final String s_name = "assignvirtualmachineresponse";
|
||||||
|
|
||||||
/////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////
|
||||||
//////////////// API parameters /////////////////////
|
//////////////// API parameters /////////////////////
|
||||||
|
|||||||
@ -0,0 +1,116 @@
|
|||||||
|
// 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.command.admin.vm;
|
||||||
|
|
||||||
|
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;
|
||||||
|
import org.apache.cloudstack.api.Parameter;
|
||||||
|
import org.apache.cloudstack.api.ServerApiException;
|
||||||
|
import org.apache.cloudstack.api.response.SuccessResponse;
|
||||||
|
import org.apache.cloudstack.api.response.UserVmResponse;
|
||||||
|
import org.apache.cloudstack.context.CallContext;
|
||||||
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
|
import com.cloud.event.EventTypes;
|
||||||
|
import com.cloud.exception.ConcurrentOperationException;
|
||||||
|
import com.cloud.exception.InvalidParameterValueException;
|
||||||
|
import com.cloud.exception.ResourceUnavailableException;
|
||||||
|
import com.cloud.user.Account;
|
||||||
|
import com.cloud.uservm.UserVm;
|
||||||
|
import com.cloud.utils.exception.CloudRuntimeException;
|
||||||
|
|
||||||
|
@APICommand(name = "expungeVirtualMachine", description="Expunge a virtual machine. Once expunged, it cannot be recoverd.", responseObject=SuccessResponse.class)
|
||||||
|
public class ExpungeVMCmd extends BaseAsyncCmd {
|
||||||
|
public static final Logger s_logger = Logger.getLogger(ExpungeVMCmd.class.getName());
|
||||||
|
|
||||||
|
private static final String s_name = "expungevirtualmachineresponse";
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////
|
||||||
|
//////////////// API parameters /////////////////////
|
||||||
|
/////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
@Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType=UserVmResponse.class,
|
||||||
|
required=true, description="The ID of the virtual machine")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////
|
||||||
|
/////////////////// Accessors ///////////////////////
|
||||||
|
/////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
public Long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////
|
||||||
|
/////////////// API Implementation///////////////////
|
||||||
|
/////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getCommandName() {
|
||||||
|
return s_name;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long getEntityOwnerId() {
|
||||||
|
UserVm vm = _responseGenerator.findUserVmById(getId());
|
||||||
|
if (vm != null) {
|
||||||
|
return vm.getAccountId();
|
||||||
|
}
|
||||||
|
|
||||||
|
return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getEventType() {
|
||||||
|
return EventTypes.EVENT_VM_EXPUNGE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getEventDescription() {
|
||||||
|
return "Expunging vm: " + getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
public ApiCommandJobType getInstanceType() {
|
||||||
|
return ApiCommandJobType.VirtualMachine;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getInstanceId() {
|
||||||
|
return getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void execute() throws ResourceUnavailableException, ConcurrentOperationException{
|
||||||
|
CallContext.current().setEventDetails("Vm Id: "+getId());
|
||||||
|
try {
|
||||||
|
UserVm result = _userVmService.expungeVm(this);
|
||||||
|
|
||||||
|
if (result != null) {
|
||||||
|
SuccessResponse response = new SuccessResponse(getCommandName());
|
||||||
|
this.setResponseObject(response);
|
||||||
|
} else {
|
||||||
|
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to expunge vm");
|
||||||
|
}
|
||||||
|
} catch (InvalidParameterValueException ipve) {
|
||||||
|
throw new ServerApiException(ApiErrorCode.PARAM_ERROR, ipve.getMessage());
|
||||||
|
} catch (CloudRuntimeException cre) {
|
||||||
|
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, cre.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -153,9 +153,7 @@ public class UpdateNetworkCmd extends BaseAsyncCmd {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getEventDescription() {
|
public String getEventDescription() {
|
||||||
|
StringBuilder eventMsg = new StringBuilder("Updating network: " + getId());
|
||||||
|
|
||||||
StringBuffer eventMsg = new StringBuffer("Updating network: " + getId());
|
|
||||||
if (getNetworkOfferingId() != null) {
|
if (getNetworkOfferingId() != null) {
|
||||||
Network network = _networkService.getNetwork(getId());
|
Network network = _networkService.getNetwork(getId());
|
||||||
if (network == null) {
|
if (network == null) {
|
||||||
|
|||||||
@ -16,6 +16,11 @@
|
|||||||
// under the License.
|
// under the License.
|
||||||
package org.apache.cloudstack.api.command.user.offering;
|
package org.apache.cloudstack.api.command.user.offering;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import org.apache.cloudstack.api.APICommand;
|
import org.apache.cloudstack.api.APICommand;
|
||||||
import org.apache.cloudstack.api.ApiConstants;
|
import org.apache.cloudstack.api.ApiConstants;
|
||||||
import org.apache.cloudstack.api.BaseListCmd;
|
import org.apache.cloudstack.api.BaseListCmd;
|
||||||
@ -24,9 +29,10 @@ import org.apache.cloudstack.api.response.DomainResponse;
|
|||||||
import org.apache.cloudstack.api.response.ListResponse;
|
import org.apache.cloudstack.api.response.ListResponse;
|
||||||
import org.apache.cloudstack.api.response.ServiceOfferingResponse;
|
import org.apache.cloudstack.api.response.ServiceOfferingResponse;
|
||||||
import org.apache.cloudstack.api.response.UserVmResponse;
|
import org.apache.cloudstack.api.response.UserVmResponse;
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
|
import com.cloud.exception.InvalidParameterValueException;
|
||||||
|
|
||||||
@APICommand(name = "listServiceOfferings", description="Lists all available service offerings.", responseObject=ServiceOfferingResponse.class)
|
@APICommand(name = "listServiceOfferings", description="Lists all available service offerings.", responseObject=ServiceOfferingResponse.class)
|
||||||
public class ListServiceOfferingsCmd extends BaseListCmd {
|
public class ListServiceOfferingsCmd extends BaseListCmd {
|
||||||
public static final Logger s_logger = Logger.getLogger(ListServiceOfferingsCmd.class.getName());
|
public static final Logger s_logger = Logger.getLogger(ListServiceOfferingsCmd.class.getName());
|
||||||
@ -98,7 +104,6 @@ public class ListServiceOfferingsCmd extends BaseListCmd {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(){
|
public void execute(){
|
||||||
|
|
||||||
ListResponse<ServiceOfferingResponse> response = _queryService.searchForServiceOfferings(this);
|
ListResponse<ServiceOfferingResponse> response = _queryService.searchForServiceOfferings(this);
|
||||||
response.setResponseName(getCommandName());
|
response.setResponseName(getCommandName());
|
||||||
this.setResponseObject(response);
|
this.setResponseObject(response);
|
||||||
|
|||||||
@ -0,0 +1,96 @@
|
|||||||
|
/*
|
||||||
|
* 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.command.user.snapshot;
|
||||||
|
|
||||||
|
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;
|
||||||
|
import org.apache.cloudstack.api.BaseCmd;
|
||||||
|
import org.apache.cloudstack.api.Parameter;
|
||||||
|
import org.apache.cloudstack.api.ServerApiException;
|
||||||
|
import org.apache.cloudstack.api.response.SnapshotResponse;
|
||||||
|
import org.apache.cloudstack.api.response.SuccessResponse;
|
||||||
|
import org.apache.cloudstack.context.CallContext;
|
||||||
|
|
||||||
|
import com.cloud.event.EventTypes;
|
||||||
|
import com.cloud.storage.Snapshot;
|
||||||
|
import com.cloud.user.Account;
|
||||||
|
|
||||||
|
@APICommand(name = "revertSnapshot", description = "revert a volume snapshot.", responseObject = SnapshotResponse.class)
|
||||||
|
public class RevertSnapshotCmd extends BaseAsyncCmd {
|
||||||
|
private static final String s_name = "revertsnapshotresponse";
|
||||||
|
@Parameter(name= ApiConstants.ID, type= BaseCmd.CommandType.UUID, entityType = SnapshotResponse.class,
|
||||||
|
required=true, description="The ID of the snapshot")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
public Long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getCommandName() {
|
||||||
|
return s_name;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long getEntityOwnerId() {
|
||||||
|
Snapshot snapshot = _entityMgr.findById(Snapshot.class, getId());
|
||||||
|
if (snapshot != null) {
|
||||||
|
return snapshot.getAccountId();
|
||||||
|
}
|
||||||
|
|
||||||
|
return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getEventType() {
|
||||||
|
return EventTypes.EVENT_SNAPSHOT_REVERT;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getEventDescription() {
|
||||||
|
return "revert snapshot: " + getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ApiCommandJobType getInstanceType() {
|
||||||
|
return ApiCommandJobType.Snapshot;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long getInstanceId() {
|
||||||
|
return getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void execute(){
|
||||||
|
CallContext.current().setEventDetails("Snapshot Id: "+getId());
|
||||||
|
boolean result = _snapshotService.revertSnapshot(getId());
|
||||||
|
if (result) {
|
||||||
|
SuccessResponse response = new SuccessResponse(getCommandName());
|
||||||
|
response.setResponseName(getCommandName());
|
||||||
|
this.setResponseObject(response);
|
||||||
|
} else {
|
||||||
|
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to revert snapshot");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -20,16 +20,16 @@ import org.apache.cloudstack.api.APICommand;
|
|||||||
import org.apache.cloudstack.api.ApiConstants;
|
import org.apache.cloudstack.api.ApiConstants;
|
||||||
import org.apache.cloudstack.api.BaseCmd;
|
import org.apache.cloudstack.api.BaseCmd;
|
||||||
import org.apache.cloudstack.api.Parameter;
|
import org.apache.cloudstack.api.Parameter;
|
||||||
|
import org.apache.cloudstack.api.response.CreateSSHKeyPairResponse;
|
||||||
import org.apache.cloudstack.api.response.DomainResponse;
|
import org.apache.cloudstack.api.response.DomainResponse;
|
||||||
import org.apache.cloudstack.api.response.ProjectResponse;
|
import org.apache.cloudstack.api.response.ProjectResponse;
|
||||||
import org.apache.cloudstack.api.response.SSHKeyPairResponse;
|
|
||||||
import org.apache.cloudstack.context.CallContext;
|
import org.apache.cloudstack.context.CallContext;
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
import com.cloud.user.SSHKeyPair;
|
import com.cloud.user.SSHKeyPair;
|
||||||
|
|
||||||
@APICommand(name = "createSSHKeyPair", description="Create a new keypair and returns the private key", responseObject=SSHKeyPairResponse.class)
|
@APICommand(name = "createSSHKeyPair", description="Create a new keypair and returns the private key", responseObject=CreateSSHKeyPairResponse.class)
|
||||||
public class CreateSSHKeyPairCmd extends BaseCmd {
|
public class CreateSSHKeyPairCmd extends BaseCmd {
|
||||||
public static final Logger s_logger = Logger.getLogger(CreateSSHKeyPairCmd.class.getName());
|
public static final Logger s_logger = Logger.getLogger(CreateSSHKeyPairCmd.class.getName());
|
||||||
private static final String s_name = "createsshkeypairresponse";
|
private static final String s_name = "createsshkeypairresponse";
|
||||||
@ -91,7 +91,7 @@ public class CreateSSHKeyPairCmd extends BaseCmd {
|
|||||||
@Override
|
@Override
|
||||||
public void execute() {
|
public void execute() {
|
||||||
SSHKeyPair r = _mgr.createSSHKeyPair(this);
|
SSHKeyPair r = _mgr.createSSHKeyPair(this);
|
||||||
SSHKeyPairResponse response = new SSHKeyPairResponse(r.getName(), r.getFingerprint(), r.getPrivateKey());
|
CreateSSHKeyPairResponse response = new CreateSSHKeyPairResponse(r.getName(), r.getFingerprint(), r.getPrivateKey());
|
||||||
response.setResponseName(getCommandName());
|
response.setResponseName(getCommandName());
|
||||||
response.setObjectName("keypair");
|
response.setObjectName("keypair");
|
||||||
this.setResponseObject(response);
|
this.setResponseObject(response);
|
||||||
|
|||||||
@ -34,7 +34,7 @@ import org.apache.log4j.Logger;
|
|||||||
|
|
||||||
import com.cloud.event.EventTypes;
|
import com.cloud.event.EventTypes;
|
||||||
import com.cloud.server.ResourceTag;
|
import com.cloud.server.ResourceTag;
|
||||||
import com.cloud.server.ResourceTag.TaggedResourceType;
|
import com.cloud.server.ResourceTag.ResourceObjectType;
|
||||||
@APICommand(name = "createTags", description = "Creates resource tag(s)", responseObject = SuccessResponse.class, since = "4.0.0")
|
@APICommand(name = "createTags", description = "Creates resource tag(s)", responseObject = SuccessResponse.class, since = "4.0.0")
|
||||||
public class CreateTagsCmd extends BaseAsyncCmd{
|
public class CreateTagsCmd extends BaseAsyncCmd{
|
||||||
public static final Logger s_logger = Logger.getLogger(CreateTagsCmd.class.getName());
|
public static final Logger s_logger = Logger.getLogger(CreateTagsCmd.class.getName());
|
||||||
@ -64,7 +64,7 @@ public class CreateTagsCmd extends BaseAsyncCmd{
|
|||||||
/////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
public TaggedResourceType getResourceType(){
|
public ResourceObjectType getResourceType(){
|
||||||
return _taggedResourceService.getResourceType(resourceType);
|
return _taggedResourceService.getResourceType(resourceType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -33,7 +33,7 @@ import org.apache.cloudstack.api.response.SuccessResponse;
|
|||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
import com.cloud.event.EventTypes;
|
import com.cloud.event.EventTypes;
|
||||||
import com.cloud.server.ResourceTag.TaggedResourceType;
|
import com.cloud.server.ResourceTag.ResourceObjectType;
|
||||||
@APICommand(name = "deleteTags", description = "Deleting resource tag(s)", responseObject = SuccessResponse.class, since = "4.0.0")
|
@APICommand(name = "deleteTags", description = "Deleting resource tag(s)", responseObject = SuccessResponse.class, since = "4.0.0")
|
||||||
public class DeleteTagsCmd extends BaseAsyncCmd{
|
public class DeleteTagsCmd extends BaseAsyncCmd{
|
||||||
public static final Logger s_logger = Logger.getLogger(DeleteTagsCmd.class.getName());
|
public static final Logger s_logger = Logger.getLogger(DeleteTagsCmd.class.getName());
|
||||||
@ -59,7 +59,7 @@ public class DeleteTagsCmd extends BaseAsyncCmd{
|
|||||||
/////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
public TaggedResourceType getResourceType(){
|
public ResourceObjectType getResourceType(){
|
||||||
return _taggedResourceService.getResourceType(resourceType);
|
return _taggedResourceService.getResourceType(resourceType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -16,6 +16,8 @@
|
|||||||
// under the License.
|
// under the License.
|
||||||
package org.apache.cloudstack.api.command.user.vm;
|
package org.apache.cloudstack.api.command.user.vm;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import org.apache.cloudstack.api.APICommand;
|
import org.apache.cloudstack.api.APICommand;
|
||||||
import org.apache.cloudstack.api.ApiCommandJobType;
|
import org.apache.cloudstack.api.ApiCommandJobType;
|
||||||
import org.apache.cloudstack.api.ApiConstants;
|
import org.apache.cloudstack.api.ApiConstants;
|
||||||
@ -25,13 +27,11 @@ import org.apache.cloudstack.api.Parameter;
|
|||||||
import org.apache.cloudstack.api.ServerApiException;
|
import org.apache.cloudstack.api.ServerApiException;
|
||||||
import org.apache.cloudstack.api.response.UserVmResponse;
|
import org.apache.cloudstack.api.response.UserVmResponse;
|
||||||
import org.apache.cloudstack.context.CallContext;
|
import org.apache.cloudstack.context.CallContext;
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
import com.cloud.event.EventTypes;
|
import com.cloud.event.EventTypes;
|
||||||
import com.cloud.exception.ConcurrentOperationException;
|
import com.cloud.exception.ConcurrentOperationException;
|
||||||
import com.cloud.exception.ResourceUnavailableException;
|
import com.cloud.exception.ResourceUnavailableException;
|
||||||
import com.cloud.hypervisor.Hypervisor.HypervisorType;
|
|
||||||
import com.cloud.user.Account;
|
import com.cloud.user.Account;
|
||||||
import com.cloud.uservm.UserVm;
|
import com.cloud.uservm.UserVm;
|
||||||
|
|
||||||
@ -49,6 +49,11 @@ public class DestroyVMCmd extends BaseAsyncCmd {
|
|||||||
required=true, description="The ID of the virtual machine")
|
required=true, description="The ID of the virtual machine")
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
|
|
||||||
|
@Parameter(name=ApiConstants.EXPUNGE, type=CommandType.BOOLEAN,
|
||||||
|
description="If true is passed, the vm is expunged immediately. False by default. Parameter can be passed to the call by ROOT/Domain admin only", since="4.2.1")
|
||||||
|
private Boolean expunge;
|
||||||
|
|
||||||
/////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////
|
||||||
/////////////////// Accessors ///////////////////////
|
/////////////////// Accessors ///////////////////////
|
||||||
/////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////
|
||||||
@ -57,6 +62,13 @@ public class DestroyVMCmd extends BaseAsyncCmd {
|
|||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean getExpunge() {
|
||||||
|
if (expunge == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return expunge;
|
||||||
|
}
|
||||||
|
|
||||||
/////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////
|
||||||
/////////////// API Implementation///////////////////
|
/////////////// API Implementation///////////////////
|
||||||
/////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////
|
||||||
@ -97,11 +109,14 @@ public class DestroyVMCmd extends BaseAsyncCmd {
|
|||||||
@Override
|
@Override
|
||||||
public void execute() throws ResourceUnavailableException, ConcurrentOperationException{
|
public void execute() throws ResourceUnavailableException, ConcurrentOperationException{
|
||||||
CallContext.current().setEventDetails("Vm Id: "+getId());
|
CallContext.current().setEventDetails("Vm Id: "+getId());
|
||||||
UserVm result;
|
UserVm result = _userVmService.destroyVm(this);
|
||||||
result = _userVmService.destroyVm(this);
|
|
||||||
|
|
||||||
|
UserVmResponse response = new UserVmResponse();
|
||||||
if (result != null) {
|
if (result != null) {
|
||||||
UserVmResponse response = _responseGenerator.createUserVmResponse("virtualmachine", result).get(0);
|
List<UserVmResponse> responses = _responseGenerator.createUserVmResponse("virtualmachine", result);
|
||||||
|
if (responses != null && !responses.isEmpty()) {
|
||||||
|
response = responses.get(0);
|
||||||
|
}
|
||||||
response.setResponseName("virtualmachine");
|
response.setResponseName("virtualmachine");
|
||||||
this.setResponseObject(response);
|
this.setResponseObject(response);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -71,7 +71,7 @@ public class AddResourceDetailCmd extends BaseAsyncCmd {
|
|||||||
return detailsMap;
|
return detailsMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ResourceTag.TaggedResourceType getResourceType() {
|
public ResourceTag.ResourceObjectType getResourceType() {
|
||||||
return _taggedResourceService.getResourceType(resourceType);
|
return _taggedResourceService.getResourceType(resourceType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -17,7 +17,8 @@
|
|||||||
|
|
||||||
package org.apache.cloudstack.api.command.user.volume;
|
package org.apache.cloudstack.api.command.user.volume;
|
||||||
|
|
||||||
import com.cloud.server.ResourceTag;
|
import java.util.List;
|
||||||
|
|
||||||
import org.apache.cloudstack.api.APICommand;
|
import org.apache.cloudstack.api.APICommand;
|
||||||
import org.apache.cloudstack.api.ApiConstants;
|
import org.apache.cloudstack.api.ApiConstants;
|
||||||
import org.apache.cloudstack.api.BaseListProjectAndAccountResourcesCmd;
|
import org.apache.cloudstack.api.BaseListProjectAndAccountResourcesCmd;
|
||||||
@ -25,39 +26,26 @@ import org.apache.cloudstack.api.Parameter;
|
|||||||
import org.apache.cloudstack.api.response.ListResponse;
|
import org.apache.cloudstack.api.response.ListResponse;
|
||||||
import org.apache.cloudstack.api.response.ResourceDetailResponse;
|
import org.apache.cloudstack.api.response.ResourceDetailResponse;
|
||||||
import org.apache.cloudstack.api.response.ResourceTagResponse;
|
import org.apache.cloudstack.api.response.ResourceTagResponse;
|
||||||
|
import org.apache.cloudstack.context.CallContext;
|
||||||
|
|
||||||
import java.util.List;
|
import com.cloud.server.ResourceTag;
|
||||||
|
|
||||||
@APICommand(name = "listResourceDetails", description = "List resource detail(s)", responseObject = ResourceTagResponse.class, since = "4.2")
|
@APICommand(name = "listResourceDetails", description = "List resource detail(s)", responseObject = ResourceTagResponse.class, since = "4.2")
|
||||||
public class ListResourceDetailsCmd extends BaseListProjectAndAccountResourcesCmd{
|
public class ListResourceDetailsCmd extends BaseListProjectAndAccountResourcesCmd{
|
||||||
private static final String s_name = "listresourcedetailsresponse";
|
private static final String s_name = "listresourcedetailsresponse";
|
||||||
|
|
||||||
@Parameter(name=ApiConstants.RESOURCE_TYPE, type=CommandType.STRING, description="list by resource type")
|
@Parameter(name=ApiConstants.RESOURCE_TYPE, type=CommandType.STRING, description="list by resource type", required=true)
|
||||||
private String resourceType;
|
private String resourceType;
|
||||||
|
|
||||||
@Parameter(name=ApiConstants.RESOURCE_ID, type=CommandType.STRING, description="list by resource id")
|
@Parameter(name=ApiConstants.RESOURCE_ID, type=CommandType.STRING, description="list by resource id", required=true)
|
||||||
private String resourceId;
|
private String resourceId;
|
||||||
|
|
||||||
@Parameter(name=ApiConstants.KEY, type=CommandType.STRING, description="list by key")
|
@Parameter(name=ApiConstants.KEY, type=CommandType.STRING, description="list by key")
|
||||||
private String key;
|
private String key;
|
||||||
|
|
||||||
/////////////////////////////////////////////////////
|
@Parameter(name=ApiConstants.FOR_DISPLAY, type=CommandType.BOOLEAN, description="if set to true, only details marked with display=true, are returned." +
|
||||||
/////////////////// Accessors ///////////////////////
|
" Always false is the call is made by the regular user", since="4.3")
|
||||||
/////////////////////////////////////////////////////
|
private Boolean forDisplay;
|
||||||
|
|
||||||
@Override
|
|
||||||
public void execute() {
|
|
||||||
|
|
||||||
ListResponse<ResourceDetailResponse> response = new ListResponse<ResourceDetailResponse>();
|
|
||||||
List<ResourceDetailResponse> resourceDetailResponse = _queryService.listResource(this);
|
|
||||||
response.setResponses(resourceDetailResponse);
|
|
||||||
response.setResponseName(getCommandName());
|
|
||||||
this.setResponseObject(response);
|
|
||||||
}
|
|
||||||
|
|
||||||
public ResourceTag.TaggedResourceType getResourceType() {
|
|
||||||
return _taggedResourceService.getResourceType(resourceType);
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getResourceId() {
|
public String getResourceId() {
|
||||||
return resourceId;
|
return resourceId;
|
||||||
@ -72,4 +60,32 @@ public class ListResourceDetailsCmd extends BaseListProjectAndAccountResourcesCm
|
|||||||
return s_name;
|
return s_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Boolean forDisplay() {
|
||||||
|
if (!_accountService.isAdmin(CallContext.current().getCallingAccount().getType())) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return forDisplay;
|
||||||
|
}
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////
|
||||||
|
/////////////////// Accessors ///////////////////////
|
||||||
|
/////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void execute() {
|
||||||
|
|
||||||
|
ListResponse<ResourceDetailResponse> response = new ListResponse<ResourceDetailResponse>();
|
||||||
|
List<ResourceDetailResponse> resourceDetailResponse = _queryService.listResourceDetails(this);
|
||||||
|
response.setResponses(resourceDetailResponse);
|
||||||
|
response.setResponseName(getCommandName());
|
||||||
|
this.setResponseObject(response);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ResourceTag.ResourceObjectType getResourceType() {
|
||||||
|
return _taggedResourceService.getResourceType(resourceType);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,32 +16,21 @@
|
|||||||
// under the License.
|
// under the License.
|
||||||
package org.apache.cloudstack.api.command.user.volume;
|
package org.apache.cloudstack.api.command.user.volume;
|
||||||
|
|
||||||
import com.cloud.server.ResourceTag;
|
|
||||||
|
|
||||||
import org.apache.cloudstack.api.APICommand;
|
import org.apache.cloudstack.api.APICommand;
|
||||||
import org.apache.cloudstack.api.ApiCommandJobType;
|
import org.apache.cloudstack.api.ApiCommandJobType;
|
||||||
import org.apache.cloudstack.api.ApiConstants;
|
import org.apache.cloudstack.api.ApiConstants;
|
||||||
import org.apache.cloudstack.api.ApiErrorCode;
|
|
||||||
import org.apache.cloudstack.api.BaseAsyncCmd;
|
import org.apache.cloudstack.api.BaseAsyncCmd;
|
||||||
import org.apache.cloudstack.api.Parameter;
|
import org.apache.cloudstack.api.Parameter;
|
||||||
import org.apache.cloudstack.api.ServerApiException;
|
|
||||||
import org.apache.cloudstack.api.response.SuccessResponse;
|
import org.apache.cloudstack.api.response.SuccessResponse;
|
||||||
import org.apache.cloudstack.api.response.UserVmResponse;
|
|
||||||
import org.apache.cloudstack.api.response.VolumeResponse;
|
|
||||||
import org.apache.cloudstack.context.CallContext;
|
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
import com.cloud.event.EventTypes;
|
import com.cloud.event.EventTypes;
|
||||||
import com.cloud.storage.Volume;
|
import com.cloud.server.ResourceTag;
|
||||||
import com.cloud.user.Account;
|
|
||||||
|
|
||||||
import java.util.*;
|
|
||||||
|
|
||||||
@APICommand(name = "removeResourceDetail", description="Removes detail for the Resource.", responseObject=SuccessResponse.class)
|
@APICommand(name = "removeResourceDetail", description="Removes detail for the Resource.", responseObject=SuccessResponse.class)
|
||||||
public class RemoveResourceDetailCmd extends BaseAsyncCmd {
|
public class RemoveResourceDetailCmd extends BaseAsyncCmd {
|
||||||
public static final Logger s_logger = Logger.getLogger(RemoveResourceDetailCmd.class.getName());
|
public static final Logger s_logger = Logger.getLogger(RemoveResourceDetailCmd.class.getName());
|
||||||
private static final String s_name = "RemoveResourceDetailresponse";
|
private static final String s_name = "removeresourcedetailresponse";
|
||||||
|
|
||||||
/////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////
|
||||||
//////////////// API parameters /////////////////////
|
//////////////// API parameters /////////////////////
|
||||||
@ -62,7 +51,7 @@ public class RemoveResourceDetailCmd extends BaseAsyncCmd {
|
|||||||
/////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
public ResourceTag.TaggedResourceType getResourceType(){
|
public ResourceTag.ResourceObjectType getResourceType(){
|
||||||
return _taggedResourceService.getResourceType(resourceType);
|
return _taggedResourceService.getResourceType(resourceType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -23,33 +23,40 @@ import org.apache.cloudstack.api.ApiErrorCode;
|
|||||||
import org.apache.cloudstack.api.BaseAsyncCmd;
|
import org.apache.cloudstack.api.BaseAsyncCmd;
|
||||||
import org.apache.cloudstack.api.Parameter;
|
import org.apache.cloudstack.api.Parameter;
|
||||||
import org.apache.cloudstack.api.ServerApiException;
|
import org.apache.cloudstack.api.ServerApiException;
|
||||||
import org.apache.cloudstack.api.response.UserVmResponse;
|
import org.apache.cloudstack.api.response.StoragePoolResponse;
|
||||||
import org.apache.cloudstack.api.response.VolumeResponse;
|
import org.apache.cloudstack.api.response.VolumeResponse;
|
||||||
import org.apache.cloudstack.context.CallContext;
|
import org.apache.cloudstack.context.CallContext;
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
import com.cloud.event.EventTypes;
|
import com.cloud.event.EventTypes;
|
||||||
|
import com.cloud.exception.InvalidParameterValueException;
|
||||||
import com.cloud.storage.Volume;
|
import com.cloud.storage.Volume;
|
||||||
import com.cloud.user.Account;
|
|
||||||
|
|
||||||
@APICommand(name = "updateVolume", description="Updates the volume.", responseObject=VolumeResponse.class)
|
@APICommand(name = "updateVolume", description="Updates the volume.", responseObject=VolumeResponse.class)
|
||||||
public class UpdateVolumeCmd extends BaseAsyncCmd {
|
public class UpdateVolumeCmd extends BaseAsyncCmd {
|
||||||
public static final Logger s_logger = Logger.getLogger(UpdateVolumeCmd.class.getName());
|
public static final Logger s_logger = Logger.getLogger(UpdateVolumeCmd.class.getName());
|
||||||
private static final String s_name = "addVolumeresponse";
|
private static final String s_name = "updatevolumeresponse";
|
||||||
|
|
||||||
/////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////
|
||||||
//////////////// API parameters /////////////////////
|
//////////////// API parameters /////////////////////
|
||||||
/////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////
|
||||||
|
|
||||||
@Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType=VolumeResponse.class,
|
@Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType=VolumeResponse.class, description="the ID of the disk volume")
|
||||||
required=true, description="the ID of the disk volume")
|
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
@Parameter(name=ApiConstants.PATH, type=CommandType.STRING,
|
@Parameter(name=ApiConstants.PATH, type=CommandType.STRING, description="The path of the volume")
|
||||||
required=true, description="the path of the volume")
|
|
||||||
private String path;
|
private String path;
|
||||||
|
|
||||||
|
@Parameter(name=ApiConstants.STORAGE_ID, type=CommandType.UUID, entityType=StoragePoolResponse.class,
|
||||||
|
description="Destination storage pool UUID for the volume", since="4.3")
|
||||||
|
private Long storageId;
|
||||||
|
|
||||||
|
@Parameter(name=ApiConstants.STATE, type=CommandType.STRING, description="The state of the volume", since="4.3")
|
||||||
|
private String state;
|
||||||
|
|
||||||
|
@Parameter(name=ApiConstants.DISPLAY_VOLUME, type=CommandType.BOOLEAN, description="an optional field, whether to the display the volume to the end user or not.")
|
||||||
|
private Boolean displayVolume;
|
||||||
|
|
||||||
/////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////
|
||||||
/////////////////// Accessors ///////////////////////
|
/////////////////// Accessors ///////////////////////
|
||||||
/////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////
|
||||||
@ -62,6 +69,18 @@ public class UpdateVolumeCmd extends BaseAsyncCmd {
|
|||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Long getStorageId() {
|
||||||
|
return storageId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getState() {
|
||||||
|
return state;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean getDisplayVolume() {
|
||||||
|
return displayVolume;
|
||||||
|
}
|
||||||
|
|
||||||
/////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////
|
||||||
/////////////// API Implementation///////////////////
|
/////////////// API Implementation///////////////////
|
||||||
/////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////
|
||||||
@ -83,25 +102,37 @@ public class UpdateVolumeCmd extends BaseAsyncCmd {
|
|||||||
public long getEntityOwnerId() {
|
public long getEntityOwnerId() {
|
||||||
Volume volume = _responseGenerator.findVolumeById(getId());
|
Volume volume = _responseGenerator.findVolumeById(getId());
|
||||||
if (volume == null) {
|
if (volume == null) {
|
||||||
return Account.ACCOUNT_ID_SYSTEM; // bad id given, parent this command to SYSTEM so ERROR events are tracked
|
throw new InvalidParameterValueException("Invalid volume id was provided");
|
||||||
}
|
}
|
||||||
return volume.getAccountId();
|
return volume.getAccountId();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getEventType() {
|
public String getEventType() {
|
||||||
return EventTypes.EVENT_VOLUME_ATTACH;
|
return EventTypes.EVENT_VOLUME_UPDATE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getEventDescription() {
|
public String getEventDescription() {
|
||||||
return "adding detail to the volume: " + getId();
|
StringBuilder desc = new StringBuilder("Updating volume: ");
|
||||||
|
desc.append(getId()).append(" with");
|
||||||
|
if (getPath() != null) {
|
||||||
|
desc.append(" path " + getPath());
|
||||||
|
}
|
||||||
|
if (getStorageId() != null) {
|
||||||
|
desc.append(", storage id " + getStorageId());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (getState() != null) {
|
||||||
|
desc.append(", state " + getState());
|
||||||
|
}
|
||||||
|
return desc.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(){
|
public void execute(){
|
||||||
CallContext.current().setEventDetails("Volume Id: "+getId());
|
CallContext.current().setEventDetails("Volume Id: "+getId());
|
||||||
Volume result = _volumeService.updateVolume(this);
|
Volume result = _volumeService.updateVolume(getId(), getPath(), getState(), getStorageId(), getDisplayVolume());
|
||||||
if (result != null) {
|
if (result != null) {
|
||||||
VolumeResponse response = _responseGenerator.createVolumeResponse(result);
|
VolumeResponse response = _responseGenerator.createVolumeResponse(result);
|
||||||
response.setResponseName(getCommandName());
|
response.setResponseName(getCommandName());
|
||||||
|
|||||||
@ -126,25 +126,10 @@ public class CreateRemoteAccessVpnCmd extends BaseAsyncCreateCmd {
|
|||||||
return EventTypes.EVENT_REMOTE_ACCESS_VPN_CREATE;
|
return EventTypes.EVENT_REMOTE_ACCESS_VPN_CREATE;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long getNetworkId() {
|
|
||||||
IpAddress ip = _entityMgr.findById(IpAddress.class, getPublicIpId());
|
|
||||||
Long ntwkId = null;
|
|
||||||
|
|
||||||
if (ip.getAssociatedWithNetworkId() != null) {
|
|
||||||
ntwkId = ip.getAssociatedWithNetworkId();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ntwkId == null) {
|
|
||||||
throw new InvalidParameterValueException("Unable to create remote access vpn for the ipAddress id=" + getPublicIpId() +
|
|
||||||
" as ip is not associated with any network and no networkId is passed in");
|
|
||||||
}
|
|
||||||
return ntwkId;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void create() {
|
public void create() {
|
||||||
try {
|
try {
|
||||||
RemoteAccessVpn vpn = _ravService.createRemoteAccessVpn(publicIpId, ipRange, getOpenFirewall(), getNetworkId());
|
RemoteAccessVpn vpn = _ravService.createRemoteAccessVpn(publicIpId, ipRange, getOpenFirewall());
|
||||||
if (vpn != null) {
|
if (vpn != null) {
|
||||||
this.setEntityId(vpn.getServerAddressId());
|
this.setEntityId(vpn.getServerAddressId());
|
||||||
// find uuid for server ip address
|
// find uuid for server ip address
|
||||||
|
|||||||
@ -16,21 +16,21 @@
|
|||||||
// under the License.
|
// under the License.
|
||||||
package org.apache.cloudstack.api.command.user.zone;
|
package org.apache.cloudstack.api.command.user.zone;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.HashMap;
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import org.apache.cloudstack.api.APICommand;
|
import org.apache.cloudstack.api.APICommand;
|
||||||
import org.apache.cloudstack.api.ApiConstants;
|
import org.apache.cloudstack.api.ApiConstants;
|
||||||
import org.apache.cloudstack.api.BaseListCmd;
|
import org.apache.cloudstack.api.BaseListCmd;
|
||||||
import org.apache.cloudstack.api.Parameter;
|
import org.apache.cloudstack.api.Parameter;
|
||||||
import org.apache.cloudstack.api.BaseCmd.CommandType;
|
|
||||||
import org.apache.cloudstack.api.response.DomainResponse;
|
import org.apache.cloudstack.api.response.DomainResponse;
|
||||||
import org.apache.cloudstack.api.response.ListResponse;
|
import org.apache.cloudstack.api.response.ListResponse;
|
||||||
import org.apache.cloudstack.api.response.ServiceOfferingResponse;
|
|
||||||
import org.apache.cloudstack.api.response.ZoneResponse;
|
import org.apache.cloudstack.api.response.ZoneResponse;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
import com.cloud.dc.DataCenter;
|
import com.cloud.exception.InvalidParameterValueException;
|
||||||
|
|
||||||
@APICommand(name = "listZones", description="Lists zones", responseObject=ZoneResponse.class)
|
@APICommand(name = "listZones", description="Lists zones", responseObject=ZoneResponse.class)
|
||||||
public class ListZonesByCmd extends BaseListCmd {
|
public class ListZonesByCmd extends BaseListCmd {
|
||||||
@ -63,6 +63,9 @@ public class ListZonesByCmd extends BaseListCmd {
|
|||||||
@Parameter(name=ApiConstants.SHOW_CAPACITIES, type=CommandType.BOOLEAN, description="flag to display the capacity of the zones")
|
@Parameter(name=ApiConstants.SHOW_CAPACITIES, type=CommandType.BOOLEAN, description="flag to display the capacity of the zones")
|
||||||
private Boolean showCapacities;
|
private Boolean showCapacities;
|
||||||
|
|
||||||
|
@Parameter(name = ApiConstants.TAGS, type = CommandType.MAP, description = "List zones by resource tags (key/value pairs)", since="4.3")
|
||||||
|
private Map tags;
|
||||||
|
|
||||||
/////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////
|
||||||
/////////////////// Accessors ///////////////////////
|
/////////////////// Accessors ///////////////////////
|
||||||
/////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////
|
||||||
@ -91,6 +94,25 @@ public class ListZonesByCmd extends BaseListCmd {
|
|||||||
return showCapacities;
|
return showCapacities;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Map<String, String> getTags() {
|
||||||
|
Map<String, String> tagsMap = null;
|
||||||
|
if (tags != null && !tags.isEmpty()) {
|
||||||
|
tagsMap = new HashMap<String, String>();
|
||||||
|
Collection<?> servicesCollection = tags.values();
|
||||||
|
Iterator<?> iter = servicesCollection.iterator();
|
||||||
|
while (iter.hasNext()) {
|
||||||
|
HashMap<String, String> services = (HashMap<String, String>) iter.next();
|
||||||
|
String key = services.get("key");
|
||||||
|
String value = services.get("value");
|
||||||
|
if (value == null) {
|
||||||
|
throw new InvalidParameterValueException("No value is passed in for key " + key);
|
||||||
|
}
|
||||||
|
tagsMap.put(key, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return tagsMap;
|
||||||
|
}
|
||||||
|
|
||||||
/////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////
|
||||||
/////////////// API Implementation///////////////////
|
/////////////// API Implementation///////////////////
|
||||||
/////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////
|
||||||
|
|||||||
@ -0,0 +1,41 @@
|
|||||||
|
// 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.response;
|
||||||
|
|
||||||
|
import com.cloud.serializer.Param;
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
|
public class CreateSSHKeyPairResponse extends SSHKeyPairResponse {
|
||||||
|
|
||||||
|
@SerializedName("privatekey") @Param(description="Private key")
|
||||||
|
private String privateKey;
|
||||||
|
|
||||||
|
public CreateSSHKeyPairResponse() {}
|
||||||
|
|
||||||
|
public CreateSSHKeyPairResponse(String name, String fingerprint, String privateKey) {
|
||||||
|
super(name, fingerprint);
|
||||||
|
this.privateKey = privateKey;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPrivateKey() {
|
||||||
|
return privateKey;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPrivateKey(String privateKey) {
|
||||||
|
this.privateKey = privateKey;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -16,14 +16,8 @@
|
|||||||
// under the License.
|
// under the License.
|
||||||
package org.apache.cloudstack.api.response;
|
package org.apache.cloudstack.api.response;
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.LinkedHashSet;
|
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
import org.apache.cloudstack.api.ApiConstants;
|
import org.apache.cloudstack.api.ApiConstants;
|
||||||
import org.apache.cloudstack.api.BaseResponse;
|
import org.apache.cloudstack.api.BaseResponse;
|
||||||
import org.apache.cloudstack.api.EntityReference;
|
|
||||||
|
|
||||||
import com.cloud.serializer.Param;
|
import com.cloud.serializer.Param;
|
||||||
import com.google.gson.annotations.SerializedName;
|
import com.google.gson.annotations.SerializedName;
|
||||||
@ -47,6 +41,11 @@ public class ResourceDetailResponse extends BaseResponse{
|
|||||||
@Param(description = "value of the resource detail")
|
@Param(description = "value of the resource detail")
|
||||||
private String value;
|
private String value;
|
||||||
|
|
||||||
|
|
||||||
|
@SerializedName(ApiConstants.FOR_DISPLAY)
|
||||||
|
@Param(description = "if detail is returned to the regular user", since="4.3")
|
||||||
|
private boolean forDisplay;
|
||||||
|
|
||||||
public String getResourceId() {
|
public String getResourceId() {
|
||||||
return resourceId;
|
return resourceId;
|
||||||
}
|
}
|
||||||
@ -78,4 +77,8 @@ public class ResourceDetailResponse extends BaseResponse{
|
|||||||
public void setValue(String value) {
|
public void setValue(String value) {
|
||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setForDisplay(boolean forDisplay) {
|
||||||
|
this.forDisplay = forDisplay;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -30,19 +30,11 @@ public class SSHKeyPairResponse extends BaseResponse {
|
|||||||
@SerializedName("fingerprint") @Param(description="Fingerprint of the public key")
|
@SerializedName("fingerprint") @Param(description="Fingerprint of the public key")
|
||||||
private String fingerprint;
|
private String fingerprint;
|
||||||
|
|
||||||
@SerializedName("privatekey") @Param(description="Private key")
|
|
||||||
private String privateKey;
|
|
||||||
|
|
||||||
public SSHKeyPairResponse() {}
|
public SSHKeyPairResponse() {}
|
||||||
|
|
||||||
public SSHKeyPairResponse(String name, String fingerprint) {
|
public SSHKeyPairResponse(String name, String fingerprint) {
|
||||||
this(name, fingerprint, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
public SSHKeyPairResponse(String name, String fingerprint, String privateKey) {
|
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.fingerprint = fingerprint;
|
this.fingerprint = fingerprint;
|
||||||
this.privateKey = privateKey;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
@ -61,12 +53,4 @@ public class SSHKeyPairResponse extends BaseResponse {
|
|||||||
this.fingerprint = fingerprint;
|
this.fingerprint = fingerprint;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getPrivateKey() {
|
|
||||||
return privateKey;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPrivateKey(String privateKey) {
|
|
||||||
this.privateKey = privateKey;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -17,19 +17,15 @@
|
|||||||
package org.apache.cloudstack.api.response;
|
package org.apache.cloudstack.api.response;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
import com.google.gson.annotations.SerializedName;
|
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
||||||
import org.apache.cloudstack.api.ApiConstants;
|
import org.apache.cloudstack.api.ApiConstants;
|
||||||
import org.apache.cloudstack.api.BaseResponse;
|
import org.apache.cloudstack.api.BaseResponse;
|
||||||
import org.apache.cloudstack.api.EntityReference;
|
import org.apache.cloudstack.api.EntityReference;
|
||||||
|
|
||||||
import com.cloud.offering.ServiceOffering;
|
import com.cloud.offering.ServiceOffering;
|
||||||
import com.cloud.serializer.Param;
|
import com.cloud.serializer.Param;
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
@EntityReference(value = ServiceOffering.class)
|
@EntityReference(value = ServiceOffering.class)
|
||||||
public class ServiceOfferingResponse extends BaseResponse {
|
public class ServiceOfferingResponse extends BaseResponse {
|
||||||
@ -109,6 +105,10 @@ public class ServiceOfferingResponse extends BaseResponse {
|
|||||||
@Param(description = "additional key/value details tied with this service offering", since = "4.2.0")
|
@Param(description = "additional key/value details tied with this service offering", since = "4.2.0")
|
||||||
private Map<String, String> details;
|
private Map<String, String> details;
|
||||||
|
|
||||||
|
|
||||||
|
public ServiceOfferingResponse(){
|
||||||
|
}
|
||||||
|
|
||||||
public String getId() {
|
public String getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
@ -287,4 +287,5 @@ public class ServiceOfferingResponse extends BaseResponse {
|
|||||||
public void setDetails(Map<String, String> details) {
|
public void setDetails(Map<String, String> details) {
|
||||||
this.details = details;
|
this.details = details;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -26,18 +26,8 @@ import org.apache.cloudstack.api.EntityReference;
|
|||||||
import com.cloud.serializer.Param;
|
import com.cloud.serializer.Param;
|
||||||
import com.cloud.storage.Snapshot;
|
import com.cloud.storage.Snapshot;
|
||||||
import com.google.gson.annotations.SerializedName;
|
import com.google.gson.annotations.SerializedName;
|
||||||
import com.cloud.serializer.Param;
|
|
||||||
import com.cloud.storage.Snapshot;
|
|
||||||
import com.google.gson.annotations.SerializedName;
|
|
||||||
import org.apache.cloudstack.api.ApiConstants;
|
|
||||||
import org.apache.cloudstack.api.BaseResponse;
|
|
||||||
import org.apache.cloudstack.api.EntityReference;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@EntityReference(value=Snapshot.class)
|
@EntityReference(value=Snapshot.class)
|
||||||
@SuppressWarnings("unused")
|
|
||||||
public class SnapshotResponse extends BaseResponse implements ControlledEntityResponse {
|
public class SnapshotResponse extends BaseResponse implements ControlledEntityResponse {
|
||||||
@SerializedName(ApiConstants.ID)
|
@SerializedName(ApiConstants.ID)
|
||||||
@Param(description = "ID of the snapshot")
|
@Param(description = "ID of the snapshot")
|
||||||
@ -100,6 +90,9 @@ public class SnapshotResponse extends BaseResponse implements ControlledEntityRe
|
|||||||
@SerializedName(ApiConstants.TAGS) @Param(description="the list of resource tags associated with snapshot", responseObject = ResourceTagResponse.class)
|
@SerializedName(ApiConstants.TAGS) @Param(description="the list of resource tags associated with snapshot", responseObject = ResourceTagResponse.class)
|
||||||
private List<ResourceTagResponse> tags;
|
private List<ResourceTagResponse> tags;
|
||||||
|
|
||||||
|
@SerializedName(ApiConstants.REVERTABLE)
|
||||||
|
@Param(description="indicates whether the underlying storage supports reverting the volume to this snapshot")
|
||||||
|
private boolean revertable;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getObjectId() {
|
public String getObjectId() {
|
||||||
@ -118,6 +111,7 @@ public class SnapshotResponse extends BaseResponse implements ControlledEntityRe
|
|||||||
return accountName;
|
return accountName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void setAccountName(String accountName) {
|
public void setAccountName(String accountName) {
|
||||||
this.accountName = accountName;
|
this.accountName = accountName;
|
||||||
}
|
}
|
||||||
@ -131,6 +125,7 @@ public class SnapshotResponse extends BaseResponse implements ControlledEntityRe
|
|||||||
this.domainId = domainId;
|
this.domainId = domainId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void setDomainName(String domainName) {
|
public void setDomainName(String domainName) {
|
||||||
this.domainName = domainName;
|
this.domainName = domainName;
|
||||||
}
|
}
|
||||||
@ -184,4 +179,12 @@ public class SnapshotResponse extends BaseResponse implements ControlledEntityRe
|
|||||||
public void setTags(List<ResourceTagResponse> tags) {
|
public void setTags(List<ResourceTagResponse> tags) {
|
||||||
this.tags = tags;
|
this.tags = tags;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isRevertable() {
|
||||||
|
return revertable;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRevertable(boolean revertable) {
|
||||||
|
this.revertable = revertable;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -18,6 +18,7 @@ package org.apache.cloudstack.api.response;
|
|||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.LinkedHashSet;
|
import java.util.LinkedHashSet;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import org.apache.cloudstack.affinity.AffinityGroupResponse;
|
import org.apache.cloudstack.affinity.AffinityGroupResponse;
|
||||||
@ -178,6 +179,9 @@ public class UserVmResponse extends BaseResponse implements ControlledEntityResp
|
|||||||
@SerializedName(ApiConstants.TAGS) @Param(description="the list of resource tags associated with vm", responseObject = ResourceTagResponse.class)
|
@SerializedName(ApiConstants.TAGS) @Param(description="the list of resource tags associated with vm", responseObject = ResourceTagResponse.class)
|
||||||
private Set<ResourceTagResponse> tags;
|
private Set<ResourceTagResponse> tags;
|
||||||
|
|
||||||
|
@SerializedName(ApiConstants.DETAILS) @Param(description="Template details in key/value pairs.", since="4.2.1")
|
||||||
|
private Map details;
|
||||||
|
|
||||||
@SerializedName(ApiConstants.SSH_KEYPAIR) @Param(description="ssh key-pair")
|
@SerializedName(ApiConstants.SSH_KEYPAIR) @Param(description="ssh key-pair")
|
||||||
private String keyPairName;
|
private String keyPairName;
|
||||||
|
|
||||||
@ -654,4 +658,7 @@ public class UserVmResponse extends BaseResponse implements ControlledEntityResp
|
|||||||
this.serviceState = state;
|
this.serviceState = state;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setDetails(Map details) {
|
||||||
|
this.details = details;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -17,7 +17,6 @@
|
|||||||
package org.apache.cloudstack.api.response;
|
package org.apache.cloudstack.api.response;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.LinkedHashSet;
|
import java.util.LinkedHashSet;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
@ -178,12 +177,30 @@ public class VolumeResponse extends BaseResponse implements ControlledViewEntity
|
|||||||
@Param(description="the status of the volume")
|
@Param(description="the status of the volume")
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
@SerializedName(ApiConstants.TAGS) @Param(description="the list of resource tags associated with volume", responseObject = ResourceTagResponse.class)
|
@SerializedName(ApiConstants.TAGS)
|
||||||
|
@Param(description="the list of resource tags associated with volume", responseObject = ResourceTagResponse.class)
|
||||||
private Set<ResourceTagResponse> tags;
|
private Set<ResourceTagResponse> tags;
|
||||||
|
|
||||||
@SerializedName(ApiConstants.DISPLAY_VOLUME) @Param(description="an optional field whether to the display the volume to the end user or not.")
|
@SerializedName(ApiConstants.DISPLAY_VOLUME)
|
||||||
|
@Param(description="an optional field whether to the display the volume to the end user or not.")
|
||||||
private Boolean displayVm;
|
private Boolean displayVm;
|
||||||
|
|
||||||
|
@SerializedName(ApiConstants.PATH)
|
||||||
|
@Param(description="The path of the volume")
|
||||||
|
private String path;
|
||||||
|
|
||||||
|
@SerializedName(ApiConstants.STORAGE_ID)
|
||||||
|
@Param(description = "id of the primary storage hosting the disk volume; returned to admin user only", since="4.3")
|
||||||
|
private String storagePoolId;
|
||||||
|
|
||||||
|
public String getPath() {
|
||||||
|
return path;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPath(String path) {
|
||||||
|
this.path = path;
|
||||||
|
}
|
||||||
|
|
||||||
public VolumeResponse(){
|
public VolumeResponse(){
|
||||||
tags = new LinkedHashSet<ResourceTagResponse>();
|
tags = new LinkedHashSet<ResourceTagResponse>();
|
||||||
}
|
}
|
||||||
@ -388,4 +405,7 @@ public class VolumeResponse extends BaseResponse implements ControlledViewEntity
|
|||||||
this.displayVm = displayVm;
|
this.displayVm = displayVm;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setStoragePoolId(String storagePoolId) {
|
||||||
|
this.storagePoolId = storagePoolId;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,7 +16,10 @@
|
|||||||
// under the License.
|
// under the License.
|
||||||
package org.apache.cloudstack.api.response;
|
package org.apache.cloudstack.api.response;
|
||||||
|
|
||||||
|
import java.util.LinkedHashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
import org.apache.cloudstack.api.ApiConstants;
|
import org.apache.cloudstack.api.ApiConstants;
|
||||||
import org.apache.cloudstack.api.BaseResponse;
|
import org.apache.cloudstack.api.BaseResponse;
|
||||||
@ -99,6 +102,19 @@ public class ZoneResponse extends BaseResponse {
|
|||||||
@SerializedName(ApiConstants.LOCAL_STORAGE_ENABLED) @Param(description="true if local storage offering enabled, false otherwise")
|
@SerializedName(ApiConstants.LOCAL_STORAGE_ENABLED) @Param(description="true if local storage offering enabled, false otherwise")
|
||||||
private boolean localStorageEnabled;
|
private boolean localStorageEnabled;
|
||||||
|
|
||||||
|
@SerializedName(ApiConstants.TAGS) @Param(description="the list of resource tags associated with zone.",
|
||||||
|
responseObject = ResourceTagResponse.class, since="4.3")
|
||||||
|
private Set<ResourceTagResponse> tags;
|
||||||
|
|
||||||
|
@SerializedName(ApiConstants.RESOURCE_DETAILS)
|
||||||
|
@Param(description = "Meta data associated with the zone (key/value pairs)", since = "4.3.0")
|
||||||
|
private Map<String, String> resourceDetails;
|
||||||
|
|
||||||
|
|
||||||
|
public ZoneResponse(){
|
||||||
|
tags = new LinkedHashSet<ResourceTagResponse>();
|
||||||
|
}
|
||||||
|
|
||||||
public void setId(String id) {
|
public void setId(String id) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
@ -198,4 +214,12 @@ public class ZoneResponse extends BaseResponse {
|
|||||||
public void setIp6Dns2(String ip6Dns2) {
|
public void setIp6Dns2(String ip6Dns2) {
|
||||||
this.ip6Dns2 = ip6Dns2;
|
this.ip6Dns2 = ip6Dns2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void addTag(ResourceTagResponse tag){
|
||||||
|
this.tags.add(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setResourceDetails(Map<String, String> details) {
|
||||||
|
this.resourceDetails = details;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -18,8 +18,10 @@ package org.apache.cloudstack.context;
|
|||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Stack;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
import org.apache.cloudstack.managed.threadlocal.ManagedThreadLocal;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import org.apache.log4j.NDC;
|
import org.apache.log4j.NDC;
|
||||||
|
|
||||||
@ -37,18 +39,27 @@ import com.cloud.utils.exception.CloudRuntimeException;
|
|||||||
*/
|
*/
|
||||||
public class CallContext {
|
public class CallContext {
|
||||||
private static final Logger s_logger = Logger.getLogger(CallContext.class);
|
private static final Logger s_logger = Logger.getLogger(CallContext.class);
|
||||||
private static ThreadLocal<CallContext> s_currentContext = new ThreadLocal<CallContext>();
|
private static ManagedThreadLocal<CallContext> s_currentContext = new ManagedThreadLocal<CallContext>();
|
||||||
|
private static ManagedThreadLocal<Stack<CallContext>> s_currentContextStack =
|
||||||
|
new ManagedThreadLocal<Stack<CallContext>>() {
|
||||||
|
@Override
|
||||||
|
protected Stack<CallContext> initialValue() {
|
||||||
|
return new Stack<CallContext>();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
private String contextId;
|
private String contextId;
|
||||||
private Account account;
|
private Account account;
|
||||||
|
private long accountId;
|
||||||
private long startEventId = 0;
|
private long startEventId = 0;
|
||||||
private String eventDescription;
|
private String eventDescription;
|
||||||
private String eventDetails;
|
private String eventDetails;
|
||||||
private String eventType;
|
private String eventType;
|
||||||
private User user;
|
private User user;
|
||||||
|
private long userId;
|
||||||
private final Map<Object, Object> context = new HashMap<Object, Object>();
|
private final Map<Object, Object> context = new HashMap<Object, Object>();
|
||||||
|
|
||||||
private static EntityManager s_entityMgr;
|
static EntityManager s_entityMgr;
|
||||||
|
|
||||||
public static void init(EntityManager entityMgr) {
|
public static void init(EntityManager entityMgr) {
|
||||||
s_entityMgr = entityMgr;
|
s_entityMgr = entityMgr;
|
||||||
@ -57,9 +68,17 @@ public class CallContext {
|
|||||||
protected CallContext() {
|
protected CallContext() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected CallContext(long userId, long accountId, String contextId) {
|
||||||
|
this.userId = userId;
|
||||||
|
this.accountId = accountId;
|
||||||
|
this.contextId = contextId;
|
||||||
|
}
|
||||||
|
|
||||||
protected CallContext(User user, Account account, String contextId) {
|
protected CallContext(User user, Account account, String contextId) {
|
||||||
this.user = user;
|
this.user = user;
|
||||||
|
this.userId = user.getId();
|
||||||
this.account = account;
|
this.account = account;
|
||||||
|
this.accountId = account.getId();
|
||||||
this.contextId = contextId;
|
this.contextId = contextId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -72,10 +91,13 @@ public class CallContext {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public long getCallingUserId() {
|
public long getCallingUserId() {
|
||||||
return user.getId();
|
return userId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public User getCallingUser() {
|
public User getCallingUser() {
|
||||||
|
if (user == null) {
|
||||||
|
user = s_entityMgr.findById(User.class, userId);
|
||||||
|
}
|
||||||
return user;
|
return user;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -84,6 +106,9 @@ public class CallContext {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Account getCallingAccount() {
|
public Account getCallingAccount() {
|
||||||
|
if (account == null) {
|
||||||
|
account = s_entityMgr.findById(Account.class, accountId);
|
||||||
|
}
|
||||||
return account;
|
return account;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -101,6 +126,10 @@ public class CallContext {
|
|||||||
* @return CallContext
|
* @return CallContext
|
||||||
*/
|
*/
|
||||||
public static CallContext register(User callingUser, Account callingAccount, String contextId) {
|
public static CallContext register(User callingUser, Account callingAccount, String contextId) {
|
||||||
|
return register(callingUser, callingAccount, null, null, contextId);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected static CallContext register(User callingUser, Account callingAccount, Long userId, Long accountId, String contextId) {
|
||||||
/*
|
/*
|
||||||
Unit tests will have multiple times of setup/tear-down call to this, remove assertions to all unit test to run
|
Unit tests will have multiple times of setup/tear-down call to this, remove assertions to all unit test to run
|
||||||
|
|
||||||
@ -109,12 +138,20 @@ public class CallContext {
|
|||||||
throw new CloudRuntimeException("There's a context already so what does this new register context mean? " + s_currentContext.get().toString());
|
throw new CloudRuntimeException("There's a context already so what does this new register context mean? " + s_currentContext.get().toString());
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
CallContext callingContext = new CallContext(callingUser, callingAccount, contextId);
|
CallContext callingContext = null;
|
||||||
|
if (userId == null || accountId == null) {
|
||||||
|
callingContext = new CallContext(callingUser, callingAccount, contextId);
|
||||||
|
} else {
|
||||||
|
callingContext = new CallContext(userId, accountId, contextId);
|
||||||
|
}
|
||||||
s_currentContext.set(callingContext);
|
s_currentContext.set(callingContext);
|
||||||
NDC.push("ctx-" + UuidUtils.first(contextId));
|
NDC.push("ctx-" + UuidUtils.first(contextId));
|
||||||
if (s_logger.isTraceEnabled()) {
|
if (s_logger.isTraceEnabled()) {
|
||||||
s_logger.trace("Registered: " + callingContext);
|
s_logger.trace("Registered: " + callingContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
s_currentContextStack.get().push(callingContext);
|
||||||
|
|
||||||
return callingContext;
|
return callingContext;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -126,14 +163,13 @@ public class CallContext {
|
|||||||
try {
|
try {
|
||||||
CallContext context = s_currentContext.get();
|
CallContext context = s_currentContext.get();
|
||||||
if (context == null) {
|
if (context == null) {
|
||||||
return register(User.UID_SYSTEM, Account.ACCOUNT_ID_SYSTEM);
|
return register(null, null, User.UID_SYSTEM, Account.ACCOUNT_ID_SYSTEM, UUID.randomUUID().toString());
|
||||||
}
|
}
|
||||||
assert context.getCallingUserId() == User.UID_SYSTEM : "You are calling a very specific method that registers a one time system context. This method is meant for background threads that does processing.";
|
assert context.getCallingUserId() == User.UID_SYSTEM : "You are calling a very specific method that registers a one time system context. This method is meant for background threads that does processing.";
|
||||||
return context;
|
return context;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
s_logger.fatal("Exiting the system because we're unable to register the system call context.", e);
|
s_logger.error("Failed to register the system call context.", e);
|
||||||
System.exit(1);
|
throw new CloudRuntimeException("Failed to register system call context", e);
|
||||||
throw new CloudRuntimeException("Should never hit this");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -162,10 +198,15 @@ public class CallContext {
|
|||||||
return register(user, account);
|
return register(user, account);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void unregisterAll() {
|
||||||
|
while ( unregister() != null ) {
|
||||||
|
// NOOP
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static CallContext unregister() {
|
public static CallContext unregister() {
|
||||||
CallContext context = s_currentContext.get();
|
CallContext context = s_currentContext.get();
|
||||||
if (context == null) {
|
if (context == null) {
|
||||||
s_logger.debug("No context to remove");
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
s_currentContext.remove();
|
s_currentContext.remove();
|
||||||
@ -183,6 +224,14 @@ public class CallContext {
|
|||||||
s_logger.trace("Popping from NDC: " + contextId);
|
s_logger.trace("Popping from NDC: " + contextId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Stack<CallContext> stack = s_currentContextStack.get();
|
||||||
|
stack.pop();
|
||||||
|
|
||||||
|
if ( ! stack.isEmpty() ) {
|
||||||
|
s_currentContext.set(stack.peek());
|
||||||
|
}
|
||||||
|
|
||||||
return context;
|
return context;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -195,15 +244,15 @@ public class CallContext {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public long getCallingAccountId() {
|
public long getCallingAccountId() {
|
||||||
return account.getId();
|
return accountId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getCallingAccountUuid() {
|
public String getCallingAccountUuid() {
|
||||||
return account.getUuid();
|
return getCallingAccount().getUuid();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getCallingUserUuid() {
|
public String getCallingUserUuid() {
|
||||||
return user.getUuid();
|
return getCallingUser().getUuid();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setEventDetails(String eventDetails) {
|
public void setEventDetails(String eventDetails) {
|
||||||
@ -240,8 +289,8 @@ public class CallContext {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return new StringBuffer("CCtxt[acct=").append(account.getId())
|
return new StringBuilder("CCtxt[acct=").append(getCallingAccountId())
|
||||||
.append("; user=").append(user.getId())
|
.append("; user=").append(getCallingUserId())
|
||||||
.append("; id=").append(contextId)
|
.append("; id=").append(contextId)
|
||||||
.append("]").toString();
|
.append("]").toString();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,53 @@
|
|||||||
|
/*
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
* distributed with this work for additional information
|
||||||
|
* regarding copyright ownership. The ASF licenses this file
|
||||||
|
* to you under the Apache License, Version 2.0 (the
|
||||||
|
* "License"); you may not use this file except in compliance
|
||||||
|
* with the License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing,
|
||||||
|
* software distributed under the License is distributed on an
|
||||||
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
* KIND, either express or implied. See the License for the
|
||||||
|
* specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
*/
|
||||||
|
package org.apache.cloudstack.context;
|
||||||
|
|
||||||
|
import javax.annotation.PostConstruct;
|
||||||
|
import javax.inject.Inject;
|
||||||
|
|
||||||
|
import org.apache.cloudstack.managed.context.ManagedContextListener;
|
||||||
|
|
||||||
|
import com.cloud.utils.db.EntityManager;
|
||||||
|
|
||||||
|
public class CallContextListener implements ManagedContextListener<Object> {
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
EntityManager entityMgr;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object onEnterContext(boolean reentry) {
|
||||||
|
if ( ! reentry ) {
|
||||||
|
CallContext.registerSystemCallContextOnceOnly();
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onLeaveContext(Object unused, boolean reentry) {
|
||||||
|
if ( ! reentry ) {
|
||||||
|
CallContext.unregisterAll();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostConstruct
|
||||||
|
public void init() {
|
||||||
|
CallContext.init(entityMgr);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -123,7 +123,7 @@ public interface QueryService {
|
|||||||
String affinityGroupType, Long vmId, String accountName, Long domainId, boolean isRecursive,
|
String affinityGroupType, Long vmId, String accountName, Long domainId, boolean isRecursive,
|
||||||
boolean listAll, Long startIndex, Long pageSize);
|
boolean listAll, Long startIndex, Long pageSize);
|
||||||
|
|
||||||
public List<ResourceDetailResponse> listResource(ListResourceDetailsCmd cmd);
|
public List<ResourceDetailResponse> listResourceDetails(ListResourceDetailsCmd cmd);
|
||||||
|
|
||||||
ListResponse<DomainRouterResponse> searchForInternalLbVms(ListInternalLBVMsCmd cmd);
|
ListResponse<DomainRouterResponse> searchForInternalLbVms(ListInternalLBVMsCmd cmd);
|
||||||
|
|
||||||
|
|||||||
@ -16,7 +16,9 @@
|
|||||||
specific language governing permissions and limitations
|
specific language governing permissions and limitations
|
||||||
under the License.
|
under the License.
|
||||||
-->
|
-->
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<artifactId>cloud-awsapi</artifactId>
|
<artifactId>cloud-awsapi</artifactId>
|
||||||
<name>Apache CloudStack AWS API Bridge</name>
|
<name>Apache CloudStack AWS API Bridge</name>
|
||||||
@ -35,7 +37,6 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework</groupId>
|
<groupId>org.springframework</groupId>
|
||||||
<artifactId>spring-web</artifactId>
|
<artifactId>spring-web</artifactId>
|
||||||
<version>${org.springframework.version}</version>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.axis2</groupId>
|
<groupId>org.apache.axis2</groupId>
|
||||||
@ -72,7 +73,6 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>log4j</groupId>
|
<groupId>log4j</groupId>
|
||||||
<artifactId>log4j</artifactId>
|
<artifactId>log4j</artifactId>
|
||||||
<version>${cs.log4j.version}</version>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.cloudstack</groupId>
|
<groupId>org.apache.cloudstack</groupId>
|
||||||
@ -102,17 +102,14 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.google.code.gson</groupId>
|
<groupId>com.google.code.gson</groupId>
|
||||||
<artifactId>gson</artifactId>
|
<artifactId>gson</artifactId>
|
||||||
<version>${cs.gson.version}</version>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>commons-codec</groupId>
|
<groupId>commons-codec</groupId>
|
||||||
<artifactId>commons-codec</artifactId>
|
<artifactId>commons-codec</artifactId>
|
||||||
<version>${cs.codec.version}</version>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>javax.servlet</groupId>
|
<groupId>javax.servlet</groupId>
|
||||||
<artifactId>servlet-api</artifactId>
|
<artifactId>servlet-api</artifactId>
|
||||||
<version>${cs.servlet.version}</version>
|
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
@ -123,7 +120,6 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.jasypt</groupId>
|
<groupId>org.jasypt</groupId>
|
||||||
<artifactId>jasypt</artifactId>
|
<artifactId>jasypt</artifactId>
|
||||||
<version>${cs.jasypt.version}</version>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.caringo.client</groupId>
|
<groupId>com.caringo.client</groupId>
|
||||||
@ -275,6 +271,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.bouncycastle</groupId>
|
<groupId>org.bouncycastle</groupId>
|
||||||
<artifactId>bcprov-jdk16</artifactId>
|
<artifactId>bcprov-jdk16</artifactId>
|
||||||
|
<!-- TODO: do we need this explicit version override? -->
|
||||||
<version>1.45</version>
|
<version>1.45</version>
|
||||||
<scope>runtime</scope>
|
<scope>runtime</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
@ -358,7 +355,6 @@
|
|||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<artifactId>maven-antrun-plugin</artifactId>
|
<artifactId>maven-antrun-plugin</artifactId>
|
||||||
<version>1.7</version>
|
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<id>generate-resource</id>
|
<id>generate-resource</id>
|
||||||
@ -368,17 +364,14 @@
|
|||||||
</goals>
|
</goals>
|
||||||
<configuration>
|
<configuration>
|
||||||
<target>
|
<target>
|
||||||
<copy
|
<copy todir="${basedir}/target/generated-webapp/WEB-INF/classes">
|
||||||
todir="${basedir}/target/generated-webapp/WEB-INF/classes">
|
|
||||||
<fileset dir="${basedir}/conf">
|
<fileset dir="${basedir}/conf">
|
||||||
<include name="*.*"/>
|
<include name="*.*"/>
|
||||||
</fileset>
|
</fileset>
|
||||||
<globmapper from="*.in" to="*"/>
|
<globmapper from="*.in" to="*"/>
|
||||||
<filterchain>
|
<filterchain>
|
||||||
<filterreader
|
<filterreader classname="org.apache.tools.ant.filters.ReplaceTokens">
|
||||||
classname="org.apache.tools.ant.filters.ReplaceTokens">
|
<param type="propertiesfile" value="${cs.replace.properties}"/>
|
||||||
<param type="propertiesfile"
|
|
||||||
value="${cs.replace.properties}" />
|
|
||||||
</filterreader>
|
</filterreader>
|
||||||
</filterchain>
|
</filterchain>
|
||||||
</copy>
|
</copy>
|
||||||
@ -426,12 +419,8 @@
|
|||||||
<pluginExecutions>
|
<pluginExecutions>
|
||||||
<pluginExecution>
|
<pluginExecution>
|
||||||
<pluginExecutionFilter>
|
<pluginExecutionFilter>
|
||||||
<groupId>
|
<groupId> org.apache.maven.plugins </groupId>
|
||||||
org.apache.maven.plugins
|
<artifactId> maven-antrun-plugin </artifactId>
|
||||||
</groupId>
|
|
||||||
<artifactId>
|
|
||||||
maven-antrun-plugin
|
|
||||||
</artifactId>
|
|
||||||
<versionRange>[1.7,)</versionRange>
|
<versionRange>[1.7,)</versionRange>
|
||||||
<goals>
|
<goals>
|
||||||
<goal>run</goal>
|
<goal>run</goal>
|
||||||
@ -485,12 +474,8 @@
|
|||||||
<!-- Create the WSDL directory structure used by codegen -->
|
<!-- Create the WSDL directory structure used by codegen -->
|
||||||
<mkdir dir="wsdl"/>
|
<mkdir dir="wsdl"/>
|
||||||
<echo message="Downloading 2012-08-15.ec2-wsdl..."/>
|
<echo message="Downloading 2012-08-15.ec2-wsdl..."/>
|
||||||
<get
|
<get src="http://s3.amazonaws.com/ec2-downloads/2012-08-15.ec2.wsdl"
|
||||||
src="http://s3.amazonaws.com/ec2-downloads/2012-08-15.ec2.wsdl"
|
dest="${basedir}/wsdl/" verbose="true" usetimestamp="true"/>
|
||||||
dest="${basedir}/wsdl/"
|
|
||||||
verbose="true"
|
|
||||||
usetimestamp="true"
|
|
||||||
/>
|
|
||||||
</target>
|
</target>
|
||||||
</configuration>
|
</configuration>
|
||||||
</execution>
|
</execution>
|
||||||
|
|||||||
@ -26,7 +26,7 @@ import com.cloud.bridge.model.BucketPolicyVO;
|
|||||||
import com.cloud.utils.db.GenericDaoBase;
|
import com.cloud.utils.db.GenericDaoBase;
|
||||||
import com.cloud.utils.db.SearchBuilder;
|
import com.cloud.utils.db.SearchBuilder;
|
||||||
import com.cloud.utils.db.SearchCriteria;
|
import com.cloud.utils.db.SearchCriteria;
|
||||||
import com.cloud.utils.db.Transaction;
|
import com.cloud.utils.db.TransactionLegacy;
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
@Local(value={BucketPolicyDao.class})
|
@Local(value={BucketPolicyDao.class})
|
||||||
@ -42,7 +42,7 @@ public class BucketPolicyDaoImpl extends GenericDaoBase<BucketPolicyVO, Long> im
|
|||||||
public BucketPolicyVO getByName( String bucketName ) {
|
public BucketPolicyVO getByName( String bucketName ) {
|
||||||
SearchBuilder <BucketPolicyVO> searchByBucket = createSearchBuilder();
|
SearchBuilder <BucketPolicyVO> searchByBucket = createSearchBuilder();
|
||||||
searchByBucket.and("BucketName", searchByBucket.entity().getBucketName(), SearchCriteria.Op.EQ);
|
searchByBucket.and("BucketName", searchByBucket.entity().getBucketName(), SearchCriteria.Op.EQ);
|
||||||
Transaction txn = Transaction.open(Transaction.AWSAPI_DB);
|
TransactionLegacy txn = TransactionLegacy.open(TransactionLegacy.AWSAPI_DB);
|
||||||
try {
|
try {
|
||||||
txn.start();
|
txn.start();
|
||||||
SearchCriteria<BucketPolicyVO> sc = searchByBucket.create();
|
SearchCriteria<BucketPolicyVO> sc = searchByBucket.create();
|
||||||
@ -59,7 +59,7 @@ public class BucketPolicyDaoImpl extends GenericDaoBase<BucketPolicyVO, Long> im
|
|||||||
public void deletePolicy( String bucketName ) {
|
public void deletePolicy( String bucketName ) {
|
||||||
SearchBuilder <BucketPolicyVO> deleteByBucket = createSearchBuilder();
|
SearchBuilder <BucketPolicyVO> deleteByBucket = createSearchBuilder();
|
||||||
deleteByBucket.and("BucketName", deleteByBucket.entity().getBucketName(), SearchCriteria.Op.EQ);
|
deleteByBucket.and("BucketName", deleteByBucket.entity().getBucketName(), SearchCriteria.Op.EQ);
|
||||||
Transaction txn = Transaction.open(Transaction.AWSAPI_DB);
|
TransactionLegacy txn = TransactionLegacy.open(TransactionLegacy.AWSAPI_DB);
|
||||||
try {
|
try {
|
||||||
txn.start();
|
txn.start();
|
||||||
SearchCriteria<BucketPolicyVO> sc = deleteByBucket.create();
|
SearchCriteria<BucketPolicyVO> sc = deleteByBucket.create();
|
||||||
|
|||||||
@ -25,6 +25,7 @@ import com.cloud.utils.db.GenericDaoBase;
|
|||||||
import com.cloud.utils.db.SearchBuilder;
|
import com.cloud.utils.db.SearchBuilder;
|
||||||
import com.cloud.utils.db.SearchCriteria;
|
import com.cloud.utils.db.SearchCriteria;
|
||||||
import com.cloud.utils.db.Transaction;
|
import com.cloud.utils.db.Transaction;
|
||||||
|
import com.cloud.utils.db.TransactionLegacy;
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
@Local(value={CloudStackAccountDao.class})
|
@Local(value={CloudStackAccountDao.class})
|
||||||
@ -34,7 +35,7 @@ public class CloudStackAccountDaoImpl extends GenericDaoBase<CloudStackAccountVO
|
|||||||
public String getDefaultZoneId(String accountId) {
|
public String getDefaultZoneId(String accountId) {
|
||||||
|
|
||||||
SearchBuilder<CloudStackAccountVO> SearchByUUID = createSearchBuilder();
|
SearchBuilder<CloudStackAccountVO> SearchByUUID = createSearchBuilder();
|
||||||
Transaction txn = Transaction.open(Transaction.CLOUD_DB);
|
TransactionLegacy txn = TransactionLegacy.open(TransactionLegacy.CLOUD_DB);
|
||||||
try {
|
try {
|
||||||
txn.start();
|
txn.start();
|
||||||
SearchByUUID.and("uuid", SearchByUUID.entity().getUuid(),
|
SearchByUUID.and("uuid", SearchByUUID.entity().getUuid(),
|
||||||
|
|||||||
@ -27,6 +27,7 @@ import com.cloud.utils.db.GenericDaoBase;
|
|||||||
import com.cloud.utils.db.SearchBuilder;
|
import com.cloud.utils.db.SearchBuilder;
|
||||||
import com.cloud.utils.db.SearchCriteria;
|
import com.cloud.utils.db.SearchCriteria;
|
||||||
import com.cloud.utils.db.Transaction;
|
import com.cloud.utils.db.Transaction;
|
||||||
|
import com.cloud.utils.db.TransactionLegacy;
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
@Local(value={CloudStackConfigurationDao.class})
|
@Local(value={CloudStackConfigurationDao.class})
|
||||||
@ -42,7 +43,7 @@ public class CloudStackConfigurationDaoImpl extends GenericDaoBase<CloudStackCon
|
|||||||
@DB
|
@DB
|
||||||
public String getConfigValue(String name) {
|
public String getConfigValue(String name) {
|
||||||
NameSearch.and("name", NameSearch.entity().getName(), SearchCriteria.Op.EQ);
|
NameSearch.and("name", NameSearch.entity().getName(), SearchCriteria.Op.EQ);
|
||||||
Transaction txn = Transaction.open("cloud", Transaction.CLOUD_DB, true);
|
TransactionLegacy txn = TransactionLegacy.open("cloud", TransactionLegacy.CLOUD_DB, true);
|
||||||
try {
|
try {
|
||||||
txn.start();
|
txn.start();
|
||||||
SearchCriteria<CloudStackConfigurationVO> sc = NameSearch.create();
|
SearchCriteria<CloudStackConfigurationVO> sc = NameSearch.create();
|
||||||
|
|||||||
@ -29,6 +29,7 @@ import com.cloud.utils.db.GenericDaoBase;
|
|||||||
import com.cloud.utils.db.SearchBuilder;
|
import com.cloud.utils.db.SearchBuilder;
|
||||||
import com.cloud.utils.db.SearchCriteria;
|
import com.cloud.utils.db.SearchCriteria;
|
||||||
import com.cloud.utils.db.Transaction;
|
import com.cloud.utils.db.Transaction;
|
||||||
|
import com.cloud.utils.db.TransactionLegacy;
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
@Local(value={CloudStackSvcOfferingDao.class})
|
@Local(value={CloudStackSvcOfferingDao.class})
|
||||||
@ -42,7 +43,7 @@ public class CloudStackSvcOfferingDaoImpl extends GenericDaoBase<CloudStackServi
|
|||||||
SearchBuilder <CloudStackServiceOfferingVO> searchByName = createSearchBuilder();
|
SearchBuilder <CloudStackServiceOfferingVO> searchByName = createSearchBuilder();
|
||||||
searchByName.and("name", searchByName.entity().getName(), SearchCriteria.Op.EQ);
|
searchByName.and("name", searchByName.entity().getName(), SearchCriteria.Op.EQ);
|
||||||
searchByName.done();
|
searchByName.done();
|
||||||
Transaction txn = Transaction.open(Transaction.CLOUD_DB);
|
TransactionLegacy txn = TransactionLegacy.open(TransactionLegacy.CLOUD_DB);
|
||||||
try {
|
try {
|
||||||
txn.start();
|
txn.start();
|
||||||
SearchCriteria<CloudStackServiceOfferingVO> sc = searchByName.create();
|
SearchCriteria<CloudStackServiceOfferingVO> sc = searchByName.create();
|
||||||
@ -61,7 +62,7 @@ public class CloudStackSvcOfferingDaoImpl extends GenericDaoBase<CloudStackServi
|
|||||||
SearchBuilder <CloudStackServiceOfferingVO> searchByID = createSearchBuilder();
|
SearchBuilder <CloudStackServiceOfferingVO> searchByID = createSearchBuilder();
|
||||||
searchByID.and("uuid", searchByID.entity().getUuid(), SearchCriteria.Op.EQ);
|
searchByID.and("uuid", searchByID.entity().getUuid(), SearchCriteria.Op.EQ);
|
||||||
searchByID.done();
|
searchByID.done();
|
||||||
Transaction txn = Transaction.open(Transaction.CLOUD_DB);
|
TransactionLegacy txn = TransactionLegacy.open(TransactionLegacy.CLOUD_DB);
|
||||||
try {
|
try {
|
||||||
txn.start();
|
txn.start();
|
||||||
SearchCriteria<CloudStackServiceOfferingVO> sc = searchByID.create();
|
SearchCriteria<CloudStackServiceOfferingVO> sc = searchByID.create();
|
||||||
|
|||||||
@ -26,6 +26,7 @@ import com.cloud.utils.db.GenericDaoBase;
|
|||||||
import com.cloud.utils.db.SearchBuilder;
|
import com.cloud.utils.db.SearchBuilder;
|
||||||
import com.cloud.utils.db.SearchCriteria;
|
import com.cloud.utils.db.SearchCriteria;
|
||||||
import com.cloud.utils.db.Transaction;
|
import com.cloud.utils.db.Transaction;
|
||||||
|
import com.cloud.utils.db.TransactionLegacy;
|
||||||
import com.cloud.utils.crypt.DBEncryptionUtil;
|
import com.cloud.utils.crypt.DBEncryptionUtil;
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
@ -43,7 +44,7 @@ public class CloudStackUserDaoImpl extends GenericDaoBase<CloudStackUserVO, Stri
|
|||||||
SearchBuilder <CloudStackUserVO> searchByAccessKey = createSearchBuilder();
|
SearchBuilder <CloudStackUserVO> searchByAccessKey = createSearchBuilder();
|
||||||
searchByAccessKey.and("apiKey", searchByAccessKey.entity().getApiKey(), SearchCriteria.Op.EQ);
|
searchByAccessKey.and("apiKey", searchByAccessKey.entity().getApiKey(), SearchCriteria.Op.EQ);
|
||||||
searchByAccessKey.done();
|
searchByAccessKey.done();
|
||||||
Transaction txn = Transaction.open(Transaction.CLOUD_DB);
|
TransactionLegacy txn = TransactionLegacy.open(TransactionLegacy.CLOUD_DB);
|
||||||
try {
|
try {
|
||||||
txn.start();
|
txn.start();
|
||||||
SearchCriteria<CloudStackUserVO> sc = searchByAccessKey.create();
|
SearchCriteria<CloudStackUserVO> sc = searchByAccessKey.create();
|
||||||
|
|||||||
@ -25,6 +25,7 @@ import com.cloud.utils.db.GenericDaoBase;
|
|||||||
import com.cloud.utils.db.SearchBuilder;
|
import com.cloud.utils.db.SearchBuilder;
|
||||||
import com.cloud.utils.db.SearchCriteria;
|
import com.cloud.utils.db.SearchCriteria;
|
||||||
import com.cloud.utils.db.Transaction;
|
import com.cloud.utils.db.Transaction;
|
||||||
|
import com.cloud.utils.db.TransactionLegacy;
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
@Local(value={MHostDao.class})
|
@Local(value={MHostDao.class})
|
||||||
@ -38,7 +39,7 @@ public class MHostDaoImpl extends GenericDaoBase<MHostVO, Long> implements MHost
|
|||||||
@Override
|
@Override
|
||||||
public MHostVO getByHostKey(String hostKey) {
|
public MHostVO getByHostKey(String hostKey) {
|
||||||
NameSearch.and("MHostKey", NameSearch.entity().getHostKey(), SearchCriteria.Op.EQ);
|
NameSearch.and("MHostKey", NameSearch.entity().getHostKey(), SearchCriteria.Op.EQ);
|
||||||
Transaction txn = Transaction.open("cloudbridge", Transaction.AWSAPI_DB, true);
|
TransactionLegacy txn = TransactionLegacy.open("cloudbridge", TransactionLegacy.AWSAPI_DB, true);
|
||||||
try {
|
try {
|
||||||
txn.start();
|
txn.start();
|
||||||
SearchCriteria<MHostVO> sc = NameSearch.create();
|
SearchCriteria<MHostVO> sc = NameSearch.create();
|
||||||
@ -52,7 +53,7 @@ public class MHostDaoImpl extends GenericDaoBase<MHostVO, Long> implements MHost
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateHeartBeat(MHostVO mhost) {
|
public void updateHeartBeat(MHostVO mhost) {
|
||||||
Transaction txn = Transaction.open("cloudbridge", Transaction.AWSAPI_DB, true);
|
TransactionLegacy txn = TransactionLegacy.open("cloudbridge", TransactionLegacy.AWSAPI_DB, true);
|
||||||
try {
|
try {
|
||||||
txn.start();
|
txn.start();
|
||||||
update(mhost.getId(), mhost);
|
update(mhost.getId(), mhost);
|
||||||
|
|||||||
@ -25,6 +25,7 @@ import com.cloud.utils.db.GenericDaoBase;
|
|||||||
import com.cloud.utils.db.SearchBuilder;
|
import com.cloud.utils.db.SearchBuilder;
|
||||||
import com.cloud.utils.db.SearchCriteria;
|
import com.cloud.utils.db.SearchCriteria;
|
||||||
import com.cloud.utils.db.Transaction;
|
import com.cloud.utils.db.Transaction;
|
||||||
|
import com.cloud.utils.db.TransactionLegacy;
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
@Local(value={MHostMountDao.class})
|
@Local(value={MHostMountDao.class})
|
||||||
@ -37,7 +38,7 @@ public class MHostMountDaoImpl extends GenericDaoBase<MHostMountVO, Long> implem
|
|||||||
public MHostMountVO getHostMount(long mHostId, long sHostId) {
|
public MHostMountVO getHostMount(long mHostId, long sHostId) {
|
||||||
SearchByMHostID.and("MHostID", SearchByMHostID.entity().getmHostID(), SearchCriteria.Op.EQ);
|
SearchByMHostID.and("MHostID", SearchByMHostID.entity().getmHostID(), SearchCriteria.Op.EQ);
|
||||||
SearchByMHostID.and("SHostID", SearchByMHostID.entity().getsHostID(), SearchCriteria.Op.EQ);
|
SearchByMHostID.and("SHostID", SearchByMHostID.entity().getsHostID(), SearchCriteria.Op.EQ);
|
||||||
Transaction txn = Transaction.open(Transaction.AWSAPI_DB);
|
TransactionLegacy txn = TransactionLegacy.open(TransactionLegacy.AWSAPI_DB);
|
||||||
try {
|
try {
|
||||||
txn.start();
|
txn.start();
|
||||||
SearchCriteria<MHostMountVO> sc = SearchByMHostID.create();
|
SearchCriteria<MHostMountVO> sc = SearchByMHostID.create();
|
||||||
|
|||||||
@ -28,6 +28,7 @@ import com.cloud.utils.db.GenericDaoBase;
|
|||||||
import com.cloud.utils.db.SearchBuilder;
|
import com.cloud.utils.db.SearchBuilder;
|
||||||
import com.cloud.utils.db.SearchCriteria;
|
import com.cloud.utils.db.SearchCriteria;
|
||||||
import com.cloud.utils.db.Transaction;
|
import com.cloud.utils.db.Transaction;
|
||||||
|
import com.cloud.utils.db.TransactionLegacy;
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
@Local(value={MultiPartPartsDao.class})
|
@Local(value={MultiPartPartsDao.class})
|
||||||
@ -42,7 +43,7 @@ public class MultiPartPartsDaoImpl extends GenericDaoBase<MultiPartPartsVO, Long
|
|||||||
ByUploadID.and("partNumber", ByUploadID.entity().getPartNumber(), SearchCriteria.Op.LT);
|
ByUploadID.and("partNumber", ByUploadID.entity().getPartNumber(), SearchCriteria.Op.LT);
|
||||||
Filter filter = new Filter(MultiPartPartsVO.class, "partNumber", Boolean.TRUE, null, null);
|
Filter filter = new Filter(MultiPartPartsVO.class, "partNumber", Boolean.TRUE, null, null);
|
||||||
|
|
||||||
Transaction txn = Transaction.currentTxn(); // Transaction.open("cloudbridge", Transaction.AWSAPI_DB, true);
|
TransactionLegacy txn = TransactionLegacy.currentTxn(); // Transaction.open("cloudbridge", Transaction.AWSAPI_DB, true);
|
||||||
try {
|
try {
|
||||||
txn.start();
|
txn.start();
|
||||||
SearchCriteria<MultiPartPartsVO> sc = ByUploadID.create();
|
SearchCriteria<MultiPartPartsVO> sc = ByUploadID.create();
|
||||||
@ -61,7 +62,7 @@ public class MultiPartPartsDaoImpl extends GenericDaoBase<MultiPartPartsVO, Long
|
|||||||
SearchBuilder<MultiPartPartsVO> byUploadID = createSearchBuilder();
|
SearchBuilder<MultiPartPartsVO> byUploadID = createSearchBuilder();
|
||||||
byUploadID.and("UploadID", byUploadID.entity().getUploadid(), SearchCriteria.Op.EQ);
|
byUploadID.and("UploadID", byUploadID.entity().getUploadid(), SearchCriteria.Op.EQ);
|
||||||
byUploadID.and("partNumber", byUploadID.entity().getPartNumber(), SearchCriteria.Op.GT);
|
byUploadID.and("partNumber", byUploadID.entity().getPartNumber(), SearchCriteria.Op.GT);
|
||||||
Transaction txn = Transaction.currentTxn(); // Transaction.open("cloudbridge", Transaction.AWSAPI_DB, true);
|
TransactionLegacy txn = TransactionLegacy.currentTxn(); // Transaction.open("cloudbridge", Transaction.AWSAPI_DB, true);
|
||||||
try {
|
try {
|
||||||
txn.start();
|
txn.start();
|
||||||
SearchCriteria<MultiPartPartsVO> sc = byUploadID.create();
|
SearchCriteria<MultiPartPartsVO> sc = byUploadID.create();
|
||||||
@ -82,7 +83,7 @@ public class MultiPartPartsDaoImpl extends GenericDaoBase<MultiPartPartsVO, Long
|
|||||||
SearchBuilder<MultiPartPartsVO> byUploadID = createSearchBuilder();
|
SearchBuilder<MultiPartPartsVO> byUploadID = createSearchBuilder();
|
||||||
byUploadID.and("UploadID", byUploadID.entity().getUploadid(), SearchCriteria.Op.EQ);
|
byUploadID.and("UploadID", byUploadID.entity().getUploadid(), SearchCriteria.Op.EQ);
|
||||||
byUploadID.and("partNumber", byUploadID.entity().getPartNumber(), SearchCriteria.Op.EQ);
|
byUploadID.and("partNumber", byUploadID.entity().getPartNumber(), SearchCriteria.Op.EQ);
|
||||||
Transaction txn = Transaction.currentTxn(); // Transaction.open("cloudbridge", Transaction.AWSAPI_DB, true);
|
TransactionLegacy txn = TransactionLegacy.currentTxn(); // Transaction.open("cloudbridge", Transaction.AWSAPI_DB, true);
|
||||||
try {
|
try {
|
||||||
txn.start();
|
txn.start();
|
||||||
SearchCriteria<MultiPartPartsVO> sc = byUploadID.create();
|
SearchCriteria<MultiPartPartsVO> sc = byUploadID.create();
|
||||||
@ -102,7 +103,7 @@ public class MultiPartPartsDaoImpl extends GenericDaoBase<MultiPartPartsVO, Long
|
|||||||
SearchBuilder<MultiPartPartsVO> byUploadID = createSearchBuilder();
|
SearchBuilder<MultiPartPartsVO> byUploadID = createSearchBuilder();
|
||||||
byUploadID.and("UploadID", byUploadID.entity().getUploadid(), SearchCriteria.Op.EQ);
|
byUploadID.and("UploadID", byUploadID.entity().getUploadid(), SearchCriteria.Op.EQ);
|
||||||
byUploadID.and("partNumber", byUploadID.entity().getPartNumber(), SearchCriteria.Op.EQ);
|
byUploadID.and("partNumber", byUploadID.entity().getPartNumber(), SearchCriteria.Op.EQ);
|
||||||
Transaction txn = Transaction.currentTxn(); // Transaction.open("cloudbridge", Transaction.AWSAPI_DB, true);
|
TransactionLegacy txn = TransactionLegacy.currentTxn(); // Transaction.open("cloudbridge", Transaction.AWSAPI_DB, true);
|
||||||
try {
|
try {
|
||||||
txn.start();
|
txn.start();
|
||||||
SearchCriteria<MultiPartPartsVO> sc = byUploadID.create();
|
SearchCriteria<MultiPartPartsVO> sc = byUploadID.create();
|
||||||
|
|||||||
@ -33,6 +33,7 @@ import com.cloud.utils.db.GenericDaoBase;
|
|||||||
import com.cloud.utils.db.SearchBuilder;
|
import com.cloud.utils.db.SearchBuilder;
|
||||||
import com.cloud.utils.db.SearchCriteria;
|
import com.cloud.utils.db.SearchCriteria;
|
||||||
import com.cloud.utils.db.Transaction;
|
import com.cloud.utils.db.Transaction;
|
||||||
|
import com.cloud.utils.db.TransactionLegacy;
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
@Local(value={MultiPartUploadsDao.class})
|
@Local(value={MultiPartUploadsDao.class})
|
||||||
@ -42,9 +43,9 @@ public class MultiPartUploadsDaoImpl extends GenericDaoBase<MultiPartUploadsVO,
|
|||||||
public OrderedPair<String,String> multipartExits( int uploadId ) {
|
public OrderedPair<String,String> multipartExits( int uploadId ) {
|
||||||
MultiPartUploadsVO uploadvo = null;
|
MultiPartUploadsVO uploadvo = null;
|
||||||
|
|
||||||
Transaction txn = null;
|
TransactionLegacy txn = null;
|
||||||
try {
|
try {
|
||||||
txn = Transaction.open(Transaction.AWSAPI_DB);
|
txn = TransactionLegacy.open(TransactionLegacy.AWSAPI_DB);
|
||||||
uploadvo = findById(new Long(uploadId));
|
uploadvo = findById(new Long(uploadId));
|
||||||
if (null != uploadvo)
|
if (null != uploadvo)
|
||||||
return new OrderedPair<String,String>(uploadvo.getAccessKey(), uploadvo.getNameKey());
|
return new OrderedPair<String,String>(uploadvo.getAccessKey(), uploadvo.getNameKey());
|
||||||
@ -58,9 +59,9 @@ public class MultiPartUploadsDaoImpl extends GenericDaoBase<MultiPartUploadsVO,
|
|||||||
@Override
|
@Override
|
||||||
public void deleteUpload(int uploadId) {
|
public void deleteUpload(int uploadId) {
|
||||||
|
|
||||||
Transaction txn = null;
|
TransactionLegacy txn = null;
|
||||||
try {
|
try {
|
||||||
txn = Transaction.open(Transaction.AWSAPI_DB);
|
txn = TransactionLegacy.open(TransactionLegacy.AWSAPI_DB);
|
||||||
remove(new Long(uploadId));
|
remove(new Long(uploadId));
|
||||||
txn.commit();
|
txn.commit();
|
||||||
}finally {
|
}finally {
|
||||||
@ -70,10 +71,10 @@ public class MultiPartUploadsDaoImpl extends GenericDaoBase<MultiPartUploadsVO,
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getAtrributeValue(String attribute, int uploadid) {
|
public String getAtrributeValue(String attribute, int uploadid) {
|
||||||
Transaction txn = null;
|
TransactionLegacy txn = null;
|
||||||
MultiPartUploadsVO uploadvo = null;
|
MultiPartUploadsVO uploadvo = null;
|
||||||
try {
|
try {
|
||||||
txn = Transaction.open(Transaction.AWSAPI_DB);
|
txn = TransactionLegacy.open(TransactionLegacy.AWSAPI_DB);
|
||||||
uploadvo = findById(new Long(uploadid));
|
uploadvo = findById(new Long(uploadid));
|
||||||
if (null != uploadvo) {
|
if (null != uploadvo) {
|
||||||
if ( attribute.equalsIgnoreCase("AccessKey") )
|
if ( attribute.equalsIgnoreCase("AccessKey") )
|
||||||
@ -105,7 +106,7 @@ public class MultiPartUploadsDaoImpl extends GenericDaoBase<MultiPartUploadsVO,
|
|||||||
Filter filter = new Filter(MultiPartUploadsVO.class, "nameKey", Boolean.TRUE, null, null);
|
Filter filter = new Filter(MultiPartUploadsVO.class, "nameKey", Boolean.TRUE, null, null);
|
||||||
filter.addOrderBy(MultiPartUploadsVO.class, "createTime", Boolean.TRUE);
|
filter.addOrderBy(MultiPartUploadsVO.class, "createTime", Boolean.TRUE);
|
||||||
|
|
||||||
Transaction txn = Transaction.open("cloudbridge", Transaction.AWSAPI_DB, true);
|
TransactionLegacy txn = TransactionLegacy.open("cloudbridge", TransactionLegacy.AWSAPI_DB, true);
|
||||||
try {
|
try {
|
||||||
txn.start();
|
txn.start();
|
||||||
SearchCriteria<MultiPartUploadsVO> sc = byBucket.create();
|
SearchCriteria<MultiPartUploadsVO> sc = byBucket.create();
|
||||||
|
|||||||
@ -34,6 +34,7 @@ import com.cloud.bridge.service.core.s3.S3MultipartPart;
|
|||||||
import com.cloud.bridge.service.core.s3.S3MultipartUpload;
|
import com.cloud.bridge.service.core.s3.S3MultipartUpload;
|
||||||
import com.cloud.bridge.util.OrderedPair;
|
import com.cloud.bridge.util.OrderedPair;
|
||||||
import com.cloud.utils.db.Transaction;
|
import com.cloud.utils.db.Transaction;
|
||||||
|
import com.cloud.utils.db.TransactionLegacy;
|
||||||
|
|
||||||
public class MultipartLoadDao {
|
public class MultipartLoadDao {
|
||||||
public static final Logger logger = Logger.getLogger(MultipartLoadDao.class);
|
public static final Logger logger = Logger.getLogger(MultipartLoadDao.class);
|
||||||
@ -94,9 +95,9 @@ public class MultipartLoadDao {
|
|||||||
*/
|
*/
|
||||||
public int initiateUpload( String accessKey, String bucketName, String key, String cannedAccess, S3MetaDataEntry[] meta ) {
|
public int initiateUpload( String accessKey, String bucketName, String key, String cannedAccess, S3MetaDataEntry[] meta ) {
|
||||||
int uploadId = -1;
|
int uploadId = -1;
|
||||||
Transaction txn = null;
|
TransactionLegacy txn = null;
|
||||||
try {
|
try {
|
||||||
txn = Transaction.open(Transaction.AWSAPI_DB);
|
txn = TransactionLegacy.open(TransactionLegacy.AWSAPI_DB);
|
||||||
Date tod = new Date();
|
Date tod = new Date();
|
||||||
MultiPartUploadsVO uploadVO = new MultiPartUploadsVO(accessKey,
|
MultiPartUploadsVO uploadVO = new MultiPartUploadsVO(accessKey,
|
||||||
bucketName, key, cannedAccess, tod);
|
bucketName, key, cannedAccess, tod);
|
||||||
@ -315,9 +316,9 @@ public class MultipartLoadDao {
|
|||||||
private void saveMultipartMeta( int uploadId, S3MetaDataEntry[] meta ) {
|
private void saveMultipartMeta( int uploadId, S3MetaDataEntry[] meta ) {
|
||||||
if (null == meta) return;
|
if (null == meta) return;
|
||||||
|
|
||||||
Transaction txn = null;
|
TransactionLegacy txn = null;
|
||||||
try {
|
try {
|
||||||
txn = Transaction.open(Transaction.AWSAPI_DB);
|
txn = TransactionLegacy.open(TransactionLegacy.AWSAPI_DB);
|
||||||
for( int i=0; i < meta.length; i++ )
|
for( int i=0; i < meta.length; i++ )
|
||||||
{
|
{
|
||||||
S3MetaDataEntry entry = meta[i];
|
S3MetaDataEntry entry = meta[i];
|
||||||
|
|||||||
@ -27,6 +27,7 @@ import com.cloud.utils.db.GenericDaoBase;
|
|||||||
import com.cloud.utils.db.SearchBuilder;
|
import com.cloud.utils.db.SearchBuilder;
|
||||||
import com.cloud.utils.db.SearchCriteria;
|
import com.cloud.utils.db.SearchCriteria;
|
||||||
import com.cloud.utils.db.Transaction;
|
import com.cloud.utils.db.Transaction;
|
||||||
|
import com.cloud.utils.db.TransactionLegacy;
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
@Local(value={MultipartMetaDao.class})
|
@Local(value={MultipartMetaDao.class})
|
||||||
@ -37,7 +38,7 @@ public class MultipartMetaDaoImpl extends GenericDaoBase<MultipartMetaVO, Long>
|
|||||||
SearchBuilder <MultipartMetaVO> searchByUID = createSearchBuilder();
|
SearchBuilder <MultipartMetaVO> searchByUID = createSearchBuilder();
|
||||||
searchByUID.and("UploadID", searchByUID.entity().getUploadID(), SearchCriteria.Op.EQ);
|
searchByUID.and("UploadID", searchByUID.entity().getUploadID(), SearchCriteria.Op.EQ);
|
||||||
searchByUID.done();
|
searchByUID.done();
|
||||||
Transaction txn = Transaction.open(Transaction.AWSAPI_DB);
|
TransactionLegacy txn = TransactionLegacy.open(TransactionLegacy.AWSAPI_DB);
|
||||||
try {
|
try {
|
||||||
txn.start();
|
txn.start();
|
||||||
SearchCriteria<MultipartMetaVO> sc = searchByUID.create();
|
SearchCriteria<MultipartMetaVO> sc = searchByUID.create();
|
||||||
|
|||||||
@ -29,6 +29,7 @@ import com.cloud.utils.db.GenericDaoBase;
|
|||||||
import com.cloud.utils.db.SearchBuilder;
|
import com.cloud.utils.db.SearchBuilder;
|
||||||
import com.cloud.utils.db.SearchCriteria;
|
import com.cloud.utils.db.SearchCriteria;
|
||||||
import com.cloud.utils.db.Transaction;
|
import com.cloud.utils.db.Transaction;
|
||||||
|
import com.cloud.utils.db.TransactionLegacy;
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
@Local(value={OfferingDao.class})
|
@Local(value={OfferingDao.class})
|
||||||
@ -39,7 +40,7 @@ public class OfferingDaoImpl extends GenericDaoBase<OfferingBundleVO, Long> impl
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getOfferingCount() {
|
public int getOfferingCount() {
|
||||||
Transaction txn = Transaction.open(Transaction.AWSAPI_DB);
|
TransactionLegacy txn = TransactionLegacy.open(TransactionLegacy.AWSAPI_DB);
|
||||||
try {
|
try {
|
||||||
txn.start();
|
txn.start();
|
||||||
return listAll().size();
|
return listAll().size();
|
||||||
@ -56,7 +57,7 @@ public class OfferingDaoImpl extends GenericDaoBase<OfferingBundleVO, Long> impl
|
|||||||
SearchBuilder <OfferingBundleVO> searchByAmazon = createSearchBuilder();
|
SearchBuilder <OfferingBundleVO> searchByAmazon = createSearchBuilder();
|
||||||
searchByAmazon.and("AmazonEC2Offering", searchByAmazon.entity().getAmazonOffering() , SearchCriteria.Op.EQ);
|
searchByAmazon.and("AmazonEC2Offering", searchByAmazon.entity().getAmazonOffering() , SearchCriteria.Op.EQ);
|
||||||
searchByAmazon.done();
|
searchByAmazon.done();
|
||||||
Transaction txn = Transaction.open(Transaction.AWSAPI_DB);
|
TransactionLegacy txn = TransactionLegacy.open(TransactionLegacy.AWSAPI_DB);
|
||||||
try {
|
try {
|
||||||
txn.start();
|
txn.start();
|
||||||
SearchCriteria<OfferingBundleVO> sc = searchByAmazon.create();
|
SearchCriteria<OfferingBundleVO> sc = searchByAmazon.create();
|
||||||
@ -74,7 +75,7 @@ public class OfferingDaoImpl extends GenericDaoBase<OfferingBundleVO, Long> impl
|
|||||||
SearchBuilder <OfferingBundleVO> searchByAmazon = createSearchBuilder();
|
SearchBuilder <OfferingBundleVO> searchByAmazon = createSearchBuilder();
|
||||||
searchByAmazon.and("CloudStackOffering", searchByAmazon.entity().getAmazonOffering() , SearchCriteria.Op.EQ);
|
searchByAmazon.and("CloudStackOffering", searchByAmazon.entity().getAmazonOffering() , SearchCriteria.Op.EQ);
|
||||||
searchByAmazon.done();
|
searchByAmazon.done();
|
||||||
Transaction txn = Transaction.open(Transaction.AWSAPI_DB);
|
TransactionLegacy txn = TransactionLegacy.open(TransactionLegacy.AWSAPI_DB);
|
||||||
try {
|
try {
|
||||||
txn.start();
|
txn.start();
|
||||||
SearchCriteria<OfferingBundleVO> sc = searchByAmazon.create();
|
SearchCriteria<OfferingBundleVO> sc = searchByAmazon.create();
|
||||||
@ -93,7 +94,7 @@ public class OfferingDaoImpl extends GenericDaoBase<OfferingBundleVO, Long> impl
|
|||||||
searchByAmazon.and("CloudStackOffering", searchByAmazon.entity().getAmazonOffering() , SearchCriteria.Op.EQ);
|
searchByAmazon.and("CloudStackOffering", searchByAmazon.entity().getAmazonOffering() , SearchCriteria.Op.EQ);
|
||||||
searchByAmazon.and("AmazonEC2Offering", searchByAmazon.entity().getCloudstackOffering() , SearchCriteria.Op.EQ);
|
searchByAmazon.and("AmazonEC2Offering", searchByAmazon.entity().getCloudstackOffering() , SearchCriteria.Op.EQ);
|
||||||
searchByAmazon.done();
|
searchByAmazon.done();
|
||||||
Transaction txn = Transaction.open(Transaction.AWSAPI_DB);
|
TransactionLegacy txn = TransactionLegacy.open(TransactionLegacy.AWSAPI_DB);
|
||||||
OfferingBundleVO offering = null;
|
OfferingBundleVO offering = null;
|
||||||
try {
|
try {
|
||||||
txn.start();
|
txn.start();
|
||||||
@ -122,7 +123,7 @@ public class OfferingDaoImpl extends GenericDaoBase<OfferingBundleVO, Long> impl
|
|||||||
SearchBuilder <OfferingBundleVO> searchByAmazon = createSearchBuilder();
|
SearchBuilder <OfferingBundleVO> searchByAmazon = createSearchBuilder();
|
||||||
searchByAmazon.and("AmazonEC2Offering", searchByAmazon.entity().getAmazonOffering() , SearchCriteria.Op.EQ);
|
searchByAmazon.and("AmazonEC2Offering", searchByAmazon.entity().getAmazonOffering() , SearchCriteria.Op.EQ);
|
||||||
searchByAmazon.done();
|
searchByAmazon.done();
|
||||||
Transaction txn = Transaction.open(Transaction.AWSAPI_DB);
|
TransactionLegacy txn = TransactionLegacy.open(TransactionLegacy.AWSAPI_DB);
|
||||||
try {
|
try {
|
||||||
txn.start();
|
txn.start();
|
||||||
SearchCriteria<OfferingBundleVO> sc = searchByAmazon.create();
|
SearchCriteria<OfferingBundleVO> sc = searchByAmazon.create();
|
||||||
|
|||||||
@ -32,6 +32,7 @@ import com.cloud.utils.db.GenericDaoBase;
|
|||||||
import com.cloud.utils.db.SearchBuilder;
|
import com.cloud.utils.db.SearchBuilder;
|
||||||
import com.cloud.utils.db.SearchCriteria;
|
import com.cloud.utils.db.SearchCriteria;
|
||||||
import com.cloud.utils.db.Transaction;
|
import com.cloud.utils.db.Transaction;
|
||||||
|
import com.cloud.utils.db.TransactionLegacy;
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
@Local(value={SAclDao.class})
|
@Local(value={SAclDao.class})
|
||||||
@ -46,7 +47,7 @@ public class SAclDaoImpl extends GenericDaoBase<SAclVO, Long> implements SAclDao
|
|||||||
SearchByTarget.and("TargetID", SearchByTarget.entity().getTargetId(), SearchCriteria.Op.EQ);
|
SearchByTarget.and("TargetID", SearchByTarget.entity().getTargetId(), SearchCriteria.Op.EQ);
|
||||||
SearchByTarget.done();
|
SearchByTarget.done();
|
||||||
Filter filter = new Filter(SAclVO.class, "grantOrder", Boolean.TRUE, null, null);
|
Filter filter = new Filter(SAclVO.class, "grantOrder", Boolean.TRUE, null, null);
|
||||||
Transaction txn = Transaction.open( Transaction.AWSAPI_DB);
|
TransactionLegacy txn = TransactionLegacy.open( TransactionLegacy.AWSAPI_DB);
|
||||||
try {
|
try {
|
||||||
txn.start();
|
txn.start();
|
||||||
SearchCriteria<SAclVO> sc = SearchByTarget.create();
|
SearchCriteria<SAclVO> sc = SearchByTarget.create();
|
||||||
@ -66,7 +67,7 @@ public class SAclDaoImpl extends GenericDaoBase<SAclVO, Long> implements SAclDao
|
|||||||
SearchByAcl.and("TargetID", SearchByAcl.entity().getTargetId(), SearchCriteria.Op.EQ);
|
SearchByAcl.and("TargetID", SearchByAcl.entity().getTargetId(), SearchCriteria.Op.EQ);
|
||||||
SearchByAcl.and("GranteeCanonicalID", SearchByAcl.entity().getGranteeCanonicalId(), SearchCriteria.Op.EQ);
|
SearchByAcl.and("GranteeCanonicalID", SearchByAcl.entity().getGranteeCanonicalId(), SearchCriteria.Op.EQ);
|
||||||
Filter filter = new Filter(SAclVO.class, "grantOrder", Boolean.TRUE, null, null);
|
Filter filter = new Filter(SAclVO.class, "grantOrder", Boolean.TRUE, null, null);
|
||||||
Transaction txn = Transaction.open( Transaction.AWSAPI_DB);
|
TransactionLegacy txn = TransactionLegacy.open( TransactionLegacy.AWSAPI_DB);
|
||||||
try {
|
try {
|
||||||
txn.start();
|
txn.start();
|
||||||
SearchCriteria<SAclVO> sc = SearchByAcl.create();
|
SearchCriteria<SAclVO> sc = SearchByAcl.create();
|
||||||
@ -85,7 +86,7 @@ public class SAclDaoImpl extends GenericDaoBase<SAclVO, Long> implements SAclDao
|
|||||||
SearchByTarget.and("Target", SearchByTarget.entity().getTarget(), SearchCriteria.Op.EQ);
|
SearchByTarget.and("Target", SearchByTarget.entity().getTarget(), SearchCriteria.Op.EQ);
|
||||||
SearchByTarget.and("TargetID", SearchByTarget.entity().getTargetId(), SearchCriteria.Op.EQ);
|
SearchByTarget.and("TargetID", SearchByTarget.entity().getTargetId(), SearchCriteria.Op.EQ);
|
||||||
|
|
||||||
Transaction txn = Transaction.open(Transaction.AWSAPI_DB);
|
TransactionLegacy txn = TransactionLegacy.open(TransactionLegacy.AWSAPI_DB);
|
||||||
try {
|
try {
|
||||||
txn.start();
|
txn.start();
|
||||||
SearchCriteria<SAclVO> sc = SearchByTarget.create();
|
SearchCriteria<SAclVO> sc = SearchByTarget.create();
|
||||||
|
|||||||
@ -29,6 +29,7 @@ import com.cloud.utils.db.GenericDaoBase;
|
|||||||
import com.cloud.utils.db.SearchBuilder;
|
import com.cloud.utils.db.SearchBuilder;
|
||||||
import com.cloud.utils.db.SearchCriteria;
|
import com.cloud.utils.db.SearchCriteria;
|
||||||
import com.cloud.utils.db.Transaction;
|
import com.cloud.utils.db.Transaction;
|
||||||
|
import com.cloud.utils.db.TransactionLegacy;
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
@Local(value={SBucketDao.class})
|
@Local(value={SBucketDao.class})
|
||||||
@ -42,7 +43,7 @@ public class SBucketDaoImpl extends GenericDaoBase<SBucketVO, Long> implements S
|
|||||||
SearchBuilder<SBucketVO> SearchByName = createSearchBuilder();
|
SearchBuilder<SBucketVO> SearchByName = createSearchBuilder();
|
||||||
SearchByName.and("Name", SearchByName.entity().getName(), SearchCriteria.Op.EQ);
|
SearchByName.and("Name", SearchByName.entity().getName(), SearchCriteria.Op.EQ);
|
||||||
//Transaction txn = Transaction.open(Transaction.AWSAPI_DB);
|
//Transaction txn = Transaction.open(Transaction.AWSAPI_DB);
|
||||||
Transaction txn = Transaction.open("cloudbridge", Transaction.AWSAPI_DB, true);
|
TransactionLegacy txn = TransactionLegacy.open("cloudbridge", TransactionLegacy.AWSAPI_DB, true);
|
||||||
try {
|
try {
|
||||||
txn.start();
|
txn.start();
|
||||||
SearchCriteria<SBucketVO> sc = SearchByName.create();
|
SearchCriteria<SBucketVO> sc = SearchByName.create();
|
||||||
@ -59,7 +60,7 @@ public class SBucketDaoImpl extends GenericDaoBase<SBucketVO, Long> implements S
|
|||||||
SearchBuilder<SBucketVO> ByCanonicalID = createSearchBuilder();
|
SearchBuilder<SBucketVO> ByCanonicalID = createSearchBuilder();
|
||||||
ByCanonicalID.and("OwnerCanonicalID", ByCanonicalID.entity().getOwnerCanonicalId(), SearchCriteria.Op.EQ);
|
ByCanonicalID.and("OwnerCanonicalID", ByCanonicalID.entity().getOwnerCanonicalId(), SearchCriteria.Op.EQ);
|
||||||
Filter filter = new Filter(SBucketVO.class, "createTime", Boolean.TRUE, null, null);
|
Filter filter = new Filter(SBucketVO.class, "createTime", Boolean.TRUE, null, null);
|
||||||
Transaction txn = Transaction.currentTxn(); // Transaction.open("cloudbridge", Transaction.AWSAPI_DB, true);
|
TransactionLegacy txn = TransactionLegacy.currentTxn(); // Transaction.open("cloudbridge", Transaction.AWSAPI_DB, true);
|
||||||
try {
|
try {
|
||||||
txn.start();
|
txn.start();
|
||||||
SearchCriteria<SBucketVO> sc = ByCanonicalID.create();
|
SearchCriteria<SBucketVO> sc = ByCanonicalID.create();
|
||||||
|
|||||||
@ -25,6 +25,7 @@ import com.cloud.utils.db.GenericDaoBase;
|
|||||||
import com.cloud.utils.db.SearchBuilder;
|
import com.cloud.utils.db.SearchBuilder;
|
||||||
import com.cloud.utils.db.SearchCriteria;
|
import com.cloud.utils.db.SearchCriteria;
|
||||||
import com.cloud.utils.db.Transaction;
|
import com.cloud.utils.db.Transaction;
|
||||||
|
import com.cloud.utils.db.TransactionLegacy;
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
@Local(value={SHostDao.class})
|
@Local(value={SHostDao.class})
|
||||||
@ -36,7 +37,7 @@ public class SHostDaoImpl extends GenericDaoBase<SHostVO, Long> implements SHost
|
|||||||
SearchBuilder <SHostVO> HostSearch = createSearchBuilder();
|
SearchBuilder <SHostVO> HostSearch = createSearchBuilder();
|
||||||
HostSearch.and("Host", HostSearch.entity().getHost(), SearchCriteria.Op.EQ);
|
HostSearch.and("Host", HostSearch.entity().getHost(), SearchCriteria.Op.EQ);
|
||||||
HostSearch.done();
|
HostSearch.done();
|
||||||
Transaction txn = Transaction.open(Transaction.AWSAPI_DB);
|
TransactionLegacy txn = TransactionLegacy.open(TransactionLegacy.AWSAPI_DB);
|
||||||
try {
|
try {
|
||||||
txn.start();
|
txn.start();
|
||||||
SearchCriteria<SHostVO> sc = HostSearch.create();
|
SearchCriteria<SHostVO> sc = HostSearch.create();
|
||||||
@ -55,7 +56,7 @@ public class SHostDaoImpl extends GenericDaoBase<SHostVO, Long> implements SHost
|
|||||||
LocalStorageHostSearch.and("MHostID", LocalStorageHostSearch.entity().getMhostid(), SearchCriteria.Op.EQ);
|
LocalStorageHostSearch.and("MHostID", LocalStorageHostSearch.entity().getMhostid(), SearchCriteria.Op.EQ);
|
||||||
LocalStorageHostSearch.and("ExportRoot", LocalStorageHostSearch.entity().getExportRoot(), SearchCriteria.Op.EQ);
|
LocalStorageHostSearch.and("ExportRoot", LocalStorageHostSearch.entity().getExportRoot(), SearchCriteria.Op.EQ);
|
||||||
LocalStorageHostSearch.done();
|
LocalStorageHostSearch.done();
|
||||||
Transaction txn = Transaction.currentTxn();
|
TransactionLegacy txn = TransactionLegacy.currentTxn();
|
||||||
try {
|
try {
|
||||||
txn.start();
|
txn.start();
|
||||||
SearchCriteria<SHostVO> sc = LocalStorageHostSearch.create();
|
SearchCriteria<SHostVO> sc = LocalStorageHostSearch.create();
|
||||||
|
|||||||
@ -28,6 +28,7 @@ import com.cloud.utils.db.GenericDaoBase;
|
|||||||
import com.cloud.utils.db.SearchBuilder;
|
import com.cloud.utils.db.SearchBuilder;
|
||||||
import com.cloud.utils.db.SearchCriteria;
|
import com.cloud.utils.db.SearchCriteria;
|
||||||
import com.cloud.utils.db.Transaction;
|
import com.cloud.utils.db.Transaction;
|
||||||
|
import com.cloud.utils.db.TransactionLegacy;
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
@Local(value={SMetaDao.class})
|
@Local(value={SMetaDao.class})
|
||||||
@ -41,7 +42,7 @@ public class SMetaDaoImpl extends GenericDaoBase<SMetaVO, Long> implements SMeta
|
|||||||
SearchByTarget.and("Target", SearchByTarget.entity().getTarget(), SearchCriteria.Op.EQ);
|
SearchByTarget.and("Target", SearchByTarget.entity().getTarget(), SearchCriteria.Op.EQ);
|
||||||
SearchByTarget.and("TargetID", SearchByTarget.entity().getTargetId(), SearchCriteria.Op.EQ);
|
SearchByTarget.and("TargetID", SearchByTarget.entity().getTargetId(), SearchCriteria.Op.EQ);
|
||||||
SearchByTarget.done();
|
SearchByTarget.done();
|
||||||
Transaction txn = Transaction.open( Transaction.AWSAPI_DB);
|
TransactionLegacy txn = TransactionLegacy.open( TransactionLegacy.AWSAPI_DB);
|
||||||
try {
|
try {
|
||||||
txn.start();
|
txn.start();
|
||||||
SearchCriteria<SMetaVO> sc = SearchByTarget.create();
|
SearchCriteria<SMetaVO> sc = SearchByTarget.create();
|
||||||
@ -71,7 +72,7 @@ public class SMetaDaoImpl extends GenericDaoBase<SMetaVO, Long> implements SMeta
|
|||||||
SearchBuilder <SMetaVO> SearchByTarget = createSearchBuilder();
|
SearchBuilder <SMetaVO> SearchByTarget = createSearchBuilder();
|
||||||
SearchByTarget.and("Target", SearchByTarget.entity().getTarget(), SearchCriteria.Op.EQ);
|
SearchByTarget.and("Target", SearchByTarget.entity().getTarget(), SearchCriteria.Op.EQ);
|
||||||
SearchByTarget.and("TargetID", SearchByTarget.entity().getTargetId(), SearchCriteria.Op.EQ);
|
SearchByTarget.and("TargetID", SearchByTarget.entity().getTargetId(), SearchCriteria.Op.EQ);
|
||||||
Transaction txn = Transaction.open(Transaction.AWSAPI_DB);
|
TransactionLegacy txn = TransactionLegacy.open(TransactionLegacy.AWSAPI_DB);
|
||||||
try {
|
try {
|
||||||
txn.start();
|
txn.start();
|
||||||
SearchCriteria<SMetaVO> sc = SearchByTarget.create();
|
SearchCriteria<SMetaVO> sc = SearchByTarget.create();
|
||||||
|
|||||||
@ -33,6 +33,7 @@ import com.cloud.utils.db.GenericDaoBase;
|
|||||||
import com.cloud.utils.db.SearchBuilder;
|
import com.cloud.utils.db.SearchBuilder;
|
||||||
import com.cloud.utils.db.SearchCriteria;
|
import com.cloud.utils.db.SearchCriteria;
|
||||||
import com.cloud.utils.db.Transaction;
|
import com.cloud.utils.db.Transaction;
|
||||||
|
import com.cloud.utils.db.TransactionLegacy;
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
@Local(value={SObjectDao.class})
|
@Local(value={SObjectDao.class})
|
||||||
@ -47,7 +48,7 @@ public class SObjectDaoImpl extends GenericDaoBase<SObjectVO, Long> implements S
|
|||||||
SearchBuilder<SObjectVO> SearchByName = createSearchBuilder();
|
SearchBuilder<SObjectVO> SearchByName = createSearchBuilder();
|
||||||
SearchByName.and("SBucketID", SearchByName.entity().getBucketID() , SearchCriteria.Op.EQ);
|
SearchByName.and("SBucketID", SearchByName.entity().getBucketID() , SearchCriteria.Op.EQ);
|
||||||
SearchByName.and("NameKey", SearchByName.entity().getNameKey() , SearchCriteria.Op.EQ);
|
SearchByName.and("NameKey", SearchByName.entity().getNameKey() , SearchCriteria.Op.EQ);
|
||||||
Transaction txn = Transaction.open(Transaction.AWSAPI_DB);
|
TransactionLegacy txn = TransactionLegacy.open(TransactionLegacy.AWSAPI_DB);
|
||||||
try {
|
try {
|
||||||
txn.start();
|
txn.start();
|
||||||
SearchCriteria<SObjectVO> sc = SearchByName.create();
|
SearchCriteria<SObjectVO> sc = SearchByName.create();
|
||||||
@ -76,7 +77,7 @@ public class SObjectDaoImpl extends GenericDaoBase<SObjectVO, Long> implements S
|
|||||||
|
|
||||||
SearchByBucket.and("SBucketID", SearchByBucket.entity().getBucketID(), SearchCriteria.Op.EQ);
|
SearchByBucket.and("SBucketID", SearchByBucket.entity().getBucketID(), SearchCriteria.Op.EQ);
|
||||||
SearchByBucket.and("DeletionMark", SearchByBucket.entity().getDeletionMark(), SearchCriteria.Op.NULL);
|
SearchByBucket.and("DeletionMark", SearchByBucket.entity().getDeletionMark(), SearchCriteria.Op.NULL);
|
||||||
Transaction txn = Transaction.currentTxn(); // Transaction.open("cloudbridge", Transaction.AWSAPI_DB, true);
|
TransactionLegacy txn = TransactionLegacy.currentTxn(); // Transaction.open("cloudbridge", Transaction.AWSAPI_DB, true);
|
||||||
try {
|
try {
|
||||||
txn.start();
|
txn.start();
|
||||||
SearchCriteria<SObjectVO> sc = SearchByBucket.create();
|
SearchCriteria<SObjectVO> sc = SearchByBucket.create();
|
||||||
@ -100,7 +101,7 @@ public class SObjectDaoImpl extends GenericDaoBase<SObjectVO, Long> implements S
|
|||||||
List<SObjectVO> objects = new ArrayList<SObjectVO>();
|
List<SObjectVO> objects = new ArrayList<SObjectVO>();
|
||||||
getAllBuckets.and("SBucketID", getAllBuckets.entity().getBucketID(), SearchCriteria.Op.EQ);
|
getAllBuckets.and("SBucketID", getAllBuckets.entity().getBucketID(), SearchCriteria.Op.EQ);
|
||||||
|
|
||||||
Transaction txn = Transaction.currentTxn(); // Transaction.open("cloudbridge", Transaction.AWSAPI_DB, true);
|
TransactionLegacy txn = TransactionLegacy.currentTxn(); // Transaction.open("cloudbridge", Transaction.AWSAPI_DB, true);
|
||||||
try {
|
try {
|
||||||
txn.start();
|
txn.start();
|
||||||
SearchCriteria<SObjectVO> sc = getAllBuckets.create();
|
SearchCriteria<SObjectVO> sc = getAllBuckets.create();
|
||||||
|
|||||||
@ -27,6 +27,7 @@ import com.cloud.utils.db.GenericDaoBase;
|
|||||||
import com.cloud.utils.db.SearchBuilder;
|
import com.cloud.utils.db.SearchBuilder;
|
||||||
import com.cloud.utils.db.SearchCriteria;
|
import com.cloud.utils.db.SearchCriteria;
|
||||||
import com.cloud.utils.db.Transaction;
|
import com.cloud.utils.db.Transaction;
|
||||||
|
import com.cloud.utils.db.TransactionLegacy;
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
@Local(value={SObjectItemDao.class})
|
@Local(value={SObjectItemDao.class})
|
||||||
@ -39,7 +40,7 @@ public class SObjectItemDaoImpl extends GenericDaoBase<SObjectItemVO, Long> impl
|
|||||||
@Override
|
@Override
|
||||||
public SObjectItemVO getByObjectIdNullVersion(long id) {
|
public SObjectItemVO getByObjectIdNullVersion(long id) {
|
||||||
|
|
||||||
Transaction txn = Transaction.open(Transaction.AWSAPI_DB);
|
TransactionLegacy txn = TransactionLegacy.open(TransactionLegacy.AWSAPI_DB);
|
||||||
SearchBuilder <SObjectItemVO> SearchByID = createSearchBuilder();
|
SearchBuilder <SObjectItemVO> SearchByID = createSearchBuilder();
|
||||||
SearchByID.and("ID", SearchByID.entity().getId(), SearchCriteria.Op.EQ);
|
SearchByID.and("ID", SearchByID.entity().getId(), SearchCriteria.Op.EQ);
|
||||||
|
|
||||||
@ -56,7 +57,7 @@ public class SObjectItemDaoImpl extends GenericDaoBase<SObjectItemVO, Long> impl
|
|||||||
@Override
|
@Override
|
||||||
public List<SObjectItemVO> getItems(long sobjectID) {
|
public List<SObjectItemVO> getItems(long sobjectID) {
|
||||||
|
|
||||||
Transaction txn = Transaction.open(Transaction.AWSAPI_DB);
|
TransactionLegacy txn = TransactionLegacy.open(TransactionLegacy.AWSAPI_DB);
|
||||||
SearchBuilder<SObjectItemVO> SearchBySobjectID = createSearchBuilder();
|
SearchBuilder<SObjectItemVO> SearchBySobjectID = createSearchBuilder();
|
||||||
SearchBySobjectID.and("SObjectID", SearchBySobjectID.entity().getId(), SearchCriteria.Op.EQ);
|
SearchBySobjectID.and("SObjectID", SearchBySobjectID.entity().getId(), SearchCriteria.Op.EQ);
|
||||||
|
|
||||||
|
|||||||
@ -29,6 +29,7 @@ import com.cloud.utils.db.GenericDaoBase;
|
|||||||
import com.cloud.utils.db.SearchBuilder;
|
import com.cloud.utils.db.SearchBuilder;
|
||||||
import com.cloud.utils.db.SearchCriteria;
|
import com.cloud.utils.db.SearchCriteria;
|
||||||
import com.cloud.utils.db.Transaction;
|
import com.cloud.utils.db.Transaction;
|
||||||
|
import com.cloud.utils.db.TransactionLegacy;
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
@Local(value={UserCredentialsDao.class})
|
@Local(value={UserCredentialsDao.class})
|
||||||
@ -41,7 +42,7 @@ public class UserCredentialsDaoImpl extends GenericDaoBase<UserCredentialsVO, Lo
|
|||||||
@Override
|
@Override
|
||||||
public UserCredentialsVO getByAccessKey( String cloudAccessKey ) {
|
public UserCredentialsVO getByAccessKey( String cloudAccessKey ) {
|
||||||
SearchBuilder<UserCredentialsVO> SearchByAccessKey = createSearchBuilder();
|
SearchBuilder<UserCredentialsVO> SearchByAccessKey = createSearchBuilder();
|
||||||
Transaction txn = Transaction.open(Transaction.AWSAPI_DB);
|
TransactionLegacy txn = TransactionLegacy.open(TransactionLegacy.AWSAPI_DB);
|
||||||
try {
|
try {
|
||||||
txn.start();
|
txn.start();
|
||||||
SearchByAccessKey.and("AccessKey", SearchByAccessKey.entity()
|
SearchByAccessKey.and("AccessKey", SearchByAccessKey.entity()
|
||||||
@ -60,7 +61,7 @@ public class UserCredentialsDaoImpl extends GenericDaoBase<UserCredentialsVO, Lo
|
|||||||
public UserCredentialsVO getByCertUniqueId( String certId ) {
|
public UserCredentialsVO getByCertUniqueId( String certId ) {
|
||||||
SearchBuilder<UserCredentialsVO> SearchByCertID = createSearchBuilder();
|
SearchBuilder<UserCredentialsVO> SearchByCertID = createSearchBuilder();
|
||||||
SearchByCertID.and("CertUniqueId", SearchByCertID.entity().getCertUniqueId(), SearchCriteria.Op.EQ);
|
SearchByCertID.and("CertUniqueId", SearchByCertID.entity().getCertUniqueId(), SearchCriteria.Op.EQ);
|
||||||
Transaction txn = Transaction.open(Transaction.AWSAPI_DB);
|
TransactionLegacy txn = TransactionLegacy.open(TransactionLegacy.AWSAPI_DB);
|
||||||
try {
|
try {
|
||||||
txn.start();
|
txn.start();
|
||||||
SearchCriteria<UserCredentialsVO> sc = SearchByCertID.create();
|
SearchCriteria<UserCredentialsVO> sc = SearchByCertID.create();
|
||||||
|
|||||||
@ -161,6 +161,7 @@ import com.cloud.bridge.util.ConfigurationHelper;
|
|||||||
import com.cloud.bridge.util.EC2RestAuth;
|
import com.cloud.bridge.util.EC2RestAuth;
|
||||||
import com.cloud.stack.models.CloudStackAccount;
|
import com.cloud.stack.models.CloudStackAccount;
|
||||||
import com.cloud.utils.db.Transaction;
|
import com.cloud.utils.db.Transaction;
|
||||||
|
import com.cloud.utils.db.TransactionLegacy;
|
||||||
|
|
||||||
@Component("EC2RestServlet")
|
@Component("EC2RestServlet")
|
||||||
public class EC2RestServlet extends HttpServlet {
|
public class EC2RestServlet extends HttpServlet {
|
||||||
@ -377,7 +378,7 @@ public class EC2RestServlet extends HttpServlet {
|
|||||||
private void setUserKeys( HttpServletRequest request, HttpServletResponse response ) {
|
private void setUserKeys( HttpServletRequest request, HttpServletResponse response ) {
|
||||||
String[] accessKey = null;
|
String[] accessKey = null;
|
||||||
String[] secretKey = null;
|
String[] secretKey = null;
|
||||||
Transaction txn = null;
|
TransactionLegacy txn = null;
|
||||||
try {
|
try {
|
||||||
// -> all these parameters are required
|
// -> all these parameters are required
|
||||||
accessKey = request.getParameterValues( "accesskey" );
|
accessKey = request.getParameterValues( "accesskey" );
|
||||||
@ -398,7 +399,7 @@ public class EC2RestServlet extends HttpServlet {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
txn = Transaction.open(Transaction.AWSAPI_DB);
|
txn = TransactionLegacy.open(TransactionLegacy.AWSAPI_DB);
|
||||||
txn.start();
|
txn.start();
|
||||||
// -> use the keys to see if the account actually exists
|
// -> use the keys to see if the account actually exists
|
||||||
ServiceProvider.getInstance().getEC2Engine().validateAccount( accessKey[0], secretKey[0] );
|
ServiceProvider.getInstance().getEC2Engine().validateAccount( accessKey[0], secretKey[0] );
|
||||||
@ -434,7 +435,7 @@ public class EC2RestServlet extends HttpServlet {
|
|||||||
*/
|
*/
|
||||||
private void setCertificate( HttpServletRequest request, HttpServletResponse response )
|
private void setCertificate( HttpServletRequest request, HttpServletResponse response )
|
||||||
throws Exception {
|
throws Exception {
|
||||||
Transaction txn = null;
|
TransactionLegacy txn = null;
|
||||||
try {
|
try {
|
||||||
// [A] Pull the cert and cloud AccessKey from the request
|
// [A] Pull the cert and cloud AccessKey from the request
|
||||||
String[] certificate = request.getParameterValues( "cert" );
|
String[] certificate = request.getParameterValues( "cert" );
|
||||||
@ -470,7 +471,7 @@ public class EC2RestServlet extends HttpServlet {
|
|||||||
// [C] Associate the cert's uniqueId with the Cloud API keys
|
// [C] Associate the cert's uniqueId with the Cloud API keys
|
||||||
String uniqueId = AuthenticationUtils.X509CertUniqueId( userCert );
|
String uniqueId = AuthenticationUtils.X509CertUniqueId( userCert );
|
||||||
logger.debug( "SetCertificate, uniqueId: " + uniqueId );
|
logger.debug( "SetCertificate, uniqueId: " + uniqueId );
|
||||||
txn = Transaction.open(Transaction.AWSAPI_DB);
|
txn = TransactionLegacy.open(TransactionLegacy.AWSAPI_DB);
|
||||||
txn.start();
|
txn.start();
|
||||||
UserCredentialsVO user = ucDao.getByAccessKey(accessKey[0]);
|
UserCredentialsVO user = ucDao.getByAccessKey(accessKey[0]);
|
||||||
user.setCertUniqueId(uniqueId);
|
user.setCertUniqueId(uniqueId);
|
||||||
@ -505,7 +506,7 @@ public class EC2RestServlet extends HttpServlet {
|
|||||||
*/
|
*/
|
||||||
private void deleteCertificate( HttpServletRequest request, HttpServletResponse response )
|
private void deleteCertificate( HttpServletRequest request, HttpServletResponse response )
|
||||||
throws Exception {
|
throws Exception {
|
||||||
Transaction txn = null;
|
TransactionLegacy txn = null;
|
||||||
try {
|
try {
|
||||||
String [] accessKey = request.getParameterValues( "AWSAccessKeyId" );
|
String [] accessKey = request.getParameterValues( "AWSAccessKeyId" );
|
||||||
if ( null == accessKey || 0 == accessKey.length ) {
|
if ( null == accessKey || 0 == accessKey.length ) {
|
||||||
@ -527,7 +528,7 @@ public class EC2RestServlet extends HttpServlet {
|
|||||||
/* UserCredentialsDao credentialDao = new UserCredentialsDao();
|
/* UserCredentialsDao credentialDao = new UserCredentialsDao();
|
||||||
credentialDao.setCertificateId( accessKey[0], null );
|
credentialDao.setCertificateId( accessKey[0], null );
|
||||||
|
|
||||||
*/ txn = Transaction.open(Transaction.AWSAPI_DB);
|
*/ txn = TransactionLegacy.open(TransactionLegacy.AWSAPI_DB);
|
||||||
UserCredentialsVO user = ucDao.getByAccessKey(accessKey[0]);
|
UserCredentialsVO user = ucDao.getByAccessKey(accessKey[0]);
|
||||||
user.setCertUniqueId(null);
|
user.setCertUniqueId(null);
|
||||||
ucDao.update(user.getId(), user);
|
ucDao.update(user.getId(), user);
|
||||||
|
|||||||
@ -67,6 +67,7 @@ import com.cloud.bridge.util.RestAuth;
|
|||||||
import com.cloud.bridge.util.S3SoapAuth;
|
import com.cloud.bridge.util.S3SoapAuth;
|
||||||
import com.cloud.utils.db.DB;
|
import com.cloud.utils.db.DB;
|
||||||
import com.cloud.utils.db.Transaction;
|
import com.cloud.utils.db.Transaction;
|
||||||
|
import com.cloud.utils.db.TransactionLegacy;
|
||||||
public class S3RestServlet extends HttpServlet {
|
public class S3RestServlet extends HttpServlet {
|
||||||
private static final long serialVersionUID = -6168996266762804877L;
|
private static final long serialVersionUID = -6168996266762804877L;
|
||||||
public static final String ENABLE_S3_API="enable.s3.api";
|
public static final String ENABLE_S3_API="enable.s3.api";
|
||||||
@ -139,7 +140,7 @@ public class S3RestServlet extends HttpServlet {
|
|||||||
*/
|
*/
|
||||||
private void processRequest( HttpServletRequest request, HttpServletResponse response, String method )
|
private void processRequest( HttpServletRequest request, HttpServletResponse response, String method )
|
||||||
{
|
{
|
||||||
Transaction txn = Transaction.open("cloudbridge", Transaction.AWSAPI_DB, true);
|
TransactionLegacy txn = TransactionLegacy.open("cloudbridge", TransactionLegacy.AWSAPI_DB, true);
|
||||||
try {
|
try {
|
||||||
logRequest(request);
|
logRequest(request);
|
||||||
|
|
||||||
@ -274,7 +275,7 @@ public class S3RestServlet extends HttpServlet {
|
|||||||
// -> use the keys to see if the account actually exists
|
// -> use the keys to see if the account actually exists
|
||||||
//ServiceProvider.getInstance().getEC2Engine().validateAccount( accessKey[0], secretKey[0] );
|
//ServiceProvider.getInstance().getEC2Engine().validateAccount( accessKey[0], secretKey[0] );
|
||||||
//UserCredentialsDaoImpl credentialDao = new UserCredentialsDao();
|
//UserCredentialsDaoImpl credentialDao = new UserCredentialsDao();
|
||||||
Transaction txn = Transaction.open(Transaction.AWSAPI_DB);
|
TransactionLegacy txn = TransactionLegacy.open(TransactionLegacy.AWSAPI_DB);
|
||||||
txn.start();
|
txn.start();
|
||||||
UserCredentialsVO user = new UserCredentialsVO(accessKey[0], secretKey[0]);
|
UserCredentialsVO user = new UserCredentialsVO(accessKey[0], secretKey[0]);
|
||||||
user = ucDao.persist(user);
|
user = ucDao.persist(user);
|
||||||
|
|||||||
@ -94,6 +94,7 @@ import com.cloud.bridge.util.XSerializer;
|
|||||||
import com.cloud.bridge.util.XSerializerXmlAdapter;
|
import com.cloud.bridge.util.XSerializerXmlAdapter;
|
||||||
import com.cloud.bridge.util.XmlHelper;
|
import com.cloud.bridge.util.XmlHelper;
|
||||||
import com.cloud.utils.db.Transaction;
|
import com.cloud.utils.db.Transaction;
|
||||||
|
import com.cloud.utils.db.TransactionLegacy;
|
||||||
|
|
||||||
|
|
||||||
public class S3BucketAction implements ServletAction {
|
public class S3BucketAction implements ServletAction {
|
||||||
@ -371,7 +372,7 @@ public class S3BucketAction implements ServletAction {
|
|||||||
response.setStatus(403);
|
response.setStatus(403);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Transaction txn = Transaction.open(Transaction.AWSAPI_DB);
|
TransactionLegacy txn = TransactionLegacy.open(TransactionLegacy.AWSAPI_DB);
|
||||||
// [B] Place the policy into the database over writting an existing policy
|
// [B] Place the policy into the database over writting an existing policy
|
||||||
try {
|
try {
|
||||||
// -> first make sure that the policy is valid by parsing it
|
// -> first make sure that the policy is valid by parsing it
|
||||||
|
|||||||
@ -35,6 +35,7 @@ import javax.annotation.PostConstruct;
|
|||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
|
||||||
import org.apache.axis2.AxisFault;
|
import org.apache.axis2.AxisFault;
|
||||||
|
import org.apache.cloudstack.managed.context.ManagedContextTimerTask;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import org.apache.log4j.xml.DOMConfigurator;
|
import org.apache.log4j.xml.DOMConfigurator;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
@ -61,6 +62,7 @@ import com.cloud.bridge.util.OrderedPair;
|
|||||||
import com.cloud.utils.component.ManagerBase;
|
import com.cloud.utils.component.ManagerBase;
|
||||||
import com.cloud.utils.db.DB;
|
import com.cloud.utils.db.DB;
|
||||||
import com.cloud.utils.db.Transaction;
|
import com.cloud.utils.db.Transaction;
|
||||||
|
import com.cloud.utils.db.TransactionLegacy;
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
public class ServiceProvider extends ManagerBase {
|
public class ServiceProvider extends ManagerBase {
|
||||||
@ -89,7 +91,7 @@ public class ServiceProvider extends ManagerBase {
|
|||||||
|
|
||||||
protected ServiceProvider() throws IOException {
|
protected ServiceProvider() throws IOException {
|
||||||
// register service implementation object
|
// register service implementation object
|
||||||
Transaction txn = Transaction.open(Transaction.AWSAPI_DB);
|
TransactionLegacy txn = TransactionLegacy.open(TransactionLegacy.AWSAPI_DB);
|
||||||
txn.close();
|
txn.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -182,7 +184,7 @@ public class ServiceProvider extends ManagerBase {
|
|||||||
|
|
||||||
public UserInfo getUserInfo(String accessKey) {
|
public UserInfo getUserInfo(String accessKey) {
|
||||||
UserInfo info = new UserInfo();
|
UserInfo info = new UserInfo();
|
||||||
Transaction txn = Transaction.open(Transaction.AWSAPI_DB);
|
TransactionLegacy txn = TransactionLegacy.open(TransactionLegacy.AWSAPI_DB);
|
||||||
try {
|
try {
|
||||||
txn.start();
|
txn.start();
|
||||||
UserCredentialsVO cloudKeys = ucDao.getByAccessKey( accessKey );
|
UserCredentialsVO cloudKeys = ucDao.getByAccessKey( accessKey );
|
||||||
@ -252,7 +254,7 @@ public class ServiceProvider extends ManagerBase {
|
|||||||
|
|
||||||
multipartDir = properties.getProperty("storage.multipartDir");
|
multipartDir = properties.getProperty("storage.multipartDir");
|
||||||
|
|
||||||
Transaction txn1 = Transaction.open(Transaction.AWSAPI_DB);
|
TransactionLegacy txn1 = TransactionLegacy.open(TransactionLegacy.AWSAPI_DB);
|
||||||
timer.schedule(getHeartbeatTask(), HEARTBEAT_INTERVAL, HEARTBEAT_INTERVAL);
|
timer.schedule(getHeartbeatTask(), HEARTBEAT_INTERVAL, HEARTBEAT_INTERVAL);
|
||||||
txn1.close();
|
txn1.close();
|
||||||
|
|
||||||
@ -280,10 +282,9 @@ public class ServiceProvider extends ManagerBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private TimerTask getHeartbeatTask() {
|
private TimerTask getHeartbeatTask() {
|
||||||
return new TimerTask() {
|
return new ManagedContextTimerTask() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
protected void runInContext() {
|
||||||
try {
|
try {
|
||||||
mhost.setLastHeartbeatTime(DateHelper.currentGMTTime());
|
mhost.setLastHeartbeatTime(DateHelper.currentGMTTime());
|
||||||
mhostDao.updateHeartBeat(mhost);
|
mhostDao.updateHeartBeat(mhost);
|
||||||
|
|||||||
@ -86,6 +86,7 @@ import com.cloud.bridge.util.StringHelper;
|
|||||||
import com.cloud.bridge.util.Triple;
|
import com.cloud.bridge.util.Triple;
|
||||||
import com.cloud.utils.db.DB;
|
import com.cloud.utils.db.DB;
|
||||||
import com.cloud.utils.db.Transaction;
|
import com.cloud.utils.db.Transaction;
|
||||||
|
import com.cloud.utils.db.TransactionLegacy;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The CRUD control actions to be invoked from S3BucketAction or S3ObjectAction.
|
* The CRUD control actions to be invoked from S3BucketAction or S3ObjectAction.
|
||||||
@ -195,7 +196,7 @@ public class S3Engine {
|
|||||||
String cannedAccessPolicy = request.getCannedAccess();
|
String cannedAccessPolicy = request.getCannedAccess();
|
||||||
String bucketName = request.getBucketName();
|
String bucketName = request.getBucketName();
|
||||||
response.setBucketName( bucketName );
|
response.setBucketName( bucketName );
|
||||||
Transaction txn= null;
|
TransactionLegacy txn= null;
|
||||||
verifyBucketName( bucketName, false );
|
verifyBucketName( bucketName, false );
|
||||||
|
|
||||||
S3PolicyContext context = new S3PolicyContext( PolicyActions.CreateBucket, bucketName );
|
S3PolicyContext context = new S3PolicyContext( PolicyActions.CreateBucket, bucketName );
|
||||||
@ -205,7 +206,7 @@ public class S3Engine {
|
|||||||
OrderedPair<SHostVO, String> shost_storagelocation_pair = null;
|
OrderedPair<SHostVO, String> shost_storagelocation_pair = null;
|
||||||
boolean success = false;
|
boolean success = false;
|
||||||
try {
|
try {
|
||||||
txn = Transaction.open(Transaction.AWSAPI_DB);
|
txn = TransactionLegacy.open(TransactionLegacy.AWSAPI_DB);
|
||||||
|
|
||||||
if (bucketDao.getByName(request.getBucketName()) != null)
|
if (bucketDao.getByName(request.getBucketName()) != null)
|
||||||
throw new ObjectAlreadyExistsException("Bucket already exists");
|
throw new ObjectAlreadyExistsException("Bucket already exists");
|
||||||
@ -257,10 +258,10 @@ public class S3Engine {
|
|||||||
String bucketName = request.getBucketName();
|
String bucketName = request.getBucketName();
|
||||||
SBucketVO sbucket = bucketDao.getByName(bucketName);
|
SBucketVO sbucket = bucketDao.getByName(bucketName);
|
||||||
|
|
||||||
Transaction txn = null;
|
TransactionLegacy txn = null;
|
||||||
if ( sbucket != null )
|
if ( sbucket != null )
|
||||||
{
|
{
|
||||||
txn = Transaction.open(Transaction.AWSAPI_DB);
|
txn = TransactionLegacy.open(TransactionLegacy.AWSAPI_DB);
|
||||||
txn.start();
|
txn.start();
|
||||||
S3PolicyContext context = new S3PolicyContext( PolicyActions.DeleteBucket, bucketName );
|
S3PolicyContext context = new S3PolicyContext( PolicyActions.DeleteBucket, bucketName );
|
||||||
switch( verifyPolicy( context ))
|
switch( verifyPolicy( context ))
|
||||||
@ -699,7 +700,7 @@ public class S3Engine {
|
|||||||
if (null != version)
|
if (null != version)
|
||||||
httpResp.addHeader("x-amz-version-id", version);
|
httpResp.addHeader("x-amz-version-id", version);
|
||||||
httpResp.flushBuffer();
|
httpResp.flushBuffer();
|
||||||
Transaction txn = Transaction.open(Transaction.AWSAPI_DB);
|
TransactionLegacy txn = TransactionLegacy.open(TransactionLegacy.AWSAPI_DB);
|
||||||
// [C] Re-assemble the object from its uploaded file parts
|
// [C] Re-assemble the object from its uploaded file parts
|
||||||
try {
|
try {
|
||||||
// explicit transaction control to avoid holding transaction during
|
// explicit transaction control to avoid holding transaction during
|
||||||
@ -752,11 +753,11 @@ public class S3Engine {
|
|||||||
S3BucketAdapter bucketAdapter = getStorageHostBucketAdapter(host_storagelocation_pair.getFirst());
|
S3BucketAdapter bucketAdapter = getStorageHostBucketAdapter(host_storagelocation_pair.getFirst());
|
||||||
String itemFileName = object_objectitem_pair.getSecond().getStoredPath();
|
String itemFileName = object_objectitem_pair.getSecond().getStoredPath();
|
||||||
InputStream is = null;
|
InputStream is = null;
|
||||||
Transaction txn = null;
|
TransactionLegacy txn = null;
|
||||||
try {
|
try {
|
||||||
// explicit transaction control to avoid holding transaction during file-copy process
|
// explicit transaction control to avoid holding transaction during file-copy process
|
||||||
|
|
||||||
txn = Transaction.open(Transaction.AWSAPI_DB);
|
txn = TransactionLegacy.open(TransactionLegacy.AWSAPI_DB);
|
||||||
txn.start();
|
txn.start();
|
||||||
is = request.getDataInputStream();
|
is = request.getDataInputStream();
|
||||||
String md5Checksum = bucketAdapter.saveObject(is, host_storagelocation_pair.getSecond(), bucket.getName(), itemFileName);
|
String md5Checksum = bucketAdapter.saveObject(is, host_storagelocation_pair.getSecond(), bucket.getName(), itemFileName);
|
||||||
@ -813,11 +814,11 @@ public class S3Engine {
|
|||||||
S3BucketAdapter bucketAdapter = getStorageHostBucketAdapter(host_storagelocation_pair.getFirst());
|
S3BucketAdapter bucketAdapter = getStorageHostBucketAdapter(host_storagelocation_pair.getFirst());
|
||||||
String itemFileName = object_objectitem_pair.getSecond().getStoredPath();
|
String itemFileName = object_objectitem_pair.getSecond().getStoredPath();
|
||||||
InputStream is = null;
|
InputStream is = null;
|
||||||
Transaction txn = null;
|
TransactionLegacy txn = null;
|
||||||
try {
|
try {
|
||||||
// explicit transaction control to avoid holding transaction during file-copy process
|
// explicit transaction control to avoid holding transaction during file-copy process
|
||||||
|
|
||||||
txn = Transaction.open(Transaction.AWSAPI_DB);
|
txn = TransactionLegacy.open(TransactionLegacy.AWSAPI_DB);
|
||||||
txn.start();
|
txn.start();
|
||||||
|
|
||||||
is = request.getInputStream();
|
is = request.getInputStream();
|
||||||
@ -1505,7 +1506,7 @@ public class S3Engine {
|
|||||||
context.setEvalParam( ConditionKeys.Acl, cannedAccessPolicy);
|
context.setEvalParam( ConditionKeys.Acl, cannedAccessPolicy);
|
||||||
|
|
||||||
verifyAccess( context, "SBucket", bucket.getId(), SAcl.PERMISSION_WRITE ); // TODO - check this validates plain POSTs
|
verifyAccess( context, "SBucket", bucket.getId(), SAcl.PERMISSION_WRITE ); // TODO - check this validates plain POSTs
|
||||||
Transaction txn = Transaction.open(Transaction.AWSAPI_DB);
|
TransactionLegacy txn = TransactionLegacy.open(TransactionLegacy.AWSAPI_DB);
|
||||||
txn.start();
|
txn.start();
|
||||||
|
|
||||||
// [B] If versioning is off them we over write a null object item
|
// [B] If versioning is off them we over write a null object item
|
||||||
@ -1554,7 +1555,7 @@ public class S3Engine {
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Transaction txn1 = Transaction.open(Transaction.AWSAPI_DB);
|
TransactionLegacy txn1 = TransactionLegacy.open(TransactionLegacy.AWSAPI_DB);
|
||||||
txn1.start();
|
txn1.start();
|
||||||
// -> there is no object nor an object item
|
// -> there is no object nor an object item
|
||||||
object = new SObjectVO();
|
object = new SObjectVO();
|
||||||
|
|||||||
@ -14,6 +14,12 @@
|
|||||||
# KIND, either express or implied. See the License for the
|
# KIND, either express or implied. See the License for the
|
||||||
# specific language governing permissions and limitations
|
# specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
label.hypervisors=Hypervisors
|
||||||
|
label.home=Home
|
||||||
|
label.sockets=Sockets
|
||||||
|
label.root.disk.size=Root disk size
|
||||||
|
label.s3.nfs.server=S3 NFS Server
|
||||||
|
label.s3.nfs.path=S3 NFS Path
|
||||||
label.delete.events=Delete events
|
label.delete.events=Delete events
|
||||||
label.delete.alerts=Delete alerts
|
label.delete.alerts=Delete alerts
|
||||||
label.archive.alerts=Archive alerts
|
label.archive.alerts=Archive alerts
|
||||||
@ -200,6 +206,8 @@ label.action.enable.user.processing=Enabling User....
|
|||||||
label.action.enable.user=Enable User
|
label.action.enable.user=Enable User
|
||||||
label.action.enable.zone.processing=Enabling Zone....
|
label.action.enable.zone.processing=Enabling Zone....
|
||||||
label.action.enable.zone=Enable Zone
|
label.action.enable.zone=Enable Zone
|
||||||
|
label.action.expunge.instance=Expunge Instance
|
||||||
|
label.action.expunge.instance.processing=Expunging Instance....
|
||||||
label.action.force.reconnect.processing=Reconnecting....
|
label.action.force.reconnect.processing=Reconnecting....
|
||||||
label.action.force.reconnect=Force Reconnect
|
label.action.force.reconnect=Force Reconnect
|
||||||
label.action.generate.keys.processing=Generate Keys....
|
label.action.generate.keys.processing=Generate Keys....
|
||||||
@ -249,6 +257,8 @@ label.action.stop.systemvm.processing=Stopping System VM....
|
|||||||
label.action.stop.systemvm=Stop System VM
|
label.action.stop.systemvm=Stop System VM
|
||||||
label.action.take.snapshot.processing=Taking Snapshot....
|
label.action.take.snapshot.processing=Taking Snapshot....
|
||||||
label.action.take.snapshot=Take Snapshot
|
label.action.take.snapshot=Take Snapshot
|
||||||
|
label.action.revert.snapshot.processing=Reverting to Snapshot...
|
||||||
|
label.action.revert.snapshot=Revert to Snapshot
|
||||||
label.action.unmanage.cluster.processing=Unmanaging Cluster....
|
label.action.unmanage.cluster.processing=Unmanaging Cluster....
|
||||||
label.action.unmanage.cluster=Unmanage Cluster
|
label.action.unmanage.cluster=Unmanage Cluster
|
||||||
label.action.update.OS.preference.processing=Updating OS Preference....
|
label.action.update.OS.preference.processing=Updating OS Preference....
|
||||||
@ -315,6 +325,7 @@ label.add.template=Add Template
|
|||||||
label.add.to.group=Add to group
|
label.add.to.group=Add to group
|
||||||
label.add.user=Add User
|
label.add.user=Add User
|
||||||
label.add.vlan=Add VLAN
|
label.add.vlan=Add VLAN
|
||||||
|
label.add.vxlan=Add VXLAN
|
||||||
label.add.VM.to.tier=Add VM to tier
|
label.add.VM.to.tier=Add VM to tier
|
||||||
label.add.vm=Add VM
|
label.add.vm=Add VM
|
||||||
label.add.vms.to.lb=Add VM(s) to load balancer rule
|
label.add.vms.to.lb=Add VM(s) to load balancer rule
|
||||||
@ -412,6 +423,11 @@ label.cluster.type=Cluster Type
|
|||||||
label.cluster=Cluster
|
label.cluster=Cluster
|
||||||
label.clusters=Clusters
|
label.clusters=Clusters
|
||||||
label.clvm=CLVM
|
label.clvm=CLVM
|
||||||
|
label.rbd=RBD
|
||||||
|
label.rbd.monitor=Ceph monitor
|
||||||
|
label.rbd.pool=Ceph pool
|
||||||
|
label.rbd.id=Cephx user
|
||||||
|
label.rbd.secret=Cephx secret
|
||||||
label.code=Code
|
label.code=Code
|
||||||
label.community=Community
|
label.community=Community
|
||||||
label.compute.and.storage=Compute and Storage
|
label.compute.and.storage=Compute and Storage
|
||||||
@ -540,6 +556,7 @@ label.end.IP=End IP
|
|||||||
label.end.port=End Port
|
label.end.port=End Port
|
||||||
label.end.reserved.system.IP=End Reserved system IP
|
label.end.reserved.system.IP=End Reserved system IP
|
||||||
label.end.vlan=End Vlan
|
label.end.vlan=End Vlan
|
||||||
|
label.end.vxlan=End Vxlan
|
||||||
label.endpoint.or.operation=Endpoint or Operation
|
label.endpoint.or.operation=Endpoint or Operation
|
||||||
label.endpoint=Endpoint
|
label.endpoint=Endpoint
|
||||||
label.enter.token=Enter token
|
label.enter.token=Enter token
|
||||||
@ -551,6 +568,7 @@ label.ESP.lifetime=ESP Lifetime (second)
|
|||||||
label.ESP.policy=ESP policy
|
label.ESP.policy=ESP policy
|
||||||
label.esx.host=ESX/ESXi Host
|
label.esx.host=ESX/ESXi Host
|
||||||
label.example=Example
|
label.example=Example
|
||||||
|
label.expunge=Expunge
|
||||||
label.external.link=External link
|
label.external.link=External link
|
||||||
label.f5=F5
|
label.f5=F5
|
||||||
label.failed=Failed
|
label.failed=Failed
|
||||||
@ -799,6 +817,7 @@ label.network.domain.text=Network domain
|
|||||||
label.network.domain=Network Domain
|
label.network.domain=Network Domain
|
||||||
label.network.id=Network ID
|
label.network.id=Network ID
|
||||||
label.network.label.display.for.blank.value=Use default gateway
|
label.network.label.display.for.blank.value=Use default gateway
|
||||||
|
label.network.limits=Network limits
|
||||||
label.network.name=Network Name
|
label.network.name=Network Name
|
||||||
label.network.offering.display.text=Network Offering Display Text
|
label.network.offering.display.text=Network Offering Display Text
|
||||||
label.network.offering.id=Network Offering ID
|
label.network.offering.id=Network Offering ID
|
||||||
@ -1026,12 +1045,14 @@ label.source.nat=Source NAT
|
|||||||
label.source=Source
|
label.source=Source
|
||||||
label.specify.IP.ranges=Specify IP ranges
|
label.specify.IP.ranges=Specify IP ranges
|
||||||
label.specify.vlan=Specify VLAN
|
label.specify.vlan=Specify VLAN
|
||||||
|
label.specify.vxlan=Specify VXLAN
|
||||||
label.SR.name = SR Name-Label
|
label.SR.name = SR Name-Label
|
||||||
label.srx=SRX
|
label.srx=SRX
|
||||||
label.start.IP=Start IP
|
label.start.IP=Start IP
|
||||||
label.start.port=Start Port
|
label.start.port=Start Port
|
||||||
label.start.reserved.system.IP=Start Reserved system IP
|
label.start.reserved.system.IP=Start Reserved system IP
|
||||||
label.start.vlan=Start Vlan
|
label.start.vlan=Start Vlan
|
||||||
|
label.start.vxlan=Start Vxlan
|
||||||
label.state=State
|
label.state=State
|
||||||
label.static.nat.enabled=Static NAT Enabled
|
label.static.nat.enabled=Static NAT Enabled
|
||||||
label.static.nat.to=Static NAT to
|
label.static.nat.to=Static NAT to
|
||||||
@ -1158,6 +1179,9 @@ label.virtual.routers=Virtual Routers
|
|||||||
label.vlan.id=VLAN ID
|
label.vlan.id=VLAN ID
|
||||||
label.vlan.range=VLAN Range
|
label.vlan.range=VLAN Range
|
||||||
label.vlan=VLAN
|
label.vlan=VLAN
|
||||||
|
label.vxlan.id=VXLAN ID
|
||||||
|
label.vxlan.range=VXLAN Range
|
||||||
|
label.vxlan=VXLAN
|
||||||
label.vm.add=Add Instance
|
label.vm.add=Add Instance
|
||||||
label.vm.destroy=Destroy
|
label.vm.destroy=Destroy
|
||||||
label.vm.display.name=VM display name
|
label.vm.display.name=VM display name
|
||||||
@ -1263,6 +1287,7 @@ message.action.enable.nexusVswitch=Please confirm that you want to enable this n
|
|||||||
message.action.enable.physical.network=Please confirm that you want to enable this physical network.
|
message.action.enable.physical.network=Please confirm that you want to enable this physical network.
|
||||||
message.action.enable.pod=Please confirm that you want to enable this pod.
|
message.action.enable.pod=Please confirm that you want to enable this pod.
|
||||||
message.action.enable.zone=Please confirm that you want to enable this zone.
|
message.action.enable.zone=Please confirm that you want to enable this zone.
|
||||||
|
message.action.expunge.instance=Please confirm that you want to expunge this instance.
|
||||||
message.action.force.reconnect=Your host has been successfully forced to reconnect. This process can take up to several minutes.
|
message.action.force.reconnect=Your host has been successfully forced to reconnect. This process can take up to several minutes.
|
||||||
message.action.host.enable.maintenance.mode=Enabling maintenance mode will cause a live migration of all running instances on this host to any available host.
|
message.action.host.enable.maintenance.mode=Enabling maintenance mode will cause a live migration of all running instances on this host to any available host.
|
||||||
message.action.instance.reset.password=Please confirm that you want to change the ROOT password for this virtual machine.
|
message.action.instance.reset.password=Please confirm that you want to change the ROOT password for this virtual machine.
|
||||||
@ -1283,6 +1308,7 @@ message.action.stop.instance=Please confirm that you want to stop this instance.
|
|||||||
message.action.stop.router=All services provided by this virtual router will be interrupted. Please confirm that you want to stop this router.
|
message.action.stop.router=All services provided by this virtual router will be interrupted. Please confirm that you want to stop this router.
|
||||||
message.action.stop.systemvm=Please confirm that you want to stop this system VM.
|
message.action.stop.systemvm=Please confirm that you want to stop this system VM.
|
||||||
message.action.take.snapshot=Please confirm that you want to take a snapshot of this volume.
|
message.action.take.snapshot=Please confirm that you want to take a snapshot of this volume.
|
||||||
|
message.action.revert.snapshot=Please confirm that you want to revert the owning volume to this snapshot.
|
||||||
message.action.unmanage.cluster=Please confirm that you want to unmanage the cluster.
|
message.action.unmanage.cluster=Please confirm that you want to unmanage the cluster.
|
||||||
message.action.vmsnapshot.delete=Please confirm that you want to delete this VM snapshot.
|
message.action.vmsnapshot.delete=Please confirm that you want to delete this VM snapshot.
|
||||||
message.action.vmsnapshot.revert=Revert VM snapshot
|
message.action.vmsnapshot.revert=Revert VM snapshot
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user