Help Center/ KooDrive/ API Reference/ API/ Batch Task Operations/ Querying Details About a Batch Task
Updated on 2024-07-30 GMT+08:00

Querying Details About a Batch Task

Function

Query details about a batch task.

URI

GET /koodrive/ose/v1/{job_id}

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

job_id

Yes

String

Batch task ID.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

Authorization

Yes

String

Access token. Token authentication is used to call KooDrive APIs. A token indicates the permission. When an API is called, the token is added to the request header to obtain the operation permission. For details about how to obtain an access token, see the corresponding developer guide. The format is Bearer+{access_token}.

X-Traceid

No

String

Message log trace ID. The value contains 58 bits.

language

No

String

Language code, which complies with the internationalization specifications. For example, en-US indicates English (United States). English (United States) is used by default.

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

code

String

Response code.

msg

String

Response message.

data

data object

Task details.

Table 4 data

Parameter

Type

Description

jobInfo

JobDetailInfo object

Task information.

taskInfos

Array of TaskInfo objects

Task details list.

uncompressedFileList

Array of UncompressedFileInfo objects

Information about files in the compressed package.

Table 5 JobDetailInfo

Parameter

Type

Description

taskId

String

Task ID.

taskName

String

Task name.

userId

String

Task creator ID.

taskType

Integer

Task type.

actionType

Integer

Operation type.

status

Integer

Task status.

taskResultCode

Integer

Task result.

resultCode

Integer

Task result code.

progress

Integer

Task progress. This parameter is returned in an asynchronous task, for example, a package download task.

downloadUrl

String

Download link. This parameter is used only when the task type is package download.

contentNum

Integer

Number of request files.

containerId

String

Target space ID in cross-space scenarios.

tenantId

String

Tenant ID.

beginTime

String

Task start time.

endTime

String

Task end time.

createTime

String

Time creation time.

Table 6 TaskInfo

Parameter

Type

Description

fileId

String

File/Directory ID.

status

String

Task processing status.

  • 0: pending.

  • 1: successful.

  • 2: failed.

newFileId

String

New ID after operation.

srcContainerId

String

Source container ID (source space ID corresponding to fileId). This parameter is mandatory only for batch replication across spaces.

resultCode

String

File operation result code.

resultDesc

String

File operation result description.

Table 7 UncompressedFileInfo

Parameter

Type

Description

containerId

String

Space ID after decompression. This parameter is returned only for decompression.

fileId

String

ID of the decompressed file. This parameter is returned only for decompression.

name

String

Full path of the file or folder in the compressed package.

fileSize

Long

File size, in bytes.

type

Integer

For details, see the definition of fileType.

  • 1: content.

  • 2: directory.

updatedAt

Long

Millisecond timestamp of file modification.

subFileList

Array of SubFileList objects

List of sub-files and sub-directories (expanded only for directories).

reason

String

Failure cause. If the operation is successful, this parameter is null.

code

String

Error code.

reservatioinInfo

Object

Reserved field.

Table 8 SubFileList

Parameter

Type

Description

containerId

String

Space ID.

name

String

File name.

type

Integer

File type.

updatedAt

Integer

Update time.

code

String

Error code.

fileId

String

File ID.

fileSize

Integer

File size.

Status code: 400

Table 9 Response body parameters

Parameter

Type

Description

code

String

Response code.

msg

String

Response description.

Status code: 401

Table 10 Response body parameters

Parameter

Type

Description

code

String

Response code.

msg

String

Response description.

Status code: 500

Table 11 Response body parameters

Parameter

Type

Description

code

String

Response code.

msg

String

Response description.

Example Requests

Queries details about a batch task.

GET /koodrive/ose/v1/1309243162258308352

Authorization:Bearer+10f8***********a544791e9ff

Example Responses

Status code: 200

Returns queried task details.

{
  "data" : {
    "jobInfo" : {
      "taskId" : "1309243162258308352",
      "userId" : "40086000004871666-369528171409614001",
      "taskType" : 1,
      "actionType" : 101,
      "status" : 2,
      "progress" : 100,
      "taskResultCode" : 1,
      "contentNum" : 1,
      "containerId" : "IAADfsBFCO6WtAtuA315074383680425b8aa9a130cba2d4",
      "tenantId" : "40086000004871666",
      "beginTime" : "20231212095227",
      "endTime" : "20231212095227",
      "createTime" : "20231212095227"
    },
    "taskInfos" : [ {
      "fileId" : "FuZmQ66CF0DdpKRG1Y29Iwajbq04Nhwu3",
      "status" : "1",
      "newFileId" : "FtEXHCpfqHueAHFbEmWZNkqUH_K866MVn",
      "srcContainerId" : "IAADfsBFCO6WtAtuA315074383680425b8aa9a130cba2d4"
    } ]
  },
  "code" : 0,
  "msg" : "OK"
}

Status Codes

Status Code

Description

200

Returns queried task details.

400

Bad Request

401

Unauthorized

500

Internal Server Error