Class Types

java.lang.Object
com.xensource.xenapi.Types

public class Types extends Object
This class holds enum types and exceptions.
  • Constructor Details

    • Types

      public Types()
  • Method Details

    • checkError

      public static void checkError(JsonRpcResponseError response) throws Types.XenAPIException, Types.BadServerResponse
      Checks the provided server response was successful. If the call failed, throws a XenAPIException. If the server returned an invalid response, throws a BadServerResponse. Otherwise, returns the server response as passed in.
      Throws:
      Types.XenAPIException
      Types.BadServerResponse
    • toBond

      public static Bond toBond(Task task, Connection connection) throws IOException
      Attempt to convert the Task's result to a Bond object. Will return null if the method cannot fetch a valid value from the Task object.
      Parameters:
      task - The task from which to fetch the result.
      connection - The connection
      Returns:
      the instantiated object if a valid value was found, null otherwise.
      Throws:
      Types.BadServerResponse - if the response from the server contains an invalid status.
      Types.XenAPIException - if the call failed.
      IOException - if an error occurs during send or receive. This includes cases where a payload is invalid JSON.
    • toCertificate

      public static Certificate toCertificate(Task task, Connection connection) throws IOException
      Attempt to convert the Task's result to a Certificate object. Will return null if the method cannot fetch a valid value from the Task object.
      Parameters:
      task - The task from which to fetch the result.
      connection - The connection
      Returns:
      the instantiated object if a valid value was found, null otherwise.
      Throws:
      Types.BadServerResponse - if the response from the server contains an invalid status.
      Types.XenAPIException - if the call failed.
      IOException - if an error occurs during send or receive. This includes cases where a payload is invalid JSON.
    • toCluster

      public static Cluster toCluster(Task task, Connection connection) throws IOException
      Attempt to convert the Task's result to a Cluster object. Will return null if the method cannot fetch a valid value from the Task object.
      Parameters:
      task - The task from which to fetch the result.
      connection - The connection
      Returns:
      the instantiated object if a valid value was found, null otherwise.
      Throws:
      Types.BadServerResponse - if the response from the server contains an invalid status.
      Types.XenAPIException - if the call failed.
      IOException - if an error occurs during send or receive. This includes cases where a payload is invalid JSON.
    • toClusterHost

      public static ClusterHost toClusterHost(Task task, Connection connection) throws IOException
      Attempt to convert the Task's result to a ClusterHost object. Will return null if the method cannot fetch a valid value from the Task object.
      Parameters:
      task - The task from which to fetch the result.
      connection - The connection
      Returns:
      the instantiated object if a valid value was found, null otherwise.
      Throws:
      Types.BadServerResponse - if the response from the server contains an invalid status.
      Types.XenAPIException - if the call failed.
      IOException - if an error occurs during send or receive. This includes cases where a payload is invalid JSON.
    • toDRTask

      public static DRTask toDRTask(Task task, Connection connection) throws IOException
      Attempt to convert the Task's result to a DRTask object. Will return null if the method cannot fetch a valid value from the Task object.
      Parameters:
      task - The task from which to fetch the result.
      connection - The connection
      Returns:
      the instantiated object if a valid value was found, null otherwise.
      Throws:
      Types.BadServerResponse - if the response from the server contains an invalid status.
      Types.XenAPIException - if the call failed.
      IOException - if an error occurs during send or receive. This includes cases where a payload is invalid JSON.
    • toDriverVariant

      public static DriverVariant toDriverVariant(Task task, Connection connection) throws IOException
      Attempt to convert the Task's result to a DriverVariant object. Will return null if the method cannot fetch a valid value from the Task object.
      Parameters:
      task - The task from which to fetch the result.
      connection - The connection
      Returns:
      the instantiated object if a valid value was found, null otherwise.
      Throws:
      Types.BadServerResponse - if the response from the server contains an invalid status.
      Types.XenAPIException - if the call failed.
      IOException - if an error occurs during send or receive. This includes cases where a payload is invalid JSON.
    • toFeature

      public static Feature toFeature(Task task, Connection connection) throws IOException
      Attempt to convert the Task's result to a Feature object. Will return null if the method cannot fetch a valid value from the Task object.
      Parameters:
      task - The task from which to fetch the result.
      connection - The connection
      Returns:
      the instantiated object if a valid value was found, null otherwise.
      Throws:
      Types.BadServerResponse - if the response from the server contains an invalid status.
      Types.XenAPIException - if the call failed.
      IOException - if an error occurs during send or receive. This includes cases where a payload is invalid JSON.
    • toGPUGroup

      public static GPUGroup toGPUGroup(Task task, Connection connection) throws IOException
      Attempt to convert the Task's result to a GPUGroup object. Will return null if the method cannot fetch a valid value from the Task object.
      Parameters:
      task - The task from which to fetch the result.
      connection - The connection
      Returns:
      the instantiated object if a valid value was found, null otherwise.
      Throws:
      Types.BadServerResponse - if the response from the server contains an invalid status.
      Types.XenAPIException - if the call failed.
      IOException - if an error occurs during send or receive. This includes cases where a payload is invalid JSON.
    • toHostDriver

      public static HostDriver toHostDriver(Task task, Connection connection) throws IOException
      Attempt to convert the Task's result to a HostDriver object. Will return null if the method cannot fetch a valid value from the Task object.
      Parameters:
      task - The task from which to fetch the result.
      connection - The connection
      Returns:
      the instantiated object if a valid value was found, null otherwise.
      Throws:
      Types.BadServerResponse - if the response from the server contains an invalid status.
      Types.XenAPIException - if the call failed.
      IOException - if an error occurs during send or receive. This includes cases where a payload is invalid JSON.
    • toLVHD

      public static LVHD toLVHD(Task task, Connection connection) throws IOException
      Attempt to convert the Task's result to a LVHD object. Will return null if the method cannot fetch a valid value from the Task object.
      Parameters:
      task - The task from which to fetch the result.
      connection - The connection
      Returns:
      the instantiated object if a valid value was found, null otherwise.
      Throws:
      Types.BadServerResponse - if the response from the server contains an invalid status.
      Types.XenAPIException - if the call failed.
      IOException - if an error occurs during send or receive. This includes cases where a payload is invalid JSON.
    • toObserver

      public static Observer toObserver(Task task, Connection connection) throws IOException
      Attempt to convert the Task's result to a Observer object. Will return null if the method cannot fetch a valid value from the Task object.
      Parameters:
      task - The task from which to fetch the result.
      connection - The connection
      Returns:
      the instantiated object if a valid value was found, null otherwise.
      Throws:
      Types.BadServerResponse - if the response from the server contains an invalid status.
      Types.XenAPIException - if the call failed.
      IOException - if an error occurs during send or receive. This includes cases where a payload is invalid JSON.
    • toPBD

      public static PBD toPBD(Task task, Connection connection) throws IOException
      Attempt to convert the Task's result to a PBD object. Will return null if the method cannot fetch a valid value from the Task object.
      Parameters:
      task - The task from which to fetch the result.
      connection - The connection
      Returns:
      the instantiated object if a valid value was found, null otherwise.
      Throws:
      Types.BadServerResponse - if the response from the server contains an invalid status.
      Types.XenAPIException - if the call failed.
      IOException - if an error occurs during send or receive. This includes cases where a payload is invalid JSON.
    • toPCI

      public static PCI toPCI(Task task, Connection connection) throws IOException
      Attempt to convert the Task's result to a PCI object. Will return null if the method cannot fetch a valid value from the Task object.
      Parameters:
      task - The task from which to fetch the result.
      connection - The connection
      Returns:
      the instantiated object if a valid value was found, null otherwise.
      Throws:
      Types.BadServerResponse - if the response from the server contains an invalid status.
      Types.XenAPIException - if the call failed.
      IOException - if an error occurs during send or receive. This includes cases where a payload is invalid JSON.
    • toPGPU

      public static PGPU toPGPU(Task task, Connection connection) throws IOException
      Attempt to convert the Task's result to a PGPU object. Will return null if the method cannot fetch a valid value from the Task object.
      Parameters:
      task - The task from which to fetch the result.
      connection - The connection
      Returns:
      the instantiated object if a valid value was found, null otherwise.
      Throws:
      Types.BadServerResponse - if the response from the server contains an invalid status.
      Types.XenAPIException - if the call failed.
      IOException - if an error occurs during send or receive. This includes cases where a payload is invalid JSON.
    • toPIF

      public static PIF toPIF(Task task, Connection connection) throws IOException
      Attempt to convert the Task's result to a PIF object. Will return null if the method cannot fetch a valid value from the Task object.
      Parameters:
      task - The task from which to fetch the result.
      connection - The connection
      Returns:
      the instantiated object if a valid value was found, null otherwise.
      Throws:
      Types.BadServerResponse - if the response from the server contains an invalid status.
      Types.XenAPIException - if the call failed.
      IOException - if an error occurs during send or receive. This includes cases where a payload is invalid JSON.
    • toPIFMetrics

      public static PIFMetrics toPIFMetrics(Task task, Connection connection) throws IOException
      Attempt to convert the Task's result to a PIFMetrics object. Will return null if the method cannot fetch a valid value from the Task object.
      Parameters:
      task - The task from which to fetch the result.
      connection - The connection
      Returns:
      the instantiated object if a valid value was found, null otherwise.
      Throws:
      Types.BadServerResponse - if the response from the server contains an invalid status.
      Types.XenAPIException - if the call failed.
      IOException - if an error occurs during send or receive. This includes cases where a payload is invalid JSON.
    • toPUSB

      public static PUSB toPUSB(Task task, Connection connection) throws IOException
      Attempt to convert the Task's result to a PUSB object. Will return null if the method cannot fetch a valid value from the Task object.
      Parameters:
      task - The task from which to fetch the result.
      connection - The connection
      Returns:
      the instantiated object if a valid value was found, null otherwise.
      Throws:
      Types.BadServerResponse - if the response from the server contains an invalid status.
      Types.XenAPIException - if the call failed.
      IOException - if an error occurs during send or receive. This includes cases where a payload is invalid JSON.
    • toPVSCacheStorage

      public static PVSCacheStorage toPVSCacheStorage(Task task, Connection connection) throws IOException
      Attempt to convert the Task's result to a PVSCacheStorage object. Will return null if the method cannot fetch a valid value from the Task object.
      Parameters:
      task - The task from which to fetch the result.
      connection - The connection
      Returns:
      the instantiated object if a valid value was found, null otherwise.
      Throws:
      Types.BadServerResponse - if the response from the server contains an invalid status.
      Types.XenAPIException - if the call failed.
      IOException - if an error occurs during send or receive. This includes cases where a payload is invalid JSON.
    • toPVSProxy

      public static PVSProxy toPVSProxy(Task task, Connection connection) throws IOException
      Attempt to convert the Task's result to a PVSProxy object. Will return null if the method cannot fetch a valid value from the Task object.
      Parameters:
      task - The task from which to fetch the result.
      connection - The connection
      Returns:
      the instantiated object if a valid value was found, null otherwise.
      Throws:
      Types.BadServerResponse - if the response from the server contains an invalid status.
      Types.XenAPIException - if the call failed.
      IOException - if an error occurs during send or receive. This includes cases where a payload is invalid JSON.
    • toPVSServer

      public static PVSServer toPVSServer(Task task, Connection connection) throws IOException
      Attempt to convert the Task's result to a PVSServer object. Will return null if the method cannot fetch a valid value from the Task object.
      Parameters:
      task - The task from which to fetch the result.
      connection - The connection
      Returns:
      the instantiated object if a valid value was found, null otherwise.
      Throws:
      Types.BadServerResponse - if the response from the server contains an invalid status.
      Types.XenAPIException - if the call failed.
      IOException - if an error occurs during send or receive. This includes cases where a payload is invalid JSON.
    • toPVSSite

      public static PVSSite toPVSSite(Task task, Connection connection) throws IOException
      Attempt to convert the Task's result to a PVSSite object. Will return null if the method cannot fetch a valid value from the Task object.
      Parameters:
      task - The task from which to fetch the result.
      connection - The connection
      Returns:
      the instantiated object if a valid value was found, null otherwise.
      Throws:
      Types.BadServerResponse - if the response from the server contains an invalid status.
      Types.XenAPIException - if the call failed.
      IOException - if an error occurs during send or receive. This includes cases where a payload is invalid JSON.
    • toRepository

      public static Repository toRepository(Task task, Connection connection) throws IOException
      Attempt to convert the Task's result to a Repository object. Will return null if the method cannot fetch a valid value from the Task object.
      Parameters:
      task - The task from which to fetch the result.
      connection - The connection
      Returns:
      the instantiated object if a valid value was found, null otherwise.
      Throws:
      Types.BadServerResponse - if the response from the server contains an invalid status.
      Types.XenAPIException - if the call failed.
      IOException - if an error occurs during send or receive. This includes cases where a payload is invalid JSON.
    • toSDNController

      public static SDNController toSDNController(Task task, Connection connection) throws IOException
      Attempt to convert the Task's result to a SDNController object. Will return null if the method cannot fetch a valid value from the Task object.
      Parameters:
      task - The task from which to fetch the result.
      connection - The connection
      Returns:
      the instantiated object if a valid value was found, null otherwise.
      Throws:
      Types.BadServerResponse - if the response from the server contains an invalid status.
      Types.XenAPIException - if the call failed.
      IOException - if an error occurs during send or receive. This includes cases where a payload is invalid JSON.
    • toSM

      public static SM toSM(Task task, Connection connection) throws IOException
      Attempt to convert the Task's result to a SM object. Will return null if the method cannot fetch a valid value from the Task object.
      Parameters:
      task - The task from which to fetch the result.
      connection - The connection
      Returns:
      the instantiated object if a valid value was found, null otherwise.
      Throws:
      Types.BadServerResponse - if the response from the server contains an invalid status.
      Types.XenAPIException - if the call failed.
      IOException - if an error occurs during send or receive. This includes cases where a payload is invalid JSON.
    • toSR

      public static SR toSR(Task task, Connection connection) throws IOException
      Attempt to convert the Task's result to a SR object. Will return null if the method cannot fetch a valid value from the Task object.
      Parameters:
      task - The task from which to fetch the result.
      connection - The connection
      Returns:
      the instantiated object if a valid value was found, null otherwise.
      Throws:
      Types.BadServerResponse - if the response from the server contains an invalid status.
      Types.XenAPIException - if the call failed.
      IOException - if an error occurs during send or receive. This includes cases where a payload is invalid JSON.
    • toUSBGroup

      public static USBGroup toUSBGroup(Task task, Connection connection) throws IOException
      Attempt to convert the Task's result to a USBGroup object. Will return null if the method cannot fetch a valid value from the Task object.
      Parameters:
      task - The task from which to fetch the result.
      connection - The connection
      Returns:
      the instantiated object if a valid value was found, null otherwise.
      Throws:
      Types.BadServerResponse - if the response from the server contains an invalid status.
      Types.XenAPIException - if the call failed.
      IOException - if an error occurs during send or receive. This includes cases where a payload is invalid JSON.
    • toVBD

      public static VBD toVBD(Task task, Connection connection) throws IOException
      Attempt to convert the Task's result to a VBD object. Will return null if the method cannot fetch a valid value from the Task object.
      Parameters:
      task - The task from which to fetch the result.
      connection - The connection
      Returns:
      the instantiated object if a valid value was found, null otherwise.
      Throws:
      Types.BadServerResponse - if the response from the server contains an invalid status.
      Types.XenAPIException - if the call failed.
      IOException - if an error occurs during send or receive. This includes cases where a payload is invalid JSON.
    • toVBDMetrics

      public static VBDMetrics toVBDMetrics(Task task, Connection connection) throws IOException
      Attempt to convert the Task's result to a VBDMetrics object. Will return null if the method cannot fetch a valid value from the Task object.
      Parameters:
      task - The task from which to fetch the result.
      connection - The connection
      Returns:
      the instantiated object if a valid value was found, null otherwise.
      Throws:
      Types.BadServerResponse - if the response from the server contains an invalid status.
      Types.XenAPIException - if the call failed.
      IOException - if an error occurs during send or receive. This includes cases where a payload is invalid JSON.
    • toVDI

      public static VDI toVDI(Task task, Connection connection) throws IOException
      Attempt to convert the Task's result to a VDI object. Will return null if the method cannot fetch a valid value from the Task object.
      Parameters:
      task - The task from which to fetch the result.
      connection - The connection
      Returns:
      the instantiated object if a valid value was found, null otherwise.
      Throws:
      Types.BadServerResponse - if the response from the server contains an invalid status.
      Types.XenAPIException - if the call failed.
      IOException - if an error occurs during send or receive. This includes cases where a payload is invalid JSON.
    • toVGPU

      public static VGPU toVGPU(Task task, Connection connection) throws IOException
      Attempt to convert the Task's result to a VGPU object. Will return null if the method cannot fetch a valid value from the Task object.
      Parameters:
      task - The task from which to fetch the result.
      connection - The connection
      Returns:
      the instantiated object if a valid value was found, null otherwise.
      Throws:
      Types.BadServerResponse - if the response from the server contains an invalid status.
      Types.XenAPIException - if the call failed.
      IOException - if an error occurs during send or receive. This includes cases where a payload is invalid JSON.
    • toVGPUType

      public static VGPUType toVGPUType(Task task, Connection connection) throws IOException
      Attempt to convert the Task's result to a VGPUType object. Will return null if the method cannot fetch a valid value from the Task object.
      Parameters:
      task - The task from which to fetch the result.
      connection - The connection
      Returns:
      the instantiated object if a valid value was found, null otherwise.
      Throws:
      Types.BadServerResponse - if the response from the server contains an invalid status.
      Types.XenAPIException - if the call failed.
      IOException - if an error occurs during send or receive. This includes cases where a payload is invalid JSON.
    • toVIF

      public static VIF toVIF(Task task, Connection connection) throws IOException
      Attempt to convert the Task's result to a VIF object. Will return null if the method cannot fetch a valid value from the Task object.
      Parameters:
      task - The task from which to fetch the result.
      connection - The connection
      Returns:
      the instantiated object if a valid value was found, null otherwise.
      Throws:
      Types.BadServerResponse - if the response from the server contains an invalid status.
      Types.XenAPIException - if the call failed.
      IOException - if an error occurs during send or receive. This includes cases where a payload is invalid JSON.
    • toVIFMetrics

      public static VIFMetrics toVIFMetrics(Task task, Connection connection) throws IOException
      Attempt to convert the Task's result to a VIFMetrics object. Will return null if the method cannot fetch a valid value from the Task object.
      Parameters:
      task - The task from which to fetch the result.
      connection - The connection
      Returns:
      the instantiated object if a valid value was found, null otherwise.
      Throws:
      Types.BadServerResponse - if the response from the server contains an invalid status.
      Types.XenAPIException - if the call failed.
      IOException - if an error occurs during send or receive. This includes cases where a payload is invalid JSON.
    • toVLAN

      public static VLAN toVLAN(Task task, Connection connection) throws IOException
      Attempt to convert the Task's result to a VLAN object. Will return null if the method cannot fetch a valid value from the Task object.
      Parameters:
      task - The task from which to fetch the result.
      connection - The connection
      Returns:
      the instantiated object if a valid value was found, null otherwise.
      Throws:
      Types.BadServerResponse - if the response from the server contains an invalid status.
      Types.XenAPIException - if the call failed.
      IOException - if an error occurs during send or receive. This includes cases where a payload is invalid JSON.
    • toVM

      public static VM toVM(Task task, Connection connection) throws IOException
      Attempt to convert the Task's result to a VM object. Will return null if the method cannot fetch a valid value from the Task object.
      Parameters:
      task - The task from which to fetch the result.
      connection - The connection
      Returns:
      the instantiated object if a valid value was found, null otherwise.
      Throws:
      Types.BadServerResponse - if the response from the server contains an invalid status.
      Types.XenAPIException - if the call failed.
      IOException - if an error occurs during send or receive. This includes cases where a payload is invalid JSON.
    • toVMPP

      public static VMPP toVMPP(Task task, Connection connection) throws IOException
      Attempt to convert the Task's result to a VMPP object. Will return null if the method cannot fetch a valid value from the Task object.
      Parameters:
      task - The task from which to fetch the result.
      connection - The connection
      Returns:
      the instantiated object if a valid value was found, null otherwise.
      Throws:
      Types.BadServerResponse - if the response from the server contains an invalid status.
      Types.XenAPIException - if the call failed.
      IOException - if an error occurs during send or receive. This includes cases where a payload is invalid JSON.
    • toVMSS

      public static VMSS toVMSS(Task task, Connection connection) throws IOException
      Attempt to convert the Task's result to a VMSS object. Will return null if the method cannot fetch a valid value from the Task object.
      Parameters:
      task - The task from which to fetch the result.
      connection - The connection
      Returns:
      the instantiated object if a valid value was found, null otherwise.
      Throws:
      Types.BadServerResponse - if the response from the server contains an invalid status.
      Types.XenAPIException - if the call failed.
      IOException - if an error occurs during send or receive. This includes cases where a payload is invalid JSON.
    • toVMAppliance

      public static VMAppliance toVMAppliance(Task task, Connection connection) throws IOException
      Attempt to convert the Task's result to a VMAppliance object. Will return null if the method cannot fetch a valid value from the Task object.
      Parameters:
      task - The task from which to fetch the result.
      connection - The connection
      Returns:
      the instantiated object if a valid value was found, null otherwise.
      Throws:
      Types.BadServerResponse - if the response from the server contains an invalid status.
      Types.XenAPIException - if the call failed.
      IOException - if an error occurs during send or receive. This includes cases where a payload is invalid JSON.
    • toVMGroup

      public static VMGroup toVMGroup(Task task, Connection connection) throws IOException
      Attempt to convert the Task's result to a VMGroup object. Will return null if the method cannot fetch a valid value from the Task object.
      Parameters:
      task - The task from which to fetch the result.
      connection - The connection
      Returns:
      the instantiated object if a valid value was found, null otherwise.
      Throws:
      Types.BadServerResponse - if the response from the server contains an invalid status.
      Types.XenAPIException - if the call failed.
      IOException - if an error occurs during send or receive. This includes cases where a payload is invalid JSON.
    • toVMGuestMetrics

      public static VMGuestMetrics toVMGuestMetrics(Task task, Connection connection) throws IOException
      Attempt to convert the Task's result to a VMGuestMetrics object. Will return null if the method cannot fetch a valid value from the Task object.
      Parameters:
      task - The task from which to fetch the result.
      connection - The connection
      Returns:
      the instantiated object if a valid value was found, null otherwise.
      Throws:
      Types.BadServerResponse - if the response from the server contains an invalid status.
      Types.XenAPIException - if the call failed.
      IOException - if an error occurs during send or receive. This includes cases where a payload is invalid JSON.
    • toVMMetrics

      public static VMMetrics toVMMetrics(Task task, Connection connection) throws IOException
      Attempt to convert the Task's result to a VMMetrics object. Will return null if the method cannot fetch a valid value from the Task object.
      Parameters:
      task - The task from which to fetch the result.
      connection - The connection
      Returns:
      the instantiated object if a valid value was found, null otherwise.
      Throws:
      Types.BadServerResponse - if the response from the server contains an invalid status.
      Types.XenAPIException - if the call failed.
      IOException - if an error occurs during send or receive. This includes cases where a payload is invalid JSON.
    • toVTPM

      public static VTPM toVTPM(Task task, Connection connection) throws IOException
      Attempt to convert the Task's result to a VTPM object. Will return null if the method cannot fetch a valid value from the Task object.
      Parameters:
      task - The task from which to fetch the result.
      connection - The connection
      Returns:
      the instantiated object if a valid value was found, null otherwise.
      Throws:
      Types.BadServerResponse - if the response from the server contains an invalid status.
      Types.XenAPIException - if the call failed.
      IOException - if an error occurs during send or receive. This includes cases where a payload is invalid JSON.
    • toVUSB

      public static VUSB toVUSB(Task task, Connection connection) throws IOException
      Attempt to convert the Task's result to a VUSB object. Will return null if the method cannot fetch a valid value from the Task object.
      Parameters:
      task - The task from which to fetch the result.
      connection - The connection
      Returns:
      the instantiated object if a valid value was found, null otherwise.
      Throws:
      Types.BadServerResponse - if the response from the server contains an invalid status.
      Types.XenAPIException - if the call failed.
      IOException - if an error occurs during send or receive. This includes cases where a payload is invalid JSON.
    • toBlob

      public static Blob toBlob(Task task, Connection connection) throws IOException
      Attempt to convert the Task's result to a Blob object. Will return null if the method cannot fetch a valid value from the Task object.
      Parameters:
      task - The task from which to fetch the result.
      connection - The connection
      Returns:
      the instantiated object if a valid value was found, null otherwise.
      Throws:
      Types.BadServerResponse - if the response from the server contains an invalid status.
      Types.XenAPIException - if the call failed.
      IOException - if an error occurs during send or receive. This includes cases where a payload is invalid JSON.
    • toConsole

      public static Console toConsole(Task task, Connection connection) throws IOException
      Attempt to convert the Task's result to a Console object. Will return null if the method cannot fetch a valid value from the Task object.
      Parameters:
      task - The task from which to fetch the result.
      connection - The connection
      Returns:
      the instantiated object if a valid value was found, null otherwise.
      Throws:
      Types.BadServerResponse - if the response from the server contains an invalid status.
      Types.XenAPIException - if the call failed.
      IOException - if an error occurs during send or receive. This includes cases where a payload is invalid JSON.
    • toCrashdump

      public static Crashdump toCrashdump(Task task, Connection connection) throws IOException
      Attempt to convert the Task's result to a Crashdump object. Will return null if the method cannot fetch a valid value from the Task object.
      Parameters:
      task - The task from which to fetch the result.
      connection - The connection
      Returns:
      the instantiated object if a valid value was found, null otherwise.
      Throws:
      Types.BadServerResponse - if the response from the server contains an invalid status.
      Types.XenAPIException - if the call failed.
      IOException - if an error occurs during send or receive. This includes cases where a payload is invalid JSON.
    • toHost

      public static Host toHost(Task task, Connection connection) throws IOException
      Attempt to convert the Task's result to a Host object. Will return null if the method cannot fetch a valid value from the Task object.
      Parameters:
      task - The task from which to fetch the result.
      connection - The connection
      Returns:
      the instantiated object if a valid value was found, null otherwise.
      Throws:
      Types.BadServerResponse - if the response from the server contains an invalid status.
      Types.XenAPIException - if the call failed.
      IOException - if an error occurs during send or receive. This includes cases where a payload is invalid JSON.
    • toHostCpu

      public static HostCpu toHostCpu(Task task, Connection connection) throws IOException
      Attempt to convert the Task's result to a HostCpu object. Will return null if the method cannot fetch a valid value from the Task object.
      Parameters:
      task - The task from which to fetch the result.
      connection - The connection
      Returns:
      the instantiated object if a valid value was found, null otherwise.
      Throws:
      Types.BadServerResponse - if the response from the server contains an invalid status.
      Types.XenAPIException - if the call failed.
      IOException - if an error occurs during send or receive. This includes cases where a payload is invalid JSON.
    • toHostCrashdump

      public static HostCrashdump toHostCrashdump(Task task, Connection connection) throws IOException
      Attempt to convert the Task's result to a HostCrashdump object. Will return null if the method cannot fetch a valid value from the Task object.
      Parameters:
      task - The task from which to fetch the result.
      connection - The connection
      Returns:
      the instantiated object if a valid value was found, null otherwise.
      Throws:
      Types.BadServerResponse - if the response from the server contains an invalid status.
      Types.XenAPIException - if the call failed.
      IOException - if an error occurs during send or receive. This includes cases where a payload is invalid JSON.
    • toHostMetrics

      public static HostMetrics toHostMetrics(Task task, Connection connection) throws IOException
      Attempt to convert the Task's result to a HostMetrics object. Will return null if the method cannot fetch a valid value from the Task object.
      Parameters:
      task - The task from which to fetch the result.
      connection - The connection
      Returns:
      the instantiated object if a valid value was found, null otherwise.
      Throws:
      Types.BadServerResponse - if the response from the server contains an invalid status.
      Types.XenAPIException - if the call failed.
      IOException - if an error occurs during send or receive. This includes cases where a payload is invalid JSON.
    • toHostPatch

      public static HostPatch toHostPatch(Task task, Connection connection) throws IOException
      Attempt to convert the Task's result to a HostPatch object. Will return null if the method cannot fetch a valid value from the Task object.
      Parameters:
      task - The task from which to fetch the result.
      connection - The connection
      Returns:
      the instantiated object if a valid value was found, null otherwise.
      Throws:
      Types.BadServerResponse - if the response from the server contains an invalid status.
      Types.XenAPIException - if the call failed.
      IOException - if an error occurs during send or receive. This includes cases where a payload is invalid JSON.
    • toMessage

      public static Message toMessage(Task task, Connection connection) throws IOException
      Attempt to convert the Task's result to a Message object. Will return null if the method cannot fetch a valid value from the Task object.
      Parameters:
      task - The task from which to fetch the result.
      connection - The connection
      Returns:
      the instantiated object if a valid value was found, null otherwise.
      Throws:
      Types.BadServerResponse - if the response from the server contains an invalid status.
      Types.XenAPIException - if the call failed.
      IOException - if an error occurs during send or receive. This includes cases where a payload is invalid JSON.
    • toNetwork

      public static Network toNetwork(Task task, Connection connection) throws IOException
      Attempt to convert the Task's result to a Network object. Will return null if the method cannot fetch a valid value from the Task object.
      Parameters:
      task - The task from which to fetch the result.
      connection - The connection
      Returns:
      the instantiated object if a valid value was found, null otherwise.
      Throws:
      Types.BadServerResponse - if the response from the server contains an invalid status.
      Types.XenAPIException - if the call failed.
      IOException - if an error occurs during send or receive. This includes cases where a payload is invalid JSON.
    • toNetworkSriov

      public static NetworkSriov toNetworkSriov(Task task, Connection connection) throws IOException
      Attempt to convert the Task's result to a NetworkSriov object. Will return null if the method cannot fetch a valid value from the Task object.
      Parameters:
      task - The task from which to fetch the result.
      connection - The connection
      Returns:
      the instantiated object if a valid value was found, null otherwise.
      Throws:
      Types.BadServerResponse - if the response from the server contains an invalid status.
      Types.XenAPIException - if the call failed.
      IOException - if an error occurs during send or receive. This includes cases where a payload is invalid JSON.
    • toPool

      public static Pool toPool(Task task, Connection connection) throws IOException
      Attempt to convert the Task's result to a Pool object. Will return null if the method cannot fetch a valid value from the Task object.
      Parameters:
      task - The task from which to fetch the result.
      connection - The connection
      Returns:
      the instantiated object if a valid value was found, null otherwise.
      Throws:
      Types.BadServerResponse - if the response from the server contains an invalid status.
      Types.XenAPIException - if the call failed.
      IOException - if an error occurs during send or receive. This includes cases where a payload is invalid JSON.
    • toPoolPatch

      public static PoolPatch toPoolPatch(Task task, Connection connection) throws IOException
      Attempt to convert the Task's result to a PoolPatch object. Will return null if the method cannot fetch a valid value from the Task object.
      Parameters:
      task - The task from which to fetch the result.
      connection - The connection
      Returns:
      the instantiated object if a valid value was found, null otherwise.
      Throws:
      Types.BadServerResponse - if the response from the server contains an invalid status.
      Types.XenAPIException - if the call failed.
      IOException - if an error occurs during send or receive. This includes cases where a payload is invalid JSON.
    • toPoolUpdate

      public static PoolUpdate toPoolUpdate(Task task, Connection connection) throws IOException
      Attempt to convert the Task's result to a PoolUpdate object. Will return null if the method cannot fetch a valid value from the Task object.
      Parameters:
      task - The task from which to fetch the result.
      connection - The connection
      Returns:
      the instantiated object if a valid value was found, null otherwise.
      Throws:
      Types.BadServerResponse - if the response from the server contains an invalid status.
      Types.XenAPIException - if the call failed.
      IOException - if an error occurs during send or receive. This includes cases where a payload is invalid JSON.
    • toRole

      public static Role toRole(Task task, Connection connection) throws IOException
      Attempt to convert the Task's result to a Role object. Will return null if the method cannot fetch a valid value from the Task object.
      Parameters:
      task - The task from which to fetch the result.
      connection - The connection
      Returns:
      the instantiated object if a valid value was found, null otherwise.
      Throws:
      Types.BadServerResponse - if the response from the server contains an invalid status.
      Types.XenAPIException - if the call failed.
      IOException - if an error occurs during send or receive. This includes cases where a payload is invalid JSON.
    • toSecret

      public static Secret toSecret(Task task, Connection connection) throws IOException
      Attempt to convert the Task's result to a Secret object. Will return null if the method cannot fetch a valid value from the Task object.
      Parameters:
      task - The task from which to fetch the result.
      connection - The connection
      Returns:
      the instantiated object if a valid value was found, null otherwise.
      Throws:
      Types.BadServerResponse - if the response from the server contains an invalid status.
      Types.XenAPIException - if the call failed.
      IOException - if an error occurs during send or receive. This includes cases where a payload is invalid JSON.
    • toSession

      public static Session toSession(Task task, Connection connection) throws IOException
      Attempt to convert the Task's result to a Session object. Will return null if the method cannot fetch a valid value from the Task object.
      Parameters:
      task - The task from which to fetch the result.
      connection - The connection
      Returns:
      the instantiated object if a valid value was found, null otherwise.
      Throws:
      Types.BadServerResponse - if the response from the server contains an invalid status.
      Types.XenAPIException - if the call failed.
      IOException - if an error occurs during send or receive. This includes cases where a payload is invalid JSON.
    • toSubject

      public static Subject toSubject(Task task, Connection connection) throws IOException
      Attempt to convert the Task's result to a Subject object. Will return null if the method cannot fetch a valid value from the Task object.
      Parameters:
      task - The task from which to fetch the result.
      connection - The connection
      Returns:
      the instantiated object if a valid value was found, null otherwise.
      Throws:
      Types.BadServerResponse - if the response from the server contains an invalid status.
      Types.XenAPIException - if the call failed.
      IOException - if an error occurs during send or receive. This includes cases where a payload is invalid JSON.
    • toTask

      public static Task toTask(Task task, Connection connection) throws IOException
      Attempt to convert the Task's result to a Task object. Will return null if the method cannot fetch a valid value from the Task object.
      Parameters:
      task - The task from which to fetch the result.
      connection - The connection
      Returns:
      the instantiated object if a valid value was found, null otherwise.
      Throws:
      Types.BadServerResponse - if the response from the server contains an invalid status.
      Types.XenAPIException - if the call failed.
      IOException - if an error occurs during send or receive. This includes cases where a payload is invalid JSON.
    • toTunnel

      public static Tunnel toTunnel(Task task, Connection connection) throws IOException
      Attempt to convert the Task's result to a Tunnel object. Will return null if the method cannot fetch a valid value from the Task object.
      Parameters:
      task - The task from which to fetch the result.
      connection - The connection
      Returns:
      the instantiated object if a valid value was found, null otherwise.
      Throws:
      Types.BadServerResponse - if the response from the server contains an invalid status.
      Types.XenAPIException - if the call failed.
      IOException - if an error occurs during send or receive. This includes cases where a payload is invalid JSON.
    • toUser

      public static User toUser(Task task, Connection connection) throws IOException
      Attempt to convert the Task's result to a User object. Will return null if the method cannot fetch a valid value from the Task object.
      Parameters:
      task - The task from which to fetch the result.
      connection - The connection
      Returns:
      the instantiated object if a valid value was found, null otherwise.
      Throws:
      Types.BadServerResponse - if the response from the server contains an invalid status.
      Types.XenAPIException - if the call failed.
      IOException - if an error occurs during send or receive. This includes cases where a payload is invalid JSON.