Class Job
java.lang.Object
com.alibaba.dashscope.types.common.ResponseBase
com.alibaba.dashscope.resources.jobs.Job
A long-running task (design §3):
taskId is the primary name (job_id accepted as
an alias), outputAs(Class) gives a typed view over the raw output node. Terminal states:
SUCCEEDED / FAILED / CANCELED / UNKNOWN.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic JobfromBody(com.fasterxml.jackson.databind.JsonNode body) Build from the task envelope body{request_id, output:{task_id,task_status,...}}.Image URLs of a finished image task; empty for other tasks.com.fasterxml.jackson.databind.JsonNodeRaw output node of the task.The artifacts of a finished task (Python v2Job.resultsparity):output.resultswhen present, else the image parts lifted from a choices-style output (multimodal-generation answers image tasks with chat-style choices).The single artifact of a one-result task: first image URL, else output.url, else video.com.fasterxml.jackson.databind.JsonNodegetUsage()Video URL of a finished video task; null for other tasks.booleanTerminal: SUCCEEDED / FAILED / CANCELED / UNKNOWN (2.x TaskStatus parity).boolean<T> TTyped view over the raw output node.Methods inherited from class com.alibaba.dashscope.types.common.ResponseBase
fillEnvelope, getCode, getHeaders, getMessage, getRequestId, getStatusCode, isError
-
Field Details
-
PENDING
- See Also:
-
RUNNING
- See Also:
-
SUCCEEDED
- See Also:
-
FAILED
- See Also:
-
CANCELED
- See Also:
-
UNKNOWN
- See Also:
-
-
Constructor Details
-
Job
public Job()
-
-
Method Details
-
fromBody
Build from the task envelope body{request_id, output:{task_id,task_status,...}}. SDK-internal wiring (transport → job); users must not call it. -
getTaskId
-
getTaskStatus
-
getOutput
public com.fasterxml.jackson.databind.JsonNode getOutput()Raw output node of the task. -
getUsage
public com.fasterxml.jackson.databind.JsonNode getUsage() -
outputAs
Typed view over the raw output node. -
getResults
The artifacts of a finished task (Python v2Job.resultsparity):output.resultswhen present, else the image parts lifted from a choices-style output (multimodal-generation answers image tasks with chat-style choices). -
getImageUrls
Image URLs of a finished image task; empty for other tasks. -
getVideoUrl
Video URL of a finished video task; null for other tasks. -
getResultUrl
The single artifact of a one-result task: first image URL, else output.url, else video. -
isSucceeded
public boolean isSucceeded() -
isFinished
public boolean isFinished()Terminal: SUCCEEDED / FAILED / CANCELED / UNKNOWN (2.x TaskStatus parity).
-