This API is used to query the job template list. Currently, only custom templates can be queried.
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID, which is used for resource isolation. For details about how to obtain its value, see Obtaining a Project ID. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
name |
No |
String |
Template name. Fuzzy query by name is supported. |
tags |
No |
String |
List of tag names. The value is k=v for a single tag. Multiple tags are separated by commas (,). Example: tag1=v1,tag2=v2. |
offset |
No |
Long |
Job offset. |
limit |
No |
Integer |
Number of returned data records. The default value is 10. |
order |
No |
String |
Sorting style of the query results.
The default value is desc. |
None
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. |
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. |
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. |
None
{ "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": "" } ] } }
Table 6 describes status 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.