mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
1 use 443 to connect xapi
2. update Java binding to xenserver-5.6.100-1.jar
This commit is contained in:
parent
4c697304ec
commit
017146f753
@ -488,7 +488,7 @@ fi
|
|||||||
%{_javadir}/%{name}-trilead-ssh2-build213.jar
|
%{_javadir}/%{name}-trilead-ssh2-build213.jar
|
||||||
%{_javadir}/%{name}-cglib.jar
|
%{_javadir}/%{name}-cglib.jar
|
||||||
%{_javadir}/%{name}-mysql-connector-java-5.1.7-bin.jar
|
%{_javadir}/%{name}-mysql-connector-java-5.1.7-bin.jar
|
||||||
%{_javadir}/%{name}-xenserver-5.6.0-1.jar
|
%{_javadir}/%{name}-xenserver-5.6.100-1.jar
|
||||||
%{_javadir}/%{name}-xmlrpc-common-3.*.jar
|
%{_javadir}/%{name}-xmlrpc-common-3.*.jar
|
||||||
%{_javadir}/%{name}-xmlrpc-client-3.*.jar
|
%{_javadir}/%{name}-xmlrpc-client-3.*.jar
|
||||||
%{_javadir}/%{name}-jstl-1.2.jar
|
%{_javadir}/%{name}-jstl-1.2.jar
|
||||||
|
|||||||
@ -38,6 +38,6 @@
|
|||||||
<classpathentry kind="lib" path="/thirdparty/vmware-vim.jar"/>
|
<classpathentry kind="lib" path="/thirdparty/vmware-vim.jar"/>
|
||||||
<classpathentry kind="lib" path="/thirdparty/vmware-vim25.jar"/>
|
<classpathentry kind="lib" path="/thirdparty/vmware-vim25.jar"/>
|
||||||
<classpathentry kind="lib" path="/thirdparty/gson.jar"/>
|
<classpathentry kind="lib" path="/thirdparty/gson.jar"/>
|
||||||
<classpathentry kind="lib" path="/thirdparty/xenserver-5.6.0-1.jar" sourcepath="/thirdparty/XenServerJava"/>
|
<classpathentry kind="lib" path="/deps/cloud-xenserver-5.6.100-1.jar" sourcepath="/deps/XenServerJava"/>
|
||||||
<classpathentry kind="output" path="bin"/>
|
<classpathentry kind="output" path="bin"/>
|
||||||
</classpath>
|
</classpath>
|
||||||
|
|||||||
@ -170,7 +170,6 @@ import com.cloud.resource.ServerResource;
|
|||||||
import com.cloud.storage.Storage;
|
import com.cloud.storage.Storage;
|
||||||
import com.cloud.storage.Storage.ImageFormat;
|
import com.cloud.storage.Storage.ImageFormat;
|
||||||
import com.cloud.storage.Storage.StoragePoolType;
|
import com.cloud.storage.Storage.StoragePoolType;
|
||||||
import com.cloud.storage.StorageLayer;
|
|
||||||
import com.cloud.storage.StoragePoolVO;
|
import com.cloud.storage.StoragePoolVO;
|
||||||
import com.cloud.storage.Volume;
|
import com.cloud.storage.Volume;
|
||||||
import com.cloud.storage.Volume.VolumeType;
|
import com.cloud.storage.Volume.VolumeType;
|
||||||
@ -181,7 +180,6 @@ import com.cloud.template.VirtualMachineTemplate.BootloaderType;
|
|||||||
import com.cloud.utils.NumbersUtil;
|
import com.cloud.utils.NumbersUtil;
|
||||||
import com.cloud.utils.Pair;
|
import com.cloud.utils.Pair;
|
||||||
import com.cloud.utils.Ternary;
|
import com.cloud.utils.Ternary;
|
||||||
import com.cloud.utils.component.ComponentLocator;
|
|
||||||
import com.cloud.utils.exception.CloudRuntimeException;
|
import com.cloud.utils.exception.CloudRuntimeException;
|
||||||
import com.cloud.utils.net.NetUtils;
|
import com.cloud.utils.net.NetUtils;
|
||||||
import com.cloud.vm.DiskProfile;
|
import com.cloud.vm.DiskProfile;
|
||||||
@ -325,26 +323,18 @@ public abstract class CitrixResourceBase implements ServerResource {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected boolean pingxenserver() {
|
protected boolean pingxenserver() {
|
||||||
Session slaveSession = null;
|
Connection conn = _connPool.slaveConnect(_host.ip, _username, _password);
|
||||||
Connection slaveConn = null;
|
if ( conn == null ) {
|
||||||
try {
|
|
||||||
URL slaveUrl = null;
|
|
||||||
slaveUrl = new URL("http://" + _host.ip);
|
|
||||||
slaveConn = new Connection(slaveUrl, 100);
|
|
||||||
slaveSession = Session.slaveLocalLoginWithPassword(slaveConn, _username, _password);
|
|
||||||
return true;
|
|
||||||
} catch (Exception e) {
|
|
||||||
return false;
|
return false;
|
||||||
} finally {
|
} else {
|
||||||
if( slaveSession != null ){
|
try {
|
||||||
try{
|
Session.localLogout(conn);
|
||||||
Session.localLogout(slaveConn);
|
} catch (Exception e) {
|
||||||
} catch (Exception e) {
|
|
||||||
|
|
||||||
}
|
|
||||||
slaveConn.dispose();
|
|
||||||
}
|
}
|
||||||
|
conn.dispose();
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String logX(XenAPIObject obj, String msg) {
|
protected String logX(XenAPIObject obj, String msg) {
|
||||||
@ -4117,6 +4107,7 @@ public abstract class CitrixResourceBase implements ServerResource {
|
|||||||
|
|
||||||
public CitrixResourceBase() {
|
public CitrixResourceBase() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
|
public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
|
||||||
@ -4169,6 +4160,7 @@ public abstract class CitrixResourceBase implements ServerResource {
|
|||||||
throw new ConfigurationException("Unable to get the uuid");
|
throw new ConfigurationException("Unable to get the uuid");
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void destroyVDI(Connection conn, VDI vdi) {
|
void destroyVDI(Connection conn, VDI vdi) {
|
||||||
|
|||||||
@ -23,8 +23,14 @@ import java.util.HashMap;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
import javax.net.ssl.HostnameVerifier;
|
||||||
|
import javax.net.ssl.HttpsURLConnection;
|
||||||
|
import javax.net.ssl.SSLSession;
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import org.apache.xmlrpc.XmlRpcException;
|
import org.apache.xmlrpc.XmlRpcException;
|
||||||
|
import org.apache.xmlrpc.client.XmlRpcClient;
|
||||||
|
import org.apache.xmlrpc.client.XmlRpcClientConfigImpl;
|
||||||
|
|
||||||
import com.cloud.utils.exception.CloudRuntimeException;
|
import com.cloud.utils.exception.CloudRuntimeException;
|
||||||
import com.xensource.xenapi.APIVersion;
|
import com.xensource.xenapi.APIVersion;
|
||||||
@ -43,11 +49,30 @@ public class XenServerConnectionPool {
|
|||||||
protected int _retries;
|
protected int _retries;
|
||||||
protected int _interval;
|
protected int _interval;
|
||||||
|
|
||||||
|
static {
|
||||||
|
try {
|
||||||
|
javax.net.ssl.TrustManager[] trustAllCerts = new javax.net.ssl.TrustManager[1];
|
||||||
|
javax.net.ssl.TrustManager tm = new TrustAllManager();
|
||||||
|
trustAllCerts[0] = tm;
|
||||||
|
javax.net.ssl.SSLContext sc = javax.net.ssl.SSLContext.getInstance("TLS");
|
||||||
|
sc.init(null, trustAllCerts, null);
|
||||||
|
javax.net.ssl.HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());
|
||||||
|
HostnameVerifier hv = new HostnameVerifier() {
|
||||||
|
public boolean verify(String hostName, SSLSession session) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
HttpsURLConnection.setDefaultHostnameVerifier(hv);
|
||||||
|
} catch (Exception e) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
protected XenServerConnectionPool() {
|
protected XenServerConnectionPool() {
|
||||||
_retries = 3;
|
_retries = 3;
|
||||||
_interval = 3;
|
_interval = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addConnect(String poolUuid, XenServerConnection conn){
|
private void addConnect(String poolUuid, XenServerConnection conn){
|
||||||
if( poolUuid == null ) return;
|
if( poolUuid == null ) return;
|
||||||
if (s_logger.isDebugEnabled()) {
|
if (s_logger.isDebugEnabled()) {
|
||||||
@ -96,7 +121,7 @@ public class XenServerConnectionPool {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static public boolean joinPool(Connection conn, String hostIp, String masterIp, String username, String password) {
|
public boolean joinPool(Connection conn, String hostIp, String masterIp, String username, String password) {
|
||||||
try {
|
try {
|
||||||
Pool.join(conn, masterIp, username, password);
|
Pool.join(conn, masterIp, username, password);
|
||||||
if (s_logger.isDebugEnabled()) {
|
if (s_logger.isDebugEnabled()) {
|
||||||
@ -114,7 +139,7 @@ public class XenServerConnectionPool {
|
|||||||
if (s_logger.isDebugEnabled()) {
|
if (s_logger.isDebugEnabled()) {
|
||||||
s_logger.debug("Logging on as the slave to " + hostIp);
|
s_logger.debug("Logging on as the slave to " + hostIp);
|
||||||
}
|
}
|
||||||
slaveConn = new Connection(getURL(hostIp), 100);
|
slaveConn = new Connection(getURL(hostIp));
|
||||||
slaveSession = Session.slaveLocalLoginWithPassword(slaveConn, username, password);
|
slaveSession = Session.slaveLocalLoginWithPassword(slaveConn, username, password);
|
||||||
if (s_logger.isDebugEnabled()) {
|
if (s_logger.isDebugEnabled()) {
|
||||||
s_logger.debug("Slave logon successful. session= " + slaveSession);
|
s_logger.debug("Slave logon successful. session= " + slaveSession);
|
||||||
@ -175,7 +200,7 @@ public class XenServerConnectionPool {
|
|||||||
masterConn = null;
|
masterConn = null;
|
||||||
Session slaveSession = null;
|
Session slaveSession = null;
|
||||||
|
|
||||||
slaveConn = new Connection(getURL(slaveIp), 100);
|
slaveConn = new Connection(getURL(slaveIp));
|
||||||
slaveSession = Session.slaveLocalLoginWithPassword(slaveConn,
|
slaveSession = Session.slaveLocalLoginWithPassword(slaveConn,
|
||||||
username, password);
|
username, password);
|
||||||
|
|
||||||
@ -193,7 +218,7 @@ public class XenServerConnectionPool {
|
|||||||
Session.localLogout(slaveConn);
|
Session.localLogout(slaveConn);
|
||||||
slaveConn = null;
|
slaveConn = null;
|
||||||
s_logger.debug("Logging on as the master to " + masterIp);
|
s_logger.debug("Logging on as the master to " + masterIp);
|
||||||
masterConn = new Connection(getURL(masterIp), 100);
|
masterConn = new Connection(getURL(masterIp));
|
||||||
Session.loginWithPassword(masterConn, username, password,
|
Session.loginWithPassword(masterConn, username, password,
|
||||||
APIVersion.latest().toString());
|
APIVersion.latest().toString());
|
||||||
removeConnect(poolUuid);
|
removeConnect(poolUuid);
|
||||||
@ -240,7 +265,7 @@ public class XenServerConnectionPool {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void logout(Connection conn) {
|
private void logout(Connection conn) {
|
||||||
try {
|
try {
|
||||||
s_logger.debug("Logging out of the session "
|
s_logger.debug("Logging out of the session "
|
||||||
+ conn.getSessionReference());
|
+ conn.getSessionReference());
|
||||||
@ -252,40 +277,49 @@ public class XenServerConnectionPool {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Connection masterConnect(String ip, String username, String password) {
|
public Connection slaveConnect(String ip, String username, String password) {
|
||||||
Connection slaveConn = null;
|
Connection conn = null;
|
||||||
Connection masterConn = null;
|
|
||||||
try{
|
try{
|
||||||
slaveConn = new Connection(getURL(ip), 100);
|
conn = new Connection(getURL(ip));
|
||||||
|
Session.slaveLocalLoginWithPassword(conn, username, password);
|
||||||
|
return conn;
|
||||||
|
}catch ( Exception e){
|
||||||
|
s_logger.debug("Failed to slave local login to " + ip);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Connection masterConnect(String ip, String username, String password) {
|
||||||
|
Connection conn = null;
|
||||||
|
try{
|
||||||
|
conn = new Connection(getURL(ip));
|
||||||
|
s_logger.debug("Logging on as the master to " + ip);
|
||||||
|
Session.loginWithPassword(conn, username, password,
|
||||||
|
APIVersion.latest().toString());
|
||||||
|
return conn;
|
||||||
|
}catch ( Exception e){
|
||||||
|
s_logger.debug("Failed to slave local login to " + ip);
|
||||||
|
}
|
||||||
|
throw new RuntimeException("can not log in to master " + ip);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getMasterIp(String ip, String username, String password) {
|
||||||
|
Connection slaveConn = null;
|
||||||
|
try{
|
||||||
|
slaveConn = new Connection(getURL(ip));
|
||||||
Session.slaveLocalLoginWithPassword(slaveConn, username, password);
|
Session.slaveLocalLoginWithPassword(slaveConn, username, password);
|
||||||
|
|
||||||
if (s_logger.isDebugEnabled()) {
|
if (s_logger.isDebugEnabled()) {
|
||||||
s_logger.debug("Slave logon to " + ip);
|
s_logger.debug("Slave logon to " + ip);
|
||||||
}
|
}
|
||||||
String masterIp = null;
|
String masterIp = null;
|
||||||
try {
|
Pool.Record pr = getPoolRecord(slaveConn);
|
||||||
Pool.Record pr = getPoolRecord(slaveConn);
|
Host master = pr.master;
|
||||||
Host master = pr.master;
|
masterIp = master.getAddress(slaveConn);
|
||||||
masterIp = master.getAddress(slaveConn);
|
return masterIp;
|
||||||
|
|
||||||
s_logger.debug("Logging on as the master to " + masterIp);
|
|
||||||
masterConn = new Connection(getURL(masterIp), 100);
|
|
||||||
Session.loginWithPassword(masterConn, username, password,
|
|
||||||
APIVersion.latest().toString());
|
|
||||||
return masterConn;
|
|
||||||
} catch (Exception e) {
|
|
||||||
s_logger.debug("Failed to log on as master to ");
|
|
||||||
if( masterConn != null ) {
|
|
||||||
try {
|
|
||||||
Session.logout(masterConn);
|
|
||||||
} catch (Exception e1) {
|
|
||||||
}
|
|
||||||
masterConn.dispose();
|
|
||||||
masterConn = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}catch ( Exception e){
|
}catch ( Exception e){
|
||||||
s_logger.debug("Failed to slave local login to " + ip);
|
s_logger.debug("Failed to slave local login to " + ip + " due to " + e.toString());
|
||||||
} finally {
|
} finally {
|
||||||
if( slaveConn != null ) {
|
if( slaveConn != null ) {
|
||||||
try {
|
try {
|
||||||
@ -295,23 +329,11 @@ public class XenServerConnectionPool {
|
|||||||
slaveConn.dispose();
|
slaveConn.dispose();
|
||||||
slaveConn = null;
|
slaveConn = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return null;
|
throw new RuntimeException("can not get master ip");
|
||||||
}
|
|
||||||
|
|
||||||
static public Connection slaveConnect(String ip, String username, String password) {
|
|
||||||
Connection conn = null;
|
|
||||||
try{
|
|
||||||
conn = new Connection(getURL(ip), 100);
|
|
||||||
Session.slaveLocalLoginWithPassword(conn, username, password);
|
|
||||||
return conn;
|
|
||||||
}catch ( Exception e){
|
|
||||||
s_logger.debug("Failed to slave local login to " + ip);
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void PoolSyncDB(Connection conn) {
|
static void PoolSyncDB(Connection conn) {
|
||||||
try {
|
try {
|
||||||
Set<Host> hosts = Host.getAll(conn);
|
Set<Host> hosts = Host.getAll(conn);
|
||||||
@ -338,7 +360,7 @@ public class XenServerConnectionPool {
|
|||||||
Connection c = null;
|
Connection c = null;
|
||||||
try{
|
try{
|
||||||
s_logger.debug("Trying to transition master to " + slaveIp);
|
s_logger.debug("Trying to transition master to " + slaveIp);
|
||||||
slaveConn = new Connection(getURL(slaveIp), 100);
|
slaveConn = new Connection(getURL(slaveIp));
|
||||||
Session.slaveLocalLoginWithPassword(slaveConn, username, password);
|
Session.slaveLocalLoginWithPassword(slaveConn, username, password);
|
||||||
Pool.emergencyTransitionToMaster(slaveConn);
|
Pool.emergencyTransitionToMaster(slaveConn);
|
||||||
try {
|
try {
|
||||||
@ -349,7 +371,7 @@ public class XenServerConnectionPool {
|
|||||||
// restart xapi in 10 sec
|
// restart xapi in 10 sec
|
||||||
forceSleep(10);
|
forceSleep(10);
|
||||||
// check if the master of this host is set correctly.
|
// check if the master of this host is set correctly.
|
||||||
c = new Connection(getURL(slaveIp), 100);
|
c = new Connection(getURL(slaveIp));
|
||||||
for (int i = 0; i < 30; i++) {
|
for (int i = 0; i < 30; i++) {
|
||||||
try {
|
try {
|
||||||
Session.loginWithPassword(c, username, password, APIVersion.latest().toString());
|
Session.loginWithPassword(c, username, password, APIVersion.latest().toString());
|
||||||
@ -383,13 +405,13 @@ public class XenServerConnectionPool {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void PoolEmergencyResetMaster(String slaveIp, String masterIp,
|
private void PoolEmergencyResetMaster(String slaveIp, String masterIp,
|
||||||
String username, String password) {
|
String username, String password) {
|
||||||
Connection slaveConn = null;
|
Connection slaveConn = null;
|
||||||
try {
|
try {
|
||||||
s_logger.debug("Trying to reset master of slave " + slaveIp
|
s_logger.debug("Trying to reset master of slave " + slaveIp
|
||||||
+ " to " + masterIp);
|
+ " to " + masterIp);
|
||||||
slaveConn = new Connection(getURL(slaveIp), 10);
|
slaveConn = new Connection(getURL(slaveIp));
|
||||||
Session.slaveLocalLoginWithPassword(slaveConn, username, password);
|
Session.slaveLocalLoginWithPassword(slaveConn, username, password);
|
||||||
Pool.emergencyResetMaster(slaveConn, masterIp);
|
Pool.emergencyResetMaster(slaveConn, masterIp);
|
||||||
if (slaveConn != null) {
|
if (slaveConn != null) {
|
||||||
@ -449,7 +471,7 @@ public class XenServerConnectionPool {
|
|||||||
|
|
||||||
String slaveIp = slave.getAddress(conn);
|
String slaveIp = slave.getAddress(conn);
|
||||||
s_logger.debug("Logging on as the slave to " + slaveIp);
|
s_logger.debug("Logging on as the slave to " + slaveIp);
|
||||||
slaveConn = new Connection(getURL(slaveIp), 10);
|
slaveConn = new Connection(getURL(slaveIp));
|
||||||
Session.slaveLocalLoginWithPassword(slaveConn, username, password);
|
Session.slaveLocalLoginWithPassword(slaveConn, username, password);
|
||||||
Pool.Record pr = getPoolRecord(slaveConn);
|
Pool.Record pr = getPoolRecord(slaveConn);
|
||||||
String mIp = pr.master.getAddress(slaveConn);
|
String mIp = pr.master.getAddress(slaveConn);
|
||||||
@ -476,7 +498,7 @@ public class XenServerConnectionPool {
|
|||||||
try {
|
try {
|
||||||
s_logger.debug("Logging on as the slave to " + slaveIp);
|
s_logger.debug("Logging on as the slave to " + slaveIp);
|
||||||
|
|
||||||
slaveConn = new Connection(getURL(slaveIp), 10);
|
slaveConn = new Connection(getURL(slaveIp));
|
||||||
Session.slaveLocalLoginWithPassword(slaveConn, username,
|
Session.slaveLocalLoginWithPassword(slaveConn, username,
|
||||||
password);
|
password);
|
||||||
Pool.Record slavePoolr = getPoolRecord(slaveConn);
|
Pool.Record slavePoolr = getPoolRecord(slaveConn);
|
||||||
@ -505,9 +527,9 @@ public class XenServerConnectionPool {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static private URL getURL(String ip){
|
private URL getURL(String ip){
|
||||||
try {
|
try {
|
||||||
return new URL("http://" + ip);
|
return new URL("https://" + ip);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
String msg = "Unable to convert IP " + ip + " to URL due to " + e.toString();
|
String msg = "Unable to convert IP " + ip + " to URL due to " + e.toString();
|
||||||
if (s_logger.isDebugEnabled()) {
|
if (s_logger.isDebugEnabled()) {
|
||||||
@ -566,7 +588,7 @@ public class XenServerConnectionPool {
|
|||||||
s_logger.debug("Logging on as the slave to " + ipAddress);
|
s_logger.debug("Logging on as the slave to " + ipAddress);
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
sConn = new Connection(getURL(ipAddress), 100);
|
sConn = new Connection(getURL(ipAddress));
|
||||||
Session.slaveLocalLoginWithPassword(sConn,
|
Session.slaveLocalLoginWithPassword(sConn,
|
||||||
username, password);
|
username, password);
|
||||||
} catch (Exception e){
|
} catch (Exception e){
|
||||||
@ -652,6 +674,7 @@ public class XenServerConnectionPool {
|
|||||||
public class XenServerConnection extends Connection {
|
public class XenServerConnection extends Connection {
|
||||||
long _interval;
|
long _interval;
|
||||||
int _retries;
|
int _retries;
|
||||||
|
int _wait;
|
||||||
String _ip;
|
String _ip;
|
||||||
String _username;
|
String _username;
|
||||||
String _password;
|
String _password;
|
||||||
@ -659,7 +682,8 @@ public class XenServerConnectionPool {
|
|||||||
|
|
||||||
public XenServerConnection(URL url, String ip, String username, String password,
|
public XenServerConnection(URL url, String ip, String username, String password,
|
||||||
int retries, int interval, int wait) {
|
int retries, int interval, int wait) {
|
||||||
super(url, wait);
|
super(url);
|
||||||
|
_wait = wait;
|
||||||
_ip = ip;
|
_ip = ip;
|
||||||
_retries = retries;
|
_retries = retries;
|
||||||
_username = username;
|
_username = username;
|
||||||
@ -671,6 +695,19 @@ public class XenServerConnectionPool {
|
|||||||
return _wait;
|
return _wait;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected XmlRpcClient getClientFromURL(URL url)
|
||||||
|
{
|
||||||
|
XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
|
||||||
|
config.setServerURL(url);
|
||||||
|
config.setReplyTimeout(_wait * 1000);
|
||||||
|
config.setConnectionTimeout(10000);
|
||||||
|
XmlRpcClient client = new XmlRpcClient();
|
||||||
|
client.setConfig(config);
|
||||||
|
return client;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public String getPoolUuid() {
|
public String getPoolUuid() {
|
||||||
return _poolUuid;
|
return _poolUuid;
|
||||||
}
|
}
|
||||||
@ -767,4 +804,29 @@ public class XenServerConnectionPool {
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static class TrustAllManager implements javax.net.ssl.TrustManager, javax.net.ssl.X509TrustManager {
|
||||||
|
public java.security.cert.X509Certificate[] getAcceptedIssuers() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isServerTrusted(java.security.cert.X509Certificate[] certs) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isClientTrusted(java.security.cert.X509Certificate[] certs) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void checkServerTrusted(java.security.cert.X509Certificate[] certs, String authType)
|
||||||
|
throws java.security.cert.CertificateException {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void checkClientTrusted(java.security.cert.X509Certificate[] certs, String authType)
|
||||||
|
throws java.security.cert.CertificateException {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
2
debian/cloud-deps.install
vendored
2
debian/cloud-deps.install
vendored
@ -12,7 +12,7 @@
|
|||||||
/usr/share/java/cloud-trilead-ssh2-build213.jar
|
/usr/share/java/cloud-trilead-ssh2-build213.jar
|
||||||
/usr/share/java/cloud-cglib.jar
|
/usr/share/java/cloud-cglib.jar
|
||||||
/usr/share/java/cloud-mysql-connector-java-5.1.7-bin.jar
|
/usr/share/java/cloud-mysql-connector-java-5.1.7-bin.jar
|
||||||
/usr/share/java/cloud-xenserver-5.6.0-1.jar
|
/usr/share/java/cloud-xenserver-5.6.100-1.jar
|
||||||
/usr/share/java/cloud-xmlrpc-common-3.*.jar
|
/usr/share/java/cloud-xmlrpc-common-3.*.jar
|
||||||
/usr/share/java/cloud-xmlrpc-client-3.*.jar
|
/usr/share/java/cloud-xmlrpc-client-3.*.jar
|
||||||
/usr/share/java/cloud-jstl-*.jar
|
/usr/share/java/cloud-jstl-*.jar
|
||||||
|
|||||||
4
deps/XenServerJava/Makefile
vendored
4
deps/XenServerJava/Makefile
vendored
@ -2,9 +2,9 @@
|
|||||||
|
|
||||||
BINDINGJAVAFILES := $(wildcard com/xensource/xenapi/*.java)
|
BINDINGJAVAFILES := $(wildcard com/xensource/xenapi/*.java)
|
||||||
BINDINGCLASSFILES := $(BINDINGJAVAFILES:.java=.class)
|
BINDINGCLASSFILES := $(BINDINGJAVAFILES:.java=.class)
|
||||||
BINDINGJAR := xenserver-5.6.0-1.jar
|
BINDINGJAR := xenserver-5.6.100-1.jar
|
||||||
|
|
||||||
CLASSPATH := :xmlrpc-client-3.1.jar:xmlrpc-common-3.1.jar:ws-commons-util-1.0.2.jar
|
CLASSPATH := :../cloud-xmlrpc-client-3.1.3.jar:../cloud-xmlrpc-common-3.1.3.jar:../cloud-ws-commons-util-1.0.2.jar
|
||||||
EXAMPLECLASSPATH := :$(BINDINGJAR)$(CLASSPATH)
|
EXAMPLECLASSPATH := :$(BINDINGJAR)$(CLASSPATH)
|
||||||
|
|
||||||
.PHONY: all
|
.PHONY: all
|
||||||
|
|||||||
2
deps/XenServerJava/README.txt
vendored
2
deps/XenServerJava/README.txt
vendored
@ -1,7 +1,7 @@
|
|||||||
XenServerJava
|
XenServerJava
|
||||||
=============
|
=============
|
||||||
|
|
||||||
Version 5.6.0-1.
|
Version 5.6.100-1.
|
||||||
|
|
||||||
XenServerJava is a complete SDK for Citrix XenServer, exposing the XenServer
|
XenServerJava is a complete SDK for Citrix XenServer, exposing the XenServer
|
||||||
API as Java classes.
|
API as Java classes.
|
||||||
|
|||||||
@ -123,7 +123,7 @@ public class Blob extends XenAPIObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* unique identifier/object reference
|
* Unique identifier/object reference
|
||||||
*/
|
*/
|
||||||
public String uuid;
|
public String uuid;
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -119,7 +119,7 @@ public class Bond extends XenAPIObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* unique identifier/object reference
|
* Unique identifier/object reference
|
||||||
*/
|
*/
|
||||||
public String uuid;
|
public String uuid;
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -42,7 +42,7 @@ import org.apache.xmlrpc.client.XmlRpcClient;
|
|||||||
import org.apache.xmlrpc.client.XmlRpcClientConfig;
|
import org.apache.xmlrpc.client.XmlRpcClientConfig;
|
||||||
import org.apache.xmlrpc.client.XmlRpcClientConfigImpl;
|
import org.apache.xmlrpc.client.XmlRpcClientConfigImpl;
|
||||||
import org.apache.xmlrpc.client.XmlRpcHttpClientConfig;
|
import org.apache.xmlrpc.client.XmlRpcHttpClientConfig;
|
||||||
import org.apache.xmlrpc.client.XmlRpcCommonsTransportFactory;
|
|
||||||
import com.xensource.xenapi.Types.BadServerResponse;
|
import com.xensource.xenapi.Types.BadServerResponse;
|
||||||
import com.xensource.xenapi.Types.SessionAuthenticationFailed;
|
import com.xensource.xenapi.Types.SessionAuthenticationFailed;
|
||||||
import com.xensource.xenapi.Types.XenAPIException;
|
import com.xensource.xenapi.Types.XenAPIException;
|
||||||
@ -57,7 +57,7 @@ public class Connection
|
|||||||
/**
|
/**
|
||||||
* The version of the bindings that this class belongs to.
|
* The version of the bindings that this class belongs to.
|
||||||
*/
|
*/
|
||||||
public static final String BINDINGS_VERSION = "5.6.0-1";
|
public static final String BINDINGS_VERSION = "5.6.100-1";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* true if the connection is to the Rio edition of XenServer. Certain function calls are not allowed.
|
* true if the connection is to the Rio edition of XenServer. Certain function calls are not allowed.
|
||||||
@ -68,7 +68,6 @@ public class Connection
|
|||||||
public Boolean rioConnection = false;
|
public Boolean rioConnection = false;
|
||||||
|
|
||||||
private APIVersion apiVersion;
|
private APIVersion apiVersion;
|
||||||
protected int _wait;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Updated when Session.login_with_password() is called.
|
* Updated when Session.login_with_password() is called.
|
||||||
@ -86,7 +85,7 @@ public class Connection
|
|||||||
/**
|
/**
|
||||||
* As seen by the xmlrpc library. From our point of view it's a server.
|
* As seen by the xmlrpc library. From our point of view it's a server.
|
||||||
*/
|
*/
|
||||||
protected XmlRpcClient client;
|
private final XmlRpcClient client;
|
||||||
|
|
||||||
private final boolean deprecatedConstructorUsed;
|
private final boolean deprecatedConstructorUsed;
|
||||||
|
|
||||||
@ -164,11 +163,10 @@ public class Connection
|
|||||||
* When this constructor is used, a call to dispose() will do nothing. The programmer is responsible for manually
|
* When this constructor is used, a call to dispose() will do nothing. The programmer is responsible for manually
|
||||||
* logging out the Session.
|
* logging out the Session.
|
||||||
*/
|
*/
|
||||||
public Connection(URL url, int wait)
|
public Connection(URL url)
|
||||||
{
|
{
|
||||||
deprecatedConstructorUsed = false;
|
deprecatedConstructorUsed = false;
|
||||||
_wait = wait;
|
|
||||||
|
|
||||||
this.client = getClientFromURL(url);
|
this.client = getClientFromURL(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -181,11 +179,10 @@ public class Connection
|
|||||||
* Connection object does not call Session.logout. The programmer is responsible for ensuring the Session is logged
|
* Connection object does not call Session.logout. The programmer is responsible for ensuring the Session is logged
|
||||||
* in and out correctly.
|
* in and out correctly.
|
||||||
*/
|
*/
|
||||||
public Connection(URL url, String sessionReference, int wait)
|
public Connection(URL url, String sessionReference)
|
||||||
{
|
{
|
||||||
deprecatedConstructorUsed = false;
|
deprecatedConstructorUsed = false;
|
||||||
|
|
||||||
this._wait = wait;
|
|
||||||
this.client = getClientFromURL(url);
|
this.client = getClientFromURL(url);
|
||||||
this.sessionReference = sessionReference;
|
this.sessionReference = sessionReference;
|
||||||
}
|
}
|
||||||
@ -281,11 +278,8 @@ public class Connection
|
|||||||
{
|
{
|
||||||
config.setTimeZone(TimeZone.getTimeZone("UTC"));
|
config.setTimeZone(TimeZone.getTimeZone("UTC"));
|
||||||
config.setServerURL(url);
|
config.setServerURL(url);
|
||||||
config.setReplyTimeout(_wait * 1000);
|
|
||||||
config.setConnectionTimeout(_wait / 10 * 1000);
|
|
||||||
XmlRpcClient client = new XmlRpcClient();
|
XmlRpcClient client = new XmlRpcClient();
|
||||||
client.setConfig(config);
|
client.setConfig(config);
|
||||||
client.setTransportFactory(new XmlRpcCommonsTransportFactory(client));
|
|
||||||
return client;
|
return client;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -347,8 +341,7 @@ public class Connection
|
|||||||
new Connection(new URL(client_url.getProtocol(),
|
new Connection(new URL(client_url.getProtocol(),
|
||||||
(String)error[1],
|
(String)error[1],
|
||||||
client_url.getPort(),
|
client_url.getPort(),
|
||||||
client_url.getFile()),
|
client_url.getFile()));
|
||||||
_wait);
|
|
||||||
tmp_conn.sessionReference = sessionReference;
|
tmp_conn.sessionReference = sessionReference;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|||||||
@ -121,7 +121,7 @@ public class Console extends XenAPIObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* unique identifier/object reference
|
* Unique identifier/object reference
|
||||||
*/
|
*/
|
||||||
public String uuid;
|
public String uuid;
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -119,7 +119,7 @@ public class Crashdump extends XenAPIObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* unique identifier/object reference
|
* Unique identifier/object reference
|
||||||
*/
|
*/
|
||||||
public String uuid;
|
public String uuid;
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -142,6 +142,7 @@ public class Host extends XenAPIObject {
|
|||||||
print.printf("%1$20s: %2$s\n", "biosStrings", this.biosStrings);
|
print.printf("%1$20s: %2$s\n", "biosStrings", this.biosStrings);
|
||||||
print.printf("%1$20s: %2$s\n", "powerOnMode", this.powerOnMode);
|
print.printf("%1$20s: %2$s\n", "powerOnMode", this.powerOnMode);
|
||||||
print.printf("%1$20s: %2$s\n", "powerOnConfig", this.powerOnConfig);
|
print.printf("%1$20s: %2$s\n", "powerOnConfig", this.powerOnConfig);
|
||||||
|
print.printf("%1$20s: %2$s\n", "localCacheSr", this.localCacheSr);
|
||||||
return writer.toString();
|
return writer.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -193,11 +194,12 @@ public class Host extends XenAPIObject {
|
|||||||
map.put("bios_strings", this.biosStrings == null ? new HashMap<String, String>() : this.biosStrings);
|
map.put("bios_strings", this.biosStrings == null ? new HashMap<String, String>() : this.biosStrings);
|
||||||
map.put("power_on_mode", this.powerOnMode == null ? "" : this.powerOnMode);
|
map.put("power_on_mode", this.powerOnMode == null ? "" : this.powerOnMode);
|
||||||
map.put("power_on_config", this.powerOnConfig == null ? new HashMap<String, String>() : this.powerOnConfig);
|
map.put("power_on_config", this.powerOnConfig == null ? new HashMap<String, String>() : this.powerOnConfig);
|
||||||
|
map.put("local_cache_sr", this.localCacheSr == null ? new SR("OpaqueRef:NULL") : this.localCacheSr);
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* unique identifier/object reference
|
* Unique identifier/object reference
|
||||||
*/
|
*/
|
||||||
public String uuid;
|
public String uuid;
|
||||||
/**
|
/**
|
||||||
@ -368,6 +370,10 @@ public class Host extends XenAPIObject {
|
|||||||
* The power on config
|
* The power on config
|
||||||
*/
|
*/
|
||||||
public Map<String, String> powerOnConfig;
|
public Map<String, String> powerOnConfig;
|
||||||
|
/**
|
||||||
|
* The SR that is used as a local cache
|
||||||
|
*/
|
||||||
|
public SR localCacheSr;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1154,6 +1160,23 @@ public class Host extends XenAPIObject {
|
|||||||
return Types.toMapOfStringString(result);
|
return Types.toMapOfStringString(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the local_cache_sr field of the given host.
|
||||||
|
*
|
||||||
|
* @return value of the field
|
||||||
|
*/
|
||||||
|
public SR getLocalCacheSr(Connection c) throws
|
||||||
|
BadServerResponse,
|
||||||
|
XenAPIException,
|
||||||
|
XmlRpcException {
|
||||||
|
String method_call = "host.get_local_cache_sr";
|
||||||
|
String session = c.getSessionReference();
|
||||||
|
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
|
||||||
|
Map response = c.dispatch(method_call, method_params);
|
||||||
|
Object result = response.get("Value");
|
||||||
|
return Types.toSR(result);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the name/label field of the given host.
|
* Set the name/label field of the given host.
|
||||||
*
|
*
|
||||||
@ -2448,6 +2471,23 @@ public class Host extends XenAPIObject {
|
|||||||
return Types.toDate(result);
|
return Types.toDate(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This call queries the host's clock for the current time in the host's local timezone
|
||||||
|
*
|
||||||
|
* @return The current local time
|
||||||
|
*/
|
||||||
|
public Date getServerLocaltime(Connection c) throws
|
||||||
|
BadServerResponse,
|
||||||
|
XenAPIException,
|
||||||
|
XmlRpcException {
|
||||||
|
String method_call = "host.get_server_localtime";
|
||||||
|
String session = c.getSessionReference();
|
||||||
|
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
|
||||||
|
Map response = c.dispatch(method_call, method_params);
|
||||||
|
Object result = response.get("Value");
|
||||||
|
return Types.toDate(result);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This call enables external authentication on a host
|
* This call enables external authentication on a host
|
||||||
*
|
*
|
||||||
@ -2665,6 +2705,37 @@ public class Host extends XenAPIObject {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enable the use of a local SR for caching purposes
|
||||||
|
*
|
||||||
|
* @param sr The SR to use as a local cache
|
||||||
|
*/
|
||||||
|
public void enableLocalStorageCaching(Connection c, SR sr) throws
|
||||||
|
BadServerResponse,
|
||||||
|
XenAPIException,
|
||||||
|
XmlRpcException {
|
||||||
|
String method_call = "host.enable_local_storage_caching";
|
||||||
|
String session = c.getSessionReference();
|
||||||
|
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(sr)};
|
||||||
|
Map response = c.dispatch(method_call, method_params);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Disable the use of a local SR for caching purposes
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void disableLocalStorageCaching(Connection c) throws
|
||||||
|
BadServerResponse,
|
||||||
|
XenAPIException,
|
||||||
|
XmlRpcException {
|
||||||
|
String method_call = "host.disable_local_storage_caching";
|
||||||
|
String session = c.getSessionReference();
|
||||||
|
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
|
||||||
|
Map response = c.dispatch(method_call, method_params);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return a list of all the hosts known to the system.
|
* Return a list of all the hosts known to the system.
|
||||||
*
|
*
|
||||||
|
|||||||
@ -137,7 +137,7 @@ public class HostCpu extends XenAPIObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* unique identifier/object reference
|
* Unique identifier/object reference
|
||||||
*/
|
*/
|
||||||
public String uuid;
|
public String uuid;
|
||||||
/**
|
/**
|
||||||
@ -192,10 +192,11 @@ public class HostCpu extends XenAPIObject {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a record containing the current state of the given host_cpu.
|
* Get a record containing the current state of the given host_cpu.
|
||||||
|
* @deprecated
|
||||||
*
|
*
|
||||||
* @return all fields from the object
|
* @return all fields from the object
|
||||||
*/
|
*/
|
||||||
public HostCpu.Record getRecord(Connection c) throws
|
@Deprecated public HostCpu.Record getRecord(Connection c) throws
|
||||||
BadServerResponse,
|
BadServerResponse,
|
||||||
XenAPIException,
|
XenAPIException,
|
||||||
XmlRpcException {
|
XmlRpcException {
|
||||||
@ -209,11 +210,12 @@ public class HostCpu extends XenAPIObject {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a reference to the host_cpu instance with the specified UUID.
|
* Get a reference to the host_cpu instance with the specified UUID.
|
||||||
|
* @deprecated
|
||||||
*
|
*
|
||||||
* @param uuid UUID of object to return
|
* @param uuid UUID of object to return
|
||||||
* @return reference to the object
|
* @return reference to the object
|
||||||
*/
|
*/
|
||||||
public static HostCpu getByUuid(Connection c, String uuid) throws
|
@Deprecated public static HostCpu getByUuid(Connection c, String uuid) throws
|
||||||
BadServerResponse,
|
BadServerResponse,
|
||||||
XenAPIException,
|
XenAPIException,
|
||||||
XmlRpcException {
|
XmlRpcException {
|
||||||
@ -497,10 +499,11 @@ public class HostCpu extends XenAPIObject {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Return a list of all the host_cpus known to the system.
|
* Return a list of all the host_cpus known to the system.
|
||||||
|
* @deprecated
|
||||||
*
|
*
|
||||||
* @return references to all objects
|
* @return references to all objects
|
||||||
*/
|
*/
|
||||||
public static Set<HostCpu> getAll(Connection c) throws
|
@Deprecated public static Set<HostCpu> getAll(Connection c) throws
|
||||||
BadServerResponse,
|
BadServerResponse,
|
||||||
XenAPIException,
|
XenAPIException,
|
||||||
XmlRpcException {
|
XmlRpcException {
|
||||||
|
|||||||
@ -121,7 +121,7 @@ public class HostCrashdump extends XenAPIObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* unique identifier/object reference
|
* Unique identifier/object reference
|
||||||
*/
|
*/
|
||||||
public String uuid;
|
public String uuid;
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -123,7 +123,7 @@ public class HostMetrics extends XenAPIObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* unique identifier/object reference
|
* Unique identifier/object reference
|
||||||
*/
|
*/
|
||||||
public String uuid;
|
public String uuid;
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -131,7 +131,7 @@ public class HostPatch extends XenAPIObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* unique identifier/object reference
|
* Unique identifier/object reference
|
||||||
*/
|
*/
|
||||||
public String uuid;
|
public String uuid;
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -125,7 +125,7 @@ public class Message extends XenAPIObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* unique identifier/object reference
|
* Unique identifier/object reference
|
||||||
*/
|
*/
|
||||||
public String uuid;
|
public String uuid;
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -135,7 +135,7 @@ public class Network extends XenAPIObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* unique identifier/object reference
|
* Unique identifier/object reference
|
||||||
*/
|
*/
|
||||||
public String uuid;
|
public String uuid;
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -123,7 +123,7 @@ public class PBD extends XenAPIObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* unique identifier/object reference
|
* Unique identifier/object reference
|
||||||
*/
|
*/
|
||||||
public String uuid;
|
public String uuid;
|
||||||
/**
|
/**
|
||||||
|
|||||||
110
deps/XenServerJava/com/xensource/xenapi/PIF.java
vendored
110
deps/XenServerJava/com/xensource/xenapi/PIF.java
vendored
@ -121,6 +121,8 @@ public class PIF extends XenAPIObject {
|
|||||||
print.printf("%1$20s: %2$s\n", "management", this.management);
|
print.printf("%1$20s: %2$s\n", "management", this.management);
|
||||||
print.printf("%1$20s: %2$s\n", "otherConfig", this.otherConfig);
|
print.printf("%1$20s: %2$s\n", "otherConfig", this.otherConfig);
|
||||||
print.printf("%1$20s: %2$s\n", "disallowUnplug", this.disallowUnplug);
|
print.printf("%1$20s: %2$s\n", "disallowUnplug", this.disallowUnplug);
|
||||||
|
print.printf("%1$20s: %2$s\n", "tunnelAccessPIFOf", this.tunnelAccessPIFOf);
|
||||||
|
print.printf("%1$20s: %2$s\n", "tunnelTransportPIFOf", this.tunnelTransportPIFOf);
|
||||||
return writer.toString();
|
return writer.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -151,11 +153,13 @@ public class PIF extends XenAPIObject {
|
|||||||
map.put("management", this.management == null ? false : this.management);
|
map.put("management", this.management == null ? false : this.management);
|
||||||
map.put("other_config", this.otherConfig == null ? new HashMap<String, String>() : this.otherConfig);
|
map.put("other_config", this.otherConfig == null ? new HashMap<String, String>() : this.otherConfig);
|
||||||
map.put("disallow_unplug", this.disallowUnplug == null ? false : this.disallowUnplug);
|
map.put("disallow_unplug", this.disallowUnplug == null ? false : this.disallowUnplug);
|
||||||
|
map.put("tunnel_access_PIF_of", this.tunnelAccessPIFOf == null ? new LinkedHashSet<Tunnel>() : this.tunnelAccessPIFOf);
|
||||||
|
map.put("tunnel_transport_PIF_of", this.tunnelTransportPIFOf == null ? new LinkedHashSet<Tunnel>() : this.tunnelTransportPIFOf);
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* unique identifier/object reference
|
* Unique identifier/object reference
|
||||||
*/
|
*/
|
||||||
public String uuid;
|
public String uuid;
|
||||||
/**
|
/**
|
||||||
@ -215,33 +219,41 @@ public class PIF extends XenAPIObject {
|
|||||||
*/
|
*/
|
||||||
public String DNS;
|
public String DNS;
|
||||||
/**
|
/**
|
||||||
* indicates which bond this interface is part of
|
* Indicates which bond this interface is part of
|
||||||
*/
|
*/
|
||||||
public Bond bondSlaveOf;
|
public Bond bondSlaveOf;
|
||||||
/**
|
/**
|
||||||
* indicates this PIF represents the results of a bond
|
* Indicates this PIF represents the results of a bond
|
||||||
*/
|
*/
|
||||||
public Set<Bond> bondMasterOf;
|
public Set<Bond> bondMasterOf;
|
||||||
/**
|
/**
|
||||||
* indicates wich VLAN this interface receives untagged traffic from
|
* Indicates wich VLAN this interface receives untagged traffic from
|
||||||
*/
|
*/
|
||||||
public VLAN VLANMasterOf;
|
public VLAN VLANMasterOf;
|
||||||
/**
|
/**
|
||||||
* indicates which VLANs this interface transmits tagged traffic to
|
* Indicates which VLANs this interface transmits tagged traffic to
|
||||||
*/
|
*/
|
||||||
public Set<VLAN> VLANSlaveOf;
|
public Set<VLAN> VLANSlaveOf;
|
||||||
/**
|
/**
|
||||||
* indicates whether the control software is listening for connections on this interface
|
* Indicates whether the control software is listening for connections on this interface
|
||||||
*/
|
*/
|
||||||
public Boolean management;
|
public Boolean management;
|
||||||
/**
|
/**
|
||||||
* additional configuration
|
* Additional configuration
|
||||||
*/
|
*/
|
||||||
public Map<String, String> otherConfig;
|
public Map<String, String> otherConfig;
|
||||||
/**
|
/**
|
||||||
* prevent this PIF from being unplugged; set this to notify the management tool-stack that the PIF has a special use and should not be unplugged under any circumstances (e.g. because you're running storage traffic over it)
|
* Prevent this PIF from being unplugged; set this to notify the management tool-stack that the PIF has a special use and should not be unplugged under any circumstances (e.g. because you're running storage traffic over it)
|
||||||
*/
|
*/
|
||||||
public Boolean disallowUnplug;
|
public Boolean disallowUnplug;
|
||||||
|
/**
|
||||||
|
* Indicates to which tunnel this PIF gives access
|
||||||
|
*/
|
||||||
|
public Set<Tunnel> tunnelAccessPIFOf;
|
||||||
|
/**
|
||||||
|
* Indicates to which tunnel this PIF provides transport
|
||||||
|
*/
|
||||||
|
public Set<Tunnel> tunnelTransportPIFOf;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -653,6 +665,40 @@ public class PIF extends XenAPIObject {
|
|||||||
return Types.toBoolean(result);
|
return Types.toBoolean(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the tunnel_access_PIF_of field of the given PIF.
|
||||||
|
*
|
||||||
|
* @return value of the field
|
||||||
|
*/
|
||||||
|
public Set<Tunnel> getTunnelAccessPIFOf(Connection c) throws
|
||||||
|
BadServerResponse,
|
||||||
|
XenAPIException,
|
||||||
|
XmlRpcException {
|
||||||
|
String method_call = "PIF.get_tunnel_access_PIF_of";
|
||||||
|
String session = c.getSessionReference();
|
||||||
|
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
|
||||||
|
Map response = c.dispatch(method_call, method_params);
|
||||||
|
Object result = response.get("Value");
|
||||||
|
return Types.toSetOfTunnel(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the tunnel_transport_PIF_of field of the given PIF.
|
||||||
|
*
|
||||||
|
* @return value of the field
|
||||||
|
*/
|
||||||
|
public Set<Tunnel> getTunnelTransportPIFOf(Connection c) throws
|
||||||
|
BadServerResponse,
|
||||||
|
XenAPIException,
|
||||||
|
XmlRpcException {
|
||||||
|
String method_call = "PIF.get_tunnel_transport_PIF_of";
|
||||||
|
String session = c.getSessionReference();
|
||||||
|
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
|
||||||
|
Map response = c.dispatch(method_call, method_params);
|
||||||
|
Object result = response.get("Value");
|
||||||
|
return Types.toSetOfTunnel(result);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the other_config field of the given PIF.
|
* Set the other_config field of the given PIF.
|
||||||
*
|
*
|
||||||
@ -876,6 +922,42 @@ public class PIF extends XenAPIObject {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Scan for physical interfaces on a host and create PIF objects to represent them. Use BIOS-based device names.
|
||||||
|
*
|
||||||
|
* @param host The host on which to scan
|
||||||
|
* @return Task
|
||||||
|
*/
|
||||||
|
public static Task scanBiosAsync(Connection c, Host host) throws
|
||||||
|
BadServerResponse,
|
||||||
|
XenAPIException,
|
||||||
|
XmlRpcException {
|
||||||
|
String method_call = "Async.PIF.scan_bios";
|
||||||
|
String session = c.getSessionReference();
|
||||||
|
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(host)};
|
||||||
|
Map response = c.dispatch(method_call, method_params);
|
||||||
|
Object result = response.get("Value");
|
||||||
|
return Types.toTask(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Scan for physical interfaces on a host and create PIF objects to represent them. Use BIOS-based device names.
|
||||||
|
*
|
||||||
|
* @param host The host on which to scan
|
||||||
|
* @return List of newly created PIFs
|
||||||
|
*/
|
||||||
|
public static Set<PIF> scanBios(Connection c, Host host) throws
|
||||||
|
BadServerResponse,
|
||||||
|
XenAPIException,
|
||||||
|
XmlRpcException {
|
||||||
|
String method_call = "PIF.scan_bios";
|
||||||
|
String session = c.getSessionReference();
|
||||||
|
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(host)};
|
||||||
|
Map response = c.dispatch(method_call, method_params);
|
||||||
|
Object result = response.get("Value");
|
||||||
|
return Types.toSetOfPIF(result);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a PIF object matching a particular network interface
|
* Create a PIF object matching a particular network interface
|
||||||
*
|
*
|
||||||
@ -924,7 +1006,8 @@ public class PIF extends XenAPIObject {
|
|||||||
public Task forgetAsync(Connection c) throws
|
public Task forgetAsync(Connection c) throws
|
||||||
BadServerResponse,
|
BadServerResponse,
|
||||||
XenAPIException,
|
XenAPIException,
|
||||||
XmlRpcException {
|
XmlRpcException,
|
||||||
|
Types.PifTunnelStillExists {
|
||||||
String method_call = "Async.PIF.forget";
|
String method_call = "Async.PIF.forget";
|
||||||
String session = c.getSessionReference();
|
String session = c.getSessionReference();
|
||||||
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
|
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
|
||||||
@ -940,7 +1023,8 @@ public class PIF extends XenAPIObject {
|
|||||||
public void forget(Connection c) throws
|
public void forget(Connection c) throws
|
||||||
BadServerResponse,
|
BadServerResponse,
|
||||||
XenAPIException,
|
XenAPIException,
|
||||||
XmlRpcException {
|
XmlRpcException,
|
||||||
|
Types.PifTunnelStillExists {
|
||||||
String method_call = "PIF.forget";
|
String method_call = "PIF.forget";
|
||||||
String session = c.getSessionReference();
|
String session = c.getSessionReference();
|
||||||
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
|
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
|
||||||
@ -988,7 +1072,8 @@ public class PIF extends XenAPIObject {
|
|||||||
public Task plugAsync(Connection c) throws
|
public Task plugAsync(Connection c) throws
|
||||||
BadServerResponse,
|
BadServerResponse,
|
||||||
XenAPIException,
|
XenAPIException,
|
||||||
XmlRpcException {
|
XmlRpcException,
|
||||||
|
Types.TransportPifNotConfigured {
|
||||||
String method_call = "Async.PIF.plug";
|
String method_call = "Async.PIF.plug";
|
||||||
String session = c.getSessionReference();
|
String session = c.getSessionReference();
|
||||||
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
|
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
|
||||||
@ -1004,7 +1089,8 @@ public class PIF extends XenAPIObject {
|
|||||||
public void plug(Connection c) throws
|
public void plug(Connection c) throws
|
||||||
BadServerResponse,
|
BadServerResponse,
|
||||||
XenAPIException,
|
XenAPIException,
|
||||||
XmlRpcException {
|
XmlRpcException,
|
||||||
|
Types.TransportPifNotConfigured {
|
||||||
String method_call = "PIF.plug";
|
String method_call = "PIF.plug";
|
||||||
String session = c.getSessionReference();
|
String session = c.getSessionReference();
|
||||||
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
|
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
|
||||||
|
|||||||
@ -137,7 +137,7 @@ public class PIFMetrics extends XenAPIObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* unique identifier/object reference
|
* Unique identifier/object reference
|
||||||
*/
|
*/
|
||||||
public String uuid;
|
public String uuid;
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -163,7 +163,7 @@ public class Pool extends XenAPIObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* unique identifier/object reference
|
* Unique identifier/object reference
|
||||||
*/
|
*/
|
||||||
public String uuid;
|
public String uuid;
|
||||||
/**
|
/**
|
||||||
@ -2179,6 +2179,88 @@ public class Pool extends XenAPIObject {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This call tests if a location is valid
|
||||||
|
*
|
||||||
|
* @param config Location config settings to test
|
||||||
|
* @return An XMLRPC result
|
||||||
|
*/
|
||||||
|
public String testArchiveTarget(Connection c, Map<String, String> config) throws
|
||||||
|
BadServerResponse,
|
||||||
|
XenAPIException,
|
||||||
|
XmlRpcException {
|
||||||
|
String method_call = "pool.test_archive_target";
|
||||||
|
String session = c.getSessionReference();
|
||||||
|
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(config)};
|
||||||
|
Map response = c.dispatch(method_call, method_params);
|
||||||
|
Object result = response.get("Value");
|
||||||
|
return Types.toString(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This call attempts to enable pool-wide local storage caching
|
||||||
|
*
|
||||||
|
* @return Task
|
||||||
|
*/
|
||||||
|
public Task enableLocalStorageCachingAsync(Connection c) throws
|
||||||
|
BadServerResponse,
|
||||||
|
XenAPIException,
|
||||||
|
XmlRpcException {
|
||||||
|
String method_call = "Async.pool.enable_local_storage_caching";
|
||||||
|
String session = c.getSessionReference();
|
||||||
|
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
|
||||||
|
Map response = c.dispatch(method_call, method_params);
|
||||||
|
Object result = response.get("Value");
|
||||||
|
return Types.toTask(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This call attempts to enable pool-wide local storage caching
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void enableLocalStorageCaching(Connection c) throws
|
||||||
|
BadServerResponse,
|
||||||
|
XenAPIException,
|
||||||
|
XmlRpcException {
|
||||||
|
String method_call = "pool.enable_local_storage_caching";
|
||||||
|
String session = c.getSessionReference();
|
||||||
|
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
|
||||||
|
Map response = c.dispatch(method_call, method_params);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This call disables pool-wide local storage caching
|
||||||
|
*
|
||||||
|
* @return Task
|
||||||
|
*/
|
||||||
|
public Task disableLocalStorageCachingAsync(Connection c) throws
|
||||||
|
BadServerResponse,
|
||||||
|
XenAPIException,
|
||||||
|
XmlRpcException {
|
||||||
|
String method_call = "Async.pool.disable_local_storage_caching";
|
||||||
|
String session = c.getSessionReference();
|
||||||
|
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
|
||||||
|
Map response = c.dispatch(method_call, method_params);
|
||||||
|
Object result = response.get("Value");
|
||||||
|
return Types.toTask(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This call disables pool-wide local storage caching
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void disableLocalStorageCaching(Connection c) throws
|
||||||
|
BadServerResponse,
|
||||||
|
XenAPIException,
|
||||||
|
XmlRpcException {
|
||||||
|
String method_call = "pool.disable_local_storage_caching";
|
||||||
|
String session = c.getSessionReference();
|
||||||
|
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
|
||||||
|
Map response = c.dispatch(method_call, method_params);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return a list of all the pools known to the system.
|
* Return a list of all the pools known to the system.
|
||||||
*
|
*
|
||||||
|
|||||||
@ -129,7 +129,7 @@ public class PoolPatch extends XenAPIObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* unique identifier/object reference
|
* Unique identifier/object reference
|
||||||
*/
|
*/
|
||||||
public String uuid;
|
public String uuid;
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -119,7 +119,7 @@ public class Role extends XenAPIObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* unique identifier/object reference
|
* Unique identifier/object reference
|
||||||
*/
|
*/
|
||||||
public String uuid;
|
public String uuid;
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -135,7 +135,7 @@ public class SM extends XenAPIObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* unique identifier/object reference
|
* Unique identifier/object reference
|
||||||
*/
|
*/
|
||||||
public String uuid;
|
public String uuid;
|
||||||
/**
|
/**
|
||||||
|
|||||||
25
deps/XenServerJava/com/xensource/xenapi/SR.java
vendored
25
deps/XenServerJava/com/xensource/xenapi/SR.java
vendored
@ -116,6 +116,7 @@ public class SR extends XenAPIObject {
|
|||||||
print.printf("%1$20s: %2$s\n", "tags", this.tags);
|
print.printf("%1$20s: %2$s\n", "tags", this.tags);
|
||||||
print.printf("%1$20s: %2$s\n", "smConfig", this.smConfig);
|
print.printf("%1$20s: %2$s\n", "smConfig", this.smConfig);
|
||||||
print.printf("%1$20s: %2$s\n", "blobs", this.blobs);
|
print.printf("%1$20s: %2$s\n", "blobs", this.blobs);
|
||||||
|
print.printf("%1$20s: %2$s\n", "localCacheEnabled", this.localCacheEnabled);
|
||||||
return writer.toString();
|
return writer.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -141,11 +142,12 @@ public class SR extends XenAPIObject {
|
|||||||
map.put("tags", this.tags == null ? new LinkedHashSet<String>() : this.tags);
|
map.put("tags", this.tags == null ? new LinkedHashSet<String>() : this.tags);
|
||||||
map.put("sm_config", this.smConfig == null ? new HashMap<String, String>() : this.smConfig);
|
map.put("sm_config", this.smConfig == null ? new HashMap<String, String>() : this.smConfig);
|
||||||
map.put("blobs", this.blobs == null ? new HashMap<String, Blob>() : this.blobs);
|
map.put("blobs", this.blobs == null ? new HashMap<String, Blob>() : this.blobs);
|
||||||
|
map.put("local_cache_enabled", this.localCacheEnabled == null ? false : this.localCacheEnabled);
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* unique identifier/object reference
|
* Unique identifier/object reference
|
||||||
*/
|
*/
|
||||||
public String uuid;
|
public String uuid;
|
||||||
/**
|
/**
|
||||||
@ -212,6 +214,10 @@ public class SR extends XenAPIObject {
|
|||||||
* Binary blobs associated with this SR
|
* Binary blobs associated with this SR
|
||||||
*/
|
*/
|
||||||
public Map<String, Blob> blobs;
|
public Map<String, Blob> blobs;
|
||||||
|
/**
|
||||||
|
* True if this SR is assigned to be the local cache for its host
|
||||||
|
*/
|
||||||
|
public Boolean localCacheEnabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -556,6 +562,23 @@ public class SR extends XenAPIObject {
|
|||||||
return Types.toMapOfStringBlob(result);
|
return Types.toMapOfStringBlob(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the local_cache_enabled field of the given SR.
|
||||||
|
*
|
||||||
|
* @return value of the field
|
||||||
|
*/
|
||||||
|
public Boolean getLocalCacheEnabled(Connection c) throws
|
||||||
|
BadServerResponse,
|
||||||
|
XenAPIException,
|
||||||
|
XmlRpcException {
|
||||||
|
String method_call = "SR.get_local_cache_enabled";
|
||||||
|
String session = c.getSessionReference();
|
||||||
|
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
|
||||||
|
Map response = c.dispatch(method_call, method_params);
|
||||||
|
Object result = response.get("Value");
|
||||||
|
return Types.toBoolean(result);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the name/label field of the given SR.
|
* Set the name/label field of the given SR.
|
||||||
*
|
*
|
||||||
|
|||||||
@ -115,7 +115,7 @@ public class Secret extends XenAPIObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* unique identifier/object reference
|
* Unique identifier/object reference
|
||||||
*/
|
*/
|
||||||
public String uuid;
|
public String uuid;
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -111,6 +111,8 @@ public class Session extends XenAPIObject {
|
|||||||
print.printf("%1$20s: %2$s\n", "authUserSid", this.authUserSid);
|
print.printf("%1$20s: %2$s\n", "authUserSid", this.authUserSid);
|
||||||
print.printf("%1$20s: %2$s\n", "authUserName", this.authUserName);
|
print.printf("%1$20s: %2$s\n", "authUserName", this.authUserName);
|
||||||
print.printf("%1$20s: %2$s\n", "rbacPermissions", this.rbacPermissions);
|
print.printf("%1$20s: %2$s\n", "rbacPermissions", this.rbacPermissions);
|
||||||
|
print.printf("%1$20s: %2$s\n", "tasks", this.tasks);
|
||||||
|
print.printf("%1$20s: %2$s\n", "parent", this.parent);
|
||||||
return writer.toString();
|
return writer.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -131,11 +133,13 @@ public class Session extends XenAPIObject {
|
|||||||
map.put("auth_user_sid", this.authUserSid == null ? "" : this.authUserSid);
|
map.put("auth_user_sid", this.authUserSid == null ? "" : this.authUserSid);
|
||||||
map.put("auth_user_name", this.authUserName == null ? "" : this.authUserName);
|
map.put("auth_user_name", this.authUserName == null ? "" : this.authUserName);
|
||||||
map.put("rbac_permissions", this.rbacPermissions == null ? new LinkedHashSet<String>() : this.rbacPermissions);
|
map.put("rbac_permissions", this.rbacPermissions == null ? new LinkedHashSet<String>() : this.rbacPermissions);
|
||||||
|
map.put("tasks", this.tasks == null ? new LinkedHashSet<Task>() : this.tasks);
|
||||||
|
map.put("parent", this.parent == null ? new Session("OpaqueRef:NULL") : this.parent);
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* unique identifier/object reference
|
* Unique identifier/object reference
|
||||||
*/
|
*/
|
||||||
public String uuid;
|
public String uuid;
|
||||||
/**
|
/**
|
||||||
@ -182,6 +186,14 @@ public class Session extends XenAPIObject {
|
|||||||
* list with all RBAC permissions for this session
|
* list with all RBAC permissions for this session
|
||||||
*/
|
*/
|
||||||
public Set<String> rbacPermissions;
|
public Set<String> rbacPermissions;
|
||||||
|
/**
|
||||||
|
* list of tasks created using the current session
|
||||||
|
*/
|
||||||
|
public Set<Task> tasks;
|
||||||
|
/**
|
||||||
|
* references the parent session that created this session
|
||||||
|
*/
|
||||||
|
public Session parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -423,6 +435,40 @@ public class Session extends XenAPIObject {
|
|||||||
return Types.toSetOfString(result);
|
return Types.toSetOfString(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the tasks field of the given session.
|
||||||
|
*
|
||||||
|
* @return value of the field
|
||||||
|
*/
|
||||||
|
public Set<Task> getTasks(Connection c) throws
|
||||||
|
BadServerResponse,
|
||||||
|
XenAPIException,
|
||||||
|
XmlRpcException {
|
||||||
|
String method_call = "session.get_tasks";
|
||||||
|
String session = c.getSessionReference();
|
||||||
|
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
|
||||||
|
Map response = c.dispatch(method_call, method_params);
|
||||||
|
Object result = response.get("Value");
|
||||||
|
return Types.toSetOfTask(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the parent field of the given session.
|
||||||
|
*
|
||||||
|
* @return value of the field
|
||||||
|
*/
|
||||||
|
public Session getParent(Connection c) throws
|
||||||
|
BadServerResponse,
|
||||||
|
XenAPIException,
|
||||||
|
XmlRpcException {
|
||||||
|
String method_call = "session.get_parent";
|
||||||
|
String session = c.getSessionReference();
|
||||||
|
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
|
||||||
|
Map response = c.dispatch(method_call, method_params);
|
||||||
|
Object result = response.get("Value");
|
||||||
|
return Types.toSession(result);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the other_config field of the given session.
|
* Set the other_config field of the given session.
|
||||||
*
|
*
|
||||||
|
|||||||
@ -119,7 +119,7 @@ public class Subject extends XenAPIObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* unique identifier/object reference
|
* Unique identifier/object reference
|
||||||
*/
|
*/
|
||||||
public String uuid;
|
public String uuid;
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -143,7 +143,7 @@ public class Task extends XenAPIObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* unique identifier/object reference
|
* Unique identifier/object reference
|
||||||
*/
|
*/
|
||||||
public String uuid;
|
public String uuid;
|
||||||
/**
|
/**
|
||||||
|
|||||||
473
deps/XenServerJava/com/xensource/xenapi/Tunnel.java
vendored
Normal file
473
deps/XenServerJava/com/xensource/xenapi/Tunnel.java
vendored
Normal file
@ -0,0 +1,473 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2006-2010 Citrix Systems, Inc.
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of version 2 of the GNU General Public License as published
|
||||||
|
* by the Free Software Foundation, with the additional linking exception as
|
||||||
|
* follows:
|
||||||
|
*
|
||||||
|
* Linking this library statically or dynamically with other modules is
|
||||||
|
* making a combined work based on this library. Thus, the terms and
|
||||||
|
* conditions of the GNU General Public License cover the whole combination.
|
||||||
|
*
|
||||||
|
* As a special exception, the copyright holders of this library give you
|
||||||
|
* permission to link this library with independent modules to produce an
|
||||||
|
* executable, regardless of the license terms of these independent modules,
|
||||||
|
* and to copy and distribute the resulting executable under terms of your
|
||||||
|
* choice, provided that you also meet, for each linked independent module,
|
||||||
|
* the terms and conditions of the license of that module. An independent
|
||||||
|
* module is a module which is not derived from or based on this library. If
|
||||||
|
* you modify this library, you may extend this exception to your version of
|
||||||
|
* the library, but you are not obligated to do so. If you do not wish to do
|
||||||
|
* so, delete this exception statement from your version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||||
|
* more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License along
|
||||||
|
* with this program; if not, write to the Free Software Foundation, Inc., 51
|
||||||
|
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.xensource.xenapi;
|
||||||
|
|
||||||
|
import com.xensource.xenapi.Types.BadServerResponse;
|
||||||
|
import com.xensource.xenapi.Types.VersionException;
|
||||||
|
import com.xensource.xenapi.Types.XenAPIException;
|
||||||
|
|
||||||
|
import java.io.PrintWriter;
|
||||||
|
import java.io.StringWriter;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.LinkedHashSet;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
import org.apache.xmlrpc.XmlRpcException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A tunnel for network traffic
|
||||||
|
*
|
||||||
|
* @author Citrix Systems, Inc.
|
||||||
|
*/
|
||||||
|
public class Tunnel extends XenAPIObject {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The XenAPI reference to this object.
|
||||||
|
*/
|
||||||
|
protected final String ref;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* For internal use only.
|
||||||
|
*/
|
||||||
|
Tunnel(String ref) {
|
||||||
|
this.ref = ref;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String toWireString() {
|
||||||
|
return this.ref;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If obj is a Tunnel, compares XenAPI references for equality.
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object obj)
|
||||||
|
{
|
||||||
|
if (obj != null && obj instanceof Tunnel)
|
||||||
|
{
|
||||||
|
Tunnel other = (Tunnel) obj;
|
||||||
|
return other.ref.equals(this.ref);
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode()
|
||||||
|
{
|
||||||
|
return ref.hashCode();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Represents all the fields in a Tunnel
|
||||||
|
*/
|
||||||
|
public static class Record implements Types.Record {
|
||||||
|
public String toString() {
|
||||||
|
StringWriter writer = new StringWriter();
|
||||||
|
PrintWriter print = new PrintWriter(writer);
|
||||||
|
print.printf("%1$20s: %2$s\n", "uuid", this.uuid);
|
||||||
|
print.printf("%1$20s: %2$s\n", "accessPIF", this.accessPIF);
|
||||||
|
print.printf("%1$20s: %2$s\n", "transportPIF", this.transportPIF);
|
||||||
|
print.printf("%1$20s: %2$s\n", "status", this.status);
|
||||||
|
print.printf("%1$20s: %2$s\n", "otherConfig", this.otherConfig);
|
||||||
|
return writer.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convert a tunnel.Record to a Map
|
||||||
|
*/
|
||||||
|
public Map<String,Object> toMap() {
|
||||||
|
Map<String,Object> map = new HashMap<String,Object>();
|
||||||
|
map.put("uuid", this.uuid == null ? "" : this.uuid);
|
||||||
|
map.put("access_PIF", this.accessPIF == null ? new PIF("OpaqueRef:NULL") : this.accessPIF);
|
||||||
|
map.put("transport_PIF", this.transportPIF == null ? new PIF("OpaqueRef:NULL") : this.transportPIF);
|
||||||
|
map.put("status", this.status == null ? new HashMap<String, String>() : this.status);
|
||||||
|
map.put("other_config", this.otherConfig == null ? new HashMap<String, String>() : this.otherConfig);
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Unique identifier/object reference
|
||||||
|
*/
|
||||||
|
public String uuid;
|
||||||
|
/**
|
||||||
|
* The interface through which the tunnel is accessed
|
||||||
|
*/
|
||||||
|
public PIF accessPIF;
|
||||||
|
/**
|
||||||
|
* The interface used by the tunnel
|
||||||
|
*/
|
||||||
|
public PIF transportPIF;
|
||||||
|
/**
|
||||||
|
* Status information about the tunnel
|
||||||
|
*/
|
||||||
|
public Map<String, String> status;
|
||||||
|
/**
|
||||||
|
* Additional configuration
|
||||||
|
*/
|
||||||
|
public Map<String, String> otherConfig;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get a record containing the current state of the given tunnel.
|
||||||
|
*
|
||||||
|
* @return all fields from the object
|
||||||
|
*/
|
||||||
|
public Tunnel.Record getRecord(Connection c) throws
|
||||||
|
BadServerResponse,
|
||||||
|
XenAPIException,
|
||||||
|
XmlRpcException {
|
||||||
|
String method_call = "tunnel.get_record";
|
||||||
|
String session = c.getSessionReference();
|
||||||
|
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
|
||||||
|
Map response = c.dispatch(method_call, method_params);
|
||||||
|
Object result = response.get("Value");
|
||||||
|
return Types.toTunnelRecord(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get a reference to the tunnel instance with the specified UUID.
|
||||||
|
*
|
||||||
|
* @param uuid UUID of object to return
|
||||||
|
* @return reference to the object
|
||||||
|
*/
|
||||||
|
public static Tunnel getByUuid(Connection c, String uuid) throws
|
||||||
|
BadServerResponse,
|
||||||
|
XenAPIException,
|
||||||
|
XmlRpcException {
|
||||||
|
String method_call = "tunnel.get_by_uuid";
|
||||||
|
String session = c.getSessionReference();
|
||||||
|
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(uuid)};
|
||||||
|
Map response = c.dispatch(method_call, method_params);
|
||||||
|
Object result = response.get("Value");
|
||||||
|
return Types.toTunnel(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the uuid field of the given tunnel.
|
||||||
|
*
|
||||||
|
* @return value of the field
|
||||||
|
*/
|
||||||
|
public String getUuid(Connection c) throws
|
||||||
|
BadServerResponse,
|
||||||
|
XenAPIException,
|
||||||
|
XmlRpcException {
|
||||||
|
String method_call = "tunnel.get_uuid";
|
||||||
|
String session = c.getSessionReference();
|
||||||
|
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
|
||||||
|
Map response = c.dispatch(method_call, method_params);
|
||||||
|
Object result = response.get("Value");
|
||||||
|
return Types.toString(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the access_PIF field of the given tunnel.
|
||||||
|
*
|
||||||
|
* @return value of the field
|
||||||
|
*/
|
||||||
|
public PIF getAccessPIF(Connection c) throws
|
||||||
|
BadServerResponse,
|
||||||
|
XenAPIException,
|
||||||
|
XmlRpcException {
|
||||||
|
String method_call = "tunnel.get_access_PIF";
|
||||||
|
String session = c.getSessionReference();
|
||||||
|
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
|
||||||
|
Map response = c.dispatch(method_call, method_params);
|
||||||
|
Object result = response.get("Value");
|
||||||
|
return Types.toPIF(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the transport_PIF field of the given tunnel.
|
||||||
|
*
|
||||||
|
* @return value of the field
|
||||||
|
*/
|
||||||
|
public PIF getTransportPIF(Connection c) throws
|
||||||
|
BadServerResponse,
|
||||||
|
XenAPIException,
|
||||||
|
XmlRpcException {
|
||||||
|
String method_call = "tunnel.get_transport_PIF";
|
||||||
|
String session = c.getSessionReference();
|
||||||
|
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
|
||||||
|
Map response = c.dispatch(method_call, method_params);
|
||||||
|
Object result = response.get("Value");
|
||||||
|
return Types.toPIF(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the status field of the given tunnel.
|
||||||
|
*
|
||||||
|
* @return value of the field
|
||||||
|
*/
|
||||||
|
public Map<String, String> getStatus(Connection c) throws
|
||||||
|
BadServerResponse,
|
||||||
|
XenAPIException,
|
||||||
|
XmlRpcException {
|
||||||
|
String method_call = "tunnel.get_status";
|
||||||
|
String session = c.getSessionReference();
|
||||||
|
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
|
||||||
|
Map response = c.dispatch(method_call, method_params);
|
||||||
|
Object result = response.get("Value");
|
||||||
|
return Types.toMapOfStringString(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the other_config field of the given tunnel.
|
||||||
|
*
|
||||||
|
* @return value of the field
|
||||||
|
*/
|
||||||
|
public Map<String, String> getOtherConfig(Connection c) throws
|
||||||
|
BadServerResponse,
|
||||||
|
XenAPIException,
|
||||||
|
XmlRpcException {
|
||||||
|
String method_call = "tunnel.get_other_config";
|
||||||
|
String session = c.getSessionReference();
|
||||||
|
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
|
||||||
|
Map response = c.dispatch(method_call, method_params);
|
||||||
|
Object result = response.get("Value");
|
||||||
|
return Types.toMapOfStringString(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the status field of the given tunnel.
|
||||||
|
*
|
||||||
|
* @param status New value to set
|
||||||
|
*/
|
||||||
|
public void setStatus(Connection c, Map<String, String> status) throws
|
||||||
|
BadServerResponse,
|
||||||
|
XenAPIException,
|
||||||
|
XmlRpcException {
|
||||||
|
String method_call = "tunnel.set_status";
|
||||||
|
String session = c.getSessionReference();
|
||||||
|
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(status)};
|
||||||
|
Map response = c.dispatch(method_call, method_params);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add the given key-value pair to the status field of the given tunnel.
|
||||||
|
*
|
||||||
|
* @param key Key to add
|
||||||
|
* @param value Value to add
|
||||||
|
*/
|
||||||
|
public void addToStatus(Connection c, String key, String value) throws
|
||||||
|
BadServerResponse,
|
||||||
|
XenAPIException,
|
||||||
|
XmlRpcException {
|
||||||
|
String method_call = "tunnel.add_to_status";
|
||||||
|
String session = c.getSessionReference();
|
||||||
|
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key), Marshalling.toXMLRPC(value)};
|
||||||
|
Map response = c.dispatch(method_call, method_params);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove the given key and its corresponding value from the status field of the given tunnel. If the key is not in that Map, then do nothing.
|
||||||
|
*
|
||||||
|
* @param key Key to remove
|
||||||
|
*/
|
||||||
|
public void removeFromStatus(Connection c, String key) throws
|
||||||
|
BadServerResponse,
|
||||||
|
XenAPIException,
|
||||||
|
XmlRpcException {
|
||||||
|
String method_call = "tunnel.remove_from_status";
|
||||||
|
String session = c.getSessionReference();
|
||||||
|
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key)};
|
||||||
|
Map response = c.dispatch(method_call, method_params);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the other_config field of the given tunnel.
|
||||||
|
*
|
||||||
|
* @param otherConfig New value to set
|
||||||
|
*/
|
||||||
|
public void setOtherConfig(Connection c, Map<String, String> otherConfig) throws
|
||||||
|
BadServerResponse,
|
||||||
|
XenAPIException,
|
||||||
|
XmlRpcException {
|
||||||
|
String method_call = "tunnel.set_other_config";
|
||||||
|
String session = c.getSessionReference();
|
||||||
|
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(otherConfig)};
|
||||||
|
Map response = c.dispatch(method_call, method_params);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add the given key-value pair to the other_config field of the given tunnel.
|
||||||
|
*
|
||||||
|
* @param key Key to add
|
||||||
|
* @param value Value to add
|
||||||
|
*/
|
||||||
|
public void addToOtherConfig(Connection c, String key, String value) throws
|
||||||
|
BadServerResponse,
|
||||||
|
XenAPIException,
|
||||||
|
XmlRpcException {
|
||||||
|
String method_call = "tunnel.add_to_other_config";
|
||||||
|
String session = c.getSessionReference();
|
||||||
|
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key), Marshalling.toXMLRPC(value)};
|
||||||
|
Map response = c.dispatch(method_call, method_params);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove the given key and its corresponding value from the other_config field of the given tunnel. If the key is not in that Map, then do nothing.
|
||||||
|
*
|
||||||
|
* @param key Key to remove
|
||||||
|
*/
|
||||||
|
public void removeFromOtherConfig(Connection c, String key) throws
|
||||||
|
BadServerResponse,
|
||||||
|
XenAPIException,
|
||||||
|
XmlRpcException {
|
||||||
|
String method_call = "tunnel.remove_from_other_config";
|
||||||
|
String session = c.getSessionReference();
|
||||||
|
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key)};
|
||||||
|
Map response = c.dispatch(method_call, method_params);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a tunnel
|
||||||
|
*
|
||||||
|
* @param transportPIF PIF which receives the tagged traffic
|
||||||
|
* @param network Network to receive the tunnelled traffic
|
||||||
|
* @return Task
|
||||||
|
*/
|
||||||
|
public static Task createAsync(Connection c, PIF transportPIF, Network network) throws
|
||||||
|
BadServerResponse,
|
||||||
|
XenAPIException,
|
||||||
|
XmlRpcException,
|
||||||
|
Types.OpenvswitchNotActive,
|
||||||
|
Types.TransportPifNotConfigured,
|
||||||
|
Types.IsTunnelAccessPif {
|
||||||
|
String method_call = "Async.tunnel.create";
|
||||||
|
String session = c.getSessionReference();
|
||||||
|
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(transportPIF), Marshalling.toXMLRPC(network)};
|
||||||
|
Map response = c.dispatch(method_call, method_params);
|
||||||
|
Object result = response.get("Value");
|
||||||
|
return Types.toTask(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a tunnel
|
||||||
|
*
|
||||||
|
* @param transportPIF PIF which receives the tagged traffic
|
||||||
|
* @param network Network to receive the tunnelled traffic
|
||||||
|
* @return The reference of the created tunnel object
|
||||||
|
*/
|
||||||
|
public static Tunnel create(Connection c, PIF transportPIF, Network network) throws
|
||||||
|
BadServerResponse,
|
||||||
|
XenAPIException,
|
||||||
|
XmlRpcException,
|
||||||
|
Types.OpenvswitchNotActive,
|
||||||
|
Types.TransportPifNotConfigured,
|
||||||
|
Types.IsTunnelAccessPif {
|
||||||
|
String method_call = "tunnel.create";
|
||||||
|
String session = c.getSessionReference();
|
||||||
|
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(transportPIF), Marshalling.toXMLRPC(network)};
|
||||||
|
Map response = c.dispatch(method_call, method_params);
|
||||||
|
Object result = response.get("Value");
|
||||||
|
return Types.toTunnel(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Destroy a tunnel
|
||||||
|
*
|
||||||
|
* @return Task
|
||||||
|
*/
|
||||||
|
public Task destroyAsync(Connection c) throws
|
||||||
|
BadServerResponse,
|
||||||
|
XenAPIException,
|
||||||
|
XmlRpcException {
|
||||||
|
String method_call = "Async.tunnel.destroy";
|
||||||
|
String session = c.getSessionReference();
|
||||||
|
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
|
||||||
|
Map response = c.dispatch(method_call, method_params);
|
||||||
|
Object result = response.get("Value");
|
||||||
|
return Types.toTask(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Destroy a tunnel
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void destroy(Connection c) throws
|
||||||
|
BadServerResponse,
|
||||||
|
XenAPIException,
|
||||||
|
XmlRpcException {
|
||||||
|
String method_call = "tunnel.destroy";
|
||||||
|
String session = c.getSessionReference();
|
||||||
|
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
|
||||||
|
Map response = c.dispatch(method_call, method_params);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return a list of all the tunnels known to the system.
|
||||||
|
*
|
||||||
|
* @return references to all objects
|
||||||
|
*/
|
||||||
|
public static Set<Tunnel> getAll(Connection c) throws
|
||||||
|
BadServerResponse,
|
||||||
|
XenAPIException,
|
||||||
|
XmlRpcException {
|
||||||
|
String method_call = "tunnel.get_all";
|
||||||
|
String session = c.getSessionReference();
|
||||||
|
Object[] method_params = {Marshalling.toXMLRPC(session)};
|
||||||
|
Map response = c.dispatch(method_call, method_params);
|
||||||
|
Object result = response.get("Value");
|
||||||
|
return Types.toSetOfTunnel(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return a map of tunnel references to tunnel records for all tunnels known to the system.
|
||||||
|
*
|
||||||
|
* @return records of all objects
|
||||||
|
*/
|
||||||
|
public static Map<Tunnel, Tunnel.Record> getAllRecords(Connection c) throws
|
||||||
|
BadServerResponse,
|
||||||
|
XenAPIException,
|
||||||
|
XmlRpcException {
|
||||||
|
String method_call = "tunnel.get_all_records";
|
||||||
|
String session = c.getSessionReference();
|
||||||
|
Object[] method_params = {Marshalling.toXMLRPC(session)};
|
||||||
|
Map response = c.dispatch(method_call, method_params);
|
||||||
|
Object result = response.get("Value");
|
||||||
|
return Types.toMapOfTunnelTunnelRecord(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
669
deps/XenServerJava/com/xensource/xenapi/Types.java
vendored
669
deps/XenServerJava/com/xensource/xenapi/Types.java
vendored
File diff suppressed because it is too large
Load Diff
@ -119,7 +119,7 @@ public class User extends XenAPIObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* unique identifier/object reference
|
* Unique identifier/object reference
|
||||||
*/
|
*/
|
||||||
public String uuid;
|
public String uuid;
|
||||||
/**
|
/**
|
||||||
@ -138,10 +138,11 @@ public class User extends XenAPIObject {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a record containing the current state of the given user.
|
* Get a record containing the current state of the given user.
|
||||||
|
* @deprecated
|
||||||
*
|
*
|
||||||
* @return all fields from the object
|
* @return all fields from the object
|
||||||
*/
|
*/
|
||||||
public User.Record getRecord(Connection c) throws
|
@Deprecated public User.Record getRecord(Connection c) throws
|
||||||
BadServerResponse,
|
BadServerResponse,
|
||||||
XenAPIException,
|
XenAPIException,
|
||||||
XmlRpcException {
|
XmlRpcException {
|
||||||
@ -155,11 +156,12 @@ public class User extends XenAPIObject {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a reference to the user instance with the specified UUID.
|
* Get a reference to the user instance with the specified UUID.
|
||||||
|
* @deprecated
|
||||||
*
|
*
|
||||||
* @param uuid UUID of object to return
|
* @param uuid UUID of object to return
|
||||||
* @return reference to the object
|
* @return reference to the object
|
||||||
*/
|
*/
|
||||||
public static User getByUuid(Connection c, String uuid) throws
|
@Deprecated public static User getByUuid(Connection c, String uuid) throws
|
||||||
BadServerResponse,
|
BadServerResponse,
|
||||||
XenAPIException,
|
XenAPIException,
|
||||||
XmlRpcException {
|
XmlRpcException {
|
||||||
@ -173,11 +175,12 @@ public class User extends XenAPIObject {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new user instance, and return its handle.
|
* Create a new user instance, and return its handle.
|
||||||
|
* @deprecated
|
||||||
*
|
*
|
||||||
* @param record All constructor arguments
|
* @param record All constructor arguments
|
||||||
* @return Task
|
* @return Task
|
||||||
*/
|
*/
|
||||||
public static Task createAsync(Connection c, User.Record record) throws
|
@Deprecated public static Task createAsync(Connection c, User.Record record) throws
|
||||||
BadServerResponse,
|
BadServerResponse,
|
||||||
XenAPIException,
|
XenAPIException,
|
||||||
XmlRpcException {
|
XmlRpcException {
|
||||||
@ -192,11 +195,12 @@ public class User extends XenAPIObject {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new user instance, and return its handle.
|
* Create a new user instance, and return its handle.
|
||||||
|
* @deprecated
|
||||||
*
|
*
|
||||||
* @param record All constructor arguments
|
* @param record All constructor arguments
|
||||||
* @return reference to the newly created object
|
* @return reference to the newly created object
|
||||||
*/
|
*/
|
||||||
public static User create(Connection c, User.Record record) throws
|
@Deprecated public static User create(Connection c, User.Record record) throws
|
||||||
BadServerResponse,
|
BadServerResponse,
|
||||||
XenAPIException,
|
XenAPIException,
|
||||||
XmlRpcException {
|
XmlRpcException {
|
||||||
@ -211,10 +215,11 @@ public class User extends XenAPIObject {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Destroy the specified user instance.
|
* Destroy the specified user instance.
|
||||||
|
* @deprecated
|
||||||
*
|
*
|
||||||
* @return Task
|
* @return Task
|
||||||
*/
|
*/
|
||||||
public Task destroyAsync(Connection c) throws
|
@Deprecated public Task destroyAsync(Connection c) throws
|
||||||
BadServerResponse,
|
BadServerResponse,
|
||||||
XenAPIException,
|
XenAPIException,
|
||||||
XmlRpcException {
|
XmlRpcException {
|
||||||
@ -228,9 +233,10 @@ public class User extends XenAPIObject {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Destroy the specified user instance.
|
* Destroy the specified user instance.
|
||||||
|
* @deprecated
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public void destroy(Connection c) throws
|
@Deprecated public void destroy(Connection c) throws
|
||||||
BadServerResponse,
|
BadServerResponse,
|
||||||
XenAPIException,
|
XenAPIException,
|
||||||
XmlRpcException {
|
XmlRpcException {
|
||||||
|
|||||||
@ -155,7 +155,7 @@ public class VBD extends XenAPIObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* unique identifier/object reference
|
* Unique identifier/object reference
|
||||||
*/
|
*/
|
||||||
public String uuid;
|
public String uuid;
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -121,7 +121,7 @@ public class VBDMetrics extends XenAPIObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* unique identifier/object reference
|
* Unique identifier/object reference
|
||||||
*/
|
*/
|
||||||
public String uuid;
|
public String uuid;
|
||||||
/**
|
/**
|
||||||
|
|||||||
48
deps/XenServerJava/com/xensource/xenapi/VDI.java
vendored
48
deps/XenServerJava/com/xensource/xenapi/VDI.java
vendored
@ -125,6 +125,8 @@ public class VDI extends XenAPIObject {
|
|||||||
print.printf("%1$20s: %2$s\n", "snapshots", this.snapshots);
|
print.printf("%1$20s: %2$s\n", "snapshots", this.snapshots);
|
||||||
print.printf("%1$20s: %2$s\n", "snapshotTime", this.snapshotTime);
|
print.printf("%1$20s: %2$s\n", "snapshotTime", this.snapshotTime);
|
||||||
print.printf("%1$20s: %2$s\n", "tags", this.tags);
|
print.printf("%1$20s: %2$s\n", "tags", this.tags);
|
||||||
|
print.printf("%1$20s: %2$s\n", "allowCaching", this.allowCaching);
|
||||||
|
print.printf("%1$20s: %2$s\n", "onBoot", this.onBoot);
|
||||||
return writer.toString();
|
return writer.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -159,11 +161,13 @@ public class VDI extends XenAPIObject {
|
|||||||
map.put("snapshots", this.snapshots == null ? new LinkedHashSet<VDI>() : this.snapshots);
|
map.put("snapshots", this.snapshots == null ? new LinkedHashSet<VDI>() : this.snapshots);
|
||||||
map.put("snapshot_time", this.snapshotTime == null ? new Date(0) : this.snapshotTime);
|
map.put("snapshot_time", this.snapshotTime == null ? new Date(0) : this.snapshotTime);
|
||||||
map.put("tags", this.tags == null ? new LinkedHashSet<String>() : this.tags);
|
map.put("tags", this.tags == null ? new LinkedHashSet<String>() : this.tags);
|
||||||
|
map.put("allow_caching", this.allowCaching == null ? false : this.allowCaching);
|
||||||
|
map.put("on_boot", this.onBoot == null ? Types.OnBoot.UNRECOGNIZED : this.onBoot);
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* unique identifier/object reference
|
* Unique identifier/object reference
|
||||||
*/
|
*/
|
||||||
public String uuid;
|
public String uuid;
|
||||||
/**
|
/**
|
||||||
@ -266,6 +270,14 @@ public class VDI extends XenAPIObject {
|
|||||||
* user-specified tags for categorization purposes
|
* user-specified tags for categorization purposes
|
||||||
*/
|
*/
|
||||||
public Set<String> tags;
|
public Set<String> tags;
|
||||||
|
/**
|
||||||
|
* true if this VDI is to be cached in the local cache SR
|
||||||
|
*/
|
||||||
|
public Boolean allowCaching;
|
||||||
|
/**
|
||||||
|
* The behaviour of this VDI on a VM boot
|
||||||
|
*/
|
||||||
|
public Types.OnBoot onBoot;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -833,6 +845,40 @@ public class VDI extends XenAPIObject {
|
|||||||
return Types.toSetOfString(result);
|
return Types.toSetOfString(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the allow_caching field of the given VDI.
|
||||||
|
*
|
||||||
|
* @return value of the field
|
||||||
|
*/
|
||||||
|
public Boolean getAllowCaching(Connection c) throws
|
||||||
|
BadServerResponse,
|
||||||
|
XenAPIException,
|
||||||
|
XmlRpcException {
|
||||||
|
String method_call = "VDI.get_allow_caching";
|
||||||
|
String session = c.getSessionReference();
|
||||||
|
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
|
||||||
|
Map response = c.dispatch(method_call, method_params);
|
||||||
|
Object result = response.get("Value");
|
||||||
|
return Types.toBoolean(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the on_boot field of the given VDI.
|
||||||
|
*
|
||||||
|
* @return value of the field
|
||||||
|
*/
|
||||||
|
public Types.OnBoot getOnBoot(Connection c) throws
|
||||||
|
BadServerResponse,
|
||||||
|
XenAPIException,
|
||||||
|
XmlRpcException {
|
||||||
|
String method_call = "VDI.get_on_boot";
|
||||||
|
String session = c.getSessionReference();
|
||||||
|
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
|
||||||
|
Map response = c.dispatch(method_call, method_params);
|
||||||
|
Object result = response.get("Value");
|
||||||
|
return Types.toOnBoot(result);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the name/label field of the given VDI.
|
* Set the name/label field of the given VDI.
|
||||||
*
|
*
|
||||||
|
|||||||
@ -147,7 +147,7 @@ public class VIF extends XenAPIObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* unique identifier/object reference
|
* Unique identifier/object reference
|
||||||
*/
|
*/
|
||||||
public String uuid;
|
public String uuid;
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -121,7 +121,7 @@ public class VIFMetrics extends XenAPIObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* unique identifier/object reference
|
* Unique identifier/object reference
|
||||||
*/
|
*/
|
||||||
public String uuid;
|
public String uuid;
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -121,7 +121,7 @@ public class VLAN extends XenAPIObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* unique identifier/object reference
|
* Unique identifier/object reference
|
||||||
*/
|
*/
|
||||||
public String uuid;
|
public String uuid;
|
||||||
/**
|
/**
|
||||||
|
|||||||
68
deps/XenServerJava/com/xensource/xenapi/VM.java
vendored
68
deps/XenServerJava/com/xensource/xenapi/VM.java
vendored
@ -163,6 +163,8 @@ public class VM extends XenAPIObject {
|
|||||||
print.printf("%1$20s: %2$s\n", "parent", this.parent);
|
print.printf("%1$20s: %2$s\n", "parent", this.parent);
|
||||||
print.printf("%1$20s: %2$s\n", "children", this.children);
|
print.printf("%1$20s: %2$s\n", "children", this.children);
|
||||||
print.printf("%1$20s: %2$s\n", "biosStrings", this.biosStrings);
|
print.printf("%1$20s: %2$s\n", "biosStrings", this.biosStrings);
|
||||||
|
print.printf("%1$20s: %2$s\n", "protectionPolicy", this.protectionPolicy);
|
||||||
|
print.printf("%1$20s: %2$s\n", "isSnapshotFromVmpp", this.isSnapshotFromVmpp);
|
||||||
return writer.toString();
|
return writer.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -235,11 +237,13 @@ public class VM extends XenAPIObject {
|
|||||||
map.put("parent", this.parent == null ? new VM("OpaqueRef:NULL") : this.parent);
|
map.put("parent", this.parent == null ? new VM("OpaqueRef:NULL") : this.parent);
|
||||||
map.put("children", this.children == null ? new LinkedHashSet<VM>() : this.children);
|
map.put("children", this.children == null ? new LinkedHashSet<VM>() : this.children);
|
||||||
map.put("bios_strings", this.biosStrings == null ? new HashMap<String, String>() : this.biosStrings);
|
map.put("bios_strings", this.biosStrings == null ? new HashMap<String, String>() : this.biosStrings);
|
||||||
|
map.put("protection_policy", this.protectionPolicy == null ? new VMPP("OpaqueRef:NULL") : this.protectionPolicy);
|
||||||
|
map.put("is_snapshot_from_vmpp", this.isSnapshotFromVmpp == null ? false : this.isSnapshotFromVmpp);
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* unique identifier/object reference
|
* Unique identifier/object reference
|
||||||
*/
|
*/
|
||||||
public String uuid;
|
public String uuid;
|
||||||
/**
|
/**
|
||||||
@ -494,6 +498,14 @@ public class VM extends XenAPIObject {
|
|||||||
* BIOS strings
|
* BIOS strings
|
||||||
*/
|
*/
|
||||||
public Map<String, String> biosStrings;
|
public Map<String, String> biosStrings;
|
||||||
|
/**
|
||||||
|
* Ref pointing to a protection policy for this VM
|
||||||
|
*/
|
||||||
|
public VMPP protectionPolicy;
|
||||||
|
/**
|
||||||
|
* true if this snapshot was created by the protection policy
|
||||||
|
*/
|
||||||
|
public Boolean isSnapshotFromVmpp;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1708,6 +1720,40 @@ public class VM extends XenAPIObject {
|
|||||||
return Types.toMapOfStringString(result);
|
return Types.toMapOfStringString(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the protection_policy field of the given VM.
|
||||||
|
*
|
||||||
|
* @return value of the field
|
||||||
|
*/
|
||||||
|
public VMPP getProtectionPolicy(Connection c) throws
|
||||||
|
BadServerResponse,
|
||||||
|
XenAPIException,
|
||||||
|
XmlRpcException {
|
||||||
|
String method_call = "VM.get_protection_policy";
|
||||||
|
String session = c.getSessionReference();
|
||||||
|
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
|
||||||
|
Map response = c.dispatch(method_call, method_params);
|
||||||
|
Object result = response.get("Value");
|
||||||
|
return Types.toVMPP(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the is_snapshot_from_vmpp field of the given VM.
|
||||||
|
*
|
||||||
|
* @return value of the field
|
||||||
|
*/
|
||||||
|
public Boolean getIsSnapshotFromVmpp(Connection c) throws
|
||||||
|
BadServerResponse,
|
||||||
|
XenAPIException,
|
||||||
|
XmlRpcException {
|
||||||
|
String method_call = "VM.get_is_snapshot_from_vmpp";
|
||||||
|
String session = c.getSessionReference();
|
||||||
|
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
|
||||||
|
Map response = c.dispatch(method_call, method_params);
|
||||||
|
Object result = response.get("Value");
|
||||||
|
return Types.toBoolean(result);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the name/label field of the given VM.
|
* Set the name/label field of the given VM.
|
||||||
*
|
*
|
||||||
@ -2541,7 +2587,7 @@ public class VM extends XenAPIObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checkpoints the specified VM, making a new VM. Checkppoint automatically exploits the capabilities of the underlying storage repository in which the VM's disk images are stored (e.g. Copy on Write) and saves the memory image as well.
|
* Checkpoints the specified VM, making a new VM. Checkpoint automatically exploits the capabilities of the underlying storage repository in which the VM's disk images are stored (e.g. Copy on Write) and saves the memory image as well.
|
||||||
*
|
*
|
||||||
* @param newName The name of the checkpointed VM
|
* @param newName The name of the checkpointed VM
|
||||||
* @return Task
|
* @return Task
|
||||||
@ -2564,7 +2610,7 @@ public class VM extends XenAPIObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checkpoints the specified VM, making a new VM. Checkppoint automatically exploits the capabilities of the underlying storage repository in which the VM's disk images are stored (e.g. Copy on Write) and saves the memory image as well.
|
* Checkpoints the specified VM, making a new VM. Checkpoint automatically exploits the capabilities of the underlying storage repository in which the VM's disk images are stored (e.g. Copy on Write) and saves the memory image as well.
|
||||||
*
|
*
|
||||||
* @param newName The name of the checkpointed VM
|
* @param newName The name of the checkpointed VM
|
||||||
* @return The reference of the newly created VM.
|
* @return The reference of the newly created VM.
|
||||||
@ -4175,6 +4221,22 @@ public class VM extends XenAPIObject {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the value of the protection_policy field
|
||||||
|
*
|
||||||
|
* @param value The value
|
||||||
|
*/
|
||||||
|
public void setProtectionPolicy(Connection c, VMPP value) throws
|
||||||
|
BadServerResponse,
|
||||||
|
XenAPIException,
|
||||||
|
XmlRpcException {
|
||||||
|
String method_call = "VM.set_protection_policy";
|
||||||
|
String session = c.getSessionReference();
|
||||||
|
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value)};
|
||||||
|
Map response = c.dispatch(method_call, method_params);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return a list of all the VMs known to the system.
|
* Return a list of all the VMs known to the system.
|
||||||
*
|
*
|
||||||
|
|||||||
@ -133,7 +133,7 @@ public class VMGuestMetrics extends XenAPIObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* unique identifier/object reference
|
* Unique identifier/object reference
|
||||||
*/
|
*/
|
||||||
public String uuid;
|
public String uuid;
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -135,7 +135,7 @@ public class VMMetrics extends XenAPIObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* unique identifier/object reference
|
* Unique identifier/object reference
|
||||||
*/
|
*/
|
||||||
public String uuid;
|
public String uuid;
|
||||||
/**
|
/**
|
||||||
|
|||||||
1157
deps/XenServerJava/com/xensource/xenapi/VMPP.java
vendored
Normal file
1157
deps/XenServerJava/com/xensource/xenapi/VMPP.java
vendored
Normal file
File diff suppressed because it is too large
Load Diff
@ -117,7 +117,7 @@ public class VTPM extends XenAPIObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* unique identifier/object reference
|
* Unique identifier/object reference
|
||||||
*/
|
*/
|
||||||
public String uuid;
|
public String uuid;
|
||||||
/**
|
/**
|
||||||
|
|||||||
BIN
deps/XenServerJava/ws-commons-util-1.0.2.jar
vendored
BIN
deps/XenServerJava/ws-commons-util-1.0.2.jar
vendored
Binary file not shown.
BIN
deps/XenServerJava/xenserver-5.6.0-1.jar
vendored
BIN
deps/XenServerJava/xenserver-5.6.0-1.jar
vendored
Binary file not shown.
BIN
deps/XenServerJava/xmlrpc-client-3.1.jar
vendored
BIN
deps/XenServerJava/xmlrpc-client-3.1.jar
vendored
Binary file not shown.
BIN
deps/XenServerJava/xmlrpc-common-3.1.jar
vendored
BIN
deps/XenServerJava/xmlrpc-common-3.1.jar
vendored
Binary file not shown.
BIN
deps/cloud-xenserver-5.6.0-1.jar
vendored
BIN
deps/cloud-xenserver-5.6.0-1.jar
vendored
Binary file not shown.
BIN
deps/cloud-xenserver-5.6.100-1.jar
vendored
Normal file
BIN
deps/cloud-xenserver-5.6.100-1.jar
vendored
Normal file
Binary file not shown.
@ -20,6 +20,6 @@
|
|||||||
<classpathentry kind="lib" path="/thirdparty/trilead-ssh2-build213.jar"/>
|
<classpathentry kind="lib" path="/thirdparty/trilead-ssh2-build213.jar"/>
|
||||||
<classpathentry kind="lib" path="/thirdparty/xstream-1.3.1.jar"/>
|
<classpathentry kind="lib" path="/thirdparty/xstream-1.3.1.jar"/>
|
||||||
<classpathentry kind="lib" path="/thirdparty/gson.jar"/>
|
<classpathentry kind="lib" path="/thirdparty/gson.jar"/>
|
||||||
<classpathentry kind="lib" path="/thirdparty/xenserver-5.6.0-1.jar" sourcepath="/thirdparty/XenServerJava"/>
|
<classpathentry kind="lib" path="/deps/cloud-xenserver-5.6.100-1.jar" sourcepath="/deps/XenServerJava"/>
|
||||||
<classpathentry kind="output" path="bin"/>
|
<classpathentry kind="output" path="bin"/>
|
||||||
</classpath>
|
</classpath>
|
||||||
|
|||||||
@ -134,10 +134,9 @@ public class XcpServerDiscoverer extends DiscovererBase implements Discoverer, L
|
|||||||
}
|
}
|
||||||
String hostname = url.getHost();
|
String hostname = url.getHost();
|
||||||
InetAddress ia = InetAddress.getByName(hostname);
|
InetAddress ia = InetAddress.getByName(hostname);
|
||||||
String hostIp = ia.getHostAddress();
|
String hostIp = ia.getHostAddress();
|
||||||
|
String masterIp = _connPool.getMasterIp(hostIp, username, password);
|
||||||
conn = _connPool.masterConnect(hostIp, username, password);
|
conn = _connPool.masterConnect(masterIp, username, password);
|
||||||
|
|
||||||
if (conn == null) {
|
if (conn == null) {
|
||||||
String msg = "Unable to get a connection to " + url;
|
String msg = "Unable to get a connection to " + url;
|
||||||
s_logger.debug(msg);
|
s_logger.debug(msg);
|
||||||
@ -329,7 +328,7 @@ public class XcpServerDiscoverer extends DiscovererBase implements Discoverer, L
|
|||||||
username = host.getDetail("username");
|
username = host.getDetail("username");
|
||||||
password = host.getDetail("password");
|
password = host.getDetail("password");
|
||||||
String address = host.getPrivateIpAddress();
|
String address = host.getPrivateIpAddress();
|
||||||
Connection hostConn = XenServerConnectionPool.slaveConnect(address, username, password);
|
Connection hostConn = _connPool.slaveConnect(address, username, password);
|
||||||
if (hostConn == null) {
|
if (hostConn == null) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -356,7 +355,7 @@ public class XcpServerDiscoverer extends DiscovererBase implements Discoverer, L
|
|||||||
throw new CloudRuntimeException("Unable to reach the pool master of the existing cluster");
|
throw new CloudRuntimeException("Unable to reach the pool master of the existing cluster");
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !XenServerConnectionPool.joinPool(conn, hostIp, masterIp, username, password) ){
|
if( !_connPool.joinPool(conn, hostIp, masterIp, username, password) ){
|
||||||
s_logger.warn("Unable to join the pool");
|
s_logger.warn("Unable to join the pool");
|
||||||
throw new DiscoveryException("Unable to join the pool");
|
throw new DiscoveryException("Unable to join the pool");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -64,6 +64,7 @@ public class Db21to22MigrationUtil {
|
|||||||
|
|
||||||
/* add guid in cluster table */
|
/* add guid in cluster table */
|
||||||
private void setupClusterGuid() {
|
private void setupClusterGuid() {
|
||||||
|
XenServerConnectionPool _connPool = XenServerConnectionPool.getInstance();
|
||||||
List<ClusterVO> clusters = _clusterDao.listByHyTypeWithoutGuid(HypervisorType.XenServer.toString());
|
List<ClusterVO> clusters = _clusterDao.listByHyTypeWithoutGuid(HypervisorType.XenServer.toString());
|
||||||
for (ClusterVO cluster : clusters) {
|
for (ClusterVO cluster : clusters) {
|
||||||
List<HostVO> hosts = _hostDao.listByCluster(cluster.getId());
|
List<HostVO> hosts = _hostDao.listByCluster(cluster.getId());
|
||||||
@ -75,7 +76,7 @@ public class Db21to22MigrationUtil {
|
|||||||
|| password.isEmpty()) {
|
|| password.isEmpty()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
Connection conn = XenServerConnectionPool.slaveConnect(ip, username, password);
|
Connection conn = _connPool.slaveConnect(ip, username, password);
|
||||||
if (conn == null)
|
if (conn == null)
|
||||||
continue;
|
continue;
|
||||||
Pool.Record pr = null;
|
Pool.Record pr = null;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user