pyvcloud.vcd.task module

class pyvcloud.vcd.task.Task(client)

Bases: object

list_tasks(filter_status_list=['queued', 'preRunning', 'running'], newer_first=True)

Return a list of tasks accessible by the user, filtered by status.

Parameters:filter_status_list (list) – a list of strings representing task statuses that should be used to filter the query result.
Returns:tasks in form of lxml.objectify.ObjectifiedElement containing EntityType.TASK XML data representing the tasks that matched the status filter.
Return type:generator object
update(status, namespace, operation, operation_name, details, progress, owner_href, owner_name, owner_type, user_href, user_name, org_href=None, task_href=None, error_message=None)

Update a task in vCD.

Parameters:
  • status (str) – new status of the task.
  • namespace (str) – identifier of the service that created the task. It must not start with com.vmware.vcloud and the length must be between 1 and 128 symbols.
  • operation (str) – new message describing the operation that is being tracked by this task.
  • operation_name (str) – new short name of the operation that is being tracked by the task.
  • details – new detailed message about the task.
  • progress (str) – read-only indicator of task progress as an approximate percentage between 0 and 100. Not available for all tasks.
  • owner_href (str) – href of the owner of the task. This is typically the object that the task is creating or updating.
  • owner_name (str) – name of the owner of the task.
  • owner_type (str) – XML type of the owner object
  • user_href (str) – href of the user who started the task.
  • user_name (str) – name of the user who started the task.
  • org_href (str) – href of the organization, which the user mentioned above belongs to.
  • task_href (str) – href of the task.
  • error_message (str) – represents error information from a failed task.
Returns:

an object containing EntityType.TASK XML data representing the updated task.

Return type:

lxml.objectify.ObjectifiedElement