All Products
Search
Document Center

Serverless App Engine:UpdateJob

Last Updated:Dec 26, 2025

Updates a job template.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • For mandatory resource types, indicate with a prefix of * .
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
sae:UpdateJobupdate
*All Resources
*
    none
none

Request syntax

POST /pop/v1/sam/job/updateJob HTTP/1.1

Request parameters

ParameterTypeRequiredDescriptionExample
AppIdstringYes

The ID of the application.

7171a6ca-d1cd-4928-8642-7d5cfe69****
JdkstringNo

The version of the Java development kit (JDK) on which the deployment package of the application depends. The following versions are supported:

  • Open JDK 8
  • Open JDK 7
  • Dragonwell 11
  • Dragonwell 8
  • openjdk-8u191-jdk-alpine3.9
  • openjdk-7u201-jdk-alpine3.9

This parameter is not returned if the PackageType parameter is set to Image.

Open JDK 8
WebContainerstringNo

The version of the Tomcat container on which the deployment package depends. The following versions are supported:

  • apache-tomcat-7.0.91
  • apache-tomcat-8.5.42

This parameter is not returned if the PackageType parameter is set to Image.

apache-tomcat-7.0.91
PackageVersionstringNo

The version of the deployment package. This parameter is required if you set PackageType to FatJar, War, or PythonZip.

1.0.1
PackageUrlstringNo

The address of the deployment package. This parameter is required if you set PackageType to FatJar, War, or PythonZip.

http://myoss.oss-cn-hangzhou.aliyuncs.com/my-buc/2019-06-30/****.jar
ImageUrlstringNo

The URL of the image. This parameter is returned only if the PackageType parameter is set to Image.

registry.cn-hangzhou.aliyuncs.com/sae_test/ali_sae_test:0.0.1
CommandstringNo

The command that is used to start the image. The command must be an existing executable object in the container. Example:

command:
      - echo
      - abc
      - >
      - file0

In this example, the Command parameter is set to Command="echo", CommandArgs=["abc", ">", "file0"].

echo
CommandArgsstringNo

The parameters of the image startup command. The CommandArgs parameter specifies the parameters that are required for the Command parameter. The name must meet the following format requirements:

["a","b"]

In the preceding example, the CommandArgs parameter is set to CommandArgs=["abc", ">", "file0"]. The data type of ["abc", ">", "file0"] must be an array of strings in the JSON format. This parameter is optional.

["a","b"]
EnvsstringNo

The environment variables. You can configure custom environment variables or reference a ConfigMap. If you want to reference a ConfigMap, you must first create a ConfigMap. For more information, see CreateConfigMap . Valid values:

  • Configure custom environment variables

    • name: the name of the environment variable.
    • value: the value of the environment variable.
  • Reference ConfigMap

    • name: the name of the environment variable. You can reference one or all keys. If you want to reference all keys, specify sae-sys-configmap-all-<ConfigMap name>. Example: sae-sys-configmap-all-test1.
    • valueFrom: the reference of the environment variable. Set the value to configMapRef.
    • configMapId: the ConfigMap ID.
    • key: the key. If you want to reference all keys, do not configure this parameter.
[{"name":"envtmp","value":"0"}]
CustomHostAliasstringNo

The custom mappings between hostnames and IP addresses in the container. Valid values:

  • hostName: the domain name or hostname.
  • ip: the IP address.
[{"hostName":"samplehost","ip":"127.0.0.1"}]
JarStartOptionsstringNo

The option settings in the JAR package. The settings are used to start the application container. The default startup command for application deployment is $JAVA_HOME/bin/java $JarStartOptions -jar $CATALINA_OPTS "$package_path" $JarStartArgs.

custom-option
JarStartArgsstringNo

The arguments in the JAR package. The arguments are used to start the application container. The default startup command is $JAVA_HOME/bin/java $JarStartOptions -jar $CATALINA_OPTS "$package_path" $JarStartArgs.

-Xms4G -Xmx4G
EdasContainerVersionstringNo

