Updated on 2024-08-23 GMT+08:00

Exporting the Result File of a Comparison Task

Function

This API is used to export the comparison result file.

URI

POST /v3/{project_id}/jobs/{job_id}/compare/result/file

Table 1 Path parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID of a tenant in a region.

For details, see Obtaining a Project ID.

job_id

Yes

String

Task ID.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

Content-Type

Yes

String

The content type.

The default value is application/json.

X-Auth-Token

Yes

String

User token obtained from IAM.

X-Language

No

String

Request language type.

Default value: en-us

Enumerated values:

  • en-us
  • zh-cn

Region

Yes

String

Region ID, for example, cn-north-4.

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

compare_type

Yes

String

Type of a comparison task.

  • contents: value comparison.
  • lines: row comparison.
  • random: sampling comparison.
  • objects_comparison: object-level comparison.

compare_job_id

No

String

ID of a comparison task. This parameter is mandatory in value comparison, sampling comparison, and row comparison scenarios.

time_zone

No

String

Time zone, for example, GMT+08:00. This parameter is used to generate the current time identifier and is added to a file name.

Response Parameters

None

Example Request

  • Exporting the result file of an object comparison task
    https://{endpoint}/v3/054ba152d480d55b2f5dc0069e7ddef0/jobs/f8688cfa-4e05-406f-a2e6-37a773cjb20ycompare/result/file
    
    {
      "compare_type" : "objects_comparison"
    }
  • Exporting the result file of a value comparison task
    https://{endpoint}/v3/054ba152d480d55b2f5dc0069e7ddef0/jobs/f8688cfa-4e05-406f-a2e6-37a773cjb20ycompare/result/file
    
    {
      "compare_type" : "contents",
      "compare_job_id" : "9406224c-8063-436a-8fe2-796d87f054dc"
    }

Example Response

Status code: 200

OK

""

Status code: 400

Bad Request

{
  "error_code" : "DRS.10000010",
  "error_msg" : "Task not found. Check the task ID."
}

Status Code

Status Code

Description

200

OK

400

Bad Request

Error Code

For details, see Error Code.