Update job template
PUT/metalakes/:metalake/jobs/templates/:jobTemplate
Applies the requested changes to a job template and returns the updated template.
Sign in with a bearer token or a local user's password; see Authentication.
Request
Path Parameters
The name of the metalake
The name of the job template
- application/vnd.gravitino.v1+json
Body
Array [
- RenameJobTemplateRequest
- UpdateJobTemplateCommentRequest
- UpdateJobTemplateContentRequest
- ShellTemplateUpdate
- SparkTemplateUpdate
]
updates
object[]
required
oneOf
Possible values: [rename]
The new name of the job template
Possible values: [updateComment]
The new comment of the job template
Possible values: [updateTemplate]
newTemplate
object
required
oneOf
A job template update object for shell jobs
Possible values: [shell]
The type of the job template
The new executable command of the job template
The new arguments of the job template
newEnvironments
object
nullable
The new configured string to string map of environment variables for the job template
newCustomFields
object
nullable
The new configured string to string map of custom fields for the job template
The new scripts of the job template
A job template update object for Spark jobs
Possible values: [spark]
The type of the job template
The new executable command of the job template
The new arguments of the job template
newEnvironments
object
nullable
The new configured string to string map of environment variables for the job template
newCustomFields
object
nullable
The new configured string to string map of custom fields for the job template
The new class name of the Spark job template. Required for Java/Scala Spark applications, optional for PySpark applications
The new JAR files of the Spark job template
The new files of the Spark job template
The new archives of the Spark job template
newConfigs
object
nullable
The new configured string to string map of Spark configurations for the job template
Responses
- 200
- 400
- 404
- 5xx
The updated job template, with its job type, executable, arguments, other run settings and audit information.
- application/vnd.gravitino.v1+json
- Schema
- Example (from schema)
- JobTemplateResponse
Schema
- ShellJobTemplate
- SparkJobTemplate
Possible values: [0]
Status code of the response
jobTemplate
object
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,
"jobTemplate": {}
}
{
"code": 0,
"jobTemplate": {
"name": "test_run_get",
"jobType": "shell",
"comment": "Test shell job template",
"executable": "/var/folders/90/v1d9hxsd6pj8m0jnn6f22tkr0000gn/T/tmpy65fiugc/test-job.sh",
"arguments": [
"{{arg1}}",
"{{arg2}}"
],
"environments": {
"ENV_VAR": "{{env_var}}"
},
"customFields": {},
"scripts": [
"/var/folders/90/v1d9hxsd6pj8m0jnn6f22tkr0000gn/T/tmpy65fiugc/common.sh"
],
"audit": {
"createTime": "2025-08-12T02:14:28.205023Z",
"creator": "anonymous"
}
}
}
A change cannot be applied to the job template, for example a Spark update sent for a shell template.
- application/vnd.gravitino.v1+json
- Schema
- Example (from schema)
- IllegalArgumentException
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": 1001,
"type": "IllegalArgumentException",
"message": "Failed to operate job template(s) [my_job] operation [UPDATE], reason [IllegalArgumentException]",
"stack": [
"java.lang.IllegalArgumentException: Invalid argument xxx",
"..."
]
}
The metalake or job template does not exist.
- application/vnd.gravitino.v1+json
- Schema
- Example (from schema)
- NoSuchMetalakeException
- NoSuchJobTemplateException
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",
"..."
]
}
{
"code": 1003,
"type": "NoSuchJobTemplateException",
"message": "Failed to operate job template(s) [my_job] operation [GET] under metalake [my_test_metalake], reason [NoSuchJobTemplateException]",
"stack": [
"org.apache.gravitino.exceptions.NoSuchJobTemplateException: Job template xxx 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"
]
}