The version of the container, such as Ali-Tomcat, in which an application developed based on High-speed Service Framework (HSF) is deployed.

3.5.3
SlsConfigsstringNo

The configurations of Log Service.

  • To use Log Service resources that are automatically created by SAE, set this parameter to [{"logDir":"","logType":"stdout"},{"logDir":"/tmp/a.log"}].
  • To use custom Log Service resources, set this parameter to [{"projectName":"test-sls","logType":"stdout","logDir":"","logstoreName":"sae","logtailName":""},{"projectName":"test","logDir":"/tmp/a.log","logstoreName":"sae","logtailName":""}].

The following parameters are involved:

  • projectName: the name of the Log Service project.
  • logDir: the path in which logs are stored.
  • logType: the log type. stdout: the standard output log of the container. You can specify only one stdout value for this parameter. If you leave this parameter empty, file logs are collected.
  • logstoreName: the name of the Logstore in Log Service.
  • logtailName: the name of the Logtail configuration in Log Service. If you do not configure this parameter, a new Logtail configuration is created.

If you do not need to modify the logging configurations when you deploy the application, configure the SlsConfigs parameter only in the first request. You do not need to include this parameter in subsequent requests. If you no longer need to use Log Service, leave the SlsConfigs parameter empty in the request.

Note A Log Service project that is automatically created by SAE when you create an application is deleted when the application is deleted. Therefore, when you create an application, you cannot select a Log Service project that is automatically created by SAE for log collection.
[{"logDir":"","logType":"stdout"},{"logDir":"/tmp/a.log"}]
TimezonestringNo

The time zone. Default value: Asia/Shanghai.

Asia/Shanghai
NasIdstringNo

The ID of the Apsara File Storage NAS file system. If you do not need to modify the NAS configurations when you deploy the application, configure NasId only in the first request. If you no longer need to use NAS, leave NasId empty in the request.

10d3b4****
MountHoststringNo

The mount target of the NAS file system in the VPC where the application is deployed. If you do not need to modify this configuration during the deployment, configure the MountHost parameter only in the first request. You do not need to include this parameter in subsequent requests. If you need to remove this configuration, leave the MountHost parameter empty in the request.

10d3b4bc9****.com
MountDescstringNo

The configurations for mounting the NAS file system. If you do not need to modify the NAS configurations when you deploy the application, configure MountDesc only in the first request. If you no longer need to use NAS, leave MountDesc empty in the request.

[{mountPath: "/tmp", nasPath: "/"}]
PostStartstringNo

The script to be run after the container is started. Example: {"exec":{"command":\["sh","-c","echo hello"\]}}

{"exec":{"command":["sh","-c","echo hello"]}}
PreStopstringNo

The script that is run before the container is stopped. Example: {"exec":{"command":\["sh","-c","echo hello"\]}}

{"exec":{"command":["sh","-c","echo hello"]}}
WarStartOptionsstringNo

The startup command of the WAR package. For information about how to configure the startup command, see Configure startup commands.

CATALINA_OPTS=\"$CATALINA_OPTS $Options\" catalina.sh run
ConfigMapMountDescstringNo

The description of the ConfigMap instance mounted to the application. Use configurations created on the Configuration Items page to configure containers. The following parameters are involved:

  • congfigMapId: the ID of the ConfigMap instance. You can call the ListNamespacedConfigMaps operation to obtain the ID.
  • key: the key.
Note You can use the sae-sys-configmap-all key to mount all keys.
  • mountPath: the mount path.
[{"configMapId":16,"key":"test","mountPath":"/tmp"}]
TerminationGracePeriodSecondsintegerNo

The timeout period for a graceful shutdown. Default value: 30. Unit: seconds. Valid values: 1 to 300.

10
PhpConfigLocationstringNo

The path on which the PHP configuration file for application startup is mounted. Make sure that the PHP server uses this configuration file during the startup.

/usr/local/etc/php/php.ini
PhpConfigstringNo

The details of the PHP configuration file.

