Querying the Template List
Function
This API is used to query the job template list. Currently, only custom templates can be queried.
Debugging
You can debug this API in API Explorer.
URI
- URI format
- Parameter description
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 its value, see Obtaining a Project ID.
Table 2 query parameter description 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.
- asc: The query results are displayed in ascending order.
- desc: The query results are displayed in the descending order.
The default value is desc.
Request
None
Response
| 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 Object | Detailed information about a template. |
| 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
- 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.
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 Code.
Last Article: Deleting a Template
Next Article: APIs Related to Basic Datasource Connections
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.