Updated on 2023-12-14 GMT+08:00

Creating a Job Template

Function

This API is used to create a job template.

URI

  • URI format

    POST /v3/{project_id}/templates

  • Parameter description
    Table 1 URI parameter

    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

Table 2 Parameters

Parameter

Mandatory

Type

Description

type

Yes

String

Template type. Available values are as follows:

  • SQL: SQL template
  • SPARK: Spark template

name

Yes

String

Template name

body

Yes

String

Template content

group

No

String

Template group name

description

No

String

Description of the template

language

No

String

Language

Response

Table 3 Parameters

Parameter

Type

Description

id

String

Template ID

Example Request

Create a SQL job template whose content is test sql.

{ 
    "type": "SQL",
    "name": "test",
    "description": "",
    "body": "test aql",
    "group": "" 
 }

Example Response

{ 
    "id":"85aad9e5-3766-46c2-b3c0-16c2832e52e8"
 }

Status Codes

Status Code

Description

200

OK

Error Codes

For details, see Error Codes.