k1=v1
TomcatConfigstringNo

The Tomcat configuration. If you want to delete the configuration, set this parameter to {} or leave this parameter empty. Valid values:

  • port: the port number. The port number ranges from 1024 to 65535. Though the admin permissions are configured for the container, the root permissions are required to perform operations on ports whose number is smaller than 1024. Enter a value that ranges from 1025 to 65535 because the container has only the admin permissions. If you do not specify this parameter, the default port number 8080 is used.
  • contextPath: the path. Default value: /. This value indicates the root directory.
  • maxThreads: the maximum number of connections in the connection pool. Default value: 400.
  • uriEncoding: the URI encoding scheme in the Tomcat container. Valid values: UTF-8, ISO-8859-1, GBK, and GB2312. If you do not specify this parameter, the default value ISO-8859-1 is used.
  • useBodyEncoding: specifies whether to use the encoding scheme that is specified by BodyEncoding for URL. Default value: true.
{"port":8080,"contextPath":"/","maxThreads":400,"uriEncoding":"ISO-8859-1","useBodyEncodingForUri":true}
OssMountDescsstringNo

The information about the mounted Object Storage Service (OSS) bucket. The following parameters are involved:

  • bucketName: the name of the OSS bucket.

  • bucketPath: the directory or object in OSS. If the specified directory or object does not exist, an error is returned.

  • mountPath: the directory of the container in SAE. If the path already exists, the newly specified path overwrites the previous one. If the path does not exist, it is created.

  • readOnly: specifies whether to only allow the container path to read data from the OSS directory. Valid values:

    • true: The container path only has read permission on the OSS directory.
    • false: The application has read and write permissions.
[{"bucketName": "oss-bucket", "bucketPath": "data/user.data", "mountPath": "/usr/data/user.data", "readOnly": true}]
OssAkIdstringNo

The AccessKey ID that is used to read data from and write data to OSS.

xxxxxx
OssAkSecretstringNo

The AccessKey secret that is used to read data from and write data to OSS.

xxxxxx
PhpstringNo

The ID of Container Registry Enterprise Edition instance N.

cri-xxxxxx
AcrInstanceIdstringNo

The ID of Container Registry Enterprise Edition instance N. This parameter is required when the ImageUrl parameter is set to the URL of an image in an ACR Enterprise Edition instance.

cri-xxxxxx
AcrAssumeRoleArnstringNo

The Alibaba Cloud Resource Name (ARN) of the RAM role that is used to pull images across accounts. For more information, see Grant permissions across Alibaba Cloud accounts by using a RAM role.

acs:ram::123456789012****:role/adminrole
ImagePullSecretsstringNo

The ID of the corresponding Secret.

10
TriggerConfigstringNo

The trigger configuration. Configure this parameter based on the job type.

  • Scheduled job: Set type to time, config to a CRON expression, and timezone to a specific time zone.

Example: {"type":"time","config":"0 1 */1 * ?","timezone":"GMT+8:00"}

  • One-time job: Set type to http and configure an HTTP trigger rule for config. For more information, see SourceHttpEventParameters .

Example: {"type":"http","config":{"type":"HTTPS","method"、["GET"],"ip":[],"referer":[],"securityConfig":"none"}}

{"type":"time","config":"0 1 */1 * ?","timezone":"GMT+8:00"}
ConcurrencyPolicystringNo

The concurrency policy of the job. Valid values:

  • Forbid: Prohibits concurrent running. If the previous job is not completed, no new job is created.
  • Allow: Allows concurrent running.
  • Replace: If the previous job is not completed when the time to create a new job is reached, the new job replaces the previous job.
Allow
TimeoutlongNo

The timeout period. Unit: seconds.

3600
BackoffLimitlongNo

The number of times the job is retried.

3
SlicebooleanNo

Specifies whether to enable job sharding.

true
SliceEnvsstringNo

The parameters of job sharding.

[0,1,2]
ReplicasstringNo

The number of concurrent instances.

3
RefAppIdstringNo

