Submitting Filter Jobs

Function

This API is used to submit filter jobs and perform offline computing tasks.

URI

POST /v1/{project_id}/filter-job

Table 1 describes the URI parameters.

Table 1 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.

Table 2 Request parameters

Parameter

Mandatory

Type

Description

workspace_id

No

String

Workspace ID. The default value is 0.

job_name

Yes

String

Training job name. The value can contain a maximum of 20 characters.

job_description

No

String

Training job description. The value can contain a maximum of 256 characters.

offline_platform

Yes

JSON

Offline computing platform. For details, see Table 3.

storage

Yes

JSON

Storage information. For details, see Table 8.

filter_rules

No

JSON

List of filter rules

Table 3 offline_platform parameters

Parameter

Mandatory

Type

Description

platform

Yes

String

Platform name. The value can contain a maximum of 64 characters. Currently, only DLI is supported.

platform_parameter

Yes

JSON

Platform parameter. For details, see Table 4.

computing_resource

No

String

Resource specifications required for the normal running of the DLI jobs.

config_load_path

Yes

String

OBS path that stores the files generated by the selected configurations

Table 4 platform_parameter parameters

Parameter

Mandatory

Type

Description

cluster_name

Yes

String

Cluster name

cluster_id

No

String

Cluster ID

Table 5 filter_rules parameters

Parameter

Mandatory

Type

Description

name

Yes

String

Filter rule name

behavior_rules

No

List

Filter rule configuration for user behaviors. For details, see Table 13.

NOTE:

Select at least one from behavior_rules, property_rules, blacklist, and whitelist as the filter criteria.

blacklist

No

String

Blacklisting rule configuration

whitelist

No

String

Whitelisting rule configuration

data_source

No

List

Data source. For details, see Table 6.

Response

Table 6 describes the response parameters.

Table 6 Response parameters

Parameter

Mandatory

Type

Description

is_success

Yes

Boolean

Whether the request is successful

job_id

Yes

String

Job ID

filter_uuid

Yes

String

UUID generated by the filter rule

Example

  • Example request
    {
    	"job_name": "dd",
    	"job_desc": "ff",
    	"offline_platform": {
    		"platform": "DLI",
    		"platform_parameter": {
    			"cluster_name": "res_cluster"
    		},
    		"config_load_path": "<OBS path for storing the configuration files>"
    	},
    	"storage": {
    		"platform": "CloudTable",
    		"platform_parameter": {
    			"cluster_name": "cloudtable-e596",
    			"cluster_id": "ec55161b-06e3-4871-af2a-2a6ec29e60f3",
    			"table_name": "res_yang0918"
    		}
    	},
    	"filter_rules": {
    "name": "filter rule name",
    		"behavior_rules": [{
    			"behavior_type": "view",
    			"interval": 7,
    			"frequency": 5
    		}],
    		"property_rules": [{
    			"user_properties": [{
    				"name": "provinceId",
    				"value": "4261.0"
    			}],
    			"item_properties": [{
    				"name": "weight",
    				"value": "0.00"
    			}]
    		}],
                    "etl_uuid": "4934b7757e1b404eafcb26c6284e2696",
    		"data_source": [{
    			"table_type_id": "ITEM_META",
    			"data_format": "csv",
    			"data_source_url": "<Path for storing the data sources>",
    			"data_param": {
    				"header": "false",
    				"delimiter": ",",
    				"quote": "\"",
    				"escape": "\\"
    			}
    		}, {
    			"table_type_id": "ITEM_META_CONF",
    			"data_format": "csv",
    			"data_source_url": "<Path for storing the data sources>",
    			"data_param": {
    				"header": "false",
    				"delimiter": ",",
    				"quote": "\"",
    				"escape": "\\"
    			}
    		}, {
    			"table_type_id": "USER_BEHAVIOR",
    			"data_format": "csv",
    			"data_source_url": "<Path for storing the data sources>",
    			"data_param": {
    				"header": "false",
    				"delimiter": ",",
    				"quote": "\"",
    				"escape": "\\"
    			}
    		}],
    		"blacklist": "<Path for storing the whitelists>",
    		"whitelist": "<Path for storing the whitelists>"
    	}
    }
  • Example of a successful response
    {
        "is_success": true,
        "job_id": "242040859dd4422d818efe7c297f1b66",
        "filter_uuid": "5666556ad3814f358a786eb6efcfe1ec"
    }
  • Example of a failed response
    {
        "is_success": false,
        "error_code": "res.1008",
        "error_msg": "The request parameter(job_name) is null."
    }

Status Code

For details about status codes, see Status Codes.