Quals & Field & Type & Description \\
\hline
$\mathit{RO}_\mathit{run}$ & {\tt uuid} & string & unique identifier/object reference \\
-$\mathit{RW}$ & {\tt name/label} & string & a human-readable name \\
-$\mathit{RW}$ & {\tt name/description} & string & a notes field containg human-readable description \\
+$\mathit{RO}_\mathit{run}$ & {\tt name/label} & string & a human-readable name \\
+$\mathit{RO}_\mathit{run}$ & {\tt name/description} & string & a notes field containg human-readable description \\
$\mathit{RO}_\mathit{run}$ & {\tt status} & task\_status\_type & current status of the task \\
$\mathit{RO}_\mathit{run}$ & {\tt progress} & int & if the task is still pending, this field contains the estimated percentage complete (0-100). If task has completed (successfully or unsuccessfully) this should be 100. \\
-$\mathit{RO}_\mathit{run}$ & {\tt eta} & datetime & if the task is still pending, this field contains the estimated completion time. If the task has finished (successfully or not) it contains the time the task finished. \\
$\mathit{RO}_\mathit{run}$ & {\tt type} & string & if the task has completed successfully, this field contains the type of the encoded result (i.e. name of the class whose reference is in the result field). Undefined otherwise. \\
$\mathit{RO}_\mathit{run}$ & {\tt result} & string & if the task has completed successfully, this field contains the result value (either Void or an object reference). Undefined otherwise. \\
$\mathit{RO}_\mathit{run}$ & {\tt error\_code} & int & if the task has failed, this field contains the error code. Undefined otherwise. \\
value of the field
-\vspace{0.3cm}
-\vspace{0.3cm}
-\vspace{0.3cm}
-\subsubsection{RPC name:~set\_name\_label}
-
-{\bf Overview:}
-Set the name/label field of the given task.
-
- \noindent {\bf Signature:}
-\begin{verbatim} void set_name_label (session_id s, task ref self, string value)\end{verbatim}
-
-
-\noindent{\bf Arguments:}
-
-
-\vspace{0.3cm}
-\begin{tabular}{|c|c|p{7cm}|}
- \hline
-{\bf type} & {\bf name} & {\bf description} \\ \hline
-{\tt task ref } & self & reference to the object \\ \hline
-
-{\tt string } & value & New value to set \\ \hline
-
-\end{tabular}
-
-\vspace{0.3cm}
-
- \noindent {\bf Return Type:}
-{\tt
-void
-}
-
-
-
\vspace{0.3cm}
\vspace{0.3cm}
\vspace{0.3cm}
value of the field
-\vspace{0.3cm}
-\vspace{0.3cm}
-\vspace{0.3cm}
-\subsubsection{RPC name:~set\_name\_description}
-
-{\bf Overview:}
-Set the name/description field of the given task.
-
- \noindent {\bf Signature:}
-\begin{verbatim} void set_name_description (session_id s, task ref self, string value)\end{verbatim}
-
-
-\noindent{\bf Arguments:}
-
-
-\vspace{0.3cm}
-\begin{tabular}{|c|c|p{7cm}|}
- \hline
-{\bf type} & {\bf name} & {\bf description} \\ \hline
-{\tt task ref } & self & reference to the object \\ \hline
-
-{\tt string } & value & New value to set \\ \hline
-
-\end{tabular}
-
-\vspace{0.3cm}
-
- \noindent {\bf Return Type:}
-{\tt
-void
-}
-
-
-
\vspace{0.3cm}
\vspace{0.3cm}
\vspace{0.3cm}
}
-value of the field
-\vspace{0.3cm}
-\vspace{0.3cm}
-\vspace{0.3cm}
-\subsubsection{RPC name:~get\_eta}
-
-{\bf Overview:}
-Get the eta field of the given task.
-
- \noindent {\bf Signature:}
-\begin{verbatim} datetime get_eta (session_id s, task ref self)\end{verbatim}
-
-
-\noindent{\bf Arguments:}
-
-
-\vspace{0.3cm}
-\begin{tabular}{|c|c|p{7cm}|}
- \hline
-{\bf type} & {\bf name} & {\bf description} \\ \hline
-{\tt task ref } & self & reference to the object \\ \hline
-
-\end{tabular}
-
-\vspace{0.3cm}
-
- \noindent {\bf Return Type:}
-{\tt
-datetime
-}
-
-
value of the field
\vspace{0.3cm}
\vspace{0.3cm}
# Xen API: Class Tasks
# ----------------------------------------------------------------
- task_attr_ro = ['status',
+ task_attr_ro = ['name_label',
+ 'name_description',
+ 'status',
'progress',
- 'eta',
'type',
'result',
'error_code',
'error_info']
- task_attr_rw = ['name_label',
- 'name_description']
+ task_attr_rw = []
task_funcs = [('get_by_name_label', 'Set(task)')]
task = XendTaskManager.get_task(task_ref)
return xen_api_success(task.progress)
- def task_get_eta(self, session, task_ref):
- task = XendTaskManager.get_task(task_ref)
- return xen_api_success(task.eta)
-
def task_get_type(self, session, task_ref):
task = XendTaskManager.get_task(task_ref)
return xen_api_success(task.type)
task = XendTaskManager.get_task(task_ref)
return xen_api_success(task.name_description)
- def task_set_name_label(self, session, task_ref, label):
- task = XendTaskManager.get_task(task_ref)
- task.name_label = label
- return xen_api_success_void()
-
- def task_set_name_description(self, session, task_ref, desc):
- task = XendTaskManager.get_task(task_ref)
- task.name_description = desc
- return xen_api_success_void()
-
def task_get_all(self, session):
tasks = XendTaskManager.get_all_tasks()
return xen_api_success(tasks)
- def task_destroy(self, session, task_uuid):
- XendTaskManager.destroy_task(task_uuid)
- return xen_api_success_void()
-
def task_get_record(self, session, task_ref):
task = XendTaskManager.get_task(task_ref)
return xen_api_success(task.get_record())