Updated on 2024-05-20 GMT+08:00

Common Algorithm Parameters

Request Parameters

Table 1 Request body parameters

Parameter

Mandatory

Type

Description

algorithmName

Yes

String

Algorithm name. For details, see the description of each algorithm.

parameters

No

Object

Algorithm parameters. For details, see the parameter description of each algorithm.

output

No

Object

Result output parameter. For details, see Table 2.

Table 2 output parameter description

Parameter

Mandatory

Type

Description

format

No

String

Output format of the algorithm result. The options include JSON and CSV. The default value is JSON. For the CSV format, see Algorithm Results in CSV Format.

mode

No

String

Output mode of algorithm results. The options include FULL and TRUNCATED. The default value is TRUNCATED.

  • FULL indicates that all algorithm results are output. In FULL mode, only the CSV format is supported. Algorithm results are written to the local directory of the nodes in the cluster. To access all results, you must utilize the export-result interface to write them to OBS.
  • TRUNCATED indicates that algorithm results are truncated and then output. Currently, only the JSON format is supported.

Example Response

Algorithms are executed based on input parameters. You can call Querying Job Status and Execution Results to use the job_id returned by the algorithm to obtain the algorithm execution result.

Status code: 200

Example response for a successful request

{
    "data": {
   "outputs": {
           $response_data //Result of each algorithm. The results vary with the algorithm.
           "runtime": 1.365867,
           "data_return_size": 3,
           "data_offset": 0,
           "data_total_size": 100
    }
  },
  "status": "complete"
}

response_data indicates the result of each algorithm. The results vary with algorithms.

Status code: 400

Example response for a failed request

Http Status Code: 400
{
"errorMessage":"Running algorithm [XXXX] error: YYYYYYYYY!",
"errorCode":"GES.8301"
}