diff --git a/.gitignore b/.gitignore
index a0307a771de..d6f5d1c8feb 100644
--- a/.gitignore
+++ b/.gitignore
@@ -64,7 +64,6 @@ awsapi/modules/*
.settings.xml
.settings/
db.properties.override
-replace.properties.override
awsapi/overlays/
tools/marvin/marvin/cloudstackAPI/*
*.egg-info/
diff --git a/deps/XenServerJava/pom.xml b/deps/XenServerJava/pom.xml
new file mode 100644
index 00000000000..c9a4e865729
--- /dev/null
+++ b/deps/XenServerJava/pom.xml
@@ -0,0 +1,60 @@
+
+
+ 4.0.0
+
+ org.apache.cloudstack
+ cloudstack
+ 4.4.0-SNAPSHOT
+ ../../pom.xml
+
+ xapi
+ 6.2.0-1-SNAPSHOT
+ Apache XenSource XAPI
+ XenSource XAPI Java Bindings
+
+
+ org.apache.xmlrpc
+ xmlrpc-client
+ ${cs.xmlrpc.version}
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-checkstyle-plugin
+
+
+ cloudstack-checkstyle
+ none
+
+
+
+
+ org.apache.cloudstack
+ checkstyle
+
+ ${project.parent.version}
+
+
+
+
+
+
diff --git a/deps/XenServerJava/src/LICENSE.Apache-2.0.txt b/deps/XenServerJava/src/LICENSE.Apache-2.0.txt
new file mode 100755
index 00000000000..261eeb9e9f8
--- /dev/null
+++ b/deps/XenServerJava/src/LICENSE.Apache-2.0.txt
@@ -0,0 +1,201 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/deps/XenServerJava/src/LICENSE.txt b/deps/XenServerJava/src/LICENSE.txt
new file mode 100755
index 00000000000..76c4a2240fa
--- /dev/null
+++ b/deps/XenServerJava/src/LICENSE.txt
@@ -0,0 +1,26 @@
+Copyright (c) Citrix Systems, Inc.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+ 1) Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ 2) Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in
+ the documentation and/or other materials provided with the
+ distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\ No newline at end of file
diff --git a/deps/XenServerJava/src/README.txt b/deps/XenServerJava/src/README.txt
new file mode 100755
index 00000000000..2e6fa457cd0
--- /dev/null
+++ b/deps/XenServerJava/src/README.txt
@@ -0,0 +1,57 @@
+XenServerJava
+=============
+
+NOTE: This is a modified version of Citrix XenServer's SDK. This version of
+XenServerJava includes some customization which is required to make it work
+with CloudStack.
+
+
+Version 6.2.0-1.
+
+XenServerJava is a complete SDK for Citrix XenServer, exposing the XenServer
+API as Java classes.
+
+For XenServer documentation, see http://docs.xensource.com.
+XenServerJava includes a class for every XenServer class, and a method for
+each XenServer API call, so API documentation and examples written for
+for other languages will apply equally well to Java.
+In particular, the SDK Guide and API Documentation are ideal for developers
+wishing to use XenServerJava.
+
+For community content, blogs, and downloads, visit the XenServer Developer
+Network at http://community.citrix.com/cdn/xs.
+
+XenServerJava is free sofware. You can redistribute and modify it under the
+terms of the BSD license. See LICENSE.txt for details.
+
+This library may be accompanied by pedagogical examples. These do not form
+part of this library, and are licensed for redistribution and modification
+under the BSD license. Such examples are licensed clearly at the top
+of each file.
+
+
+Dependencies
+------------
+
+XenServerJava is dependent upon Apache XML-RPC and WS-Commons, both by The
+Apache Software Foundation. We would like to thank the ASF and the
+Apache XML-RPC development team in particular.
+Both are licensed under the Apache Software License 2.0; see
+LICENSE.Apache-2.0.txt for details.
+
+We test with version 3.1 of Apache XML-RPC, and version 1.0.2 of WS-Commons.
+We recommend that you use these versions, though others may work.
+
+
+Downloads
+---------
+
+XenServerJava is available in the XenServer-6.2.0-SDK.zip in three separate
+folders, one for the compiled binaries, one for the source code,
+and one containing sample code.
+
+The XenServer-6.2.0-SDK.zip is available from
+http://www.citrix.com/downloads/xenserver/.
+
+Apache XML-RPC is available from http://ws.apache.org/xmlrpc/.
+WS-Commons is available from http://ws.apache.org/commons/.
diff --git a/deps/XenServerJava/src/com/xensource/xenapi/APIVersion.java b/deps/XenServerJava/src/com/xensource/xenapi/APIVersion.java
new file mode 100755
index 00000000000..9dcdd9f151e
--- /dev/null
+++ b/deps/XenServerJava/src/com/xensource/xenapi/APIVersion.java
@@ -0,0 +1,131 @@
+/*
+ * Copyright (c) Citrix Systems, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1) Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2) Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.xensource.xenapi;
+
+public enum APIVersion
+{
+ API_1_1, API_1_2, API_1_3, API_1_4, API_1_5, API_1_6, API_1_7, API_1_8, API_1_9, API_1_10, API_2_0, API_2_1, UNKNOWN;
+
+ public static APIVersion latest()
+ {
+ return API_2_1;
+ }
+
+ public static APIVersion fromMajorMinor(long major, long minor)
+ {
+ if (major == 2 && minor == 1)
+ {
+ return API_2_1;
+ }
+ else if (major == 2 && minor == 0)
+ {
+ return API_2_0;
+ }
+ else if (major == 1 && minor == 10)
+ {
+ return API_1_10;
+ }
+ else if (major == 1 && minor == 9)
+ {
+ return API_1_9;
+ }
+ else if (major == 1 && minor == 8)
+ {
+ return API_1_8;
+ }
+ else if (major == 1 && minor == 7)
+ {
+ return API_1_7;
+ }
+ else if (major == 1 && minor == 6)
+ {
+ return API_1_6;
+ }
+ else if (major == 1 && minor == 5)
+ {
+ return API_1_5;
+ }
+ else if (major == 1 && minor == 4)
+ {
+ return API_1_4;
+ }
+ else if (major == 1 && minor == 3)
+ {
+ return API_1_3;
+ }
+ else if (major == 1 && minor == 2)
+ {
+ return API_1_2;
+ }
+ else if (major == 1 && minor == 1)
+ {
+ return API_1_1;
+ }
+ else
+ {
+ return UNKNOWN;
+ }
+ }
+
+ @Override
+ public String toString()
+ {
+ switch (this)
+ {
+ case API_1_1:
+ return "1.1";
+ case API_1_2:
+ return "1.2";
+ case API_1_3:
+ return "1.3";
+ case API_1_4:
+ return "1.4";
+ case API_1_5:
+ return "1.5";
+ case API_1_6:
+ return "1.6";
+ case API_1_7:
+ return "1.7";
+ case API_1_8:
+ return "1.8";
+ case API_1_9:
+ return "1.9";
+ case API_1_10:
+ return "1.10";
+ case API_2_0:
+ return "2.0";
+ case API_2_1:
+ return "2.1";
+ default:
+ return "Unknown";
+ }
+ }
+}
diff --git a/deps/XenServerJava/src/com/xensource/xenapi/Auth.java b/deps/XenServerJava/src/com/xensource/xenapi/Auth.java
new file mode 100644
index 00000000000..4778e6ab061
--- /dev/null
+++ b/deps/XenServerJava/src/com/xensource/xenapi/Auth.java
@@ -0,0 +1,114 @@
+/*
+ * Copyright (c) Citrix Systems, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1) Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2) Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+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;
+
+/**
+ * Management of remote authentication services
+ *
+ * @author Citrix Systems, Inc.
+ */
+public class Auth extends XenAPIObject {
+
+
+ public String toWireString() {
+ return null;
+ }
+
+ /**
+ * This call queries the external directory service to obtain the subject_identifier as a string from the human-readable subject_name
+ *
+ * @param subjectName The human-readable subject_name, such as a username or a groupname
+ * @return the subject_identifier obtained from the external directory service
+ */
+ public static String getSubjectIdentifier(Connection c, String subjectName) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "auth.get_subject_identifier";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(subjectName)};
+ Map response = c.dispatch(method_call, method_params);
+ Object result = response.get("Value");
+ return Types.toString(result);
+ }
+
+ /**
+ * This call queries the external directory service to obtain the user information (e.g. username, organization etc) from the specified subject_identifier
+ *
+ * @param subjectIdentifier A string containing the subject_identifier, unique in the external directory service
+ * @return key-value pairs containing at least a key called subject_name
+ */
+ public static Map getSubjectInformationFromIdentifier(Connection c, String subjectIdentifier) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "auth.get_subject_information_from_identifier";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(subjectIdentifier)};
+ Map response = c.dispatch(method_call, method_params);
+ Object result = response.get("Value");
+ return Types.toMapOfStringString(result);
+ }
+
+ /**
+ * This calls queries the external directory service to obtain the transitively-closed set of groups that the the subject_identifier is member of.
+ *
+ * @param subjectIdentifier A string containing the subject_identifier, unique in the external directory service
+ * @return set of subject_identifiers that provides the group membership of subject_identifier passed as argument, it contains, recursively, all groups a subject_identifier is member of.
+ */
+ public static Set getGroupMembership(Connection c, String subjectIdentifier) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "auth.get_group_membership";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(subjectIdentifier)};
+ Map response = c.dispatch(method_call, method_params);
+ Object result = response.get("Value");
+ return Types.toSetOfString(result);
+ }
+
+}
\ No newline at end of file
diff --git a/deps/XenServerJava/src/com/xensource/xenapi/Blob.java b/deps/XenServerJava/src/com/xensource/xenapi/Blob.java
new file mode 100644
index 00000000000..ec91d8788f6
--- /dev/null
+++ b/deps/XenServerJava/src/com/xensource/xenapi/Blob.java
@@ -0,0 +1,446 @@
+/*
+ * Copyright (c) Citrix Systems, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1) Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2) Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+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 placeholder for a binary blob
+ *
+ * @author Citrix Systems, Inc.
+ */
+public class Blob extends XenAPIObject {
+
+ /**
+ * The XenAPI reference (OpaqueRef) to this object.
+ */
+ protected final String ref;
+
+ /**
+ * For internal use only.
+ */
+ Blob(String ref) {
+ this.ref = ref;
+ }
+
+ /**
+ * @return The XenAPI reference (OpaqueRef) to this object.
+ */
+ public String toWireString() {
+ return this.ref;
+ }
+
+ /**
+ * If obj is a Blob, compares XenAPI references for equality.
+ */
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (obj != null && obj instanceof Blob)
+ {
+ Blob other = (Blob) obj;
+ return other.ref.equals(this.ref);
+ } else
+ {
+ return false;
+ }
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return ref.hashCode();
+ }
+
+ /**
+ * Represents all the fields in a Blob
+ */
+ 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", "nameLabel", this.nameLabel);
+ print.printf("%1$20s: %2$s\n", "nameDescription", this.nameDescription);
+ print.printf("%1$20s: %2$s\n", "size", this.size);
+ print.printf("%1$20s: %2$s\n", "_public", this._public);
+ print.printf("%1$20s: %2$s\n", "lastUpdated", this.lastUpdated);
+ print.printf("%1$20s: %2$s\n", "mimeType", this.mimeType);
+ return writer.toString();
+ }
+
+ /**
+ * Convert a blob.Record to a Map
+ */
+ public Map toMap() {
+ Map map = new HashMap();
+ map.put("uuid", this.uuid == null ? "" : this.uuid);
+ map.put("name_label", this.nameLabel == null ? "" : this.nameLabel);
+ map.put("name_description", this.nameDescription == null ? "" : this.nameDescription);
+ map.put("size", this.size == null ? 0 : this.size);
+ map.put("public", this._public == null ? false : this._public);
+ map.put("last_updated", this.lastUpdated == null ? new Date(0) : this.lastUpdated);
+ map.put("mime_type", this.mimeType == null ? "" : this.mimeType);
+ return map;
+ }
+
+ /**
+ * Unique identifier/object reference
+ */
+ public String uuid;
+ /**
+ * a human-readable name
+ */
+ public String nameLabel;
+ /**
+ * a notes field containing human-readable description
+ */
+ public String nameDescription;
+ /**
+ * Size of the binary data, in bytes
+ */
+ public Long size;
+ /**
+ * True if the blob is publicly accessible
+ */
+ public Boolean _public;
+ /**
+ * Time at which the data in the blob was last updated
+ */
+ public Date lastUpdated;
+ /**
+ * The mime type associated with this object. Defaults to 'application/octet-stream' if the empty string is supplied
+ */
+ public String mimeType;
+ }
+
+ /**
+ * Get a record containing the current state of the given blob.
+ *
+ * @return all fields from the object
+ */
+ public Blob.Record getRecord(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "blob.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.toBlobRecord(result);
+ }
+
+ /**
+ * Get a reference to the blob instance with the specified UUID.
+ *
+ * @param uuid UUID of object to return
+ * @return reference to the object
+ */
+ public static Blob getByUuid(Connection c, String uuid) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "blob.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.toBlob(result);
+ }
+
+ /**
+ * Get all the blob instances with the given label.
+ *
+ * @param label label of object to return
+ * @return references to objects with matching names
+ */
+ public static Set getByNameLabel(Connection c, String label) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "blob.get_by_name_label";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(label)};
+ Map response = c.dispatch(method_call, method_params);
+ Object result = response.get("Value");
+ return Types.toSetOfBlob(result);
+ }
+
+ /**
+ * Get the uuid field of the given blob.
+ *
+ * @return value of the field
+ */
+ public String getUuid(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "blob.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 name/label field of the given blob.
+ *
+ * @return value of the field
+ */
+ public String getNameLabel(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "blob.get_name_label";
+ 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 name/description field of the given blob.
+ *
+ * @return value of the field
+ */
+ public String getNameDescription(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "blob.get_name_description";
+ 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 size field of the given blob.
+ *
+ * @return value of the field
+ */
+ public Long getSize(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "blob.get_size";
+ 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.toLong(result);
+ }
+
+ /**
+ * Get the public field of the given blob.
+ *
+ * @return value of the field
+ */
+ public Boolean getPublic(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "blob.get_public";
+ 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 last_updated field of the given blob.
+ *
+ * @return value of the field
+ */
+ public Date getLastUpdated(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "blob.get_last_updated";
+ 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);
+ }
+
+ /**
+ * Get the mime_type field of the given blob.
+ *
+ * @return value of the field
+ */
+ public String getMimeType(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "blob.get_mime_type";
+ 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);
+ }
+
+ /**
+ * Set the name/label field of the given blob.
+ *
+ * @param label New value to set
+ */
+ public void setNameLabel(Connection c, String label) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "blob.set_name_label";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(label)};
+ Map response = c.dispatch(method_call, method_params);
+ return;
+ }
+
+ /**
+ * Set the name/description field of the given blob.
+ *
+ * @param description New value to set
+ */
+ public void setNameDescription(Connection c, String description) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "blob.set_name_description";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(description)};
+ Map response = c.dispatch(method_call, method_params);
+ return;
+ }
+
+ /**
+ * Set the public field of the given blob.
+ *
+ * @param _public New value to set
+ */
+ public void setPublic(Connection c, Boolean _public) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "blob.set_public";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(_public)};
+ Map response = c.dispatch(method_call, method_params);
+ return;
+ }
+
+ /**
+ * Create a placeholder for a binary blob
+ *
+ * @param mimeType The mime-type of the blob. Defaults to 'application/octet-stream' if the empty string is supplied
+ * @param _public True if the blob should be publicly available
+ * @return The reference to the created blob
+ */
+ public static Blob create(Connection c, String mimeType, Boolean _public) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "blob.create";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(mimeType), Marshalling.toXMLRPC(_public)};
+ Map response = c.dispatch(method_call, method_params);
+ Object result = response.get("Value");
+ return Types.toBlob(result);
+ }
+
+ /**
+ *
+ *
+ */
+ public void destroy(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "blob.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 blobs known to the system.
+ *
+ * @return references to all objects
+ */
+ public static Set getAll(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "blob.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.toSetOfBlob(result);
+ }
+
+ /**
+ * Return a map of blob references to blob records for all blobs known to the system.
+ *
+ * @return records of all objects
+ */
+ public static Map getAllRecords(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "blob.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.toMapOfBlobBlobRecord(result);
+ }
+
+}
\ No newline at end of file
diff --git a/deps/XenServerJava/src/com/xensource/xenapi/Bond.java b/deps/XenServerJava/src/com/xensource/xenapi/Bond.java
new file mode 100644
index 00000000000..5a54ad27920
--- /dev/null
+++ b/deps/XenServerJava/src/com/xensource/xenapi/Bond.java
@@ -0,0 +1,564 @@
+/*
+ * Copyright (c) Citrix Systems, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1) Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2) Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+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;
+
+/**
+ *
+ *
+ * @author Citrix Systems, Inc.
+ */
+public class Bond extends XenAPIObject {
+
+ /**
+ * The XenAPI reference (OpaqueRef) to this object.
+ */
+ protected final String ref;
+
+ /**
+ * For internal use only.
+ */
+ Bond(String ref) {
+ this.ref = ref;
+ }
+
+ /**
+ * @return The XenAPI reference (OpaqueRef) to this object.
+ */
+ public String toWireString() {
+ return this.ref;
+ }
+
+ /**
+ * If obj is a Bond, compares XenAPI references for equality.
+ */
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (obj != null && obj instanceof Bond)
+ {
+ Bond other = (Bond) obj;
+ return other.ref.equals(this.ref);
+ } else
+ {
+ return false;
+ }
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return ref.hashCode();
+ }
+
+ /**
+ * Represents all the fields in a Bond
+ */
+ 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", "master", this.master);
+ print.printf("%1$20s: %2$s\n", "slaves", this.slaves);
+ print.printf("%1$20s: %2$s\n", "otherConfig", this.otherConfig);
+ print.printf("%1$20s: %2$s\n", "primarySlave", this.primarySlave);
+ print.printf("%1$20s: %2$s\n", "mode", this.mode);
+ print.printf("%1$20s: %2$s\n", "properties", this.properties);
+ print.printf("%1$20s: %2$s\n", "linksUp", this.linksUp);
+ return writer.toString();
+ }
+
+ /**
+ * Convert a Bond.Record to a Map
+ */
+ public Map toMap() {
+ Map map = new HashMap();
+ map.put("uuid", this.uuid == null ? "" : this.uuid);
+ map.put("master", this.master == null ? new PIF("OpaqueRef:NULL") : this.master);
+ map.put("slaves", this.slaves == null ? new LinkedHashSet() : this.slaves);
+ map.put("other_config", this.otherConfig == null ? new HashMap() : this.otherConfig);
+ map.put("primary_slave", this.primarySlave == null ? new PIF("OpaqueRef:NULL") : this.primarySlave);
+ map.put("mode", this.mode == null ? Types.BondMode.UNRECOGNIZED : this.mode);
+ map.put("properties", this.properties == null ? new HashMap() : this.properties);
+ map.put("links_up", this.linksUp == null ? 0 : this.linksUp);
+ return map;
+ }
+
+ /**
+ * Unique identifier/object reference
+ */
+ public String uuid;
+ /**
+ * The bonded interface
+ */
+ public PIF master;
+ /**
+ * The interfaces which are part of this bond
+ */
+ public Set slaves;
+ /**
+ * additional configuration
+ */
+ public Map otherConfig;
+ /**
+ * The PIF of which the IP configuration and MAC were copied to the bond, and which will receive all configuration/VLANs/VIFs on the bond if the bond is destroyed
+ */
+ public PIF primarySlave;
+ /**
+ * The algorithm used to distribute traffic among the bonded NICs
+ */
+ public Types.BondMode mode;
+ /**
+ * Additional configuration properties specific to the bond mode.
+ */
+ public Map properties;
+ /**
+ * Number of links up in this bond
+ */
+ public Long linksUp;
+ }
+
+ /**
+ * Get a record containing the current state of the given Bond.
+ *
+ * @return all fields from the object
+ */
+ public Bond.Record getRecord(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "Bond.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.toBondRecord(result);
+ }
+
+ /**
+ * Get a reference to the Bond instance with the specified UUID.
+ *
+ * @param uuid UUID of object to return
+ * @return reference to the object
+ */
+ public static Bond getByUuid(Connection c, String uuid) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "Bond.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.toBond(result);
+ }
+
+ /**
+ * Get the uuid field of the given Bond.
+ *
+ * @return value of the field
+ */
+ public String getUuid(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "Bond.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 master field of the given Bond.
+ *
+ * @return value of the field
+ */
+ public PIF getMaster(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "Bond.get_master";
+ 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 slaves field of the given Bond.
+ *
+ * @return value of the field
+ */
+ public Set getSlaves(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "Bond.get_slaves";
+ 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.toSetOfPIF(result);
+ }
+
+ /**
+ * Get the other_config field of the given Bond.
+ *
+ * @return value of the field
+ */
+ public Map getOtherConfig(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "Bond.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);
+ }
+
+ /**
+ * Get the primary_slave field of the given Bond.
+ *
+ * @return value of the field
+ */
+ public PIF getPrimarySlave(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "Bond.get_primary_slave";
+ 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 mode field of the given Bond.
+ *
+ * @return value of the field
+ */
+ public Types.BondMode getMode(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "Bond.get_mode";
+ 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.toBondMode(result);
+ }
+
+ /**
+ * Get the properties field of the given Bond.
+ *
+ * @return value of the field
+ */
+ public Map getProperties(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "Bond.get_properties";
+ 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 links_up field of the given Bond.
+ *
+ * @return value of the field
+ */
+ public Long getLinksUp(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "Bond.get_links_up";
+ 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.toLong(result);
+ }
+
+ /**
+ * Set the other_config field of the given Bond.
+ *
+ * @param otherConfig New value to set
+ */
+ public void setOtherConfig(Connection c, Map otherConfig) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "Bond.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 Bond.
+ *
+ * @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 = "Bond.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 Bond. 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 = "Bond.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 an interface bond
+ *
+ * @param network Network to add the bonded PIF to
+ * @param members PIFs to add to this bond
+ * @param MAC The MAC address to use on the bond itself. If this parameter is the empty string then the bond will inherit its MAC address from the primary slave.
+ * @param mode Bonding mode to use for the new bond
+ * @param properties Additional configuration parameters specific to the bond mode
+ * @return Task
+ */
+ public static Task createAsync(Connection c, Network network, Set members, String MAC, Types.BondMode mode, Map properties) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "Async.Bond.create";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(network), Marshalling.toXMLRPC(members), Marshalling.toXMLRPC(MAC), Marshalling.toXMLRPC(mode), Marshalling.toXMLRPC(properties)};
+ Map response = c.dispatch(method_call, method_params);
+ Object result = response.get("Value");
+ return Types.toTask(result);
+ }
+
+ /**
+ * Create an interface bond
+ *
+ * @param network Network to add the bonded PIF to
+ * @param members PIFs to add to this bond
+ * @param MAC The MAC address to use on the bond itself. If this parameter is the empty string then the bond will inherit its MAC address from the primary slave.
+ * @param mode Bonding mode to use for the new bond
+ * @param properties Additional configuration parameters specific to the bond mode
+ * @return The reference of the created Bond object
+ */
+ public static Bond create(Connection c, Network network, Set members, String MAC, Types.BondMode mode, Map properties) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "Bond.create";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(network), Marshalling.toXMLRPC(members), Marshalling.toXMLRPC(MAC), Marshalling.toXMLRPC(mode), Marshalling.toXMLRPC(properties)};
+ Map response = c.dispatch(method_call, method_params);
+ Object result = response.get("Value");
+ return Types.toBond(result);
+ }
+
+ /**
+ * Destroy an interface bond
+ *
+ * @return Task
+ */
+ public Task destroyAsync(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "Async.Bond.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 an interface bond
+ *
+ */
+ public void destroy(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "Bond.destroy";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+ Map response = c.dispatch(method_call, method_params);
+ return;
+ }
+
+ /**
+ * Change the bond mode
+ *
+ * @param value The new bond mode
+ * @return Task
+ */
+ public Task setModeAsync(Connection c, Types.BondMode value) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "Async.Bond.set_mode";
+ 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);
+ Object result = response.get("Value");
+ return Types.toTask(result);
+ }
+
+ /**
+ * Change the bond mode
+ *
+ * @param value The new bond mode
+ */
+ public void setMode(Connection c, Types.BondMode value) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "Bond.set_mode";
+ 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;
+ }
+
+ /**
+ * Set the value of a property of the bond
+ *
+ * @param name The property name
+ * @param value The property value
+ * @return Task
+ */
+ public Task setPropertyAsync(Connection c, String name, String value) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "Async.Bond.set_property";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(name), Marshalling.toXMLRPC(value)};
+ Map response = c.dispatch(method_call, method_params);
+ Object result = response.get("Value");
+ return Types.toTask(result);
+ }
+
+ /**
+ * Set the value of a property of the bond
+ *
+ * @param name The property name
+ * @param value The property value
+ */
+ public void setProperty(Connection c, String name, String value) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "Bond.set_property";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(name), Marshalling.toXMLRPC(value)};
+ Map response = c.dispatch(method_call, method_params);
+ return;
+ }
+
+ /**
+ * Return a list of all the Bonds known to the system.
+ *
+ * @return references to all objects
+ */
+ public static Set getAll(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "Bond.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.toSetOfBond(result);
+ }
+
+ /**
+ * Return a map of Bond references to Bond records for all Bonds known to the system.
+ *
+ * @return records of all objects
+ */
+ public static Map getAllRecords(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "Bond.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.toMapOfBondBondRecord(result);
+ }
+
+}
\ No newline at end of file
diff --git a/deps/XenServerJava/src/com/xensource/xenapi/Connection.java b/deps/XenServerJava/src/com/xensource/xenapi/Connection.java
new file mode 100755
index 00000000000..661724fefb8
--- /dev/null
+++ b/deps/XenServerJava/src/com/xensource/xenapi/Connection.java
@@ -0,0 +1,367 @@
+/*
+ * Copyright (c) Citrix Systems, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1) Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2) Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.xensource.xenapi;
+
+import java.net.URL;
+import java.util.Map;
+import java.util.TimeZone;
+
+import org.apache.xmlrpc.XmlRpcException;
+import org.apache.xmlrpc.client.XmlRpcClient;
+import org.apache.xmlrpc.client.XmlRpcClientConfig;
+import org.apache.xmlrpc.client.XmlRpcClientConfigImpl;
+import org.apache.xmlrpc.client.XmlRpcHttpClientConfig;
+
+import com.xensource.xenapi.Types.BadServerResponse;
+import com.xensource.xenapi.Types.SessionAuthenticationFailed;
+import com.xensource.xenapi.Types.XenAPIException;
+
+/**
+ * Represents a connection to a XenServer. Creating a new instance of this class initialises a new XmlRpcClient that is
+ * then used by all method calls: each method call in xenapi takes a Connection as a parameter, composes an XMLRPC
+ * method call, and dispatches it on the Connection's client via the dispatch method.
+ */
+public class Connection
+{
+ /**
+ * The version of the bindings that this class belongs to.
+ */
+ public static final String BINDINGS_VERSION = "6.2.0-1";
+
+ private APIVersion apiVersion;
+
+ protected int _wait = 600;
+
+ /**
+ * Updated when Session.login_with_password() is called.
+ */
+ public APIVersion getAPIVersion()
+ {
+ return apiVersion;
+ }
+
+ /**
+ * The opaque reference to the session used by this connection
+ */
+ private String sessionReference;
+
+ /**
+ * As seen by the xmlrpc library. From our point of view it's a server.
+ */
+ private final XmlRpcClient client;
+
+ private final boolean deprecatedConstructorUsed;
+
+ /**
+ * Creates a connection to a particular server using a given username and password. This object can then be passed
+ * in to any other API calls.
+ *
+ * This constructor calls Session.loginWithPassword, passing itself as the first parameter.
+ *
+ * When this constructor is used, a call to dispose() (also called in the Connection's finalizer) will attempt a
+ * Session.logout on this connection.
+ *
+ * @deprecated Use a constructor that takes a URL as the first parameter instead.
+ */
+ @Deprecated
+ public Connection(String client, String username, String password) throws java.net.MalformedURLException,
+ XmlRpcException, BadServerResponse, SessionAuthenticationFailed, XenAPIException
+ {
+ deprecatedConstructorUsed = true;
+
+ final String ApiVersion = APIVersion.latest().toString();
+ this.client = getClientFromURL(new URL(client));
+ try
+ {
+ this.sessionReference = loginWithPassword(this.client, username, password, ApiVersion);
+ } catch (BadServerResponse e)
+ {
+ String[] errDesc = e.errorDescription;
+
+ if (0 == errDesc[0].compareTo("MESSAGE_PARAMETER_COUNT_MISMATCH")
+ && 0 == errDesc[1].compareTo("session.login_with_password")
+ && 0 == errDesc[2].compareTo("2")
+ && 0 == errDesc[3].compareTo("3"))
+ {
+ this.sessionReference = loginWithPassword(this.client, username, password);
+ } else
+ {
+ throw e;
+ }
+ }
+
+ try
+ {
+ setAPIVersion(new Session(sessionReference));
+ }
+ catch (XenAPIException exn)
+ {
+ dispose();
+ throw exn;
+ }
+ catch (XmlRpcException exn)
+ {
+ dispose();
+ throw exn;
+ }
+ }
+
+ /**
+ * Creates a connection to a particular server using a given username and password. This object can then be passed
+ * in to any other API calls.
+ *
+ * Note this constructor does NOT call Session.loginWithPassword; the programmer is responsible for calling it,
+ * passing the Connection as a parameter. No attempt to connect to the server is made until login is called.
+ *
+ * When this constructor is used, a call to dispose() will do nothing. The programmer is responsible for manually
+ * logging out the Session.
+ */
+ public Connection(URL url, int wait)
+ {
+ deprecatedConstructorUsed = false;
+ _wait = wait;
+ this.client = getClientFromURL(url);
+ }
+
+ /**
+ * Creates a connection to a particular server using a given username and password. This object can then be passed
+ * in to any other API calls.
+ *
+ * The additional sessionReference parameter must be a reference to a logged-in Session. Any method calls on this
+ * Connection will use it. This constructor does not call Session.loginWithPassword, and dispose() on the resulting
+ * Connection object does not call Session.logout. The programmer is responsible for ensuring the Session is logged
+ * in and out correctly.
+ */
+ public Connection(URL url, String sessionReference)
+ {
+ deprecatedConstructorUsed = false;
+
+ this.client = getClientFromURL(url);
+ this.sessionReference = sessionReference;
+ }
+
+ protected void finalize() throws Throwable
+ {
+ dispose();
+ super.finalize();
+ }
+
+ /**
+ * Nothrow guarantee.
+ */
+ public void dispose()
+ {
+ if (!deprecatedConstructorUsed)
+ {
+ // We only need to do the Session.logout if they used the old deprecated constructor.
+ return;
+ }
+
+ try
+ {
+ if (sessionReference != null)
+ {
+ String method_call = "session.logout";
+ Object[] method_params = { Marshalling.toXMLRPC(this.sessionReference) };
+ client.execute(method_call, method_params);
+ sessionReference = null;
+ }
+ }
+ catch (XmlRpcException exn)
+ {
+ }
+ }
+
+ /**
+ * @deprecated The programmer is now responsible for calling login/logout themselves.
+ */
+ @Deprecated
+ private static String loginWithPassword(XmlRpcClient client, String username, String password)
+ throws BadServerResponse, XmlRpcException, SessionAuthenticationFailed
+ {
+ String method_call = "session.login_with_password";
+ Object[] method_params = { Marshalling.toXMLRPC(username), Marshalling.toXMLRPC(password) };
+ Map response = (Map) client.execute(method_call, method_params);
+ if (response.get("Status").equals("Success"))
+ {
+ return (String) response.get("Value");
+ } else if (response.get("Status").equals("Failure"))
+ {
+ Object[] error = (Object[]) response.get("ErrorDescription");
+ if (error[0].equals("SESSION_AUTHENTICATION_FAILED"))
+ {
+ throw new SessionAuthenticationFailed();
+ }
+ }
+ throw new BadServerResponse(response);
+ }
+
+ /**
+ * @deprecated The programmer is now responsible for calling login/logout themselves.
+ */
+ @Deprecated
+ private static String loginWithPassword(XmlRpcClient client, String username, String password, String ApiVersion)
+ throws BadServerResponse, XmlRpcException, SessionAuthenticationFailed
+ {
+ String method_call = "session.login_with_password";
+ Object[] method_params = { Marshalling.toXMLRPC(username), Marshalling.toXMLRPC(password),
+ Marshalling.toXMLRPC(ApiVersion) };
+ Map response = (Map) client.execute(method_call, method_params);
+ if (response.get("Status").equals("Success"))
+ {
+ return (String) response.get("Value");
+ } else if (response.get("Status").equals("Failure"))
+ {
+ Object[] error = (Object[]) response.get("ErrorDescription");
+ if (error[0].equals("SESSION_AUTHENTICATION_FAILED"))
+ {
+ throw new SessionAuthenticationFailed();
+ }
+ }
+ throw new BadServerResponse(response);
+ }
+
+ private XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
+
+ public XmlRpcClientConfigImpl getConfig()
+ {
+ return config;
+ }
+ private XmlRpcClient getClientFromURL(URL url)
+ {
+ config.setTimeZone(TimeZone.getTimeZone("UTC"));
+ config.setServerURL(url);
+ config.setReplyTimeout(_wait * 1000);
+ config.setConnectionTimeout(5000);
+ XmlRpcClient client = new XmlRpcClient();
+ client.setConfig(config);
+ return client;
+ }
+
+ /*
+ * Because the binding calls are constructing their own parameter lists, they need to be able to get to
+ * the session reference directly. This is all rather ugly and needs redone
+ * Changed to public to allow easier integration with HTTP-level streaming interface,
+ * see CA-15447
+ */
+ public String getSessionReference()
+ {
+ return this.sessionReference;
+ }
+
+ /**
+ * The (auto-generated parts of) the bindings dispatch XMLRPC calls on this Connection's client through this method.
+ */
+ protected Map dispatch(String method_call, Object[] method_params) throws XmlRpcException, XenAPIException
+ {
+ Map response = (Map) client.execute(method_call, method_params);
+
+ if (!deprecatedConstructorUsed)
+ {
+ // We are using the new-style constructor which doesn't perform login.
+ // Set this Connection's Session reference from the value returned on the wire.
+ if (method_call.equals("session.login_with_password") &&
+ response.get("Status").equals("Success"))
+ {
+ // Store the Session reference and ask the server what the
+ // API version it's using is.
+ Session session = Types.toSession(response.get("Value"));
+ sessionReference = session.ref;
+ setAPIVersion(session);
+ }
+ else if (method_call.equals("session.slave_local_login_with_password") &&
+ response.get("Status").equals("Success"))
+ {
+ // Store the Session reference and assume the latest API version.
+ sessionReference = Types.toSession(response.get("Value")).ref;
+ apiVersion = APIVersion.latest();
+ }
+ else if (method_call.equals("session.logout"))
+ {
+ // Work around a bug in XenServer 5.0 and below.
+ // session.login_with_password should have rejected us with
+ // HOST_IS_SLAVE, but instead we don't find out until later.
+ // We don't want to leak the session, so we need to log out
+ // this session from the master instead.
+ if (response.get("Status").equals("Failure"))
+ {
+ Object[] error = (Object[]) response.get("ErrorDescription");
+ if (error.length == 2 && error[0].equals("HOST_IS_SLAVE"))
+ {
+ try
+ {
+ URL client_url =
+ ((XmlRpcHttpClientConfig)client.getClientConfig()).getServerURL();
+ Connection tmp_conn =
+ new Connection(new URL(client_url.getProtocol(),
+ (String)error[1],
+ client_url.getPort(),
+ client_url.getFile()), _wait);
+ tmp_conn.sessionReference = sessionReference;
+ try
+ {
+ Session.logout(tmp_conn);
+ }
+ finally
+ {
+ tmp_conn.dispose();
+ }
+ }
+ catch (Exception exn2)
+ {
+ // Ignore -- we're going to throw HostIsSlave anyway.
+ }
+ }
+ }
+
+ // Clear the stored Session reference.
+ this.sessionReference = null;
+ }
+ }
+
+ return Types.checkResponse(response);
+ }
+
+
+ private void setAPIVersion(Session session) throws XenAPIException, XmlRpcException
+ {
+ try
+ {
+ long major = session.getThisHost(this).getAPIVersionMajor(this);
+ long minor = session.getThisHost(this).getAPIVersionMinor(this);
+ apiVersion = APIVersion.fromMajorMinor(major, minor);
+ }
+ catch (BadServerResponse exn)
+ {
+ apiVersion = APIVersion.UNKNOWN;
+ }
+ }
+}
diff --git a/deps/XenServerJava/src/com/xensource/xenapi/Console.java b/deps/XenServerJava/src/com/xensource/xenapi/Console.java
new file mode 100644
index 00000000000..bb4440aebd4
--- /dev/null
+++ b/deps/XenServerJava/src/com/xensource/xenapi/Console.java
@@ -0,0 +1,419 @@
+/*
+ * Copyright (c) Citrix Systems, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1) Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2) Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+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 console
+ *
+ * @author Citrix Systems, Inc.
+ */
+public class Console extends XenAPIObject {
+
+ /**
+ * The XenAPI reference (OpaqueRef) to this object.
+ */
+ protected final String ref;
+
+ /**
+ * For internal use only.
+ */
+ Console(String ref) {
+ this.ref = ref;
+ }
+
+ /**
+ * @return The XenAPI reference (OpaqueRef) to this object.
+ */
+ public String toWireString() {
+ return this.ref;
+ }
+
+ /**
+ * If obj is a Console, compares XenAPI references for equality.
+ */
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (obj != null && obj instanceof Console)
+ {
+ Console other = (Console) obj;
+ return other.ref.equals(this.ref);
+ } else
+ {
+ return false;
+ }
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return ref.hashCode();
+ }
+
+ /**
+ * Represents all the fields in a Console
+ */
+ 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", "protocol", this.protocol);
+ print.printf("%1$20s: %2$s\n", "location", this.location);
+ print.printf("%1$20s: %2$s\n", "VM", this.VM);
+ print.printf("%1$20s: %2$s\n", "otherConfig", this.otherConfig);
+ return writer.toString();
+ }
+
+ /**
+ * Convert a console.Record to a Map
+ */
+ public Map toMap() {
+ Map map = new HashMap();
+ map.put("uuid", this.uuid == null ? "" : this.uuid);
+ map.put("protocol", this.protocol == null ? Types.ConsoleProtocol.UNRECOGNIZED : this.protocol);
+ map.put("location", this.location == null ? "" : this.location);
+ map.put("VM", this.VM == null ? new VM("OpaqueRef:NULL") : this.VM);
+ map.put("other_config", this.otherConfig == null ? new HashMap() : this.otherConfig);
+ return map;
+ }
+
+ /**
+ * Unique identifier/object reference
+ */
+ public String uuid;
+ /**
+ * the protocol used by this console
+ */
+ public Types.ConsoleProtocol protocol;
+ /**
+ * URI for the console service
+ */
+ public String location;
+ /**
+ * VM to which this console is attached
+ */
+ public VM VM;
+ /**
+ * additional configuration
+ */
+ public Map otherConfig;
+ }
+
+ /**
+ * Get a record containing the current state of the given console.
+ *
+ * @return all fields from the object
+ */
+ public Console.Record getRecord(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "console.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.toConsoleRecord(result);
+ }
+
+ /**
+ * Get a reference to the console instance with the specified UUID.
+ *
+ * @param uuid UUID of object to return
+ * @return reference to the object
+ */
+ public static Console getByUuid(Connection c, String uuid) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "console.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.toConsole(result);
+ }
+
+ /**
+ * Create a new console instance, and return its handle.
+ *
+ * @param record All constructor arguments
+ * @return Task
+ */
+ public static Task createAsync(Connection c, Console.Record record) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "Async.console.create";
+ String session = c.getSessionReference();
+ Map record_map = record.toMap();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(record_map)};
+ Map response = c.dispatch(method_call, method_params);
+ Object result = response.get("Value");
+ return Types.toTask(result);
+ }
+
+ /**
+ * Create a new console instance, and return its handle.
+ *
+ * @param record All constructor arguments
+ * @return reference to the newly created object
+ */
+ public static Console create(Connection c, Console.Record record) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "console.create";
+ String session = c.getSessionReference();
+ Map record_map = record.toMap();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(record_map)};
+ Map response = c.dispatch(method_call, method_params);
+ Object result = response.get("Value");
+ return Types.toConsole(result);
+ }
+
+ /**
+ * Destroy the specified console instance.
+ *
+ * @return Task
+ */
+ public Task destroyAsync(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "Async.console.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 the specified console instance.
+ *
+ */
+ public void destroy(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "console.destroy";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+ Map response = c.dispatch(method_call, method_params);
+ return;
+ }
+
+ /**
+ * Get the uuid field of the given console.
+ *
+ * @return value of the field
+ */
+ public String getUuid(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "console.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 protocol field of the given console.
+ *
+ * @return value of the field
+ */
+ public Types.ConsoleProtocol getProtocol(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "console.get_protocol";
+ 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.toConsoleProtocol(result);
+ }
+
+ /**
+ * Get the location field of the given console.
+ *
+ * @return value of the field
+ */
+ public String getLocation(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "console.get_location";
+ 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 VM field of the given console.
+ *
+ * @return value of the field
+ */
+ public VM getVM(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "console.get_VM";
+ 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.toVM(result);
+ }
+
+ /**
+ * Get the other_config field of the given console.
+ *
+ * @return value of the field
+ */
+ public Map getOtherConfig(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "console.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 other_config field of the given console.
+ *
+ * @param otherConfig New value to set
+ */
+ public void setOtherConfig(Connection c, Map otherConfig) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "console.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 console.
+ *
+ * @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 = "console.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 console. 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 = "console.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;
+ }
+
+ /**
+ * Return a list of all the consoles known to the system.
+ *
+ * @return references to all objects
+ */
+ public static Set getAll(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "console.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.toSetOfConsole(result);
+ }
+
+ /**
+ * Return a map of console references to console records for all consoles known to the system.
+ *
+ * @return records of all objects
+ */
+ public static Map getAllRecords(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "console.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.toMapOfConsoleConsoleRecord(result);
+ }
+
+}
\ No newline at end of file
diff --git a/deps/XenServerJava/src/com/xensource/xenapi/Crashdump.java b/deps/XenServerJava/src/com/xensource/xenapi/Crashdump.java
new file mode 100644
index 00000000000..1d40d4d994f
--- /dev/null
+++ b/deps/XenServerJava/src/com/xensource/xenapi/Crashdump.java
@@ -0,0 +1,358 @@
+/*
+ * Copyright (c) Citrix Systems, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1) Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2) Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+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 VM crashdump
+ *
+ * @author Citrix Systems, Inc.
+ */
+public class Crashdump extends XenAPIObject {
+
+ /**
+ * The XenAPI reference (OpaqueRef) to this object.
+ */
+ protected final String ref;
+
+ /**
+ * For internal use only.
+ */
+ Crashdump(String ref) {
+ this.ref = ref;
+ }
+
+ /**
+ * @return The XenAPI reference (OpaqueRef) to this object.
+ */
+ public String toWireString() {
+ return this.ref;
+ }
+
+ /**
+ * If obj is a Crashdump, compares XenAPI references for equality.
+ */
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (obj != null && obj instanceof Crashdump)
+ {
+ Crashdump other = (Crashdump) obj;
+ return other.ref.equals(this.ref);
+ } else
+ {
+ return false;
+ }
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return ref.hashCode();
+ }
+
+ /**
+ * Represents all the fields in a Crashdump
+ */
+ 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", "VM", this.VM);
+ print.printf("%1$20s: %2$s\n", "VDI", this.VDI);
+ print.printf("%1$20s: %2$s\n", "otherConfig", this.otherConfig);
+ return writer.toString();
+ }
+
+ /**
+ * Convert a crashdump.Record to a Map
+ */
+ public Map toMap() {
+ Map map = new HashMap();
+ map.put("uuid", this.uuid == null ? "" : this.uuid);
+ map.put("VM", this.VM == null ? new VM("OpaqueRef:NULL") : this.VM);
+ map.put("VDI", this.VDI == null ? new VDI("OpaqueRef:NULL") : this.VDI);
+ map.put("other_config", this.otherConfig == null ? new HashMap() : this.otherConfig);
+ return map;
+ }
+
+ /**
+ * Unique identifier/object reference
+ */
+ public String uuid;
+ /**
+ * the virtual machine
+ */
+ public VM VM;
+ /**
+ * the virtual disk
+ */
+ public VDI VDI;
+ /**
+ * additional configuration
+ */
+ public Map otherConfig;
+ }
+
+ /**
+ * Get a record containing the current state of the given crashdump.
+ *
+ * @return all fields from the object
+ */
+ public Crashdump.Record getRecord(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "crashdump.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.toCrashdumpRecord(result);
+ }
+
+ /**
+ * Get a reference to the crashdump instance with the specified UUID.
+ *
+ * @param uuid UUID of object to return
+ * @return reference to the object
+ */
+ public static Crashdump getByUuid(Connection c, String uuid) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "crashdump.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.toCrashdump(result);
+ }
+
+ /**
+ * Get the uuid field of the given crashdump.
+ *
+ * @return value of the field
+ */
+ public String getUuid(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "crashdump.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 VM field of the given crashdump.
+ *
+ * @return value of the field
+ */
+ public VM getVM(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "crashdump.get_VM";
+ 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.toVM(result);
+ }
+
+ /**
+ * Get the VDI field of the given crashdump.
+ *
+ * @return value of the field
+ */
+ public VDI getVDI(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "crashdump.get_VDI";
+ 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.toVDI(result);
+ }
+
+ /**
+ * Get the other_config field of the given crashdump.
+ *
+ * @return value of the field
+ */
+ public Map getOtherConfig(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "crashdump.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 other_config field of the given crashdump.
+ *
+ * @param otherConfig New value to set
+ */
+ public void setOtherConfig(Connection c, Map otherConfig) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "crashdump.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 crashdump.
+ *
+ * @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 = "crashdump.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 crashdump. 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 = "crashdump.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;
+ }
+
+ /**
+ * Destroy the specified crashdump
+ *
+ * @return Task
+ */
+ public Task destroyAsync(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "Async.crashdump.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 the specified crashdump
+ *
+ */
+ public void destroy(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "crashdump.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 crashdumps known to the system.
+ *
+ * @return references to all objects
+ */
+ public static Set getAll(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "crashdump.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.toSetOfCrashdump(result);
+ }
+
+ /**
+ * Return a map of crashdump references to crashdump records for all crashdumps known to the system.
+ *
+ * @return records of all objects
+ */
+ public static Map getAllRecords(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "crashdump.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.toMapOfCrashdumpCrashdumpRecord(result);
+ }
+
+}
\ No newline at end of file
diff --git a/deps/XenServerJava/src/com/xensource/xenapi/DRTask.java b/deps/XenServerJava/src/com/xensource/xenapi/DRTask.java
new file mode 100644
index 00000000000..bbca81cb522
--- /dev/null
+++ b/deps/XenServerJava/src/com/xensource/xenapi/DRTask.java
@@ -0,0 +1,303 @@
+/*
+ * Copyright (c) Citrix Systems, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1) Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2) Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+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;
+
+/**
+ * DR task
+ *
+ * @author Citrix Systems, Inc.
+ */
+public class DRTask extends XenAPIObject {
+
+ /**
+ * The XenAPI reference (OpaqueRef) to this object.
+ */
+ protected final String ref;
+
+ /**
+ * For internal use only.
+ */
+ DRTask(String ref) {
+ this.ref = ref;
+ }
+
+ /**
+ * @return The XenAPI reference (OpaqueRef) to this object.
+ */
+ public String toWireString() {
+ return this.ref;
+ }
+
+ /**
+ * If obj is a DRTask, compares XenAPI references for equality.
+ */
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (obj != null && obj instanceof DRTask)
+ {
+ DRTask other = (DRTask) obj;
+ return other.ref.equals(this.ref);
+ } else
+ {
+ return false;
+ }
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return ref.hashCode();
+ }
+
+ /**
+ * Represents all the fields in a DRTask
+ */
+ 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", "introducedSRs", this.introducedSRs);
+ return writer.toString();
+ }
+
+ /**
+ * Convert a DR_task.Record to a Map
+ */
+ public Map toMap() {
+ Map map = new HashMap();
+ map.put("uuid", this.uuid == null ? "" : this.uuid);
+ map.put("introduced_SRs", this.introducedSRs == null ? new LinkedHashSet() : this.introducedSRs);
+ return map;
+ }
+
+ /**
+ * Unique identifier/object reference
+ */
+ public String uuid;
+ /**
+ * All SRs introduced by this appliance
+ */
+ public Set introducedSRs;
+ }
+
+ /**
+ * Get a record containing the current state of the given DR_task.
+ *
+ * @return all fields from the object
+ */
+ public DRTask.Record getRecord(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "DR_task.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.toDRTaskRecord(result);
+ }
+
+ /**
+ * Get a reference to the DR_task instance with the specified UUID.
+ *
+ * @param uuid UUID of object to return
+ * @return reference to the object
+ */
+ public static DRTask getByUuid(Connection c, String uuid) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "DR_task.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.toDRTask(result);
+ }
+
+ /**
+ * Get the uuid field of the given DR_task.
+ *
+ * @return value of the field
+ */
+ public String getUuid(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "DR_task.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 introduced_SRs field of the given DR_task.
+ *
+ * @return value of the field
+ */
+ public Set getIntroducedSRs(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "DR_task.get_introduced_SRs";
+ 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.toSetOfSR(result);
+ }
+
+ /**
+ * Create a disaster recovery task which will query the supplied list of devices
+ *
+ * @param type The SR driver type of the SRs to introduce
+ * @param deviceConfig The device configuration of the SRs to introduce
+ * @param whitelist The devices to use for disaster recovery
+ * @return Task
+ */
+ public static Task createAsync(Connection c, String type, Map deviceConfig, Set whitelist) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "Async.DR_task.create";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(type), Marshalling.toXMLRPC(deviceConfig), Marshalling.toXMLRPC(whitelist)};
+ Map response = c.dispatch(method_call, method_params);
+ Object result = response.get("Value");
+ return Types.toTask(result);
+ }
+
+ /**
+ * Create a disaster recovery task which will query the supplied list of devices
+ *
+ * @param type The SR driver type of the SRs to introduce
+ * @param deviceConfig The device configuration of the SRs to introduce
+ * @param whitelist The devices to use for disaster recovery
+ * @return The reference to the created task
+ */
+ public static DRTask create(Connection c, String type, Map deviceConfig, Set whitelist) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "DR_task.create";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(type), Marshalling.toXMLRPC(deviceConfig), Marshalling.toXMLRPC(whitelist)};
+ Map response = c.dispatch(method_call, method_params);
+ Object result = response.get("Value");
+ return Types.toDRTask(result);
+ }
+
+ /**
+ * Destroy the disaster recovery task, detaching and forgetting any SRs introduced which are no longer required
+ *
+ * @return Task
+ */
+ public Task destroyAsync(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "Async.DR_task.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 the disaster recovery task, detaching and forgetting any SRs introduced which are no longer required
+ *
+ */
+ public void destroy(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "DR_task.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 DR_tasks known to the system.
+ *
+ * @return references to all objects
+ */
+ public static Set getAll(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "DR_task.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.toSetOfDRTask(result);
+ }
+
+ /**
+ * Return a map of DR_task references to DR_task records for all DR_tasks known to the system.
+ *
+ * @return records of all objects
+ */
+ public static Map getAllRecords(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "DR_task.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.toMapOfDRTaskDRTaskRecord(result);
+ }
+
+}
\ No newline at end of file
diff --git a/deps/XenServerJava/src/com/xensource/xenapi/DataSource.java b/deps/XenServerJava/src/com/xensource/xenapi/DataSource.java
new file mode 100644
index 00000000000..9a4bfcd6f74
--- /dev/null
+++ b/deps/XenServerJava/src/com/xensource/xenapi/DataSource.java
@@ -0,0 +1,164 @@
+/*
+ * Copyright (c) Citrix Systems, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1) Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2) Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+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;
+
+/**
+ * Data sources for logging in RRDs
+ *
+ * @author Citrix Systems, Inc.
+ */
+public class DataSource extends XenAPIObject {
+
+ /**
+ * The XenAPI reference (OpaqueRef) to this object.
+ */
+ protected final String ref;
+
+ /**
+ * For internal use only.
+ */
+ DataSource(String ref) {
+ this.ref = ref;
+ }
+
+ /**
+ * @return The XenAPI reference (OpaqueRef) to this object.
+ */
+ public String toWireString() {
+ return this.ref;
+ }
+
+ /**
+ * If obj is a DataSource, compares XenAPI references for equality.
+ */
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (obj != null && obj instanceof DataSource)
+ {
+ DataSource other = (DataSource) obj;
+ return other.ref.equals(this.ref);
+ } else
+ {
+ return false;
+ }
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return ref.hashCode();
+ }
+
+ /**
+ * Represents all the fields in a DataSource
+ */
+ 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", "nameLabel", this.nameLabel);
+ print.printf("%1$20s: %2$s\n", "nameDescription", this.nameDescription);
+ print.printf("%1$20s: %2$s\n", "enabled", this.enabled);
+ print.printf("%1$20s: %2$s\n", "standard", this.standard);
+ print.printf("%1$20s: %2$s\n", "units", this.units);
+ print.printf("%1$20s: %2$s\n", "min", this.min);
+ print.printf("%1$20s: %2$s\n", "max", this.max);
+ print.printf("%1$20s: %2$s\n", "value", this.value);
+ return writer.toString();
+ }
+
+ /**
+ * Convert a data_source.Record to a Map
+ */
+ public Map toMap() {
+ Map map = new HashMap();
+ map.put("name_label", this.nameLabel == null ? "" : this.nameLabel);
+ map.put("name_description", this.nameDescription == null ? "" : this.nameDescription);
+ map.put("enabled", this.enabled == null ? false : this.enabled);
+ map.put("standard", this.standard == null ? false : this.standard);
+ map.put("units", this.units == null ? "" : this.units);
+ map.put("min", this.min == null ? 0.0 : this.min);
+ map.put("max", this.max == null ? 0.0 : this.max);
+ map.put("value", this.value == null ? 0.0 : this.value);
+ return map;
+ }
+
+ /**
+ * a human-readable name
+ */
+ public String nameLabel;
+ /**
+ * a notes field containing human-readable description
+ */
+ public String nameDescription;
+ /**
+ * true if the data source is being logged
+ */
+ public Boolean enabled;
+ /**
+ * true if the data source is enabled by default. Non-default data sources cannot be disabled
+ */
+ public Boolean standard;
+ /**
+ * the units of the value
+ */
+ public String units;
+ /**
+ * the minimum value of the data source
+ */
+ public Double min;
+ /**
+ * the maximum value of the data source
+ */
+ public Double max;
+ /**
+ * current value of the data source
+ */
+ public Double value;
+ }
+
+}
\ No newline at end of file
diff --git a/deps/XenServerJava/src/com/xensource/xenapi/Event.java b/deps/XenServerJava/src/com/xensource/xenapi/Event.java
new file mode 100644
index 00000000000..27db4a5652c
--- /dev/null
+++ b/deps/XenServerJava/src/com/xensource/xenapi/Event.java
@@ -0,0 +1,319 @@
+/*
+ * Copyright (c) Citrix Systems, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1) Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2) Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+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;
+
+/**
+ * Asynchronous event registration and handling
+ *
+ * @author Citrix Systems, Inc.
+ */
+public class Event extends XenAPIObject {
+
+ /**
+ * The XenAPI reference (OpaqueRef) to this object.
+ */
+ protected final String ref;
+
+ /**
+ * For internal use only.
+ */
+ Event(String ref) {
+ this.ref = ref;
+ }
+
+ /**
+ * @return The XenAPI reference (OpaqueRef) to this object.
+ */
+ public String toWireString() {
+ return this.ref;
+ }
+
+ /**
+ * If obj is a Event, compares XenAPI references for equality.
+ */
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (obj != null && obj instanceof Event)
+ {
+ Event other = (Event) obj;
+ return other.ref.equals(this.ref);
+ } else
+ {
+ return false;
+ }
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return ref.hashCode();
+ }
+
+ /**
+ * Represents all the fields in a Event
+ */
+ 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", "id", this.id);
+ print.printf("%1$20s: %2$s\n", "timestamp", this.timestamp);
+ print.printf("%1$20s: %2$s\n", "clazz", this.clazz);
+ print.printf("%1$20s: %2$s\n", "operation", this.operation);
+ print.printf("%1$20s: %2$s\n", "ref", this.ref);
+ print.printf("%1$20s: %2$s\n", "objUuid", this.objUuid);
+ print.printf("%1$20s: %2$s\n", "snapshot", this.snapshot);
+ return writer.toString();
+ }
+
+ /**
+ * Convert a event.Record to a Map
+ */
+ public Map toMap() {
+ Map map = new HashMap();
+ map.put("id", this.id == null ? 0 : this.id);
+ map.put("timestamp", this.timestamp == null ? new Date(0) : this.timestamp);
+ map.put("class", this.clazz == null ? "" : this.clazz);
+ map.put("operation", this.operation == null ? Types.EventOperation.UNRECOGNIZED : this.operation);
+ map.put("ref", this.ref == null ? "" : this.ref);
+ map.put("obj_uuid", this.objUuid == null ? "" : this.objUuid);
+ map.put("snapshot", this.snapshot);
+ return map;
+ }
+
+ /**
+ * An ID, monotonically increasing, and local to the current session
+ */
+ public Long id;
+ /**
+ * The time at which the event occurred
+ */
+ public Date timestamp;
+ /**
+ * The name of the class of the object that changed
+ */
+ public String clazz;
+ /**
+ * The operation that was performed
+ */
+ public Types.EventOperation operation;
+ /**
+ * A reference to the object that changed
+ */
+ public String ref;
+ /**
+ * The uuid of the object that changed
+ */
+ public String objUuid;
+ /**
+ * The record of the database object that was added, changed or deleted
+ * (the actual type will be VM.Record, VBD.Record or similar)
+ */
+ public Object snapshot;
+ }
+
+ /**
+ * Registers this session with the event system. Specifying * as the desired class will register for all classes.
+ *
+ * @param classes register for events for the indicated classes
+ * @return Task
+ */
+ public static Task registerAsync(Connection c, Set classes) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "Async.event.register";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(classes)};
+ Map response = c.dispatch(method_call, method_params);
+ Object result = response.get("Value");
+ return Types.toTask(result);
+ }
+
+ /**
+ * Registers this session with the event system. Specifying * as the desired class will register for all classes.
+ *
+ * @param classes register for events for the indicated classes
+ */
+ public static void register(Connection c, Set classes) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "event.register";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(classes)};
+ Map response = c.dispatch(method_call, method_params);
+ return;
+ }
+
+ /**
+ * Unregisters this session with the event system
+ *
+ * @param classes remove this session's registration for the indicated classes
+ * @return Task
+ */
+ public static Task unregisterAsync(Connection c, Set classes) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "Async.event.unregister";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(classes)};
+ Map response = c.dispatch(method_call, method_params);
+ Object result = response.get("Value");
+ return Types.toTask(result);
+ }
+
+ /**
+ * Unregisters this session with the event system
+ *
+ * @param classes remove this session's registration for the indicated classes
+ */
+ public static void unregister(Connection c, Set classes) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "event.unregister";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(classes)};
+ Map response = c.dispatch(method_call, method_params);
+ return;
+ }
+
+ /**
+ * Blocking call which returns a (possibly empty) batch of events
+ *
+ * @return the batch of events
+ */
+ public static Set next(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException,
+ Types.SessionNotRegistered,
+ Types.EventsLost {
+ String method_call = "event.next";
+ 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.toSetOfEventRecord(result);
+ }
+
+ /**
+ * Blocking call which returns a (possibly empty) batch of events
+ *
+ * @param classes register for events for the indicated classes
+ * @param token A token representing the point from which to generate database events. The empty string represents the beginning.
+ * @param timeout Return after this many seconds if no events match
+ * @return the batch of events
+ */
+ public static Set from(Connection c, Set classes, String token, Double timeout) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException,
+ Types.SessionNotRegistered,
+ Types.EventsLost {
+ String method_call = "event.from";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(classes), Marshalling.toXMLRPC(token), Marshalling.toXMLRPC(timeout)};
+ Map response = c.dispatch(method_call, method_params);
+ Object result = response.get("Value");
+ return Types.toSetOfEventRecord(result);
+ }
+
+ /**
+ * Return the ID of the next event to be generated by the system
+ *
+ * @return the event ID
+ */
+ public static Long getCurrentId(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "event.get_current_id";
+ 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.toLong(result);
+ }
+
+ /**
+ * Injects an artificial event on the given object and return the corresponding ID
+ *
+ * @param clazz class of the object
+ * @param ref A reference to the object that will be changed.
+ * @return the event ID
+ */
+ public static String inject(Connection c, String clazz, String ref) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "event.inject";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(clazz), Marshalling.toXMLRPC(ref)};
+ Map response = c.dispatch(method_call, method_params);
+ Object result = response.get("Value");
+ return Types.toString(result);
+ }
+
+ public static Map properFrom(Connection c, Set classes, String token, Double timeout) throws BadServerResponse, XenAPIException, XmlRpcException,
+ Types.SessionNotRegistered,
+ Types.EventsLost {
+ String method_call = "event.from";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(classes), Marshalling.toXMLRPC(token), Marshalling.toXMLRPC(timeout)};
+ Map response = c.dispatch(method_call, method_params);
+ Object result = response.get("Value");
+ Map value = (Map)result;
+ Map from = new HashMap();
+ from.put("token", value.get("token"));
+ from.put("events", Types.toSetOfEventRecord(value.get("events")));
+ return from;
+ }
+
+}
\ No newline at end of file
diff --git a/deps/XenServerJava/src/com/xensource/xenapi/GPUGroup.java b/deps/XenServerJava/src/com/xensource/xenapi/GPUGroup.java
new file mode 100644
index 00000000000..916d8b64aea
--- /dev/null
+++ b/deps/XenServerJava/src/com/xensource/xenapi/GPUGroup.java
@@ -0,0 +1,638 @@
+/*
+ * Copyright (c) Citrix Systems, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1) Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2) Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+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 group of compatible GPUs across the resource pool
+ *
+ * @author Citrix Systems, Inc.
+ */
+public class GPUGroup extends XenAPIObject {
+
+ /**
+ * The XenAPI reference (OpaqueRef) to this object.
+ */
+ protected final String ref;
+
+ /**
+ * For internal use only.
+ */
+ GPUGroup(String ref) {
+ this.ref = ref;
+ }
+
+ /**
+ * @return The XenAPI reference (OpaqueRef) to this object.
+ */
+ public String toWireString() {
+ return this.ref;
+ }
+
+ /**
+ * If obj is a GPUGroup, compares XenAPI references for equality.
+ */
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (obj != null && obj instanceof GPUGroup)
+ {
+ GPUGroup other = (GPUGroup) obj;
+ return other.ref.equals(this.ref);
+ } else
+ {
+ return false;
+ }
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return ref.hashCode();
+ }
+
+ /**
+ * Represents all the fields in a GPUGroup
+ */
+ 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", "nameLabel", this.nameLabel);
+ print.printf("%1$20s: %2$s\n", "nameDescription", this.nameDescription);
+ print.printf("%1$20s: %2$s\n", "PGPUs", this.PGPUs);
+ print.printf("%1$20s: %2$s\n", "VGPUs", this.VGPUs);
+ print.printf("%1$20s: %2$s\n", "GPUTypes", this.GPUTypes);
+ print.printf("%1$20s: %2$s\n", "otherConfig", this.otherConfig);
+ print.printf("%1$20s: %2$s\n", "allocationAlgorithm", this.allocationAlgorithm);
+ print.printf("%1$20s: %2$s\n", "supportedVGPUTypes", this.supportedVGPUTypes);
+ print.printf("%1$20s: %2$s\n", "enabledVGPUTypes", this.enabledVGPUTypes);
+ return writer.toString();
+ }
+
+ /**
+ * Convert a GPU_group.Record to a Map
+ */
+ public Map toMap() {
+ Map map = new HashMap();
+ map.put("uuid", this.uuid == null ? "" : this.uuid);
+ map.put("name_label", this.nameLabel == null ? "" : this.nameLabel);
+ map.put("name_description", this.nameDescription == null ? "" : this.nameDescription);
+ map.put("PGPUs", this.PGPUs == null ? new LinkedHashSet() : this.PGPUs);
+ map.put("VGPUs", this.VGPUs == null ? new LinkedHashSet() : this.VGPUs);
+ map.put("GPU_types", this.GPUTypes == null ? new LinkedHashSet() : this.GPUTypes);
+ map.put("other_config", this.otherConfig == null ? new HashMap() : this.otherConfig);
+ map.put("allocation_algorithm", this.allocationAlgorithm == null ? Types.AllocationAlgorithm.UNRECOGNIZED : this.allocationAlgorithm);
+ map.put("supported_VGPU_types", this.supportedVGPUTypes == null ? new LinkedHashSet() : this.supportedVGPUTypes);
+ map.put("enabled_VGPU_types", this.enabledVGPUTypes == null ? new LinkedHashSet() : this.enabledVGPUTypes);
+ return map;
+ }
+
+ /**
+ * Unique identifier/object reference
+ */
+ public String uuid;
+ /**
+ * a human-readable name
+ */
+ public String nameLabel;
+ /**
+ * a notes field containing human-readable description
+ */
+ public String nameDescription;
+ /**
+ * List of pGPUs in the group
+ */
+ public Set PGPUs;
+ /**
+ * List of vGPUs using the group
+ */
+ public Set VGPUs;
+ /**
+ * List of GPU types (vendor+device ID) that can be in this group
+ */
+ public Set GPUTypes;
+ /**
+ * Additional configuration
+ */
+ public Map otherConfig;
+ /**
+ * Current allocation of vGPUs to pGPUs for this group
+ */
+ public Types.AllocationAlgorithm allocationAlgorithm;
+ /**
+ * vGPU types supported on at least one of the pGPUs in this group
+ */
+ public Set supportedVGPUTypes;
+ /**
+ * vGPU types supported on at least one of the pGPUs in this group
+ */
+ public Set enabledVGPUTypes;
+ }
+
+ /**
+ * Get a record containing the current state of the given GPU_group.
+ *
+ * @return all fields from the object
+ */
+ public GPUGroup.Record getRecord(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "GPU_group.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.toGPUGroupRecord(result);
+ }
+
+ /**
+ * Get a reference to the GPU_group instance with the specified UUID.
+ *
+ * @param uuid UUID of object to return
+ * @return reference to the object
+ */
+ public static GPUGroup getByUuid(Connection c, String uuid) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "GPU_group.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.toGPUGroup(result);
+ }
+
+ /**
+ * Get all the GPU_group instances with the given label.
+ *
+ * @param label label of object to return
+ * @return references to objects with matching names
+ */
+ public static Set getByNameLabel(Connection c, String label) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "GPU_group.get_by_name_label";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(label)};
+ Map response = c.dispatch(method_call, method_params);
+ Object result = response.get("Value");
+ return Types.toSetOfGPUGroup(result);
+ }
+
+ /**
+ * Get the uuid field of the given GPU_group.
+ *
+ * @return value of the field
+ */
+ public String getUuid(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "GPU_group.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 name/label field of the given GPU_group.
+ *
+ * @return value of the field
+ */
+ public String getNameLabel(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "GPU_group.get_name_label";
+ 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 name/description field of the given GPU_group.
+ *
+ * @return value of the field
+ */
+ public String getNameDescription(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "GPU_group.get_name_description";
+ 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 PGPUs field of the given GPU_group.
+ *
+ * @return value of the field
+ */
+ public Set getPGPUs(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "GPU_group.get_PGPUs";
+ 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.toSetOfPGPU(result);
+ }
+
+ /**
+ * Get the VGPUs field of the given GPU_group.
+ *
+ * @return value of the field
+ */
+ public Set getVGPUs(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "GPU_group.get_VGPUs";
+ 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.toSetOfVGPU(result);
+ }
+
+ /**
+ * Get the GPU_types field of the given GPU_group.
+ *
+ * @return value of the field
+ */
+ public Set getGPUTypes(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "GPU_group.get_GPU_types";
+ 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.toSetOfString(result);
+ }
+
+ /**
+ * Get the other_config field of the given GPU_group.
+ *
+ * @return value of the field
+ */
+ public Map getOtherConfig(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "GPU_group.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);
+ }
+
+ /**
+ * Get the allocation_algorithm field of the given GPU_group.
+ *
+ * @return value of the field
+ */
+ public Types.AllocationAlgorithm getAllocationAlgorithm(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "GPU_group.get_allocation_algorithm";
+ 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.toAllocationAlgorithm(result);
+ }
+
+ /**
+ * Get the supported_VGPU_types field of the given GPU_group.
+ *
+ * @return value of the field
+ */
+ public Set getSupportedVGPUTypes(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "GPU_group.get_supported_VGPU_types";
+ 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.toSetOfVGPUType(result);
+ }
+
+ /**
+ * Get the enabled_VGPU_types field of the given GPU_group.
+ *
+ * @return value of the field
+ */
+ public Set getEnabledVGPUTypes(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "GPU_group.get_enabled_VGPU_types";
+ 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.toSetOfVGPUType(result);
+ }
+
+ /**
+ * Set the name/label field of the given GPU_group.
+ *
+ * @param label New value to set
+ */
+ public void setNameLabel(Connection c, String label) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "GPU_group.set_name_label";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(label)};
+ Map response = c.dispatch(method_call, method_params);
+ return;
+ }
+
+ /**
+ * Set the name/description field of the given GPU_group.
+ *
+ * @param description New value to set
+ */
+ public void setNameDescription(Connection c, String description) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "GPU_group.set_name_description";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(description)};
+ Map response = c.dispatch(method_call, method_params);
+ return;
+ }
+
+ /**
+ * Set the other_config field of the given GPU_group.
+ *
+ * @param otherConfig New value to set
+ */
+ public void setOtherConfig(Connection c, Map otherConfig) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "GPU_group.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 GPU_group.
+ *
+ * @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 = "GPU_group.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 GPU_group. 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 = "GPU_group.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;
+ }
+
+ /**
+ * Set the allocation_algorithm field of the given GPU_group.
+ *
+ * @param allocationAlgorithm New value to set
+ */
+ public void setAllocationAlgorithm(Connection c, Types.AllocationAlgorithm allocationAlgorithm) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "GPU_group.set_allocation_algorithm";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(allocationAlgorithm)};
+ Map response = c.dispatch(method_call, method_params);
+ return;
+ }
+
+ /**
+ *
+ *
+ * @param nameLabel
+ * @param nameDescription
+ * @param otherConfig
+ * @return Task
+ */
+ public static Task createAsync(Connection c, String nameLabel, String nameDescription, Map otherConfig) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "Async.GPU_group.create";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(nameLabel), Marshalling.toXMLRPC(nameDescription), Marshalling.toXMLRPC(otherConfig)};
+ Map response = c.dispatch(method_call, method_params);
+ Object result = response.get("Value");
+ return Types.toTask(result);
+ }
+
+ /**
+ *
+ *
+ * @param nameLabel
+ * @param nameDescription
+ * @param otherConfig
+ * @return
+ */
+ public static GPUGroup create(Connection c, String nameLabel, String nameDescription, Map otherConfig) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "GPU_group.create";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(nameLabel), Marshalling.toXMLRPC(nameDescription), Marshalling.toXMLRPC(otherConfig)};
+ Map response = c.dispatch(method_call, method_params);
+ Object result = response.get("Value");
+ return Types.toGPUGroup(result);
+ }
+
+ /**
+ *
+ *
+ * @return Task
+ */
+ public Task destroyAsync(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "Async.GPU_group.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);
+ }
+
+ /**
+ *
+ *
+ */
+ public void destroy(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "GPU_group.destroy";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+ Map response = c.dispatch(method_call, method_params);
+ return;
+ }
+
+ /**
+ *
+ *
+ * @param vgpuType The VGPU_type for which the remaining capacity will be calculated
+ * @return Task
+ */
+ public Task getRemainingCapacityAsync(Connection c, VGPUType vgpuType) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "Async.GPU_group.get_remaining_capacity";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(vgpuType)};
+ Map response = c.dispatch(method_call, method_params);
+ Object result = response.get("Value");
+ return Types.toTask(result);
+ }
+
+ /**
+ *
+ *
+ * @param vgpuType The VGPU_type for which the remaining capacity will be calculated
+ * @return The number of VGPUs of the given type which can still be started on the PGPUs in the group
+ */
+ public Long getRemainingCapacity(Connection c, VGPUType vgpuType) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "GPU_group.get_remaining_capacity";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(vgpuType)};
+ Map response = c.dispatch(method_call, method_params);
+ Object result = response.get("Value");
+ return Types.toLong(result);
+ }
+
+ /**
+ * Return a list of all the GPU_groups known to the system.
+ *
+ * @return references to all objects
+ */
+ public static Set getAll(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "GPU_group.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.toSetOfGPUGroup(result);
+ }
+
+ /**
+ * Return a map of GPU_group references to GPU_group records for all GPU_groups known to the system.
+ *
+ * @return records of all objects
+ */
+ public static Map getAllRecords(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "GPU_group.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.toMapOfGPUGroupGPUGroupRecord(result);
+ }
+
+}
\ No newline at end of file
diff --git a/deps/XenServerJava/src/com/xensource/xenapi/Host.java b/deps/XenServerJava/src/com/xensource/xenapi/Host.java
new file mode 100644
index 00000000000..0bbae111641
--- /dev/null
+++ b/deps/XenServerJava/src/com/xensource/xenapi/Host.java
@@ -0,0 +1,3024 @@
+/*
+ * Copyright (c) Citrix Systems, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1) Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2) Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+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 physical host
+ *
+ * @author Citrix Systems, Inc.
+ */
+public class Host extends XenAPIObject {
+
+ /**
+ * The XenAPI reference (OpaqueRef) to this object.
+ */
+ protected final String ref;
+
+ /**
+ * For internal use only.
+ */
+ Host(String ref) {
+ this.ref = ref;
+ }
+
+ /**
+ * @return The XenAPI reference (OpaqueRef) to this object.
+ */
+ public String toWireString() {
+ return this.ref;
+ }
+
+ /**
+ * If obj is a Host, compares XenAPI references for equality.
+ */
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (obj != null && obj instanceof Host)
+ {
+ Host other = (Host) obj;
+ return other.ref.equals(this.ref);
+ } else
+ {
+ return false;
+ }
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return ref.hashCode();
+ }
+
+ /**
+ * Represents all the fields in a Host
+ */
+ 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", "nameLabel", this.nameLabel);
+ print.printf("%1$20s: %2$s\n", "nameDescription", this.nameDescription);
+ print.printf("%1$20s: %2$s\n", "memoryOverhead", this.memoryOverhead);
+ print.printf("%1$20s: %2$s\n", "allowedOperations", this.allowedOperations);
+ print.printf("%1$20s: %2$s\n", "currentOperations", this.currentOperations);
+ print.printf("%1$20s: %2$s\n", "APIVersionMajor", this.APIVersionMajor);
+ print.printf("%1$20s: %2$s\n", "APIVersionMinor", this.APIVersionMinor);
+ print.printf("%1$20s: %2$s\n", "APIVersionVendor", this.APIVersionVendor);
+ print.printf("%1$20s: %2$s\n", "APIVersionVendorImplementation", this.APIVersionVendorImplementation);
+ print.printf("%1$20s: %2$s\n", "enabled", this.enabled);
+ print.printf("%1$20s: %2$s\n", "softwareVersion", this.softwareVersion);
+ print.printf("%1$20s: %2$s\n", "otherConfig", this.otherConfig);
+ print.printf("%1$20s: %2$s\n", "capabilities", this.capabilities);
+ print.printf("%1$20s: %2$s\n", "cpuConfiguration", this.cpuConfiguration);
+ print.printf("%1$20s: %2$s\n", "schedPolicy", this.schedPolicy);
+ print.printf("%1$20s: %2$s\n", "supportedBootloaders", this.supportedBootloaders);
+ print.printf("%1$20s: %2$s\n", "residentVMs", this.residentVMs);
+ print.printf("%1$20s: %2$s\n", "logging", this.logging);
+ print.printf("%1$20s: %2$s\n", "PIFs", this.PIFs);
+ print.printf("%1$20s: %2$s\n", "suspendImageSr", this.suspendImageSr);
+ print.printf("%1$20s: %2$s\n", "crashDumpSr", this.crashDumpSr);
+ print.printf("%1$20s: %2$s\n", "crashdumps", this.crashdumps);
+ print.printf("%1$20s: %2$s\n", "patches", this.patches);
+ print.printf("%1$20s: %2$s\n", "PBDs", this.PBDs);
+ print.printf("%1$20s: %2$s\n", "hostCPUs", this.hostCPUs);
+ print.printf("%1$20s: %2$s\n", "cpuInfo", this.cpuInfo);
+ print.printf("%1$20s: %2$s\n", "hostname", this.hostname);
+ print.printf("%1$20s: %2$s\n", "address", this.address);
+ print.printf("%1$20s: %2$s\n", "metrics", this.metrics);
+ print.printf("%1$20s: %2$s\n", "licenseParams", this.licenseParams);
+ print.printf("%1$20s: %2$s\n", "haStatefiles", this.haStatefiles);
+ print.printf("%1$20s: %2$s\n", "haNetworkPeers", this.haNetworkPeers);
+ print.printf("%1$20s: %2$s\n", "blobs", this.blobs);
+ print.printf("%1$20s: %2$s\n", "tags", this.tags);
+ print.printf("%1$20s: %2$s\n", "externalAuthType", this.externalAuthType);
+ print.printf("%1$20s: %2$s\n", "externalAuthServiceName", this.externalAuthServiceName);
+ print.printf("%1$20s: %2$s\n", "externalAuthConfiguration", this.externalAuthConfiguration);
+ print.printf("%1$20s: %2$s\n", "edition", this.edition);
+ print.printf("%1$20s: %2$s\n", "licenseServer", this.licenseServer);
+ 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", "powerOnConfig", this.powerOnConfig);
+ print.printf("%1$20s: %2$s\n", "localCacheSr", this.localCacheSr);
+ print.printf("%1$20s: %2$s\n", "chipsetInfo", this.chipsetInfo);
+ print.printf("%1$20s: %2$s\n", "PCIs", this.PCIs);
+ print.printf("%1$20s: %2$s\n", "PGPUs", this.PGPUs);
+ print.printf("%1$20s: %2$s\n", "guestVCPUsParams", this.guestVCPUsParams);
+ return writer.toString();
+ }
+
+ /**
+ * Convert a host.Record to a Map
+ */
+ public Map toMap() {
+ Map map = new HashMap();
+ map.put("uuid", this.uuid == null ? "" : this.uuid);
+ map.put("name_label", this.nameLabel == null ? "" : this.nameLabel);
+ map.put("name_description", this.nameDescription == null ? "" : this.nameDescription);
+ map.put("memory_overhead", this.memoryOverhead == null ? 0 : this.memoryOverhead);
+ map.put("allowed_operations", this.allowedOperations == null ? new LinkedHashSet() : this.allowedOperations);
+ map.put("current_operations", this.currentOperations == null ? new HashMap() : this.currentOperations);
+ map.put("API_version_major", this.APIVersionMajor == null ? 0 : this.APIVersionMajor);
+ map.put("API_version_minor", this.APIVersionMinor == null ? 0 : this.APIVersionMinor);
+ map.put("API_version_vendor", this.APIVersionVendor == null ? "" : this.APIVersionVendor);
+ map.put("API_version_vendor_implementation", this.APIVersionVendorImplementation == null ? new HashMap() : this.APIVersionVendorImplementation);
+ map.put("enabled", this.enabled == null ? false : this.enabled);
+ map.put("software_version", this.softwareVersion == null ? new HashMap() : this.softwareVersion);
+ map.put("other_config", this.otherConfig == null ? new HashMap() : this.otherConfig);
+ map.put("capabilities", this.capabilities == null ? new LinkedHashSet() : this.capabilities);
+ map.put("cpu_configuration", this.cpuConfiguration == null ? new HashMap() : this.cpuConfiguration);
+ map.put("sched_policy", this.schedPolicy == null ? "" : this.schedPolicy);
+ map.put("supported_bootloaders", this.supportedBootloaders == null ? new LinkedHashSet() : this.supportedBootloaders);
+ map.put("resident_VMs", this.residentVMs == null ? new LinkedHashSet() : this.residentVMs);
+ map.put("logging", this.logging == null ? new HashMap() : this.logging);
+ map.put("PIFs", this.PIFs == null ? new LinkedHashSet() : this.PIFs);
+ map.put("suspend_image_sr", this.suspendImageSr == null ? new SR("OpaqueRef:NULL") : this.suspendImageSr);
+ map.put("crash_dump_sr", this.crashDumpSr == null ? new SR("OpaqueRef:NULL") : this.crashDumpSr);
+ map.put("crashdumps", this.crashdumps == null ? new LinkedHashSet() : this.crashdumps);
+ map.put("patches", this.patches == null ? new LinkedHashSet() : this.patches);
+ map.put("PBDs", this.PBDs == null ? new LinkedHashSet() : this.PBDs);
+ map.put("host_CPUs", this.hostCPUs == null ? new LinkedHashSet() : this.hostCPUs);
+ map.put("cpu_info", this.cpuInfo == null ? new HashMap() : this.cpuInfo);
+ map.put("hostname", this.hostname == null ? "" : this.hostname);
+ map.put("address", this.address == null ? "" : this.address);
+ map.put("metrics", this.metrics == null ? new HostMetrics("OpaqueRef:NULL") : this.metrics);
+ map.put("license_params", this.licenseParams == null ? new HashMap() : this.licenseParams);
+ map.put("ha_statefiles", this.haStatefiles == null ? new LinkedHashSet() : this.haStatefiles);
+ map.put("ha_network_peers", this.haNetworkPeers == null ? new LinkedHashSet() : this.haNetworkPeers);
+ map.put("blobs", this.blobs == null ? new HashMap() : this.blobs);
+ map.put("tags", this.tags == null ? new LinkedHashSet() : this.tags);
+ map.put("external_auth_type", this.externalAuthType == null ? "" : this.externalAuthType);
+ map.put("external_auth_service_name", this.externalAuthServiceName == null ? "" : this.externalAuthServiceName);
+ map.put("external_auth_configuration", this.externalAuthConfiguration == null ? new HashMap() : this.externalAuthConfiguration);
+ map.put("edition", this.edition == null ? "" : this.edition);
+ map.put("license_server", this.licenseServer == null ? new HashMap() : this.licenseServer);
+ map.put("bios_strings", this.biosStrings == null ? new HashMap() : this.biosStrings);
+ map.put("power_on_mode", this.powerOnMode == null ? "" : this.powerOnMode);
+ map.put("power_on_config", this.powerOnConfig == null ? new HashMap() : this.powerOnConfig);
+ map.put("local_cache_sr", this.localCacheSr == null ? new SR("OpaqueRef:NULL") : this.localCacheSr);
+ map.put("chipset_info", this.chipsetInfo == null ? new HashMap() : this.chipsetInfo);
+ map.put("PCIs", this.PCIs == null ? new LinkedHashSet() : this.PCIs);
+ map.put("PGPUs", this.PGPUs == null ? new LinkedHashSet() : this.PGPUs);
+ map.put("guest_VCPUs_params", this.guestVCPUsParams == null ? new HashMap() : this.guestVCPUsParams);
+ return map;
+ }
+
+ /**
+ * Unique identifier/object reference
+ */
+ public String uuid;
+ /**
+ * a human-readable name
+ */
+ public String nameLabel;
+ /**
+ * a notes field containing human-readable description
+ */
+ public String nameDescription;
+ /**
+ * Virtualization memory overhead (bytes).
+ */
+ public Long memoryOverhead;
+ /**
+ * list of the operations allowed in this state. This list is advisory only and the server state may have changed by the time this field is read by a client.
+ */
+ public Set allowedOperations;
+ /**
+ * links each of the running tasks using this object (by reference) to a current_operation enum which describes the nature of the task.
+ */
+ public Map currentOperations;
+ /**
+ * major version number
+ */
+ public Long APIVersionMajor;
+ /**
+ * minor version number
+ */
+ public Long APIVersionMinor;
+ /**
+ * identification of vendor
+ */
+ public String APIVersionVendor;
+ /**
+ * details of vendor implementation
+ */
+ public Map APIVersionVendorImplementation;
+ /**
+ * True if the host is currently enabled
+ */
+ public Boolean enabled;
+ /**
+ * version strings
+ */
+ public Map softwareVersion;
+ /**
+ * additional configuration
+ */
+ public Map otherConfig;
+ /**
+ * Xen capabilities
+ */
+ public Set capabilities;
+ /**
+ * The CPU configuration on this host. May contain keys such as "nr_nodes", "sockets_per_node", "cores_per_socket", or "threads_per_core"
+ */
+ public Map cpuConfiguration;
+ /**
+ * Scheduler policy currently in force on this host
+ */
+ public String schedPolicy;
+ /**
+ * a list of the bootloaders installed on the machine
+ */
+ public Set supportedBootloaders;
+ /**
+ * list of VMs currently resident on host
+ */
+ public Set residentVMs;
+ /**
+ * logging configuration
+ */
+ public Map logging;
+ /**
+ * physical network interfaces
+ */
+ public Set PIFs;
+ /**
+ * The SR in which VDIs for suspend images are created
+ */
+ public SR suspendImageSr;
+ /**
+ * The SR in which VDIs for crash dumps are created
+ */
+ public SR crashDumpSr;
+ /**
+ * Set of host crash dumps
+ */
+ public Set crashdumps;
+ /**
+ * Set of host patches
+ */
+ public Set patches;
+ /**
+ * physical blockdevices
+ */
+ public Set PBDs;
+ /**
+ * The physical CPUs on this host
+ */
+ public Set hostCPUs;
+ /**
+ * Details about the physical CPUs on this host
+ */
+ public Map cpuInfo;
+ /**
+ * The hostname of this host
+ */
+ public String hostname;
+ /**
+ * The address by which this host can be contacted from any other host in the pool
+ */
+ public String address;
+ /**
+ * metrics associated with this host
+ */
+ public HostMetrics metrics;
+ /**
+ * State of the current license
+ */
+ public Map licenseParams;
+ /**
+ * The set of statefiles accessible from this host
+ */
+ public Set haStatefiles;
+ /**
+ * The set of hosts visible via the network from this host
+ */
+ public Set haNetworkPeers;
+ /**
+ * Binary blobs associated with this host
+ */
+ public Map blobs;
+ /**
+ * user-specified tags for categorization purposes
+ */
+ public Set tags;
+ /**
+ * type of external authentication service configured; empty if none configured.
+ */
+ public String externalAuthType;
+ /**
+ * name of external authentication service configured; empty if none configured.
+ */
+ public String externalAuthServiceName;
+ /**
+ * configuration specific to external authentication service
+ */
+ public Map externalAuthConfiguration;
+ /**
+ * XenServer edition
+ */
+ public String edition;
+ /**
+ * Contact information of the license server
+ */
+ public Map licenseServer;
+ /**
+ * BIOS strings
+ */
+ public Map biosStrings;
+ /**
+ * The power on mode
+ */
+ public String powerOnMode;
+ /**
+ * The power on config
+ */
+ public Map powerOnConfig;
+ /**
+ * The SR that is used as a local cache
+ */
+ public SR localCacheSr;
+ /**
+ * Information about chipset features
+ */
+ public Map chipsetInfo;
+ /**
+ * List of PCI devices in the host
+ */
+ public Set PCIs;
+ /**
+ * List of physical GPUs in the host
+ */
+ public Set PGPUs;
+ /**
+ * VCPUs params to apply to all resident guests
+ */
+ public Map guestVCPUsParams;
+ }
+
+ /**
+ * Get a record containing the current state of the given host.
+ *
+ * @return all fields from the object
+ */
+ public Host.Record getRecord(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.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.toHostRecord(result);
+ }
+
+ /**
+ * Get a reference to the host instance with the specified UUID.
+ *
+ * @param uuid UUID of object to return
+ * @return reference to the object
+ */
+ public static Host getByUuid(Connection c, String uuid) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.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.toHost(result);
+ }
+
+ /**
+ * Get all the host instances with the given label.
+ *
+ * @param label label of object to return
+ * @return references to objects with matching names
+ */
+ public static Set getByNameLabel(Connection c, String label) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.get_by_name_label";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(label)};
+ Map response = c.dispatch(method_call, method_params);
+ Object result = response.get("Value");
+ return Types.toSetOfHost(result);
+ }
+
+ /**
+ * Get the uuid field of the given host.
+ *
+ * @return value of the field
+ */
+ public String getUuid(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.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 name/label field of the given host.
+ *
+ * @return value of the field
+ */
+ public String getNameLabel(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.get_name_label";
+ 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 name/description field of the given host.
+ *
+ * @return value of the field
+ */
+ public String getNameDescription(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.get_name_description";
+ 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 memory/overhead field of the given host.
+ *
+ * @return value of the field
+ */
+ public Long getMemoryOverhead(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.get_memory_overhead";
+ 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.toLong(result);
+ }
+
+ /**
+ * Get the allowed_operations field of the given host.
+ *
+ * @return value of the field
+ */
+ public Set getAllowedOperations(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.get_allowed_operations";
+ 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.toSetOfHostAllowedOperations(result);
+ }
+
+ /**
+ * Get the current_operations field of the given host.
+ *
+ * @return value of the field
+ */
+ public Map getCurrentOperations(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.get_current_operations";
+ 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.toMapOfStringHostAllowedOperations(result);
+ }
+
+ /**
+ * Get the API_version/major field of the given host.
+ *
+ * @return value of the field
+ */
+ public Long getAPIVersionMajor(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.get_API_version_major";
+ 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.toLong(result);
+ }
+
+ /**
+ * Get the API_version/minor field of the given host.
+ *
+ * @return value of the field
+ */
+ public Long getAPIVersionMinor(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.get_API_version_minor";
+ 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.toLong(result);
+ }
+
+ /**
+ * Get the API_version/vendor field of the given host.
+ *
+ * @return value of the field
+ */
+ public String getAPIVersionVendor(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.get_API_version_vendor";
+ 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 API_version/vendor_implementation field of the given host.
+ *
+ * @return value of the field
+ */
+ public Map getAPIVersionVendorImplementation(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.get_API_version_vendor_implementation";
+ 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 enabled field of the given host.
+ *
+ * @return value of the field
+ */
+ public Boolean getEnabled(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.get_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);
+ }
+
+ /**
+ * Get the software_version field of the given host.
+ *
+ * @return value of the field
+ */
+ public Map getSoftwareVersion(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.get_software_version";
+ 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 host.
+ *
+ * @return value of the field
+ */
+ public Map getOtherConfig(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.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);
+ }
+
+ /**
+ * Get the capabilities field of the given host.
+ *
+ * @return value of the field
+ */
+ public Set getCapabilities(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.get_capabilities";
+ 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.toSetOfString(result);
+ }
+
+ /**
+ * Get the cpu_configuration field of the given host.
+ *
+ * @return value of the field
+ */
+ public Map getCpuConfiguration(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.get_cpu_configuration";
+ 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 sched_policy field of the given host.
+ *
+ * @return value of the field
+ */
+ public String getSchedPolicy(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.get_sched_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.toString(result);
+ }
+
+ /**
+ * Get the supported_bootloaders field of the given host.
+ *
+ * @return value of the field
+ */
+ public Set getSupportedBootloaders(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.get_supported_bootloaders";
+ 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.toSetOfString(result);
+ }
+
+ /**
+ * Get the resident_VMs field of the given host.
+ *
+ * @return value of the field
+ */
+ public Set getResidentVMs(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.get_resident_VMs";
+ 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.toSetOfVM(result);
+ }
+
+ /**
+ * Get the logging field of the given host.
+ *
+ * @return value of the field
+ */
+ public Map getLogging(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.get_logging";
+ 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 PIFs field of the given host.
+ *
+ * @return value of the field
+ */
+ public Set getPIFs(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.get_PIFs";
+ 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.toSetOfPIF(result);
+ }
+
+ /**
+ * Get the suspend_image_sr field of the given host.
+ *
+ * @return value of the field
+ */
+ public SR getSuspendImageSr(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.get_suspend_image_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);
+ }
+
+ /**
+ * Get the crash_dump_sr field of the given host.
+ *
+ * @return value of the field
+ */
+ public SR getCrashDumpSr(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.get_crash_dump_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);
+ }
+
+ /**
+ * Get the crashdumps field of the given host.
+ *
+ * @return value of the field
+ */
+ public Set getCrashdumps(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.get_crashdumps";
+ 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.toSetOfHostCrashdump(result);
+ }
+
+ /**
+ * Get the patches field of the given host.
+ *
+ * @return value of the field
+ */
+ public Set getPatches(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.get_patches";
+ 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.toSetOfHostPatch(result);
+ }
+
+ /**
+ * Get the PBDs field of the given host.
+ *
+ * @return value of the field
+ */
+ public Set getPBDs(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.get_PBDs";
+ 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.toSetOfPBD(result);
+ }
+
+ /**
+ * Get the host_CPUs field of the given host.
+ *
+ * @return value of the field
+ */
+ public Set getHostCPUs(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.get_host_CPUs";
+ 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.toSetOfHostCpu(result);
+ }
+
+ /**
+ * Get the cpu_info field of the given host.
+ *
+ * @return value of the field
+ */
+ public Map getCpuInfo(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.get_cpu_info";
+ 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 hostname field of the given host.
+ *
+ * @return value of the field
+ */
+ public String getHostname(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.get_hostname";
+ 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 address field of the given host.
+ *
+ * @return value of the field
+ */
+ public String getAddress(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.get_address";
+ 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 metrics field of the given host.
+ *
+ * @return value of the field
+ */
+ public HostMetrics getMetrics(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.get_metrics";
+ 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.toHostMetrics(result);
+ }
+
+ /**
+ * Get the license_params field of the given host.
+ *
+ * @return value of the field
+ */
+ public Map getLicenseParams(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.get_license_params";
+ 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 ha_statefiles field of the given host.
+ *
+ * @return value of the field
+ */
+ public Set getHaStatefiles(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.get_ha_statefiles";
+ 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.toSetOfString(result);
+ }
+
+ /**
+ * Get the ha_network_peers field of the given host.
+ *
+ * @return value of the field
+ */
+ public Set getHaNetworkPeers(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.get_ha_network_peers";
+ 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.toSetOfString(result);
+ }
+
+ /**
+ * Get the blobs field of the given host.
+ *
+ * @return value of the field
+ */
+ public Map getBlobs(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.get_blobs";
+ 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.toMapOfStringBlob(result);
+ }
+
+ /**
+ * Get the tags field of the given host.
+ *
+ * @return value of the field
+ */
+ public Set getTags(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.get_tags";
+ 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.toSetOfString(result);
+ }
+
+ /**
+ * Get the external_auth_type field of the given host.
+ *
+ * @return value of the field
+ */
+ public String getExternalAuthType(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.get_external_auth_type";
+ 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 external_auth_service_name field of the given host.
+ *
+ * @return value of the field
+ */
+ public String getExternalAuthServiceName(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.get_external_auth_service_name";
+ 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 external_auth_configuration field of the given host.
+ *
+ * @return value of the field
+ */
+ public Map getExternalAuthConfiguration(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.get_external_auth_configuration";
+ 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 edition field of the given host.
+ *
+ * @return value of the field
+ */
+ public String getEdition(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.get_edition";
+ 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 license_server field of the given host.
+ *
+ * @return value of the field
+ */
+ public Map getLicenseServer(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.get_license_server";
+ 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 bios_strings field of the given host.
+ *
+ * @return value of the field
+ */
+ public Map getBiosStrings(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.get_bios_strings";
+ 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 power_on_mode field of the given host.
+ *
+ * @return value of the field
+ */
+ public String getPowerOnMode(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.get_power_on_mode";
+ 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 power_on_config field of the given host.
+ *
+ * @return value of the field
+ */
+ public Map getPowerOnConfig(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.get_power_on_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);
+ }
+
+ /**
+ * 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);
+ }
+
+ /**
+ * Get the chipset_info field of the given host.
+ *
+ * @return value of the field
+ */
+ public Map getChipsetInfo(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.get_chipset_info";
+ 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 PCIs field of the given host.
+ *
+ * @return value of the field
+ */
+ public Set getPCIs(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.get_PCIs";
+ 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.toSetOfPCI(result);
+ }
+
+ /**
+ * Get the PGPUs field of the given host.
+ *
+ * @return value of the field
+ */
+ public Set getPGPUs(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.get_PGPUs";
+ 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.toSetOfPGPU(result);
+ }
+
+ /**
+ * Get the guest_VCPUs_params field of the given host.
+ *
+ * @return value of the field
+ */
+ public Map getGuestVCPUsParams(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.get_guest_VCPUs_params";
+ 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 name/label field of the given host.
+ *
+ * @param label New value to set
+ */
+ public void setNameLabel(Connection c, String label) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.set_name_label";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(label)};
+ Map response = c.dispatch(method_call, method_params);
+ return;
+ }
+
+ /**
+ * Set the name/description field of the given host.
+ *
+ * @param description New value to set
+ */
+ public void setNameDescription(Connection c, String description) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.set_name_description";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(description)};
+ Map response = c.dispatch(method_call, method_params);
+ return;
+ }
+
+ /**
+ * Set the other_config field of the given host.
+ *
+ * @param otherConfig New value to set
+ */
+ public void setOtherConfig(Connection c, Map otherConfig) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.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 host.
+ *
+ * @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 = "host.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 host. 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 = "host.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;
+ }
+
+ /**
+ * Set the logging field of the given host.
+ *
+ * @param logging New value to set
+ */
+ public void setLogging(Connection c, Map logging) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.set_logging";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(logging)};
+ Map response = c.dispatch(method_call, method_params);
+ return;
+ }
+
+ /**
+ * Add the given key-value pair to the logging field of the given host.
+ *
+ * @param key Key to add
+ * @param value Value to add
+ */
+ public void addToLogging(Connection c, String key, String value) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.add_to_logging";
+ 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 logging field of the given host. If the key is not in that Map, then do nothing.
+ *
+ * @param key Key to remove
+ */
+ public void removeFromLogging(Connection c, String key) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.remove_from_logging";
+ 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 suspend_image_sr field of the given host.
+ *
+ * @param suspendImageSr New value to set
+ */
+ public void setSuspendImageSr(Connection c, SR suspendImageSr) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.set_suspend_image_sr";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(suspendImageSr)};
+ Map response = c.dispatch(method_call, method_params);
+ return;
+ }
+
+ /**
+ * Set the crash_dump_sr field of the given host.
+ *
+ * @param crashDumpSr New value to set
+ */
+ public void setCrashDumpSr(Connection c, SR crashDumpSr) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.set_crash_dump_sr";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(crashDumpSr)};
+ Map response = c.dispatch(method_call, method_params);
+ return;
+ }
+
+ /**
+ * Set the hostname field of the given host.
+ *
+ * @param hostname New value to set
+ */
+ public void setHostname(Connection c, String hostname) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.set_hostname";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(hostname)};
+ Map response = c.dispatch(method_call, method_params);
+ return;
+ }
+
+ /**
+ * Set the address field of the given host.
+ *
+ * @param address New value to set
+ */
+ public void setAddress(Connection c, String address) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.set_address";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(address)};
+ Map response = c.dispatch(method_call, method_params);
+ return;
+ }
+
+ /**
+ * Set the tags field of the given host.
+ *
+ * @param tags New value to set
+ */
+ public void setTags(Connection c, Set tags) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.set_tags";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(tags)};
+ Map response = c.dispatch(method_call, method_params);
+ return;
+ }
+
+ /**
+ * Add the given value to the tags field of the given host. If the value is already in that Set, then do nothing.
+ *
+ * @param value New value to add
+ */
+ public void addTags(Connection c, String value) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.add_tags";
+ 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;
+ }
+
+ /**
+ * Remove the given value from the tags field of the given host. If the value is not in that Set, then do nothing.
+ *
+ * @param value Value to remove
+ */
+ public void removeTags(Connection c, String value) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.remove_tags";
+ 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;
+ }
+
+ /**
+ * Set the license_server field of the given host.
+ *
+ * @param licenseServer New value to set
+ */
+ public void setLicenseServer(Connection c, Map licenseServer) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.set_license_server";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(licenseServer)};
+ Map response = c.dispatch(method_call, method_params);
+ return;
+ }
+
+ /**
+ * Add the given key-value pair to the license_server field of the given host.
+ *
+ * @param key Key to add
+ * @param value Value to add
+ */
+ public void addToLicenseServer(Connection c, String key, String value) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.add_to_license_server";
+ 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 license_server field of the given host. If the key is not in that Map, then do nothing.
+ *
+ * @param key Key to remove
+ */
+ public void removeFromLicenseServer(Connection c, String key) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.remove_from_license_server";
+ 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 guest_VCPUs_params field of the given host.
+ *
+ * @param guestVCPUsParams New value to set
+ */
+ public void setGuestVCPUsParams(Connection c, Map guestVCPUsParams) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.set_guest_VCPUs_params";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(guestVCPUsParams)};
+ Map response = c.dispatch(method_call, method_params);
+ return;
+ }
+
+ /**
+ * Add the given key-value pair to the guest_VCPUs_params field of the given host.
+ *
+ * @param key Key to add
+ * @param value Value to add
+ */
+ public void addToGuestVCPUsParams(Connection c, String key, String value) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.add_to_guest_VCPUs_params";
+ 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 guest_VCPUs_params field of the given host. If the key is not in that Map, then do nothing.
+ *
+ * @param key Key to remove
+ */
+ public void removeFromGuestVCPUsParams(Connection c, String key) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.remove_from_guest_VCPUs_params";
+ 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;
+ }
+
+ /**
+ * Puts the host into a state in which no new VMs can be started. Currently active VMs on the host continue to execute.
+ *
+ * @return Task
+ */
+ public Task disableAsync(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "Async.host.disable";
+ 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);
+ }
+
+ /**
+ * Puts the host into a state in which no new VMs can be started. Currently active VMs on the host continue to execute.
+ *
+ */
+ public void disable(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.disable";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+ Map response = c.dispatch(method_call, method_params);
+ return;
+ }
+
+ /**
+ * Puts the host into a state in which new VMs can be started.
+ *
+ * @return Task
+ */
+ public Task enableAsync(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "Async.host.enable";
+ 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);
+ }
+
+ /**
+ * Puts the host into a state in which new VMs can be started.
+ *
+ */
+ public void enable(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.enable";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+ Map response = c.dispatch(method_call, method_params);
+ return;
+ }
+
+ /**
+ * Shutdown the host. (This function can only be called if there are no currently running VMs on the host and it is disabled.)
+ *
+ * @return Task
+ */
+ public Task shutdownAsync(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "Async.host.shutdown";
+ 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);
+ }
+
+ /**
+ * Shutdown the host. (This function can only be called if there are no currently running VMs on the host and it is disabled.)
+ *
+ */
+ public void shutdown(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.shutdown";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+ Map response = c.dispatch(method_call, method_params);
+ return;
+ }
+
+ /**
+ * Reboot the host. (This function can only be called if there are no currently running VMs on the host and it is disabled.)
+ *
+ * @return Task
+ */
+ public Task rebootAsync(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "Async.host.reboot";
+ 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);
+ }
+
+ /**
+ * Reboot the host. (This function can only be called if there are no currently running VMs on the host and it is disabled.)
+ *
+ */
+ public void reboot(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.reboot";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+ Map response = c.dispatch(method_call, method_params);
+ return;
+ }
+
+ /**
+ * Get the host xen dmesg.
+ *
+ * @return Task
+ */
+ public Task dmesgAsync(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "Async.host.dmesg";
+ 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);
+ }
+
+ /**
+ * Get the host xen dmesg.
+ *
+ * @return dmesg string
+ */
+ public String dmesg(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.dmesg";
+ 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 host xen dmesg, and clear the buffer.
+ *
+ * @return Task
+ */
+ public Task dmesgClearAsync(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "Async.host.dmesg_clear";
+ 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);
+ }
+
+ /**
+ * Get the host xen dmesg, and clear the buffer.
+ *
+ * @return dmesg string
+ */
+ public String dmesgClear(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.dmesg_clear";
+ 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 host's log file
+ *
+ * @return Task
+ */
+ public Task getLogAsync(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "Async.host.get_log";
+ 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);
+ }
+
+ /**
+ * Get the host's log file
+ *
+ * @return The contents of the host's primary log file
+ */
+ public String getLog(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.get_log";
+ 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);
+ }
+
+ /**
+ * Inject the given string as debugging keys into Xen
+ *
+ * @param keys The keys to send
+ * @return Task
+ */
+ public Task sendDebugKeysAsync(Connection c, String keys) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "Async.host.send_debug_keys";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(keys)};
+ Map response = c.dispatch(method_call, method_params);
+ Object result = response.get("Value");
+ return Types.toTask(result);
+ }
+
+ /**
+ * Inject the given string as debugging keys into Xen
+ *
+ * @param keys The keys to send
+ */
+ public void sendDebugKeys(Connection c, String keys) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.send_debug_keys";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(keys)};
+ Map response = c.dispatch(method_call, method_params);
+ return;
+ }
+
+ /**
+ * Run xen-bugtool --yestoall and upload the output to Citrix support
+ *
+ * @param url The URL to upload to
+ * @param options Extra configuration operations
+ * @return Task
+ */
+ public Task bugreportUploadAsync(Connection c, String url, Map options) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "Async.host.bugreport_upload";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(url), Marshalling.toXMLRPC(options)};
+ Map response = c.dispatch(method_call, method_params);
+ Object result = response.get("Value");
+ return Types.toTask(result);
+ }
+
+ /**
+ * Run xen-bugtool --yestoall and upload the output to Citrix support
+ *
+ * @param url The URL to upload to
+ * @param options Extra configuration operations
+ */
+ public void bugreportUpload(Connection c, String url, Map options) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.bugreport_upload";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(url), Marshalling.toXMLRPC(options)};
+ Map response = c.dispatch(method_call, method_params);
+ return;
+ }
+
+ /**
+ * List all supported methods
+ *
+ * @return The name of every supported method.
+ */
+ public static Set listMethods(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.list_methods";
+ 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.toSetOfString(result);
+ }
+
+ /**
+ * Apply a new license to a host
+ *
+ * @param contents The contents of the license file, base64 encoded
+ * @return Task
+ */
+ public Task licenseApplyAsync(Connection c, String contents) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException,
+ Types.LicenseProcessingError {
+ String method_call = "Async.host.license_apply";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(contents)};
+ Map response = c.dispatch(method_call, method_params);
+ Object result = response.get("Value");
+ return Types.toTask(result);
+ }
+
+ /**
+ * Apply a new license to a host
+ *
+ * @param contents The contents of the license file, base64 encoded
+ */
+ public void licenseApply(Connection c, String contents) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException,
+ Types.LicenseProcessingError {
+ String method_call = "host.license_apply";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(contents)};
+ Map response = c.dispatch(method_call, method_params);
+ return;
+ }
+
+ /**
+ * Destroy specified host record in database
+ *
+ * @return Task
+ */
+ public Task destroyAsync(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "Async.host.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 specified host record in database
+ *
+ */
+ public void destroy(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.destroy";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+ Map response = c.dispatch(method_call, method_params);
+ return;
+ }
+
+ /**
+ * Attempt to power-on the host (if the capability exists).
+ *
+ * @return Task
+ */
+ public Task powerOnAsync(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "Async.host.power_on";
+ 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);
+ }
+
+ /**
+ * Attempt to power-on the host (if the capability exists).
+ *
+ */
+ public void powerOn(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.power_on";
+ 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 HA on the local host. This should only be used with extreme care.
+ *
+ */
+ public static void emergencyHaDisable(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.emergency_ha_disable";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session)};
+ Map response = c.dispatch(method_call, method_params);
+ return;
+ }
+
+ /**
+ *
+ *
+ * @return A set of data sources
+ */
+ public Set getDataSources(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.get_data_sources";
+ 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.toSetOfDataSourceRecord(result);
+ }
+
+ /**
+ * Start recording the specified data source
+ *
+ * @param dataSource The data source to record
+ */
+ public void recordDataSource(Connection c, String dataSource) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.record_data_source";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(dataSource)};
+ Map response = c.dispatch(method_call, method_params);
+ return;
+ }
+
+ /**
+ * Query the latest value of the specified data source
+ *
+ * @param dataSource The data source to query
+ * @return The latest value, averaged over the last 5 seconds
+ */
+ public Double queryDataSource(Connection c, String dataSource) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.query_data_source";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(dataSource)};
+ Map response = c.dispatch(method_call, method_params);
+ Object result = response.get("Value");
+ return Types.toDouble(result);
+ }
+
+ /**
+ * Forget the recorded statistics related to the specified data source
+ *
+ * @param dataSource The data source whose archives are to be forgotten
+ */
+ public void forgetDataSourceArchives(Connection c, String dataSource) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.forget_data_source_archives";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(dataSource)};
+ Map response = c.dispatch(method_call, method_params);
+ return;
+ }
+
+ /**
+ * Check this host can be evacuated.
+ *
+ * @return Task
+ */
+ public Task assertCanEvacuateAsync(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "Async.host.assert_can_evacuate";
+ 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);
+ }
+
+ /**
+ * Check this host can be evacuated.
+ *
+ */
+ public void assertCanEvacuate(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.assert_can_evacuate";
+ 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 set of VMs which prevent the host being evacuated, with per-VM error codes
+ *
+ * @return Task
+ */
+ public Task getVmsWhichPreventEvacuationAsync(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "Async.host.get_vms_which_prevent_evacuation";
+ 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);
+ }
+
+ /**
+ * Return a set of VMs which prevent the host being evacuated, with per-VM error codes
+ *
+ * @return VMs which block evacuation together with reasons
+ */
+ public Map> getVmsWhichPreventEvacuation(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.get_vms_which_prevent_evacuation";
+ 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.toMapOfVMSetOfString(result);
+ }
+
+ /**
+ * Return a set of VMs which are not co-operating with the host's memory control system
+ * @deprecated
+ *
+ * @return Task
+ */
+ @Deprecated public Task getUncooperativeResidentVMsAsync(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "Async.host.get_uncooperative_resident_VMs";
+ 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);
+ }
+
+ /**
+ * Return a set of VMs which are not co-operating with the host's memory control system
+ * @deprecated
+ *
+ * @return VMs which are not co-operating
+ */
+ @Deprecated public Set getUncooperativeResidentVMs(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.get_uncooperative_resident_VMs";
+ 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.toSetOfVM(result);
+ }
+
+ /**
+ * Migrate all VMs off of this host, where possible.
+ *
+ * @return Task
+ */
+ public Task evacuateAsync(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "Async.host.evacuate";
+ 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);
+ }
+
+ /**
+ * Migrate all VMs off of this host, where possible.
+ *
+ */
+ public void evacuate(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.evacuate";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+ Map response = c.dispatch(method_call, method_params);
+ return;
+ }
+
+ /**
+ * Re-configure syslog logging
+ *
+ * @return Task
+ */
+ public Task syslogReconfigureAsync(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "Async.host.syslog_reconfigure";
+ 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);
+ }
+
+ /**
+ * Re-configure syslog logging
+ *
+ */
+ public void syslogReconfigure(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.syslog_reconfigure";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+ Map response = c.dispatch(method_call, method_params);
+ return;
+ }
+
+ /**
+ * Reconfigure the management network interface
+ *
+ * @param pif reference to a PIF object corresponding to the management interface
+ * @return Task
+ */
+ public static Task managementReconfigureAsync(Connection c, PIF pif) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "Async.host.management_reconfigure";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(pif)};
+ Map response = c.dispatch(method_call, method_params);
+ Object result = response.get("Value");
+ return Types.toTask(result);
+ }
+
+ /**
+ * Reconfigure the management network interface
+ *
+ * @param pif reference to a PIF object corresponding to the management interface
+ */
+ public static void managementReconfigure(Connection c, PIF pif) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.management_reconfigure";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(pif)};
+ Map response = c.dispatch(method_call, method_params);
+ return;
+ }
+
+ /**
+ * Reconfigure the management network interface. Should only be used if Host.management_reconfigure is impossible because the network configuration is broken.
+ *
+ * @param iface name of the interface to use as a management interface
+ */
+ public static void localManagementReconfigure(Connection c, String iface) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.local_management_reconfigure";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(iface)};
+ Map response = c.dispatch(method_call, method_params);
+ return;
+ }
+
+ /**
+ * Disable the management network interface
+ *
+ */
+ public static void managementDisable(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.management_disable";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session)};
+ Map response = c.dispatch(method_call, method_params);
+ return;
+ }
+
+ /**
+ * Returns the management interface for the specified host
+ *
+ * @return Task
+ */
+ public Task getManagementIfaceAsync(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "Async.host.get_management_interface";
+ 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);
+ }
+
+ /**
+ * Returns the management interface for the specified host
+ *
+ * @return The managment interface for the host
+ */
+ public PIF getManagementIface(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.get_management_interface";
+ 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);
+ }
+
+ /**
+ *
+ *
+ * @return An XML fragment containing the system status capabilities.
+ */
+ public String getSystemStatusCapabilities(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.get_system_status_capabilities";
+ 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);
+ }
+
+ /**
+ * Restarts the agent after a 10 second pause. WARNING: this is a dangerous operation. Any operations in progress will be aborted, and unrecoverable data loss may occur. The caller is responsible for ensuring that there are no operations in progress when this method is called.
+ *
+ * @return Task
+ */
+ public Task restartAgentAsync(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "Async.host.restart_agent";
+ 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);
+ }
+
+ /**
+ * Restarts the agent after a 10 second pause. WARNING: this is a dangerous operation. Any operations in progress will be aborted, and unrecoverable data loss may occur. The caller is responsible for ensuring that there are no operations in progress when this method is called.
+ *
+ */
+ public void restartAgent(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.restart_agent";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+ Map response = c.dispatch(method_call, method_params);
+ return;
+ }
+
+ /**
+ * Shuts the agent down after a 10 second pause. WARNING: this is a dangerous operation. Any operations in progress will be aborted, and unrecoverable data loss may occur. The caller is responsible for ensuring that there are no operations in progress when this method is called.
+ *
+ */
+ public static void shutdownAgent(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.shutdown_agent";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session)};
+ Map response = c.dispatch(method_call, method_params);
+ return;
+ }
+
+ /**
+ * Sets the host name to the specified string. Both the API and lower-level system hostname are changed immediately.
+ *
+ * @param hostname The new host name
+ */
+ public void setHostnameLive(Connection c, String hostname) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException,
+ Types.HostNameInvalid {
+ String method_call = "host.set_hostname_live";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(hostname)};
+ Map response = c.dispatch(method_call, method_params);
+ return;
+ }
+
+ /**
+ * Computes the amount of free memory on the host.
+ *
+ * @return Task
+ */
+ public Task computeFreeMemoryAsync(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "Async.host.compute_free_memory";
+ 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);
+ }
+
+ /**
+ * Computes the amount of free memory on the host.
+ *
+ * @return the amount of free memory on the host.
+ */
+ public Long computeFreeMemory(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.compute_free_memory";
+ 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.toLong(result);
+ }
+
+ /**
+ * Computes the virtualization memory overhead of a host.
+ *
+ * @return Task
+ */
+ public Task computeMemoryOverheadAsync(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "Async.host.compute_memory_overhead";
+ 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);
+ }
+
+ /**
+ * Computes the virtualization memory overhead of a host.
+ *
+ * @return the virtualization memory overhead of the host.
+ */
+ public Long computeMemoryOverhead(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.compute_memory_overhead";
+ 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.toLong(result);
+ }
+
+ /**
+ * This causes the synchronisation of the non-database data (messages, RRDs and so on) stored on the master to be synchronised with the host
+ *
+ */
+ public void syncData(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.sync_data";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+ Map response = c.dispatch(method_call, method_params);
+ return;
+ }
+
+ /**
+ * This causes the RRDs to be backed up to the master
+ *
+ * @param delay Delay in seconds from when the call is received to perform the backup
+ */
+ public void backupRrds(Connection c, Double delay) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.backup_rrds";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(delay)};
+ Map response = c.dispatch(method_call, method_params);
+ return;
+ }
+
+ /**
+ * Create a placeholder for a named binary blob of data that is associated with this host
+ *
+ * @param name The name associated with the blob
+ * @param mimeType The mime type for the data. Empty string translates to application/octet-stream
+ * @param _public True if the blob should be publicly available
+ * @return Task
+ */
+ public Task createNewBlobAsync(Connection c, String name, String mimeType, Boolean _public) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "Async.host.create_new_blob";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(name), Marshalling.toXMLRPC(mimeType), Marshalling.toXMLRPC(_public)};
+ Map response = c.dispatch(method_call, method_params);
+ Object result = response.get("Value");
+ return Types.toTask(result);
+ }
+
+ /**
+ * Create a placeholder for a named binary blob of data that is associated with this host
+ *
+ * @param name The name associated with the blob
+ * @param mimeType The mime type for the data. Empty string translates to application/octet-stream
+ * @param _public True if the blob should be publicly available
+ * @return The reference of the blob, needed for populating its data
+ */
+ public Blob createNewBlob(Connection c, String name, String mimeType, Boolean _public) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.create_new_blob";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(name), Marshalling.toXMLRPC(mimeType), Marshalling.toXMLRPC(_public)};
+ Map response = c.dispatch(method_call, method_params);
+ Object result = response.get("Value");
+ return Types.toBlob(result);
+ }
+
+ /**
+ * Call a XenAPI plugin on this host
+ *
+ * @param plugin The name of the plugin
+ * @param fn The name of the function within the plugin
+ * @param args Arguments for the function
+ * @return Task
+ */
+ public Task callPluginAsync(Connection c, String plugin, String fn, Map args) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "Async.host.call_plugin";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(plugin), Marshalling.toXMLRPC(fn), Marshalling.toXMLRPC(args)};
+ Map response = c.dispatch(method_call, method_params);
+ Object result = response.get("Value");
+ return Types.toTask(result);
+ }
+
+ /**
+ * Call a XenAPI plugin on this host
+ *
+ * @param plugin The name of the plugin
+ * @param fn The name of the function within the plugin
+ * @param args Arguments for the function
+ * @return Result from the plugin
+ */
+ public String callPlugin(Connection c, String plugin, String fn, Map args) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.call_plugin";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(plugin), Marshalling.toXMLRPC(fn), Marshalling.toXMLRPC(args)};
+ Map response = c.dispatch(method_call, method_params);
+ Object result = response.get("Value");
+ return Types.toString(result);
+ }
+
+ /**
+ * This call queries the host's clock for the current time
+ *
+ * @return The current time
+ */
+ public Date getServertime(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.get_servertime";
+ 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 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
+ *
+ * @param config A list of key-values containing the configuration data
+ * @param serviceName The name of the service
+ * @param authType The type of authentication (e.g. AD for Active Directory)
+ */
+ public void enableExternalAuth(Connection c, Map config, String serviceName, String authType) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.enable_external_auth";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(config), Marshalling.toXMLRPC(serviceName), Marshalling.toXMLRPC(authType)};
+ Map response = c.dispatch(method_call, method_params);
+ return;
+ }
+
+ /**
+ * This call disables external authentication on the local host
+ *
+ * @param config Optional parameters as a list of key-values containing the configuration data
+ */
+ public void disableExternalAuth(Connection c, Map config) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.disable_external_auth";
+ 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);
+ return;
+ }
+
+ /**
+ * Retrieves recommended host migrations to perform when evacuating the host from the wlb server. If a VM cannot be migrated from the host the reason is listed instead of a recommendation.
+ *
+ * @return Task
+ */
+ public Task retrieveWlbEvacuateRecommendationsAsync(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "Async.host.retrieve_wlb_evacuate_recommendations";
+ 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);
+ }
+
+ /**
+ * Retrieves recommended host migrations to perform when evacuating the host from the wlb server. If a VM cannot be migrated from the host the reason is listed instead of a recommendation.
+ *
+ * @return VMs and the reasons why they would block evacuation, or their target host recommended by the wlb server
+ */
+ public Map> retrieveWlbEvacuateRecommendations(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.retrieve_wlb_evacuate_recommendations";
+ 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.toMapOfVMSetOfString(result);
+ }
+
+ /**
+ * Get the installed server SSL certificate.
+ *
+ * @return Task
+ */
+ public Task getServerCertificateAsync(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "Async.host.get_server_certificate";
+ 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);
+ }
+
+ /**
+ * Get the installed server SSL certificate.
+ *
+ * @return The installed server SSL certificate, in PEM form.
+ */
+ public String getServerCertificate(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.get_server_certificate";
+ 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);
+ }
+
+ /**
+ * Change to another edition, or reactivate the current edition after a license has expired. This may be subject to the successful checkout of an appropriate license.
+ *
+ * @param edition The requested edition
+ * @param force Update the license params even if the apply call fails
+ */
+ public void applyEdition(Connection c, String edition, Boolean force) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.apply_edition";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(edition), Marshalling.toXMLRPC(force)};
+ Map response = c.dispatch(method_call, method_params);
+ return;
+ }
+
+ /**
+ * Refresh the list of installed Supplemental Packs.
+ *
+ * @return Task
+ */
+ public Task refreshPackInfoAsync(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "Async.host.refresh_pack_info";
+ 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);
+ }
+
+ /**
+ * Refresh the list of installed Supplemental Packs.
+ *
+ */
+ public void refreshPackInfo(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.refresh_pack_info";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+ Map response = c.dispatch(method_call, method_params);
+ return;
+ }
+
+ /**
+ * Set the power-on-mode, host, user and password
+ *
+ * @param powerOnMode power-on-mode can be empty,iLO,wake-on-lan, DRAC or other
+ * @param powerOnConfig Power on config
+ * @return Task
+ */
+ public Task setPowerOnModeAsync(Connection c, String powerOnMode, Map powerOnConfig) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "Async.host.set_power_on_mode";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(powerOnMode), Marshalling.toXMLRPC(powerOnConfig)};
+ Map response = c.dispatch(method_call, method_params);
+ Object result = response.get("Value");
+ return Types.toTask(result);
+ }
+
+ /**
+ * Set the power-on-mode, host, user and password
+ *
+ * @param powerOnMode power-on-mode can be empty,iLO,wake-on-lan, DRAC or other
+ * @param powerOnConfig Power on config
+ */
+ public void setPowerOnMode(Connection c, String powerOnMode, Map powerOnConfig) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.set_power_on_mode";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(powerOnMode), Marshalling.toXMLRPC(powerOnConfig)};
+ Map response = c.dispatch(method_call, method_params);
+ return;
+ }
+
+ /**
+ * Set the CPU features to be used after a reboot, if the given features string is valid.
+ *
+ * @param features The features string (32 hexadecimal digits)
+ */
+ public void setCpuFeatures(Connection c, String features) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.set_cpu_features";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(features)};
+ Map response = c.dispatch(method_call, method_params);
+ return;
+ }
+
+ /**
+ * Remove the feature mask, such that after a reboot all features of the CPU are enabled.
+ *
+ */
+ public void resetCpuFeatures(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.reset_cpu_features";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+ Map response = c.dispatch(method_call, method_params);
+ 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;
+ }
+
+ /**
+ * Prepare to receive a VM, returning a token which can be passed to VM.migrate.
+ *
+ * @param network The network through which migration traffic should be received.
+ * @param options Extra configuration operations
+ * @return Task
+ */
+ public Task migrateReceiveAsync(Connection c, Network network, Map options) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "Async.host.migrate_receive";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(network), Marshalling.toXMLRPC(options)};
+ Map response = c.dispatch(method_call, method_params);
+ Object result = response.get("Value");
+ return Types.toTask(result);
+ }
+
+ /**
+ * Prepare to receive a VM, returning a token which can be passed to VM.migrate.
+ *
+ * @param network The network through which migration traffic should be received.
+ * @param options Extra configuration operations
+ * @return A value which should be passed to VM.migrate
+ */
+ public Map migrateReceive(Connection c, Network network, Map options) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.migrate_receive";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(network), Marshalling.toXMLRPC(options)};
+ Map response = c.dispatch(method_call, method_params);
+ Object result = response.get("Value");
+ return Types.toMapOfStringString(result);
+ }
+
+ /**
+ * Declare that a host is dead. This is a dangerous operation, and should only be called if the administrator is absolutely sure the host is definitely dead
+ *
+ * @return Task
+ */
+ public Task declareDeadAsync(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "Async.host.declare_dead";
+ 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);
+ }
+
+ /**
+ * Declare that a host is dead. This is a dangerous operation, and should only be called if the administrator is absolutely sure the host is definitely dead
+ *
+ */
+ public void declareDead(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.declare_dead";
+ 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 references to all objects
+ */
+ public static Set getAll(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.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.toSetOfHost(result);
+ }
+
+ /**
+ * Return a map of host references to host records for all hosts known to the system.
+ *
+ * @return records of all objects
+ */
+ public static Map getAllRecords(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host.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.toMapOfHostHostRecord(result);
+ }
+
+}
\ No newline at end of file
diff --git a/deps/XenServerJava/src/com/xensource/xenapi/HostCpu.java b/deps/XenServerJava/src/com/xensource/xenapi/HostCpu.java
new file mode 100644
index 00000000000..0f802f88ee9
--- /dev/null
+++ b/deps/XenServerJava/src/com/xensource/xenapi/HostCpu.java
@@ -0,0 +1,536 @@
+/*
+ * Copyright (c) Citrix Systems, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1) Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2) Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+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 physical CPU
+ *
+ * @author Citrix Systems, Inc.
+ */
+public class HostCpu extends XenAPIObject {
+
+ /**
+ * The XenAPI reference (OpaqueRef) to this object.
+ */
+ protected final String ref;
+
+ /**
+ * For internal use only.
+ */
+ HostCpu(String ref) {
+ this.ref = ref;
+ }
+
+ /**
+ * @return The XenAPI reference (OpaqueRef) to this object.
+ */
+ public String toWireString() {
+ return this.ref;
+ }
+
+ /**
+ * If obj is a HostCpu, compares XenAPI references for equality.
+ */
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (obj != null && obj instanceof HostCpu)
+ {
+ HostCpu other = (HostCpu) obj;
+ return other.ref.equals(this.ref);
+ } else
+ {
+ return false;
+ }
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return ref.hashCode();
+ }
+
+ /**
+ * Represents all the fields in a HostCpu
+ */
+ 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", "host", this.host);
+ print.printf("%1$20s: %2$s\n", "number", this.number);
+ print.printf("%1$20s: %2$s\n", "vendor", this.vendor);
+ print.printf("%1$20s: %2$s\n", "speed", this.speed);
+ print.printf("%1$20s: %2$s\n", "modelname", this.modelname);
+ print.printf("%1$20s: %2$s\n", "family", this.family);
+ print.printf("%1$20s: %2$s\n", "model", this.model);
+ print.printf("%1$20s: %2$s\n", "stepping", this.stepping);
+ print.printf("%1$20s: %2$s\n", "flags", this.flags);
+ print.printf("%1$20s: %2$s\n", "features", this.features);
+ print.printf("%1$20s: %2$s\n", "utilisation", this.utilisation);
+ print.printf("%1$20s: %2$s\n", "otherConfig", this.otherConfig);
+ return writer.toString();
+ }
+
+ /**
+ * Convert a host_cpu.Record to a Map
+ */
+ public Map toMap() {
+ Map map = new HashMap();
+ map.put("uuid", this.uuid == null ? "" : this.uuid);
+ map.put("host", this.host == null ? new Host("OpaqueRef:NULL") : this.host);
+ map.put("number", this.number == null ? 0 : this.number);
+ map.put("vendor", this.vendor == null ? "" : this.vendor);
+ map.put("speed", this.speed == null ? 0 : this.speed);
+ map.put("modelname", this.modelname == null ? "" : this.modelname);
+ map.put("family", this.family == null ? 0 : this.family);
+ map.put("model", this.model == null ? 0 : this.model);
+ map.put("stepping", this.stepping == null ? "" : this.stepping);
+ map.put("flags", this.flags == null ? "" : this.flags);
+ map.put("features", this.features == null ? "" : this.features);
+ map.put("utilisation", this.utilisation == null ? 0.0 : this.utilisation);
+ map.put("other_config", this.otherConfig == null ? new HashMap() : this.otherConfig);
+ return map;
+ }
+
+ /**
+ * Unique identifier/object reference
+ */
+ public String uuid;
+ /**
+ * the host the CPU is in
+ */
+ public Host host;
+ /**
+ * the number of the physical CPU within the host
+ */
+ public Long number;
+ /**
+ * the vendor of the physical CPU
+ */
+ public String vendor;
+ /**
+ * the speed of the physical CPU
+ */
+ public Long speed;
+ /**
+ * the model name of the physical CPU
+ */
+ public String modelname;
+ /**
+ * the family (number) of the physical CPU
+ */
+ public Long family;
+ /**
+ * the model number of the physical CPU
+ */
+ public Long model;
+ /**
+ * the stepping of the physical CPU
+ */
+ public String stepping;
+ /**
+ * the flags of the physical CPU (a decoded version of the features field)
+ */
+ public String flags;
+ /**
+ * the physical CPU feature bitmap
+ */
+ public String features;
+ /**
+ * the current CPU utilisation
+ */
+ public Double utilisation;
+ /**
+ * additional configuration
+ */
+ public Map otherConfig;
+ }
+
+ /**
+ * Get a record containing the current state of the given host_cpu.
+ * @deprecated
+ *
+ * @return all fields from the object
+ */
+ @Deprecated public HostCpu.Record getRecord(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host_cpu.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.toHostCpuRecord(result);
+ }
+
+ /**
+ * Get a reference to the host_cpu instance with the specified UUID.
+ * @deprecated
+ *
+ * @param uuid UUID of object to return
+ * @return reference to the object
+ */
+ @Deprecated public static HostCpu getByUuid(Connection c, String uuid) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host_cpu.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.toHostCpu(result);
+ }
+
+ /**
+ * Get the uuid field of the given host_cpu.
+ *
+ * @return value of the field
+ */
+ public String getUuid(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host_cpu.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 host field of the given host_cpu.
+ *
+ * @return value of the field
+ */
+ public Host getHost(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host_cpu.get_host";
+ 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.toHost(result);
+ }
+
+ /**
+ * Get the number field of the given host_cpu.
+ *
+ * @return value of the field
+ */
+ public Long getNumber(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host_cpu.get_number";
+ 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.toLong(result);
+ }
+
+ /**
+ * Get the vendor field of the given host_cpu.
+ *
+ * @return value of the field
+ */
+ public String getVendor(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host_cpu.get_vendor";
+ 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 speed field of the given host_cpu.
+ *
+ * @return value of the field
+ */
+ public Long getSpeed(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host_cpu.get_speed";
+ 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.toLong(result);
+ }
+
+ /**
+ * Get the modelname field of the given host_cpu.
+ *
+ * @return value of the field
+ */
+ public String getModelname(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host_cpu.get_modelname";
+ 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 family field of the given host_cpu.
+ *
+ * @return value of the field
+ */
+ public Long getFamily(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host_cpu.get_family";
+ 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.toLong(result);
+ }
+
+ /**
+ * Get the model field of the given host_cpu.
+ *
+ * @return value of the field
+ */
+ public Long getModel(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host_cpu.get_model";
+ 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.toLong(result);
+ }
+
+ /**
+ * Get the stepping field of the given host_cpu.
+ *
+ * @return value of the field
+ */
+ public String getStepping(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host_cpu.get_stepping";
+ 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 flags field of the given host_cpu.
+ *
+ * @return value of the field
+ */
+ public String getFlags(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host_cpu.get_flags";
+ 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 features field of the given host_cpu.
+ *
+ * @return value of the field
+ */
+ public String getFeatures(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host_cpu.get_features";
+ 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 utilisation field of the given host_cpu.
+ *
+ * @return value of the field
+ */
+ public Double getUtilisation(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host_cpu.get_utilisation";
+ 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.toDouble(result);
+ }
+
+ /**
+ * Get the other_config field of the given host_cpu.
+ *
+ * @return value of the field
+ */
+ public Map getOtherConfig(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host_cpu.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 other_config field of the given host_cpu.
+ *
+ * @param otherConfig New value to set
+ */
+ public void setOtherConfig(Connection c, Map otherConfig) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host_cpu.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 host_cpu.
+ *
+ * @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 = "host_cpu.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 host_cpu. 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 = "host_cpu.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;
+ }
+
+ /**
+ * Return a list of all the host_cpus known to the system.
+ * @deprecated
+ *
+ * @return references to all objects
+ */
+ @Deprecated public static Set getAll(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host_cpu.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.toSetOfHostCpu(result);
+ }
+
+ /**
+ * Return a map of host_cpu references to host_cpu records for all host_cpus known to the system.
+ *
+ * @return records of all objects
+ */
+ public static Map getAllRecords(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host_cpu.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.toMapOfHostCpuHostCpuRecord(result);
+ }
+
+}
\ No newline at end of file
diff --git a/deps/XenServerJava/src/com/xensource/xenapi/HostCrashdump.java b/deps/XenServerJava/src/com/xensource/xenapi/HostCrashdump.java
new file mode 100644
index 00000000000..e93240e6c2b
--- /dev/null
+++ b/deps/XenServerJava/src/com/xensource/xenapi/HostCrashdump.java
@@ -0,0 +1,417 @@
+/*
+ * Copyright (c) Citrix Systems, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1) Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2) Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+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;
+
+/**
+ * Represents a host crash dump
+ *
+ * @author Citrix Systems, Inc.
+ */
+public class HostCrashdump extends XenAPIObject {
+
+ /**
+ * The XenAPI reference (OpaqueRef) to this object.
+ */
+ protected final String ref;
+
+ /**
+ * For internal use only.
+ */
+ HostCrashdump(String ref) {
+ this.ref = ref;
+ }
+
+ /**
+ * @return The XenAPI reference (OpaqueRef) to this object.
+ */
+ public String toWireString() {
+ return this.ref;
+ }
+
+ /**
+ * If obj is a HostCrashdump, compares XenAPI references for equality.
+ */
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (obj != null && obj instanceof HostCrashdump)
+ {
+ HostCrashdump other = (HostCrashdump) obj;
+ return other.ref.equals(this.ref);
+ } else
+ {
+ return false;
+ }
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return ref.hashCode();
+ }
+
+ /**
+ * Represents all the fields in a HostCrashdump
+ */
+ 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", "host", this.host);
+ print.printf("%1$20s: %2$s\n", "timestamp", this.timestamp);
+ print.printf("%1$20s: %2$s\n", "size", this.size);
+ print.printf("%1$20s: %2$s\n", "otherConfig", this.otherConfig);
+ return writer.toString();
+ }
+
+ /**
+ * Convert a host_crashdump.Record to a Map
+ */
+ public Map toMap() {
+ Map map = new HashMap();
+ map.put("uuid", this.uuid == null ? "" : this.uuid);
+ map.put("host", this.host == null ? new Host("OpaqueRef:NULL") : this.host);
+ map.put("timestamp", this.timestamp == null ? new Date(0) : this.timestamp);
+ map.put("size", this.size == null ? 0 : this.size);
+ map.put("other_config", this.otherConfig == null ? new HashMap() : this.otherConfig);
+ return map;
+ }
+
+ /**
+ * Unique identifier/object reference
+ */
+ public String uuid;
+ /**
+ * Host the crashdump relates to
+ */
+ public Host host;
+ /**
+ * Time the crash happened
+ */
+ public Date timestamp;
+ /**
+ * Size of the crashdump
+ */
+ public Long size;
+ /**
+ * additional configuration
+ */
+ public Map otherConfig;
+ }
+
+ /**
+ * Get a record containing the current state of the given host_crashdump.
+ *
+ * @return all fields from the object
+ */
+ public HostCrashdump.Record getRecord(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host_crashdump.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.toHostCrashdumpRecord(result);
+ }
+
+ /**
+ * Get a reference to the host_crashdump instance with the specified UUID.
+ *
+ * @param uuid UUID of object to return
+ * @return reference to the object
+ */
+ public static HostCrashdump getByUuid(Connection c, String uuid) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host_crashdump.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.toHostCrashdump(result);
+ }
+
+ /**
+ * Get the uuid field of the given host_crashdump.
+ *
+ * @return value of the field
+ */
+ public String getUuid(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host_crashdump.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 host field of the given host_crashdump.
+ *
+ * @return value of the field
+ */
+ public Host getHost(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host_crashdump.get_host";
+ 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.toHost(result);
+ }
+
+ /**
+ * Get the timestamp field of the given host_crashdump.
+ *
+ * @return value of the field
+ */
+ public Date getTimestamp(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host_crashdump.get_timestamp";
+ 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);
+ }
+
+ /**
+ * Get the size field of the given host_crashdump.
+ *
+ * @return value of the field
+ */
+ public Long getSize(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host_crashdump.get_size";
+ 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.toLong(result);
+ }
+
+ /**
+ * Get the other_config field of the given host_crashdump.
+ *
+ * @return value of the field
+ */
+ public Map getOtherConfig(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host_crashdump.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 other_config field of the given host_crashdump.
+ *
+ * @param otherConfig New value to set
+ */
+ public void setOtherConfig(Connection c, Map otherConfig) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host_crashdump.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 host_crashdump.
+ *
+ * @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 = "host_crashdump.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 host_crashdump. 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 = "host_crashdump.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;
+ }
+
+ /**
+ * Destroy specified host crash dump, removing it from the disk.
+ *
+ * @return Task
+ */
+ public Task destroyAsync(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "Async.host_crashdump.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 specified host crash dump, removing it from the disk.
+ *
+ */
+ public void destroy(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host_crashdump.destroy";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+ Map response = c.dispatch(method_call, method_params);
+ return;
+ }
+
+ /**
+ * Upload the specified host crash dump to a specified URL
+ *
+ * @param url The URL to upload to
+ * @param options Extra configuration operations
+ * @return Task
+ */
+ public Task uploadAsync(Connection c, String url, Map options) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "Async.host_crashdump.upload";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(url), Marshalling.toXMLRPC(options)};
+ Map response = c.dispatch(method_call, method_params);
+ Object result = response.get("Value");
+ return Types.toTask(result);
+ }
+
+ /**
+ * Upload the specified host crash dump to a specified URL
+ *
+ * @param url The URL to upload to
+ * @param options Extra configuration operations
+ */
+ public void upload(Connection c, String url, Map options) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host_crashdump.upload";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(url), Marshalling.toXMLRPC(options)};
+ Map response = c.dispatch(method_call, method_params);
+ return;
+ }
+
+ /**
+ * Return a list of all the host_crashdumps known to the system.
+ *
+ * @return references to all objects
+ */
+ public static Set getAll(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host_crashdump.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.toSetOfHostCrashdump(result);
+ }
+
+ /**
+ * Return a map of host_crashdump references to host_crashdump records for all host_crashdumps known to the system.
+ *
+ * @return records of all objects
+ */
+ public static Map getAllRecords(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host_crashdump.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.toMapOfHostCrashdumpHostCrashdumpRecord(result);
+ }
+
+}
\ No newline at end of file
diff --git a/deps/XenServerJava/src/com/xensource/xenapi/HostMetrics.java b/deps/XenServerJava/src/com/xensource/xenapi/HostMetrics.java
new file mode 100644
index 00000000000..261933fef60
--- /dev/null
+++ b/deps/XenServerJava/src/com/xensource/xenapi/HostMetrics.java
@@ -0,0 +1,373 @@
+/*
+ * Copyright (c) Citrix Systems, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1) Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2) Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+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;
+
+/**
+ * The metrics associated with a host
+ *
+ * @author Citrix Systems, Inc.
+ */
+public class HostMetrics extends XenAPIObject {
+
+ /**
+ * The XenAPI reference (OpaqueRef) to this object.
+ */
+ protected final String ref;
+
+ /**
+ * For internal use only.
+ */
+ HostMetrics(String ref) {
+ this.ref = ref;
+ }
+
+ /**
+ * @return The XenAPI reference (OpaqueRef) to this object.
+ */
+ public String toWireString() {
+ return this.ref;
+ }
+
+ /**
+ * If obj is a HostMetrics, compares XenAPI references for equality.
+ */
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (obj != null && obj instanceof HostMetrics)
+ {
+ HostMetrics other = (HostMetrics) obj;
+ return other.ref.equals(this.ref);
+ } else
+ {
+ return false;
+ }
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return ref.hashCode();
+ }
+
+ /**
+ * Represents all the fields in a HostMetrics
+ */
+ 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", "memoryTotal", this.memoryTotal);
+ print.printf("%1$20s: %2$s\n", "memoryFree", this.memoryFree);
+ print.printf("%1$20s: %2$s\n", "live", this.live);
+ print.printf("%1$20s: %2$s\n", "lastUpdated", this.lastUpdated);
+ print.printf("%1$20s: %2$s\n", "otherConfig", this.otherConfig);
+ return writer.toString();
+ }
+
+ /**
+ * Convert a host_metrics.Record to a Map
+ */
+ public Map toMap() {
+ Map map = new HashMap();
+ map.put("uuid", this.uuid == null ? "" : this.uuid);
+ map.put("memory_total", this.memoryTotal == null ? 0 : this.memoryTotal);
+ map.put("memory_free", this.memoryFree == null ? 0 : this.memoryFree);
+ map.put("live", this.live == null ? false : this.live);
+ map.put("last_updated", this.lastUpdated == null ? new Date(0) : this.lastUpdated);
+ map.put("other_config", this.otherConfig == null ? new HashMap() : this.otherConfig);
+ return map;
+ }
+
+ /**
+ * Unique identifier/object reference
+ */
+ public String uuid;
+ /**
+ * Total host memory (bytes)
+ */
+ public Long memoryTotal;
+ /**
+ * Free host memory (bytes)
+ */
+ public Long memoryFree;
+ /**
+ * Pool master thinks this host is live
+ */
+ public Boolean live;
+ /**
+ * Time at which this information was last updated
+ */
+ public Date lastUpdated;
+ /**
+ * additional configuration
+ */
+ public Map otherConfig;
+ }
+
+ /**
+ * Get a record containing the current state of the given host_metrics.
+ *
+ * @return all fields from the object
+ */
+ public HostMetrics.Record getRecord(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host_metrics.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.toHostMetricsRecord(result);
+ }
+
+ /**
+ * Get a reference to the host_metrics instance with the specified UUID.
+ *
+ * @param uuid UUID of object to return
+ * @return reference to the object
+ */
+ public static HostMetrics getByUuid(Connection c, String uuid) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host_metrics.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.toHostMetrics(result);
+ }
+
+ /**
+ * Get the uuid field of the given host_metrics.
+ *
+ * @return value of the field
+ */
+ public String getUuid(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host_metrics.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 memory/total field of the given host_metrics.
+ *
+ * @return value of the field
+ */
+ public Long getMemoryTotal(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host_metrics.get_memory_total";
+ 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.toLong(result);
+ }
+
+ /**
+ * Get the memory/free field of the given host_metrics.
+ * @deprecated
+ *
+ * @return value of the field
+ */
+ @Deprecated public Long getMemoryFree(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host_metrics.get_memory_free";
+ 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.toLong(result);
+ }
+
+ /**
+ * Get the live field of the given host_metrics.
+ *
+ * @return value of the field
+ */
+ public Boolean getLive(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host_metrics.get_live";
+ 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 last_updated field of the given host_metrics.
+ *
+ * @return value of the field
+ */
+ public Date getLastUpdated(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host_metrics.get_last_updated";
+ 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);
+ }
+
+ /**
+ * Get the other_config field of the given host_metrics.
+ *
+ * @return value of the field
+ */
+ public Map getOtherConfig(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host_metrics.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 other_config field of the given host_metrics.
+ *
+ * @param otherConfig New value to set
+ */
+ public void setOtherConfig(Connection c, Map otherConfig) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host_metrics.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 host_metrics.
+ *
+ * @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 = "host_metrics.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 host_metrics. 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 = "host_metrics.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;
+ }
+
+ /**
+ * Return a list of all the host_metrics instances known to the system.
+ *
+ * @return references to all objects
+ */
+ public static Set getAll(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host_metrics.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.toSetOfHostMetrics(result);
+ }
+
+ /**
+ * Return a map of host_metrics references to host_metrics records for all host_metrics instances known to the system.
+ *
+ * @return records of all objects
+ */
+ public static Map getAllRecords(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host_metrics.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.toMapOfHostMetricsHostMetricsRecord(result);
+ }
+
+}
\ No newline at end of file
diff --git a/deps/XenServerJava/src/com/xensource/xenapi/HostPatch.java b/deps/XenServerJava/src/com/xensource/xenapi/HostPatch.java
new file mode 100644
index 00000000000..0f229dc93a4
--- /dev/null
+++ b/deps/XenServerJava/src/com/xensource/xenapi/HostPatch.java
@@ -0,0 +1,552 @@
+/*
+ * Copyright (c) Citrix Systems, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1) Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2) Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+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;
+
+/**
+ * Represents a patch stored on a server
+ *
+ * @author Citrix Systems, Inc.
+ */
+public class HostPatch extends XenAPIObject {
+
+ /**
+ * The XenAPI reference (OpaqueRef) to this object.
+ */
+ protected final String ref;
+
+ /**
+ * For internal use only.
+ */
+ HostPatch(String ref) {
+ this.ref = ref;
+ }
+
+ /**
+ * @return The XenAPI reference (OpaqueRef) to this object.
+ */
+ public String toWireString() {
+ return this.ref;
+ }
+
+ /**
+ * If obj is a HostPatch, compares XenAPI references for equality.
+ */
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (obj != null && obj instanceof HostPatch)
+ {
+ HostPatch other = (HostPatch) obj;
+ return other.ref.equals(this.ref);
+ } else
+ {
+ return false;
+ }
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return ref.hashCode();
+ }
+
+ /**
+ * Represents all the fields in a HostPatch
+ */
+ 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", "nameLabel", this.nameLabel);
+ print.printf("%1$20s: %2$s\n", "nameDescription", this.nameDescription);
+ print.printf("%1$20s: %2$s\n", "version", this.version);
+ print.printf("%1$20s: %2$s\n", "host", this.host);
+ print.printf("%1$20s: %2$s\n", "applied", this.applied);
+ print.printf("%1$20s: %2$s\n", "timestampApplied", this.timestampApplied);
+ print.printf("%1$20s: %2$s\n", "size", this.size);
+ print.printf("%1$20s: %2$s\n", "poolPatch", this.poolPatch);
+ print.printf("%1$20s: %2$s\n", "otherConfig", this.otherConfig);
+ return writer.toString();
+ }
+
+ /**
+ * Convert a host_patch.Record to a Map
+ */
+ public Map toMap() {
+ Map map = new HashMap();
+ map.put("uuid", this.uuid == null ? "" : this.uuid);
+ map.put("name_label", this.nameLabel == null ? "" : this.nameLabel);
+ map.put("name_description", this.nameDescription == null ? "" : this.nameDescription);
+ map.put("version", this.version == null ? "" : this.version);
+ map.put("host", this.host == null ? new Host("OpaqueRef:NULL") : this.host);
+ map.put("applied", this.applied == null ? false : this.applied);
+ map.put("timestamp_applied", this.timestampApplied == null ? new Date(0) : this.timestampApplied);
+ map.put("size", this.size == null ? 0 : this.size);
+ map.put("pool_patch", this.poolPatch == null ? new PoolPatch("OpaqueRef:NULL") : this.poolPatch);
+ map.put("other_config", this.otherConfig == null ? new HashMap() : this.otherConfig);
+ return map;
+ }
+
+ /**
+ * Unique identifier/object reference
+ */
+ public String uuid;
+ /**
+ * a human-readable name
+ */
+ public String nameLabel;
+ /**
+ * a notes field containing human-readable description
+ */
+ public String nameDescription;
+ /**
+ * Patch version number
+ */
+ public String version;
+ /**
+ * Host the patch relates to
+ */
+ public Host host;
+ /**
+ * True if the patch has been applied
+ */
+ public Boolean applied;
+ /**
+ * Time the patch was applied
+ */
+ public Date timestampApplied;
+ /**
+ * Size of the patch
+ */
+ public Long size;
+ /**
+ * The patch applied
+ */
+ public PoolPatch poolPatch;
+ /**
+ * additional configuration
+ */
+ public Map otherConfig;
+ }
+
+ /**
+ * Get a record containing the current state of the given host_patch.
+ *
+ * @return all fields from the object
+ */
+ public HostPatch.Record getRecord(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host_patch.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.toHostPatchRecord(result);
+ }
+
+ /**
+ * Get a reference to the host_patch instance with the specified UUID.
+ *
+ * @param uuid UUID of object to return
+ * @return reference to the object
+ */
+ public static HostPatch getByUuid(Connection c, String uuid) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host_patch.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.toHostPatch(result);
+ }
+
+ /**
+ * Get all the host_patch instances with the given label.
+ *
+ * @param label label of object to return
+ * @return references to objects with matching names
+ */
+ public static Set getByNameLabel(Connection c, String label) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host_patch.get_by_name_label";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(label)};
+ Map response = c.dispatch(method_call, method_params);
+ Object result = response.get("Value");
+ return Types.toSetOfHostPatch(result);
+ }
+
+ /**
+ * Get the uuid field of the given host_patch.
+ *
+ * @return value of the field
+ */
+ public String getUuid(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host_patch.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 name/label field of the given host_patch.
+ *
+ * @return value of the field
+ */
+ public String getNameLabel(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host_patch.get_name_label";
+ 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 name/description field of the given host_patch.
+ *
+ * @return value of the field
+ */
+ public String getNameDescription(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host_patch.get_name_description";
+ 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 version field of the given host_patch.
+ *
+ * @return value of the field
+ */
+ public String getVersion(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host_patch.get_version";
+ 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 host field of the given host_patch.
+ *
+ * @return value of the field
+ */
+ public Host getHost(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host_patch.get_host";
+ 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.toHost(result);
+ }
+
+ /**
+ * Get the applied field of the given host_patch.
+ *
+ * @return value of the field
+ */
+ public Boolean getApplied(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host_patch.get_applied";
+ 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 timestamp_applied field of the given host_patch.
+ *
+ * @return value of the field
+ */
+ public Date getTimestampApplied(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host_patch.get_timestamp_applied";
+ 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);
+ }
+
+ /**
+ * Get the size field of the given host_patch.
+ *
+ * @return value of the field
+ */
+ public Long getSize(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host_patch.get_size";
+ 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.toLong(result);
+ }
+
+ /**
+ * Get the pool_patch field of the given host_patch.
+ *
+ * @return value of the field
+ */
+ public PoolPatch getPoolPatch(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host_patch.get_pool_patch";
+ 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.toPoolPatch(result);
+ }
+
+ /**
+ * Get the other_config field of the given host_patch.
+ *
+ * @return value of the field
+ */
+ public Map getOtherConfig(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host_patch.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 other_config field of the given host_patch.
+ *
+ * @param otherConfig New value to set
+ */
+ public void setOtherConfig(Connection c, Map otherConfig) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host_patch.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 host_patch.
+ *
+ * @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 = "host_patch.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 host_patch. 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 = "host_patch.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;
+ }
+
+ /**
+ * Destroy the specified host patch, removing it from the disk. This does NOT reverse the patch
+ * @deprecated
+ *
+ * @return Task
+ */
+ @Deprecated public Task destroyAsync(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "Async.host_patch.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 the specified host patch, removing it from the disk. This does NOT reverse the patch
+ * @deprecated
+ *
+ */
+ @Deprecated public void destroy(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host_patch.destroy";
+ String session = c.getSessionReference();
+ Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
+ Map response = c.dispatch(method_call, method_params);
+ return;
+ }
+
+ /**
+ * Apply the selected patch and return its output
+ * @deprecated
+ *
+ * @return Task
+ */
+ @Deprecated public Task applyAsync(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "Async.host_patch.apply";
+ 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);
+ }
+
+ /**
+ * Apply the selected patch and return its output
+ * @deprecated
+ *
+ * @return the output of the patch application process
+ */
+ @Deprecated public String apply(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host_patch.apply";
+ 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);
+ }
+
+ /**
+ * Return a list of all the host_patchs known to the system.
+ *
+ * @return references to all objects
+ */
+ public static Set getAll(Connection c) throws
+ BadServerResponse,
+ XenAPIException,
+ XmlRpcException {
+ String method_call = "host_patch.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.toSetOfHostPatch(result);
+ }
+
+ /**
+ * Return a map of host_patch references to host_patch records for all host_patchs known to the system.
+ *
+ * @return records of all objects
+ */
+ public static Map