Creating a Template
Function
This API is used to create a user template for the DLI service. A maximum of 100 user templates can be created.
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.
Request
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
name |
Yes |
String |
Template name. The value can contain 1 to 64 characters. |
desc |
No |
String |
Template description. Length range: 0 to 512 characters. |
sql_body |
No |
String |
Stream SQL statement, which includes at least the following three parts: source, query, and sink. Length range: 0 to 2,048 characters. |
tags |
No |
Array of Objects |
Label of a Flink job template. For details, see Table 3. |
job_type |
No |
String |
Flink job template type. The default value is flink_sql_job. You can set this parameter to flink_sql_job or flink_opensource_sql_job only. |
Response
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
is_success |
No |
Boolean |
Indicates whether the request is successful. |
message |
No |
String |
Message content. |
template |
No |
Object |
Information about job update. For details, see Table 5. |
Example Request
{ "name": "simple_stream_sql", "desc": "Example of quick start", "sql_body": "select * from source_table" }
Example Response
{ "is_success": true, "message": "A template is created successfully.", "template": { "template_id": 0, "name": "IoT_example", "desc": "Example of quick start", "create_time": 1516952710040, "job_type": "flink_sql_job" } }
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.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot