All Products
Search
Document Center

Serverless App Engine:UpdateJob

Last Updated:Apr 23, 2026

Call the UpdateJob API to update a job template.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

sae:UpdateJob

update

*All Resource

*

None None

Request syntax

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

Request parameters

Parameter

Type

Required

Description

Example

AppId

string

Yes

The ID of the job template to update.

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

Jdk

string

No

The Java Development Kit (JDK) version that the deployment package depends on. 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 supported when Package Type is set to Image.

Open JDK 8

WebContainer

string

No

The Tomcat version that the deployment package depends on. The following versions are supported:

  • apache-tomcat-7.0.91

  • apache-tomcat-8.5.42

This parameter is not supported when Package Type is set to Image.

apache-tomcat-7.0.91

PackageVersion

string

No

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

1.0.1

PackageUrl

string

No

The URL of the deployment package. This parameter is required if Package Type is set to FatJar, War, or PythonZip.

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

ImageUrl

string

No

The URL of the image. This parameter is required if Package Type is set to Image.

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

Command

string

No

The startup command of the image. The command must be an executable object that exists in the container. Example:

command:
      - echo
      - abc
      - >
      - file0

In this example, Command="echo" and CommandArgs=["abc", ">", "file0"].

echo

CommandArgs

string

No

The arguments of the image startup Command. The value must be a JSON array that is converted to a string. Format:

["a","b"]

In the preceding example, CommandArgs=["abc", ">", "file0"]. The ["abc", ">", "file0"] array is converted to a string. This parameter is optional.

["a","b"]

Envs

string

No

The environment variables of the container. You can customize environment variables or reference variables from a ConfigMap. To reference a ConfigMap, you must create a ConfigMap instance first. For more information, see CreateConfigMap. The value is a JSON string. The following fields are supported:

  • Custom variables
    • name: the name of the environment variable.

    • value: the value of the environment variable.

  • Reference variables from a ConfigMap
    • name: The name of the environment variable. You can reference a single key-value pair or all key-value pairs. To reference all key-value pairs, set the value to 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 ID of the ConfigMap.

    • key: The key of the key-value pair. If you want to reference all key-value pairs, do not configure this field.

[{"name":"envtmp","value":"0"}]

CustomHostAlias

string

No

The custom mapping between a hostname and an IP address in the container. The value is a JSON string. The following fields are supported:

  • hostName: the domain name or hostname.

  • ip: the IP address.

[{"hostName":"samplehost","ip":"127.0.0.1"}]

JarStartOptions

string

No

The options of the JAR package to start the application. The default startup command of the application is: $JAVA_HOME/bin/java $JarStartOptions -jar $CATALINA_OPTS "$package_path" $JarStartArgs

custom-option

JarStartArgs

string

No

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

-Xms4G -Xmx4G

EdasContainerVersion

string

No

The version of the application runtime environment in High-speed Service Framework (HSF), such as an Ali-Tomcat container.

3.5.3

SlsConfigs

string

No

The configurations of collecting logs to Log Service.

  • Use the Log Service resources that are automatically created by SAE: [{"logDir":"","logType":"stdout"},{"logDir":"/tmp/a.log"}].

  • Use a custom Log Service resource: [{"projectName":"test-sls","logType":"stdout","logDir":"","logstoreName":"sae","logtailName":""},{"projectName":"test","logDir":"/tmp/a.log","logstoreName":"sae","logtailName":""}].

The following fields are supported:

  • projectName: The name of the Log Service project.

  • logDir: The log path.

  • logType: The log type. stdout indicates the standard output log of the container. You can specify only one standard output. If you do not configure this field, file logs are collected.

  • logstoreName: The name of the Logstore in Log Service.

  • logtailName: The name of the Logtail. If you do not specify this parameter, a new Logtail is created.

If the SLS configuration is not changed during a deployment, you do not need to configure this parameter. To stop using the log collection feature, set the value of this parameter to an empty string ("").

Note

Projects that are automatically created with a job template are deleted when the job template is deleted. Therefore, when you select an existing project, do not select a project that is automatically created by SAE.

[{"logDir":"","logType":"stdout"},{"logDir":"/tmp/a.log"}]

Timezone

string

No

The time zone. Default value: Asia/Shanghai.

Asia/Shanghai

NasId

string

No

The ID of the Apsara File Storage NAS file system. If the configurations are not changed during a deployment, you do not need to configure this parameter. To clear the NAS configurations, set the value of this parameter to an empty string ("").

10d3b4****

MountHost

string

No

The mount target of the NAS file system in the virtual private cloud (VPC) where the job template is located. If the configurations are not changed during a deployment, you do not need to configure this parameter. To clear the NAS configurations, set the value of this parameter to an empty string ("").

10d3b4bc9****.com

MountDesc

string

No

The description of the NAS mount. If the configurations are not changed during a deployment, you do not need to configure this parameter. To clear the NAS configurations, set the value of this parameter to an empty string ("") in the request.

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

PostStart

string

No

The script that is executed after the container is started. Example: {"exec":{"command":["sh","-c","echo hello"]}}

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

