You can call the UpdateJob operation to update a job template.
Try it now
Test
RAM authorization
|
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 JDK version that the deployment package depends on. Supported versions:
Not supported when Package Type is Image. |
Open JDK 8 |
| WebContainer |
string |
No |
The Tomcat version that the deployment package depends on. Supported versions:
Not supported when Package Type is Image. |
apache-tomcat-7.0.91 |
| PackageVersion |
string |
No |
The version number of the deployment package. Required when Package Type is FatJar, War, or PythonZip. |
1.0.1 |
| PackageUrl |
string |
No |
The URL of the deployment package. Required when Package Type is FatJar, War, or PythonZip. |
http://myoss.oss-cn-hangzhou.aliyuncs.com/my-buc/2019-06-30/****.jar |
| ImageUrl |
string |
No |
The image address. Required when Package Type is Image. |
registry.cn-hangzhou.aliyuncs.com/sae_test/ali_sae_test:0.0.1 |
| Command |
string |
No |
The startup command for the image. This command must be an executable object that exists in the container. Example:
In this example, Command="echo" and |
echo |
| CommandArgs |
string |
No |
The arguments for the startup command Command. Format:
In the preceding example, |
["a","b"] |
| Envs |
string |
No |
Environment variables for the container. You can define custom environment variables or reference ConfigMaps. To reference a ConfigMap, create a ConfigMap instance first. For more information, see CreateConfigMap. Values:
|
[{"name":"envtmp","value":"0"}] |
| CustomHostAlias |
string |
No |
Custom host mappings in the container. Values:
|
[{"hostName":"samplehost","ip":"127.0.0.1"}] |
| JarStartOptions |
string |
No |
Startup options for JAR packages. Default startup command: |
custom-option |
| JarStartArgs |
string |
No |
Startup arguments for JAR packages. Default startup command: |
-Xms4G -Xmx4G |
| EdasContainerVersion |
string |
No |
The runtime environment version for jobs in the HSF framework, such as the Ali-Tomcat container. |
3.5.3 |
| SlsConfigs |
string |
No |
Configuration for log collection to Simple Log Service (SLS).
Parameters:
If the SLS collection configuration remains unchanged during redeployment, you do not need to specify this parameter (exclude the SlsConfigs field from the request). To disable SLS collection, set this field to an empty string (SlsConfigs=""). Note
Projects automatically created with job templates are deleted when the job templates are deleted. Therefore, do not select SAE-auto-created projects when choosing an existing project. |
[{"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 NAS file system. If the NAS configuration remains unchanged during deployment, you do not need to specify this parameter (exclude the NasId field from the request). To clear the NAS configuration, set this field to an empty string (NasId=""). |
10d3b4**** |
| MountHost |
string |
No |
The mount target of the NAS file system in the VPC of the job template. If the NAS configuration remains unchanged during deployment, you do not need to specify this parameter (exclude the MountHost field from the request). To clear the NAS configuration, set this field to an empty string (MountHost=""). |
10d3b4bc9****.com |
| MountDesc |
string |
No |
The NAS mount description. If the NAS configuration remains unchanged during deployment, you do not need to specify this parameter (exclude the MountDesc field from the request). To clear the NAS configuration, set this field to an empty string (MountDesc=""). |
[{mountPath: "/tmp", nasPath: "/"}] |
| PostStart |
string |
No |
A script that runs after the container starts. This script runs immediately after the container is created. Format: |
{"exec":{"command":["sh","-c","echo hello"]}} |
| PreStop |
string |
No |
A script that runs before the container stops. This script runs before the container is deleted. Format: |
{"exec":{"command":["sh","-c","echo hello"]}} |
| WarStartOptions |
string |
No |
The startup command for WAR package deployment tasks. The configuration steps are the same as those for image deployment startup commands. For more information, see Configure startup commands. |
CATALINA_OPTS=\"$CATALINA_OPTS $Options\" catalina.sh run |
| ConfigMapMountDesc |
string |
No |
The ConfigMap mount description. Use ConfigMaps created on the namespace ConfigMap page to inject configuration information into containers. Parameters:
Note
You can mount all keys by passing the
|
[{"configMapId":16,"key":"test","mountPath":"/tmp"}] |
| TerminationGracePeriodSeconds |
integer |
No |
The graceful shutdown timeout period. Default value: 30. Unit: seconds. Valid values: 1 to 300. |
10 |
| PhpConfigLocation |
string |
No |
The mount path for the PHP task startup configuration file. Ensure that the PHP server uses this configuration file to start. |
/usr/local/etc/php/php.ini |
| PhpConfig |
string |
No |
The content of the PHP configuration file. |
k1=v1 |
| TomcatConfig |
string |
No |
Tomcat file configuration. Set this parameter to "" or "{}" to delete the configuration. Parameters:
|
{"port":8080,"contextPath":"/","maxThreads":400,"uriEncoding":"ISO-8859-1","useBodyEncodingForUri":true} |
| OssMountDescs |
string |
No |
OSS mount description. Parameters:
|
[{"bucketName": "oss-bucket", "bucketPath": "data/user.data", "mountPath": "/usr/data/user.data", "readOnly": true}] |
| OssAkId |
string |
No |
The AccessKey ID for OSS read and write operations. |
xxxxxx |
| OssAkSecret |
string |
No |
The AccessKey secret for OSS read and write operations. |
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. Required when ImageUrl is from Container Registry Enterprise Edition. |
cri-xxxxxx |
| AcrAssumeRoleArn |
string |
No |
The ARN of the RAM role required for cross-account image pulling. For more information, see Authorize cross-cloud account access using RAM roles. |
acs:ram::123456789012****:role/adminrole |
| ImagePullSecrets |
string |
No |
The ID of the corresponding secret. |
10 |
| EnableImageAccl |
boolean |
No |
||
| TriggerConfig |
string |
No |
Job trigger configuration based on job type.
|
{"type":"time","config":"0 1 */1 * ?","timezone":"GMT+8:00"} |
| ConcurrencyPolicy |
string |
No |
Job concurrency policy. Values:
|
Allow |
| Timeout |
integer |
No |
The job timeout period. Unit: seconds. |
3600 |
| BackoffLimit |
integer |
No |
The number of job retries. |
3 |
| Slice |
boolean |
No |
Enable job sharding. |
true |
| SliceEnvs |
string |
No |
Job sharding parameters. |
[0,1,2] |
| Replicas |
string |
No |
The number of concurrent job instances. |
3 |
| RefAppId |
string |
No |
The ID of the referenced job target. |
7171a6ca-d1cd-4928-8642-7d5cfe69**** |
| ProgrammingLanguage |
string |
No |
The programming language of the program. Supported languages: java, php, python, and shell. |
java |
| Python |
string |
No |
The Python environment. Supports PYTHON 3.9.15. |
PYTHON 3.9.15 |
| PythonModules |
string |
No |
Dependencies for custom installation. By default, dependencies defined in requirements.txt in the root directory are installed. If no configuration or custom packages are provided, you can specify the dependencies to install. |
Flask==2.0 |
| NasConfigs |
string |
No |
||
| BestEffortType |
string |
No |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The updated job template information. |
||
| RequestId |
string |
The request ID. |
01CF26C7-00A3-4AA6-BA76-7E95F2A3*** |
| Message |
string |
Additional information. Values:
|
success |
| TraceId |
string |
The trace ID used for precise query of call information. |
ac1a0b2215622246421415014e**** |
| Data |
object |
The response result. |
|
| ChangeOrderId |
string |
The ID of the returned change order, which is used to query the job execution status. |
01db03d3-3ee9-48b3-b3d0-dfce2d88**** |
| AppId |
string |
The job template ID. |
7171a6ca-d1cd-4928-8642-7d5cfe69**** |
| ErrorCode |
string |
The error code. Values:
|
空 |
| Code |
string |
The API status or POP error code. Values:
|
200 |
| Success |
boolean |
Indicates whether the job template is updated successfully. Values:
|
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.