Querying the Template List

Function

This API is used to query the job template list. Currently, only custom templates can be queried.

URI

Request

None

Response

Table 3 Response parameters

Parameter

Mandatory

Type

Description

is_success

No

Boolean

Indicates whether the request is successful.

message

No

String

Message content.

template_list

No

Object

Information about the template list. For details, see Table 4.

Table 4 template_list parameters

Parameter

Mandatory

Type

Description

total_count

No

Integer

Total number of templates.

templates

No

Array of Objects

Detailed information about a template. For details, see Table 5.

Table 5 templates parameters

Parameter

Mandatory

Type

Description

template_id

No

Integer

Template ID.

name

No

String

Template name.

desc

No

String

Template description.

create_time

No

Long

Time when the template is created.

update_time

No

Long

Time when the template is updated.

sql_body

No

String

Stream SQL statement. Contains at least the source, query, and sink parts.

job_type

No

String

Job template type.

Example Request

None

Example Response

{
    "is_success": "true",
    "message": "The template list is obtained successfully.",
    "template_list": {
        "total_count": 2,
        "templates": [
            {
                "template_id": 2,
                "name": "updatetest",
                 "desc": "Example of quick start",
                "create_time": 1578748092000,
                "update_time": 1578748092000,
                "sql_body": "select * from source_table",
                "job_type": "flink_sql_job"
            },
            {
                "template_id": 1,
                "name": "we",
                "desc": "qwe",
                "create_time": 1577951045000,
                "update_time": 1577951045000,
                "sql_body": ""
            }
        ]
    }
}

Status Codes

Table 6 describes status codes.

Table 6 Status codes

Status Code

Description

200

Template list query succeeds.

400

The input parameter is invalid.

Error Codes

If an error occurs when this API is invoked, the system does not return the result similar to the preceding example, but returns the error code and error information. For details, see Error Codes.