Package com.xensource.xenapi
Class Task
java.lang.Object
com.xensource.xenapi.XenAPIObject
com.xensource.xenapi.Task
A long-running asynchronous task
First published in XenServer 4.0.
- Author:
- Cloud Software Group, Inc.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoid
addToOtherConfig
(Connection c, String key, String value) Add the given key-value pair to the other_config field of the given task.void
cancel
(Connection c) Request that a task be cancelled.Request that a task be cancelled.static Task
create
(Connection c, String label, String description) Create a new task object which must be manually destroyed.void
Destroy the task object Minimum allowed role: read-only First published in XenServer 4.0.boolean
If obj is a Task, compares XenAPI references for equality.getAll
(Connection c) Return a list of all the tasks known to the system.Get the allowed_operations field of the given task.static Map<Task,
Task.Record> Return a map of task references to task records for all tasks known to the system.Get the backtrace field of the given task.getByNameLabel
(Connection c, String label) Get all the task instances with the given label.static Task
getByUuid
(Connection c, String uuid) Get a reference to the task instance with the specified UUID.Get the created field of the given task.Get the current_operations field of the given task.Get the error_info field of the given task.Get the finished field of the given task.Get the name/description field of the given task.Get the name/label field of the given task.Get the other_config field of the given task.Get the progress field of the given task.Get a record containing the current state of the given task.Get the resident_on field of the given task.Get the result field of the given task.Get the status field of the given task.Get the subtask_of field of the given task.Get the subtasks field of the given task.Get the type field of the given task.Get the uuid field of the given task.int
hashCode()
void
removeFromOtherConfig
(Connection c, String key) Remove the given key and its corresponding value from the other_config field of the given task.void
setErrorInfo
(Connection c, Set<String> value) Set the task error info Minimum allowed role: read-only First published in 21.3.0.void
setOtherConfig
(Connection c, Map<String, String> otherConfig) Set the other_config field of the given task.void
setProgress
(Connection c, Double value) Set the task progress Minimum allowed role: read-only First published in Citrix Hypervisor 8.2.void
setResult
(Connection c, String value) Set the task result Minimum allowed role: read-only First published in 21.3.0.void
setStatus
(Connection c, Types.TaskStatusType value) Set the task status Minimum allowed role: read-only First published in XenServer 7.2.Methods inherited from class com.xensource.xenapi.XenAPIObject
isNull
-
Field Details
-
ref
The XenAPI reference (OpaqueRef) to this object.
-
-
Method Details
-
toWireString
- Specified by:
toWireString
in classXenAPIObject
- Returns:
- The XenAPI reference (OpaqueRef) to this object.
-
equals
If obj is a Task, compares XenAPI references for equality. -
hashCode
public int hashCode() -
getRecord
public Task.Record getRecord(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException Get a record containing the current state of the given task. Minimum allowed role: read-only First published in XenServer 4.0.- Parameters:
c
- The connection the call is made on- Returns:
- all fields from the object
- Throws:
Types.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- Thrown if the call failed.org.apache.xmlrpc.XmlRpcException
- Thrown if the result of an asynchronous call could not be parsed.
-
getByUuid
public static Task getByUuid(Connection c, String uuid) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException Get a reference to the task instance with the specified UUID. Minimum allowed role: read-only First published in XenServer 4.0.- Parameters:
c
- The connection the call is made onuuid
- UUID of object to return- Returns:
- reference to the object
- Throws:
Types.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- Thrown if the call failed.org.apache.xmlrpc.XmlRpcException
- Thrown if the result of an asynchronous call could not be parsed.
-
getByNameLabel
public static Set<Task> getByNameLabel(Connection c, String label) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException Get all the task instances with the given label. Minimum allowed role: read-only First published in XenServer 4.0.- Parameters:
c
- The connection the call is made onlabel
- label of object to return- Returns:
- references to objects with matching names
- Throws:
Types.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- Thrown if the call failed.org.apache.xmlrpc.XmlRpcException
- Thrown if the result of an asynchronous call could not be parsed.
-
getUuid
public String getUuid(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException Get the uuid field of the given task. Minimum allowed role: read-only First published in XenServer 4.0.- Parameters:
c
- The connection the call is made on- Returns:
- value of the field
- Throws:
Types.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- Thrown if the call failed.org.apache.xmlrpc.XmlRpcException
- Thrown if the result of an asynchronous call could not be parsed.
-
getNameLabel
public String getNameLabel(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException Get the name/label field of the given task. Minimum allowed role: read-only First published in XenServer 4.0.- Parameters:
c
- The connection the call is made on- Returns:
- value of the field
- Throws:
Types.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- Thrown if the call failed.org.apache.xmlrpc.XmlRpcException
- Thrown if the result of an asynchronous call could not be parsed.
-
getNameDescription
public String getNameDescription(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException Get the name/description field of the given task. Minimum allowed role: read-only First published in XenServer 4.0.- Parameters:
c
- The connection the call is made on- Returns:
- value of the field
- Throws:
Types.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- Thrown if the call failed.org.apache.xmlrpc.XmlRpcException
- Thrown if the result of an asynchronous call could not be parsed.
-
getAllowedOperations
public Set<Types.TaskAllowedOperations> getAllowedOperations(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException Get the allowed_operations field of the given task. Minimum allowed role: read-only First published in XenServer 4.0.- Parameters:
c
- The connection the call is made on- Returns:
- value of the field
- Throws:
Types.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- Thrown if the call failed.org.apache.xmlrpc.XmlRpcException
- Thrown if the result of an asynchronous call could not be parsed.
-
getCurrentOperations
public Map<String,Types.TaskAllowedOperations> getCurrentOperations(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException Get the current_operations field of the given task. Minimum allowed role: read-only First published in XenServer 4.0.- Parameters:
c
- The connection the call is made on- Returns:
- value of the field
- Throws:
Types.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- Thrown if the call failed.org.apache.xmlrpc.XmlRpcException
- Thrown if the result of an asynchronous call could not be parsed.
-
getCreated
public Date getCreated(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException Get the created field of the given task. Minimum allowed role: read-only First published in XenServer 4.0.- Parameters:
c
- The connection the call is made on- Returns:
- value of the field
- Throws:
Types.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- Thrown if the call failed.org.apache.xmlrpc.XmlRpcException
- Thrown if the result of an asynchronous call could not be parsed.
-
getFinished
public Date getFinished(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException Get the finished field of the given task. Minimum allowed role: read-only First published in XenServer 4.0.- Parameters:
c
- The connection the call is made on- Returns:
- value of the field
- Throws:
Types.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- Thrown if the call failed.org.apache.xmlrpc.XmlRpcException
- Thrown if the result of an asynchronous call could not be parsed.
-
getStatus
public Types.TaskStatusType getStatus(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException Get the status field of the given task. Minimum allowed role: read-only First published in XenServer 4.0.- Parameters:
c
- The connection the call is made on- Returns:
- value of the field
- Throws:
Types.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- Thrown if the call failed.org.apache.xmlrpc.XmlRpcException
- Thrown if the result of an asynchronous call could not be parsed.
-
getResidentOn
public Host getResidentOn(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException Get the resident_on field of the given task. Minimum allowed role: read-only First published in XenServer 4.0.- Parameters:
c
- The connection the call is made on- Returns:
- value of the field
- Throws:
Types.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- Thrown if the call failed.org.apache.xmlrpc.XmlRpcException
- Thrown if the result of an asynchronous call could not be parsed.
-
getProgress
public Double getProgress(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException Get the progress field of the given task. Minimum allowed role: read-only First published in XenServer 4.0.- Parameters:
c
- The connection the call is made on- Returns:
- value of the field
- Throws:
Types.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- Thrown if the call failed.org.apache.xmlrpc.XmlRpcException
- Thrown if the result of an asynchronous call could not be parsed.
-
getType
public String getType(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException Get the type field of the given task. Minimum allowed role: read-only First published in XenServer 4.0.- Parameters:
c
- The connection the call is made on- Returns:
- value of the field
- Throws:
Types.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- Thrown if the call failed.org.apache.xmlrpc.XmlRpcException
- Thrown if the result of an asynchronous call could not be parsed.
-
getResult
public String getResult(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException Get the result field of the given task. Minimum allowed role: read-only First published in XenServer 4.0.- Parameters:
c
- The connection the call is made on- Returns:
- value of the field
- Throws:
Types.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- Thrown if the call failed.org.apache.xmlrpc.XmlRpcException
- Thrown if the result of an asynchronous call could not be parsed.
-
getErrorInfo
public Set<String> getErrorInfo(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException Get the error_info field of the given task. Minimum allowed role: read-only First published in XenServer 4.0.- Parameters:
c
- The connection the call is made on- Returns:
- value of the field
- Throws:
Types.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- Thrown if the call failed.org.apache.xmlrpc.XmlRpcException
- Thrown if the result of an asynchronous call could not be parsed.
-
getOtherConfig
public Map<String,String> getOtherConfig(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException Get the other_config field of the given task. Minimum allowed role: read-only First published in XenServer 4.1.- Parameters:
c
- The connection the call is made on- Returns:
- value of the field
- Throws:
Types.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- Thrown if the call failed.org.apache.xmlrpc.XmlRpcException
- Thrown if the result of an asynchronous call could not be parsed.
-
getSubtaskOf
public Task getSubtaskOf(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException Get the subtask_of field of the given task. Minimum allowed role: read-only First published in XenServer 5.0.- Parameters:
c
- The connection the call is made on- Returns:
- value of the field
- Throws:
Types.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- Thrown if the call failed.org.apache.xmlrpc.XmlRpcException
- Thrown if the result of an asynchronous call could not be parsed.
-
getSubtasks
public Set<Task> getSubtasks(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException Get the subtasks field of the given task. Minimum allowed role: read-only First published in XenServer 5.0.- Parameters:
c
- The connection the call is made on- Returns:
- value of the field
- Throws:
Types.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- Thrown if the call failed.org.apache.xmlrpc.XmlRpcException
- Thrown if the result of an asynchronous call could not be parsed.
-
getBacktrace
public String getBacktrace(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException Get the backtrace field of the given task. Minimum allowed role: read-only First published in XenServer 7.0.- Parameters:
c
- The connection the call is made on- Returns:
- value of the field
- Throws:
Types.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- Thrown if the call failed.org.apache.xmlrpc.XmlRpcException
- Thrown if the result of an asynchronous call could not be parsed.
-
setOtherConfig
public void setOtherConfig(Connection c, Map<String, String> otherConfig) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcExceptionSet the other_config field of the given task. Minimum allowed role: pool-operator First published in XenServer 4.1.- Parameters:
c
- The connection the call is made onotherConfig
- New value to set- Throws:
Types.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- Thrown if the call failed.org.apache.xmlrpc.XmlRpcException
- Thrown if the result of an asynchronous call could not be parsed.
-
addToOtherConfig
public void addToOtherConfig(Connection c, String key, String value) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException Add the given key-value pair to the other_config field of the given task. Minimum allowed role: pool-operator First published in XenServer 4.1.- Parameters:
c
- The connection the call is made onkey
- Key to addvalue
- Value to add- Throws:
Types.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- Thrown if the call failed.org.apache.xmlrpc.XmlRpcException
- Thrown if the result of an asynchronous call could not be parsed.
-
removeFromOtherConfig
public void removeFromOtherConfig(Connection c, String key) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException Remove the given key and its corresponding value from the other_config field of the given task. If the key is not in that Map, then do nothing. Minimum allowed role: pool-operator First published in XenServer 4.1.- Parameters:
c
- The connection the call is made onkey
- Key to remove- Throws:
Types.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- Thrown if the call failed.org.apache.xmlrpc.XmlRpcException
- Thrown if the result of an asynchronous call could not be parsed.
-
create
public static Task create(Connection c, String label, String description) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException Create a new task object which must be manually destroyed. Minimum allowed role: read-only First published in XenServer 4.0.- Parameters:
c
- The connection the call is made onlabel
- short label for the new taskdescription
- longer description for the new task- Returns:
- The reference of the created task object
- Throws:
Types.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- Thrown if the call failed.org.apache.xmlrpc.XmlRpcException
- Thrown if the result of an asynchronous call could not be parsed.
-
destroy
public void destroy(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException Destroy the task object Minimum allowed role: read-only First published in XenServer 4.0.- Parameters:
c
- The connection the call is made on- Throws:
Types.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- Thrown if the call failed.org.apache.xmlrpc.XmlRpcException
- Thrown if the result of an asynchronous call could not be parsed.
-
cancelAsync
public Task cancelAsync(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException, Types.OperationNotAllowed Request that a task be cancelled. Note that a task may fail to be cancelled and may complete or fail normally and note that, even when a task does cancel, it might take an arbitrary amount of time. Minimum allowed role: read-only First published in XenServer 4.0.- Parameters:
c
- The connection the call is made on- Returns:
- Task
- Throws:
Types.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- Thrown if the call failed.org.apache.xmlrpc.XmlRpcException
- Thrown if the result of an asynchronous call could not be parsed.Types.OperationNotAllowed
- You attempted an operation that was not allowed.
-
cancel
public void cancel(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException, Types.OperationNotAllowed Request that a task be cancelled. Note that a task may fail to be cancelled and may complete or fail normally and note that, even when a task does cancel, it might take an arbitrary amount of time. Minimum allowed role: read-only First published in XenServer 4.0.- Parameters:
c
- The connection the call is made on- Throws:
Types.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- Thrown if the call failed.org.apache.xmlrpc.XmlRpcException
- Thrown if the result of an asynchronous call could not be parsed.Types.OperationNotAllowed
- You attempted an operation that was not allowed.
-
setStatus
public void setStatus(Connection c, Types.TaskStatusType value) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException Set the task status Minimum allowed role: read-only First published in XenServer 7.2.- Parameters:
c
- The connection the call is made onvalue
- task status value to be set- Throws:
Types.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- Thrown if the call failed.org.apache.xmlrpc.XmlRpcException
- Thrown if the result of an asynchronous call could not be parsed.
-
setProgress
public void setProgress(Connection c, Double value) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException Set the task progress Minimum allowed role: read-only First published in Citrix Hypervisor 8.2.- Parameters:
c
- The connection the call is made onvalue
- Task progress value to be set- Throws:
Types.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- Thrown if the call failed.org.apache.xmlrpc.XmlRpcException
- Thrown if the result of an asynchronous call could not be parsed.
-
setResult
public void setResult(Connection c, String value) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException Set the task result Minimum allowed role: read-only First published in 21.3.0.- Parameters:
c
- The connection the call is made onvalue
- Task result to be set- Throws:
Types.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- Thrown if the call failed.org.apache.xmlrpc.XmlRpcException
- Thrown if the result of an asynchronous call could not be parsed.
-
setErrorInfo
public void setErrorInfo(Connection c, Set<String> value) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException Set the task error info Minimum allowed role: read-only First published in 21.3.0.- Parameters:
c
- The connection the call is made onvalue
- Task error info to be set- Throws:
Types.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- Thrown if the call failed.org.apache.xmlrpc.XmlRpcException
- Thrown if the result of an asynchronous call could not be parsed.
-
getAll
public static Set<Task> getAll(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException Return a list of all the tasks known to the system. Minimum allowed role: read-only First published in XenServer 4.0.- Parameters:
c
- The connection the call is made on- Returns:
- references to all objects
- Throws:
Types.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- Thrown if the call failed.org.apache.xmlrpc.XmlRpcException
- Thrown if the result of an asynchronous call could not be parsed.
-
getAllRecords
public static Map<Task,Task.Record> getAllRecords(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException Return a map of task references to task records for all tasks known to the system. Minimum allowed role: read-only First published in XenServer 4.0.- Parameters:
c
- The connection the call is made on- Returns:
- records of all objects
- Throws:
Types.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- Thrown if the call failed.org.apache.xmlrpc.XmlRpcException
- Thrown if the result of an asynchronous call could not be parsed.
-