PreStop

string

No

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

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

WarStartOptions

string

No

The startup command for the application that is deployed in a WAR package. The procedure is the same as that for configuring the startup command for an image. For more information, see Set a startup command.

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

ConfigMapMountDesc

string

No

The description of the ConfigMap instance that is mounted to the container. You can use the ConfigMap instance created on the Namespace Configurations page to inject configurations into the container. The value is a JSON string. The following fields are supported:

  • configMapId: The ID of the ConfigMap instance. You can call the ListNamespacedConfigMaps operation to obtain the ID.

  • key: The key of the key-value pair.

Note

You can pass the sae-sys-configmap-all parameter to mount all key-value pairs.

  • mountPath: The mount path.

[{"configMapId":16,"key":"test","mountPath":"/tmp"}]

TerminationGracePeriodSeconds

integer

No

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

10

PhpConfigLocation

string

No

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

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

PhpConfig

string

No

The content of the PHP configuration file.

k1=v1

TomcatConfig

string

No

The configurations of the Tomcat file. If you set this parameter to "" or "{}", the configurations are deleted. The value is a JSON string. The following fields are supported:

  • port: The port number. Valid values: 1024 to 65535. The root permission is required to perform operations on ports whose number is smaller than 1024. The container is configured with the administrator permission. Therefore, specify a port whose number is greater than 1024. If you do not configure this field, the default port 8080 is used.

  • contextPath: The context path. Default value: /.

  • maxThreads: The maximum number of connections in the connection pool. Default value: 400.

  • uriEncoding: The URI encoding scheme in Tomcat. Supported values: UTF-8, ISO-8859-1, GBK, and GB2312. If you do not set this parameter, the default value ISO-8859-1 is used.

  • useBodyEncodingForUri: Specifies whether to use BodyEncoding for URL. Default value: true.

{"port":8080,"contextPath":"/","maxThreads":400,"uriEncoding":"ISO-8859-1","useBodyEncodingForUri":true}

OssMountDescs

string

No

The description of the OSS mount. The value is a JSON string. The following parameters are supported:

  • bucketName: the name of the bucket.

  • bucketPath: the directory or object that you created in OSS. An exception occurs if the specified OSS mount directory does not exist.

  • mountPath: The path in the SAE container. If the path exists, the new path overwrites the existing one. If the path does not exist, a new path is created.

  • readOnly: specifies whether a container has the read-only permission on the resources in the mount directory.
    • true: The container has the read-only permission.

    • false: The container has the read and write permissions.

[{"bucketName": "oss-bucket", "bucketPath": "data/user.data", "mountPath": "/usr/data/user.data", "readOnly": true}]

OssAkId

string

No

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

xxxxxx

OssAkSecret

string

No

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

xxxxxx

Php

string

No

The ID of the Container Registry Enterprise Edition instance.

cri-xxxxxx

AcrInstanceId

string

No

The ID of the Container Registry Enterprise Edition instance. This parameter is required if ImageUrl is set to an image in a Container Registry Enterprise Edition instance.

cri-xxxxxx

AcrAssumeRoleArn

string

No

The Alibaba Cloud Resource Name (ARN) of the RAM role that is required 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

ImagePullSecrets

string

No

The ID of the secret.

10

EnableImageAccl

boolean

No

Specifies whether to enable image acceleration.

TriggerConfig

string

No

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

  • Cron job: Set the type field to time, the config field to a cron expression, and the timezone field to the desired time zone. Example: {"type":"time","config":"0 1 */1 * ?","timezone":"GMT+8:00"}

  • One-time job: Set the type field to http and configure the config field with specific HTTP trigger rules. 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"}

ConcurrencyPolicy

string

No

The policy of running concurrent jobs. Valid values:

  • Forbid: A new job is not created if the previous job is not completed.

  • Allow: Concurrent jobs are allowed.

  • Replace: When the time to create a new job is reached, the new job replaces the previous job if the previous job is not completed.

Allow

Timeout

integer

No

The timeout period for the job. Unit: seconds.

3600

BackoffLimit

integer

No

The number of retries for the job.

3

Slice

boolean

No

Enables job sharding.

true

SliceEnvs

string

No

The parameters for job sharding.

[0,1,2]

Replicas

string

No

The number of concurrent instances for the job.

3

RefAppId

string

No

The ID of the referenced application.

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

ProgrammingLanguage

string

No

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

java

Python

string

No

The Python environment. PYTHON 3.9.15 is supported.

PYTHON 3.9.15

PythonModules

string

No

The custom module dependencies. By default, the dependencies that are defined in the requirements.txt file in the root directory of the package are installed. If you do not configure this parameter or the package does not have a requirements.txt file, you can specify the dependencies that you want to install.

Flask==2.0

NasConfigs

string

No

The configurations of mounting a NAS file system.

BestEffortType

string

No

The BestEffort policy.

Response elements

Element

Type

Description

Example

object

Information about the updated job template.

RequestId

string

The request ID.

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

Message

string

The response message.

  • success if the request is successful.

  • An error code if the request fails.

success

TraceId

string

