Register job template
POST/metalakes/:metalake/jobs/templates
Registers a job template in the metalake. The response carries only the status code.
Sign in with a bearer token or a local user's password; see Authentication.
Request
Path Parameters
The name of the metalake
- application/vnd.gravitino.v1+json
Body
- ShellJobTemplate
- SparkJobTemplate
jobTemplate
object
required
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
Responses
- 200
- 409
- 5xx
The operation succeeded. The body carries only code, which is 0.
- application/vnd.gravitino.v1+json
- Schema
- Example (from schema)
- Example
Schema
Possible values: [0]
Status code of the response
{
"code": 0
}
{
"code": 0
}
A job template with the same name already exists in the metalake.
- application/vnd.gravitino.v1+json
- Schema
- Example (from schema)
- JobTemplateAlreadyExistsException
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": 1004,
"type": "JobTemplateAlreadyExistsException",
"message": "Failed to operate job template(s) [my_job] operation [REGISTER], reason [JobTemplateAlreadyExistsException]",
"stack": [
"org.apache.gravitino.exceptions.JobTemplateAlreadyExistsException: job template xxx already exists",
"..."
]
}
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"
]
}