Submitting Effect Evaluation Jobs
Function
This API is used to submit effect evaluation jobs.
URI
POST /v1/{project_id}/evaluate
Table 1 describes the URI parameters.
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Project ID, which is used for resource isolation. For details about how to obtain the project ID, see Obtaining a Project ID. |
Request
Table 2 describes the request parameters.
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| workspace_id | No | String | Workspace ID. The default value is 0. |
| job_name | Yes | String | Job name. The value contains 1 to 20 characters. Only letters, digits, hyphens (-), and underscores (_) are allowed. |
| job_description | No | String | Job description. The value can contain a maximum of 256 characters. |
| online_services | Yes | List | Online services that require effect evaluation. |
| indicators | Yes | List | List of metrics and related parameters. For details, see Table 3. |
| start_time | Yes | Long | Timestamp marking the start of data collection |
| end_time | Yes | Long | Timestamp marking the end of data collection |
| interval | Yes | Double | Interval, in days. The value is greater than 0. |
| result_path | Yes | String | Result save path |
| offline_platform | Yes | JSON | Configuration information. For details, see Table 8. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| indicator_name | Yes | String | Metric name. The options are as follows:
|
| indicator_params | - | JSON | Metric parameter. This parameter is mandatory when indicator_name is set to customize. For details, see Table 4. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| customize_parameter | Yes | JSON | Table 5 describes the custom parameters. |
| customize_formula | Yes | JSON | Table 6 describes the custom formula. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| alias | Yes | String | Parameter alias, which is invoked in a custom formula and is represented by letters. |
| behavior_type | Yes | String | Behavior types:
|
| threshold | Yes | String | Behavior threshold. Behavior records within the threshold are valid. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| alias | Yes | String | Metric alias, which consists of letters, underscores (_), and digits. |
| formula | Yes | String | Custom metric formula, which consists of the parameter alias and calculation symbols. For example, A/(A+B), where A and B indicate the aliases of custom parameters. The calculation symbols can only be add (+), subtract (-), multiply (x), and divide (/). |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| header | Yes | Boolean | Whether to display the table header |
| delimiter | Yes | String | Delimiter. The value can contain a maximum of 10 characters. |
| quote | Yes | String | Quotation character. The value can contain a maximum of 10 characters. |
| escape | Yes | String | Quotation character. The value can contain a maximum of 10 characters. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| platform | Yes | String | Platform name. The value can be DLI. |
| platform_parameter | Yes | JSON | Platform parameter. For details, see Table 9. |
| computing_resource | No | String | Resource specifications required for the normal running of the DLI jobs. |
| config_load_path | Yes | String | Path to access the configuration items |
Response
Table 10 describes the response parameters.
| Parameter | Type | Description |
|---|---|---|
| is_success | Boolean | Whether the request is successful |
| job_name | String | Job name |
| job_id | String | Job ID |
| create_time | Long | Time when a job is created |
| error_code | String | Error code that indicates a request has failed. This parameter is unavailable when a request is successful. |
| error_msg | String | Error message that indicates a request has failed. This parameter is unavailable when a request is successful. |
Example
- Example request
{ "job_name": "Evaluate-job", "job_description": "", "data_source": { "table_type_id": "GENERAL_FORMAT", "data_format": "json", "data_source_url": "<Path for storing the data sources>" }, "online_services": [ "res-test1", "res-test2" ], "indicators": [ { "indicator_name": "clickPVRate", "indicator_params": {} }, { "indicator_name": "customize", "indicator_params": { "customize_parameter": [ { "alias": "A", "behavior_type": "click", "threshold": "1" }, { "alias": "B", "behavior_type": "click", "threshold": "0.6" }, { "alias": "C", "behavior_type": "consume", "threshold": "1" } ], "customize_formula": [ { "alias": "indicator1", "formula": "A+B" }, { "alias": "indicator2", "formula": "A+B-C" } ] } } ], "start_time": "1560960000", "end_time": "1561305600", "interval": 1, "result_path": "<Path for storing the output data>", "offline_platform": { "platform": "DLI", "platform_parameter": { "cluster_name": "test", "cluster_id": "7f1781ff-438a-40f7-b2b8-8f3f5e464104" }, "config_load_path": "<Path for storing the configuration sources>", "computing_resource": "" } } - Example of a successful response
{ "is_success": true, "job_id": "6b9848b8f2ac4c479855734e354459c1", "job_name": "evaluation-job", "create_time": "1543978717768" } - Example of a failed response
{ "is_success": false, "error_code": "res.xxxx", "error_msg": "Failed to submit job." }
Status Code
For details about status codes, see Status Codes.
Last Article: Deleting Jobs
Next Article: Querying Metrics
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.