The trace ID that you can use to query the details of a request.

ac1a0b2215622246421415014e****

Data

object

The data that is returned.

ChangeOrderId

string

The change order ID. You can use this ID to query the execution status of the job.

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

AppId

string

The job template ID.

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

ErrorCode

string

  • This parameter is not returned if the request is successful.

  • This parameter is returned if the request fails. For more information, see the Error codes section of this topic.

Code

string

The HTTP status code.

  • 2xx: The request is successful.

  • 3xx: The request is redirected.

  • 4xx: The request is invalid.

  • 5xx: A server error occurred.

200

Success

boolean

Indicates whether the job template was updated. Valid values:

  • true

  • false

true

Examples

Success response

JSON format

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

Error codes

HTTP status code

Error code

Error message

Description

400 Application.MissingJdk Your application must at least contain a JDK component.
400 InvalidApplication.NotFound The current application does not exist.
400 InvalidComponent.NotFound The current component (such as JDK, Tomcat, or EDASWebContainer) does not exist.
400 InvalidHostnameIp.Invalid The hostname and/or IP is invalid: Hostname [%s], IP [%s].
400 InvalidInstanceSpecification.Unsupported The instance specification is not supported: CPU [%s], memory [%s].
400 InvalidPackageType.NotFound The package type must be War, FatJar, or Image.
400 InvalidParameter.FileName The 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.
400 InvalidParameter.NotEmpty You must specify the parameter %s.
400 InvalidParameter.Obviously The specified parameter is invalid {%s}.
400 InvalidParameter.WithMessage The parameter is invalid {%s}: %s
400 JarApplication.MissingJdk A FatJar application must contain JDK.
400 NoComputeResourceQuota.Exceed Your compute resource is insufficient. Please contact us to raise the quota.
400 PandoraApplication.MissingJdk The Pandora application is missing a JDK component.
400 PandoraApplication.OnlyJdk A Pandora application only requires JDK component.
400 WarApplication.MissingJdkWebcontainer A War application must contain JDK and Tomcat.
400 LogService.ConfigQuotaExceed The 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.
400 LogService.InternalError An 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.
400 LogService.LogDirInvalid The log collection path is invalid. The log collection path is invalid.
400 LogService.NotAvailable Log Service is unavailable. Please activate Log Service first. The log service is not available. Please open the log service first.
400 LogService.ProjectNumQuotaExceed The 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.
400 user.indebt The user has an outstanding payment.
400 NoComputeResourceQuota.App.Exceed You 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.
400 NoComputeResourceQuota.User.Exceed Your 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.
400 System.Upgrading The system is being upgraded. Please try again later.
400 VolumnPath.Conflict Conflict between log collection directory and persistent storage directory. Conflict between log collection directory and persistent storage directory.
400 Application.ChangerOrderRunning An application change process is in progress. Please try again later. An application change process is in progress. Please try again later.
400 Application.InvalidStatus The application status is abnormal. Please try again later. The application status is abnormal. Please try again later.
400 MountConflict.ConfigMap Conflict detected for ConfigMap path %s.
400 NotFound.ConfigMap The ConfigMap object (ID: %s) does not exist.
400 NotFound.ConfigMapKey The key %s of ConfigMap object (ID: %s) does not exist.
400 Package.Version.Too.Long The maximum length of package version is exceeded. This package version is too long.
400 App.Package.Version.Exists The package version of application already exists. The package version of application already exists.
400 Slb.Occupied The SLB instance is occupied. This SLB is occupied.
400 Slb.Tag.Not.Qualified The 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.
400 MinReadyInstances.Not.Smaller.Replicas The 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.
400 BatchWaitTime.Not.Smaller.Zero BatchWaitTime must not be smaller than zero. BatchWaitTime must not be smaller than zero.
400 Sls.Config.Mixed.Multi.Project The specified Config contains multiple projects.
400 Sls.Config.User.Defined.Missing.Logstore.Info The specified Config is invalid. Both Project and Logstore must be specified.
400 Sls.Config.User.Defined.Missing.Project.Info The specified Config is invalid. Both Project and Logstore must be specified.
400 Sls.Logstore.Name.Invalid The specified name of Logstore is invalid. The Logstore name must not contain the prefix "sae-".
400 Sls.Logstore.User.Defined.Not.Exist The user defined Logstore does not exist.
400 Sls.Project.Name.Invalid The specified project name is invalid. The project name must not contain the prefix "sae-".
400 Sls.Project.User.Defined.Not.Exist The user defined project does not exist.
400 Sae.Errorcode.Ahas.Create.Error.Message Failed to create AHAS.
400 InvalidImageUrl.AcrInstanceId.Domain.NotMatch The specified domain of ImageUrl does not match AcrInstanceId domains.
400 PhpApplication.MissingPhpRuntime A PHP application must contain PHP Runtime.
404 InvalidNamespaceId.NotFound The specified NamespaceId does not exist.
404 InvalidAcrInstanceId.NotFound The specified AcrInstanceId does not exist.
404 Associate.Eip.Not.Enough No sufficient EIPs are available.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.