The ID of the job that you reference.

7171a6ca-d1cd-4928-8642-7d5cfe69****
ProgrammingLanguagestringNo

The programming language. Valid values: java, php, python, and shell.

java
PythonstringNo

The Python environment. Set the value to PYTHON 3.9.15.

PYTHON 3.9.15
PythonModulesstringNo

The configurations for installing custom module dependencies. By default, the dependencies defined by the requirements.txt file in the root directory are installed. If the package does not contain this file and you do not configure custom dependencies in the package, specify the dependencies that you want to install in the text box.

Flask==2.0

Response parameters

ParameterTypeDescriptionExample
object

The information about the deployed application.

RequestIdstring

The ID of the request.

01CF26C7-00A3-4AA6-BA76-7E95F2A3***
Messagestring

The additional information that is returned. Valid values:

  • success: If the call is successful, success is returned.
  • An error code: If the call fails, an error code is returned.
success
TraceIdstring

The trace ID that is used to query the details of the request.

ac1a0b2215622246421415014e****
Dataobject

The response.

ChangeOrderIdstring

The ID of the change order. It can be used to query the task status.

01db03d3-3ee9-48b3-b3d0-dfce2d88****
AppIdstring

The application ID.

7171a6ca-d1cd-4928-8642-7d5cfe69****
ErrorCodestring

The error code returned. Valid values:

  • The ErrorCode parameter is not returned if the request succeeds.
  • If the call fails, the ErrorCode parameter is returned. For more information, see the "Error codes" section of this topic.
Null
Codestring

The HTTP status code. Valid values:

  • 2xx: The call was successful.
  • 3xx: The call was redirected.
  • 4xx: The call failed.
  • 5xx: A server error occurred.
200
Successboolean

Indicates whether the application deployment is successful. Valid values:

  • true
  • false
true

Examples

Sample success responses

JSONformat

{
  "RequestId": "01CF26C7-00A3-4AA6-BA76-7E95F2A3***",
  "Message": "success",
  "TraceId": "ac1a0b2215622246421415014e****",
  "Data": {
    "ChangeOrderId": "01db03d3-3ee9-48b3-b3d0-dfce2d88****",
    "AppId": "7171a6ca-d1cd-4928-8642-7d5cfe69****"
  },
  "ErrorCode": "Null\n",
  "Code": 200,
  "Success": true
}

Error codes

