Update job template
PUT/metalakes/:metalake/jobs/templates/:jobTemplate
Updates a job template in the specified metalake
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
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
Returns the updated job template object
- 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
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"
}
}
}
Bad Request - The changes in the request cannot be applied to the job 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
{
"code": 1002,
"type": "string",
"message": "string",
"stack": [
"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",
"..."
]
}
Not Found - The specified job template does not exist in the specified metalake
- 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
{
"code": 1002,
"type": "string",
"message": "string",
"stack": [
"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",
"..."
]
}
A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes.
- 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
{
"code": 1002,
"type": "string",
"message": "string",
"stack": [
"string"
]
}
{
"code": 1002,
"type": "RuntimeException",
"message": "Internal Server Error",
"stack": [
"java.lang.RuntimeException: Internal Server Error"
]
}