From: Ewan Mellor Date: Sun, 28 Jan 2007 17:33:50 +0000 (+0000) Subject: Made task.name_* read-only (these are set by Xend) and drop task.eta. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~15368^2~61 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=e9d603068bbfe6618798767b584d9fbd98f3628f;p=xen.git Made task.name_* read-only (these are set by Xend) and drop task.eta. Signed-off-by: Ewan Mellor --- diff --git a/docs/xen-api/xenapi-datamodel.tex b/docs/xen-api/xenapi-datamodel.tex index 511ef10d6d..64a9741b3d 100644 --- a/docs/xen-api/xenapi-datamodel.tex +++ b/docs/xen-api/xenapi-datamodel.tex @@ -550,11 +550,10 @@ all fields from the object 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. \\ @@ -644,40 +643,6 @@ string 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} @@ -710,40 +675,6 @@ string 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} @@ -807,38 +738,6 @@ int } -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} diff --git a/tools/python/xen/xend/XendAPI.py b/tools/python/xen/xend/XendAPI.py index 52e7ba3c4d..c9ad48cb17 100644 --- a/tools/python/xen/xend/XendAPI.py +++ b/tools/python/xen/xend/XendAPI.py @@ -496,16 +496,16 @@ class XendAPI(object): # 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)')] @@ -517,10 +517,6 @@ class XendAPI(object): 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) @@ -545,24 +541,10 @@ class XendAPI(object): 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())