HTTP status codeError codeError messageDescription
400Application.MissingJdkYour application must at least contain a JDK component.-
400InvalidApplication.NotFoundThe current application does not exist.-
400InvalidComponent.NotFoundThe current component (such as JDK, Tomcat, or EDASWebContainer) does not exist.-
400InvalidHostnameIp.InvalidThe hostname and/or IP is invalid: Hostname [%s], IP [%s].-
400InvalidInstanceSpecification.UnsupportedThe instance specification is not supported: CPU [%s], memory [%s].-
400InvalidPackageType.NotFoundThe package type must be War, FatJar, or Image.-
400InvalidParameter.FileNameThe application deployment package name is invalid. This name can contain only alphanumeric characters, hyphens (-), and underscores (_). In addition, you can upload JAR files only if the selected deployment version supports JAR file. Otherwise, upload WAR files only.-
400InvalidParameter.NotEmptyYou must specify the parameter %s.-
400InvalidParameter.ObviouslyThe specified parameter is invalid {%s}.-
400InvalidParameter.WithMessageThe parameter is invalid {%s}: %s-
400JarApplication.MissingJdkA FatJar application must contain JDK.-
400NoComputeResourceQuota.ExceedYour compute resource is insufficient. Please submit a ticket to raise the quota.-
400PandoraApplication.MissingJdkThe Pandora application is missing a JDK component.-
400PandoraApplication.OnlyJdkA Pandora application only requires JDK component.-
400WarApplication.MissingJdkWebcontainerA War application must contain JDK and Tomcat.-
400LogService.ConfigQuotaExceedThe maximum number of Log Service configs is exceeded.The maximum number of Log Service configs is exceeded, please join the DingTalk group 32874633 for technical support.
400LogService.InternalErrorAn exception occurred while calling Log Service. Please submit a ticket to solve the problem.An exception occurred while calling log service. please join the DingTalk group 32874633 for technical support.
400LogService.LogDirInvalidThe log collection path is invalid.The log collection path is invalid.
400LogService.NotAvailableLog Service is unavailable. Please activate Log Service first.The log service is not available. Please open the log service first.
400LogService.ProjectNumQuotaExceedThe maximum number of Log Service projects is exceeded.The maximum number of Log Service projects is exceeded, please join the DingTalk group 32874633 for technical support.
400user.indebtThe user has an outstanding payment.-
400NoComputeResourceQuota.App.ExceedYou can create %s instances for each application. Please submit a ticket to raise the quota.You can create %s instances for each application. please join the DingTalk group 32874633 for technical support.
400NoComputeResourceQuota.User.ExceedYour account is limited to create %s instances. Please submit a ticket to raise the quota.Your account is limited to create %s instances. please join the DingTalk group 32874633 for technical support.
400System.UpgradingThe system is being upgraded. Please try again later.-
400VolumnPath.ConflictConflict between log collection directory and persistent storage directory.Conflict between log collection directory and persistent storage directory.
400Application.ChangerOrderRunningAn application change process is in progress. Please try again later.An application change process is in progress. Please try again later.
400Application.InvalidStatusThe application status is abnormal. Please try again later.The application status is abnormal. Please try again later.
400MountConflict.ConfigMapConflict detected for ConfigMap path %s.-
400NotFound.ConfigMapThe ConfigMap object (ID: %s) does not exist.-
400NotFound.ConfigMapKeyThe key %s of ConfigMap object (ID: %s) does not exist.-
400Package.Version.Too.LongThe maximum length of package version is exceeded.This package version is too long.
400App.Package.Version.ExistsThe package version of application already exists.The package version of application already exists.
400Slb.OccupiedThe SLB instance is occupied.This SLB is occupied.
400Slb.Tag.Not.QualifiedThe current SLB instance cannot be reused because it may have been occupied by %s.The current SLB instance cannot be reused because it may have been occupied by %s.
400MinReadyInstances.Not.Smaller.ReplicasThe minimum number of available instances must be less than the number of application instances.The minimum number of available instances must be less than the number of application instances.
400BatchWaitTime.Not.Smaller.ZeroBatchWaitTime must not be smaller than zero.BatchWaitTime must not be smaller than zero.
400Sls.Config.Mixed.Multi.ProjectThe specified Config contains multiple projects.-
400Sls.Config.User.Defined.Missing.Logstore.InfoThe specified Config is invalid. Both Project and Logstore must be specified.-
400Sls.Config.User.Defined.Missing.Project.InfoThe specified Config is invalid. Both Project and Logstore must be specified.-
400Sls.Logstore.Name.InvalidThe specified name of Logstore is invalid. The Logstore name must not contain the prefix "sae-".-
400Sls.Logstore.User.Defined.Not.ExistThe user defined Logstore does not exist.-
400Sls.Project.Name.InvalidThe specified project name is invalid. The project name must not contain the prefix "sae-".-
400Sls.Project.User.Defined.Not.ExistThe user defined project does not exist.-
400Sae.Errorcode.Ahas.Create.Error.MessageFailed to create AHAS.-
400InvalidImageUrl.AcrInstanceId.Domain.NotMatchThe specified domain of ImageUrl does not match AcrInstanceId domains.-
400PhpApplication.MissingPhpRuntimeA PHP application must contain PHP Runtime.-
404InvalidNamespaceId.NotFoundThe specified NamespaceId does not exist.-
404InvalidAcrInstanceId.NotFoundThe specified AcrInstanceId does not exist.-
404Associate.Eip.Not.EnoughNo sufficient EIPs are available.-

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2025-09-08The Error code has changed. The request parameters of the API has changedView Change Details