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

Creating a PatchData Instance

Function

This API is used to create a PatchData instance.

URI

  • URI format

    POST /v2/{project_id}/factory/supplement-data

  • Parameter description

    Parameter

    Mandatory

    Type

    Description

    project_id

    Yes

    String

    Project ID. For details about how to obtain a project ID, see Project ID and Account ID.

Request Parameters

Table 1 Request header parameters

Parameter

Mandatory

Type

Description

workspace

No

String

Workspace ID

  • If this parameter is not set, data in the default workspace is queried by default.
  • To query data in other workspaces, this header must be carried.

X-Auth-Token

Yes

String

IAM Token

Minimum length: 0

Maximum length: 4096

Content-Type

Yes

String

MIME type of the request body

Table 2 Body parameters

Parameter

Mandatory

Type

Description

name

Yes

String

Name of the PatchData job

job_name

Yes

String

Name of the job to which data is to be patched

start_date

Yes

String

Start time for the PatchData job, for example, 2023-08-21T00:00:00 +08

end_date

Yes

String

End time for the PatchData job, for example, 2023-08-21T23:59:59 +08

parallel

Yes

int

Number of parallel periods. The value ranges from 1 to 5.

depend_jobs

No

List<JobDTO>

See Table 3.

is_day_granularity

No

Boolean

Whether to patch data by day. The value can be true (yes) or false (no).

priority

No

int

Priority of the PatchData job. If system resources are insufficient, computing resources are preferentially allocated to jobs with higher priorities. A larger value indicates a higher priority. Priorities can be set only for DLI SQL operators.

is_stop_when_fail

No

Boolean

Whether to stop a PatchData job if it fails. The value can be true (yes) or false (no).

reverse_order

No

int

Whether to patch data in descending order of date. The value can be 0 (ascending order) or 1 (descending order).

force

No

String

Whether to forcibly patch data. The value true indicates that data can be forcibly patched, that is, if a job has two PatchData instances, data can still be patched. The value false indicates that data cannot be forcibly patched.

supplement_data_run_time

No

Object

PatchData time period. Currently, data can only be patched only every day. If this parameter is not specified, the default value 00:00-00:00 is used. For details, see Table 4.

supplement_data_instance_time

No

Object

Discrete time for the PatchData job. For details, see Table 5.

Table 3 JobDTO parameters

Parameter

Mandatory

Type

Description

job_name

No

String

Job name

workspace_id

No

String

Workspace ID

Table 4 SupplementDataRunTime parameters

Parameter

Mandatory

Type

Description

time_of_day

No

String

Time period for patching data every day, for example, 10:15-23:30.

day_of_week

No

String

Days of each week for patching data, for example, 10:15 to 23:30 on Monday and Wednesday

day_of_month

No

String

Days in each month for patching data, for example, 1,3 which indicates the first and third day in each month

Table 5 SupplementDataInstanceTime parameters

Parameter

Mandatory

Type

Description

days

No

array[string]

Discrete days

time_of_day

No

String

Time period on a specified day

Response Parameters

None.

Example Request

Create a PatchData instance named P_job_6796_20230823_9991 which depends on job_5799.

POST /v2/62099355b894428e8916573ae635f1f9/factory/supplement-data

{
	"name": "P_job_6796_20230823_9991",
	"job_name": "job_5799",
	"start_date": "2023-08-23T00:00:00 +08",
	"end_date": "2023-08-23T23:59:59 +08",
	"parallel": 1,
	"depend_jobs": [],
	"is_day_granularity": false,
	"priority": 0,
	"is_stop_when_fail": false,
	"reverse_order": 0,
        "supplement_data_run_time": {
		"time_of_day": "01:03-02:00"
	},
	"supplement_data_instance_time": {
		"days": ["2023/09/05-2023/09/05"],
		"time_of_day": "00:00-23:59"
	},
	"force": "true"
}

Example Response

  • Success response

    HTTP status code 200

  • Failure response

    HTTP status code 400

    {
        "error_code":"DLF.3051",
        "error_msg":"The request parameter is invalid."
    }