VMware Cloud Community
raj11
Contributor
Contributor
Jump to solution

VCD API 5.1 java SDK Task getProgress

Hi,

I am trying to get the status of a task that has been submitted to the VCD. From the java SDK 5.1 documentation I see this for the Task class:

java.lang.Integer getProgress()

                                  - Returns the progress of the task.

But I am at a loss to understand what the integer value returned means? i.e. how do I interpret the integer value as what task status? I don't see any explanation for that in the documentation. Beats me.

I am rather looking for a way to find out the task status so that I get a return type of "TaskStatusType" (which has values

[QUEUED, PRERUNNING, SUCCESS, RUNNING, ERROR, CANCELED, ABORTED]). But I don't think I see any method in the Task class that would provide me the status in TaskStatusType for the task.

How could I do this?

Thanks,

Raj

Tags (5)
0 Kudos
1 Solution

Accepted Solutions
raj11
Contributor
Contributor
Jump to solution

Never mind. I figured it out.

TaskType taskType = task.getResource();

String taskStatus = taskType.getStatus()

does what I need.

View solution in original post

0 Kudos
2 Replies
raj11
Contributor
Contributor
Jump to solution

Never mind. I figured it out.

TaskType taskType = task.getResource();

String taskStatus = taskType.getStatus()

does what I need.

0 Kudos
ndalal
VMware Employee
VMware Employee
Jump to solution

Progress indicates progress of the task (in percentage). You need status to check the status of the task.

HTH