Submitting Retrieval Jobs

Function

This API is used to submit retrieval jobs.

URI

POST /v1/{project_id}/recall-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.

strategy

Yes

JSON

Strategy information. For details, see Table 5.

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

Path to read the configuration sources.

Table 4 platform_parameter parameters

Parameter

Mandatory

Type

Description

cluster_name

Yes

String

Cluster name

cluster_id

No

String

Cluster ID

Table 5 strategy parameters

Parameter

Mandatory

Type

Description

strategy_type

Yes

String

(Optional) Strategy type:

  • Retrieval strategy

name

Yes

String

Strategy alias. The value can contain a maximum of 60 characters.

algorithm_type

Yes

String

Algorithm type

parameter

Yes

JSON

Algorithm parameter, which is a JSON character string. For details, see Parameters for Supported Strategies.

data_source

Yes

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

strategy

Yes

List

Returned strategy result. For details, see Table 7.

job_id

Yes

String

Job ID

Table 7 strategy parameters

Parameter

Mandatory

Type

Description

strategy_type

Yes

String

(Optional) Strategy type:

  • Retrieval strategy

name

Yes

String

Strategy alias. This value consists of Chinese characters, digits, letters, underscores (_), hyphens (-), and spaces.

algorithm_type

Yes

String

Algorithm type

parameter

Yes

String

Algorithm parameter, which is a JSON character string. For details, see Parameters for Supported Strategies.

Table 8 candidate_set parameters

Parameter

Mandatory

Type

Description

uuid

Yes

String

Candidate set ID

description

Yes

String

Candidate set description

Example

  • Example request
    {
      "job_name": "ddddddddddddd",
      "job_description": "",
      "offline_platform": {
           "platform": "DLI",
    "platform_parameter": {"cluster_name":"res_cluster"},
    "config_load_path":"<Path for reading the configuration sources>"
        },
      "storage": {
          "platform": "CloudTable",
          "platform_parameter": {"cluster_name":"cloudtable-e596","cluster_id":"ec55161b-06e3-4871-af2a-2a6ec29e60f3","table_name":"res_yang0918"}
        },
      "strategy": 
            {
    "name": "Default recommendation - specific behavior popularity",
    "algorithm_type": "SpecificBehavior",
    "strategy_type": "retrieval",
    "parameter": {
    "data_source_config":{
    "retain_days":30,
    "behavior_type":"uncollect",
    "start_time":"1533571200000",
    "end_time":"3155328000000"
    },
    "algorithm_config":{},
    "candidate_set_config":{
    "is_recommended_by_category":true
    }
    },
    "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": true,
                "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": "\\"
              }
    }
        ]
      }
    }
  • Example of a successful response
    {
        "is_success": true,
        "strategy": {
    "name": "Recommendation Based on Specific Behavior Popularity" by default,
            "strategy_type": "recall",
            "algorithm_type": "SpecificBehavior",
            "parameter": {
                "data_source_config": {
                    "retain_days": 30,
                    "behavior_type": "uncollect",
                    "start_time": "1533571200000",
                    "end_time": "3155328000000"
                },
                "algorithm_config": {},
                "candidate_set_config": {
                    "is_recommended_by_category": true
                }
            },
            "candidate_set": [
                {
                    "uuid": "6de41841ff904e75b35657dd4323876f",
    "description": "[Recommendation Based on Specific Behavior Popularity by default] Candidate sets generated by the recommendation algorithms of specific behavior popularity"
                }
            ],
            "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": "true",
                        "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": "\\"
                    }
                }
            ],
            "strategy_id": 0
        },
        "job_id": "1e9bf244ebdc41f0b5ee5c1dd0fa07c3"
    }
  • Example of a failed response
    {
        "is_success": false,
        "error_code": "res.2006",
        "error_msg": "The datasourceUrl(<Path for storing the data sources>) is not match Bucket structure."
    }

Status Code

For details about status codes, see Status Codes.