List job templates
GET/metalakes/:metalake/jobs/templates
Returns the names of the job templates in the metalake, or the full job templates when details is true.
Sign in with a bearer token or a local user's password; see Authentication.
Request
Path Parameters
The name of the metalake
Query Parameters
Whether to return full job templates instead of names
Responses
- 200
- 400
- 404
- 5xx
The names of the job templates in the metalake, or the full job templates when details is true.
- application/vnd.gravitino.v1+json
- Schema
- Example (from schema)
- NameListResponse
- JobTemplateListResponse
Schema
- NameListResponse
- JobTemplateListResponse
Array [
- ShellJobTemplate
- SparkJobTemplate
]
oneOf
Possible values: [0]
Status code of the response
Possible values: [0]
Status code of the response
jobTemplates
object[]
A list of job template objects
oneOf
A job template object for shell jobs
The name of the job template
Possible values: [shell]
The type of the job template
A comment about the job template
The executable command of the job template
The arguments of the job template
environments
object
Configured string to string map of environment variables for the job template
customFields
object
Configured string to string map of custom fields for the job template
The scripts of the job template
audit
object
Audit information for a Gravitino resource.
The user who created the resource
The time the resource was created
The user who last modified the resource
The time the resource was last modified
A job template object for Spark jobs
The name of the job template
Possible values: [spark]
The type of the job template
A comment about the job template
The executable command of the job template
The arguments of the job template
environments
object
Configured string to string map of environment variables for the job template
customFields
object
Configured string to string map of custom fields for the job template
The main class of the Spark job template. Required for Java/Scala Spark applications, optional for PySpark applications
The JAR files of the Spark job template
The files of the Spark job template
The archives of the Spark job template
configs
object
Configured string to string map of Spark configurations for the job template
audit
object
Audit information for a Gravitino resource.
The user who created the resource
The time the resource was created
The user who last modified the resource
The time the resource was last modified
{}
{
"code": 0,
"names": [
"my_template1",
"my_template2"
]
}
{
"code": 0,
"jobTemplates": [
{
"arguments": [
"{{arg1}}",
"{{arg2}}"
],
"audit": {
"createTime": "2025-08-12T02:14:28.205023Z",
"creator": "anonymous"
},
"comment": "Test shell job template",
"customFields": {},
"environments": {
"ENV_VAR": "{{env_var}}"
},
"executable": "/var/folders/90/v1d9hxsd6pj8m0jnn6f22tkr0000gn/T/tmpy65fiugc/test-job.sh",
"jobType": "shell",
"name": "test_run_get",
"scripts": [
"/var/folders/90/v1d9hxsd6pj8m0jnn6f22tkr0000gn/T/tmpy65fiugc/common.sh"
]
},
{
"arguments": [
"--arg1",
"{{arg2}}"
],
"audit": {
"createTime": "2025-08-12T02:14:28.205023Z",
"creator": "anonymous"
},
"comment": "Test spark job template",
"customFields": {},
"environments": {
"ENV_VAR": "{{env_var}}"
},
"executable": "/var/folders/90/v1d9hxsd6pj8m0jnn6f22tkr0000gn/T/tmpy65fiugc/spark-demo.jar",
"jobType": "spark",
"name": "test_run_get_spark",
"className": "org.apache.spark.examples.SparkPi",
"jars": [
"/var/folders/90/v1d9hxsd6pj8m0jnn6f22tkr0000gn/T/tmpy65fiugc/spark-job.jar"
]
}
]
}
The request is malformed or fails validation, for example because of invalid JSON, a missing required field or an invalid parameter value. The body is normally an error model, although the server's middleware can return plain text instead.
- application/vnd.gravitino.v1+json
- Schema
- Example (from schema)
- Example
Schema
Possible values: >= 1000 and <= 1100
HTTP response code
Internal type definition of the error
A human-readable message
Deprecated diagnostic stack trace. Enterprise omits it by default because it can expose internal implementation details. Operators can opt in for controlled diagnostics with gravitino.server.webserver.includeErrorStackTrace=true. See OWASP REST Security: Error handling and CWE-209.
{
"code": 1002,
"type": "string",
"message": "string"
}
{
"code": 1003,
"type": "BadRequestException",
"message": "Malformed request"
}
The metalake does not exist.
- application/vnd.gravitino.v1+json
- Schema
- Example (from schema)
- NoSuchMetalakeException
Schema
Possible values: >= 1000 and <= 1100
HTTP response code
Internal type definition of the error
A human-readable message
Deprecated diagnostic stack trace. Enterprise omits it by default because it can expose internal implementation details. Operators can opt in for controlled diagnostics with gravitino.server.webserver.includeErrorStackTrace=true. See OWASP REST Security: Error handling and CWE-209.
{
"code": 1002,
"type": "string",
"message": "string"
}
{
"code": 1003,
"type": "NoSuchMetalakeException",
"message": "Failed to operate metalake(s) [test] operation [LOAD], reason [NoSuchMetalakeException]",
"stack": [
"org.apache.gravitino.exceptions.NoSuchMetalakeException: Metalake test does not exist",
"..."
]
}
The server hit an internal error that the client usually cannot fix by changing the request.
- application/vnd.gravitino.v1+json
- Schema
- Example (from schema)
- Example
Schema
Possible values: >= 1000 and <= 1100
HTTP response code
Internal type definition of the error
A human-readable message
Deprecated diagnostic stack trace. Enterprise omits it by default because it can expose internal implementation details. Operators can opt in for controlled diagnostics with gravitino.server.webserver.includeErrorStackTrace=true. See OWASP REST Security: Error handling and CWE-209.
{
"code": 1002,
"type": "string",
"message": "string"
}
{
"code": 1002,
"type": "RuntimeException",
"message": "Internal Server Error",
"stack": [
"java.lang.RuntimeException: Internal Server Error"
]
}