public static final class CreateJobRequest.Builder extends Object
| 限定符和类型 | 方法和说明 |
|---|---|
CreateJobRequest.Builder |
acrAssumeRoleArn(String acrAssumeRoleArn)
The Alibaba Cloud Resource Name (ARN) required for a RAM role to obtain images across accounts.
|
CreateJobRequest.Builder |
acrInstanceId(String acrInstanceId)
The ID of Container Registry Enterprise Edition instance N.
|
CreateJobRequest.Builder |
appDescription(String appDescription)
The description of the template.
|
CreateJobRequest.Builder |
appName(String appName)
The name of the job template.
|
CreateJobRequest.Builder |
autoConfig(Boolean autoConfig)
Specifies whether to automatically configure the network environment.
|
CreateJobRequest.Builder |
backoffLimit(Long backoffLimit)
The number of times the job is retried.
|
CreateJobRequest.Builder |
bestEffortType(String bestEffortType)
BestEffortType.
|
CreateJobRequest |
build() |
CreateJobRequest.Builder |
command(String command)
The command that is used to start the image.
|
CreateJobRequest.Builder |
commandArgs(String commandArgs)
The parameters of the image startup command.
|
CreateJobRequest.Builder |
concurrencyPolicy(String concurrencyPolicy)
The concurrency policy of the job.
|
CreateJobRequest.Builder |
configMapMountDesc(String configMapMountDesc)
The description of the ConfigMap instance mounted to the application.
|
CreateJobRequest.Builder |
cpu(Integer cpu)
The CPU specifications that are required for each instance.
|
CreateJobRequest.Builder |
customHostAlias(String customHostAlias)
The custom mappings between hostnames and IP addresses in the container.
|
CreateJobRequest.Builder |
edasContainerVersion(String edasContainerVersion)
The version of the container, such as Ali-Tomcat, in which an application developed based on High-speed Service Framework (HSF) is deployed.
|
CreateJobRequest.Builder |
enableImageAccl(Boolean enableImageAccl)
EnableImageAccl.
|
CreateJobRequest.Builder |
envs(String envs)
The environment variables.
|
CreateJobRequest.Builder |
imagePullSecrets(String imagePullSecrets)
The ID of the corresponding Secret.
|
CreateJobRequest.Builder |
imageUrl(String imageUrl)
The URL of the image.
|
CreateJobRequest.Builder |
jarStartArgs(String jarStartArgs)
The arguments in the JAR package.
|
CreateJobRequest.Builder |
jarStartOptions(String jarStartOptions)
The option settings in the JAR package.
|
CreateJobRequest.Builder |
jdk(String jdk)
The version of the Java development kit (JDK) on which the deployment package of the application depends.
|
CreateJobRequest.Builder |
memory(Integer memory)
The size of memory required by each instance.
|
CreateJobRequest.Builder |
mountDesc(String mountDesc)
The configurations for mounting the NAS file system.
|
CreateJobRequest.Builder |
mountHost(String mountHost)
The mount target of the NAS file system in the VPC where the application is deployed.
|
CreateJobRequest.Builder |
namespaceId(String namespaceId)
The ID of the Serverless App Engine (SAE) namespace.
|
CreateJobRequest.Builder |
nasConfigs(String nasConfigs)
NasConfigs.
|
CreateJobRequest.Builder |
nasId(String nasId)
The ID of the Apsara File Storage NAS file system.
|
CreateJobRequest.Builder |
ossAkId(String ossAkId)
The AccessKey ID that is used to read data from and write data to Object Storage Service (OSS) buckets.
|
CreateJobRequest.Builder |
ossAkSecret(String ossAkSecret)
The AccessKey secret that is used to read data from and write data to OSS buckets.
|
CreateJobRequest.Builder |
ossMountDescs(String ossMountDescs)
Information of the Object Storage Service (OSS) bucket mounted to the application.
|
CreateJobRequest.Builder |
packageType(String packageType)
The type of the deployment package.
|
CreateJobRequest.Builder |
packageUrl(String packageUrl)
The address of the deployment package.
|
CreateJobRequest.Builder |
packageVersion(String packageVersion)
The version of the deployment package.
|
CreateJobRequest.Builder |
phpConfig(String phpConfig)
The details of the PHP configuration file.
|
CreateJobRequest.Builder |
phpConfigLocation(String phpConfigLocation)
The path on which the PHP configuration file for application startup is mounted.
|
CreateJobRequest.Builder |
postStart(String postStart)
The script that is run immediately after the container is started.
|
CreateJobRequest.Builder |
preStop(String preStop)
The script that is run before the container is stopped.
|
CreateJobRequest.Builder |
programmingLanguage(String programmingLanguage)
The programming language.
|
CreateJobRequest.Builder |
python(String python)
The Python environment.
|
CreateJobRequest.Builder |
pythonModules(String pythonModules)
The configurations for installing custom module dependencies.
|
CreateJobRequest.Builder |
refAppId(String refAppId)
The ID of the job that you reference.
|
CreateJobRequest.Builder |
replicas(Integer replicas)
The number of concurrent instances.
|
CreateJobRequest.Builder |
securityGroupId(String securityGroupId)
The ID of the security group.
|
CreateJobRequest.Builder |
slice(Boolean slice)
Specifies whether to enable job sharding.
|
CreateJobRequest.Builder |
sliceEnvs(String sliceEnvs)
The parameters of job sharding.
|
CreateJobRequest.Builder |
slsConfigs(String slsConfigs)
The logging configurations of Log Service.
|
CreateJobRequest.Builder |
terminationGracePeriodSeconds(Integer terminationGracePeriodSeconds)
The timeout period for a graceful shutdown.
|
CreateJobRequest.Builder |
timeout(Long timeout)
The timeout period.
|
CreateJobRequest.Builder |
timezone(String timezone)
The time zone.
|
CreateJobRequest.Builder |
tomcatConfig(String tomcatConfig)
The Tomcat configuration.
|
CreateJobRequest.Builder |
triggerConfig(String triggerConfig)
TriggerConfig.
|
CreateJobRequest.Builder |
vpcId(String vpcId)
The ID of the virtual private cloud (VPC) that corresponds to the SAE namespace.
|
CreateJobRequest.Builder |
vSwitchId(String vSwitchId)
The vSwitch to which the elastic network interface (ENI) of the application instance is connected.
|
CreateJobRequest.Builder |
warStartOptions(String warStartOptions)
The startup command of the WAR package.
|
CreateJobRequest.Builder |
webContainer(String webContainer)
The version of the Tomcat container on which the deployment package depends.
|
CreateJobRequest.Builder |
workload(String workload)
Set the value to
job. |
public CreateJobRequest.Builder acrAssumeRoleArn(String acrAssumeRoleArn)
The Alibaba Cloud Resource Name (ARN) required for a RAM role to obtain images across accounts. For more information, see Grant permissions across Alibaba Cloud accounts by using a RAM role.
example:acs:ram::123456789012****:role/adminrole
public CreateJobRequest.Builder acrInstanceId(String acrInstanceId)
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.
example:cri-xxxxxx
public CreateJobRequest.Builder appDescription(String appDescription)
The description of the template. The description cannot exceed 1,024 characters in length.
example:This is a test description.
public CreateJobRequest.Builder appName(String appName)
The name of the job template. The name can contain digits, letters, and hyphens (-). The name must start with a letter and cannot exceed 36 characters in length.
This parameter is required.
example:test
public CreateJobRequest.Builder autoConfig(Boolean autoConfig)
Specifies whether to automatically configure the network environment. Take note of the following rules:
false
public CreateJobRequest.Builder backoffLimit(Long backoffLimit)
The number of times the job is retried.
example:3
public CreateJobRequest.Builder bestEffortType(String bestEffortType)
public CreateJobRequest.Builder command(String command)
The command that is used to start the image. The command must be an existing executable object in the container. Sample statements:
command:
- echo
- abc
- >
- file0
In this example, the Command parameter is set to Command="echo", CommandArgs=["abc", ">", "file0"].
echo
public CreateJobRequest.Builder commandArgs(String commandArgs)
The parameters of the image startup command. The CommandArgs parameter specifies the parameters that are required for the Command parameter. You can specify the name in one of the following formats:
["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"]
public CreateJobRequest.Builder concurrencyPolicy(String concurrencyPolicy)
The concurrency policy of the job. Take note of the following rules:
Allow
public CreateJobRequest.Builder configMapMountDesc(String configMapMountDesc)
The description of the ConfigMap instance mounted to the application. Use configurations created on the Configuration Items page to configure containers. The following table describes the parameters that are used in the preceding statements.
You can use the
sae-sys-configmap-allkey to mount all keys.
[{"configMapId":16,"key":"test","mountPath":"/tmp"}]
public CreateJobRequest.Builder cpu(Integer cpu)
The CPU specifications that are required for each instance. Unit: millicores. You cannot set this parameter to 0. Valid values:
1000
public CreateJobRequest.Builder customHostAlias(String customHostAlias)
The custom mappings between hostnames and IP addresses in the container. Take note of the following rules:
[{"hostName":"samplehost","ip":"127.0.0.1"}]
public CreateJobRequest.Builder edasContainerVersion(String edasContainerVersion)
The version of the container, such as Ali-Tomcat, in which an application developed based on High-speed Service Framework (HSF) is deployed.
example:3.5.3
public CreateJobRequest.Builder enableImageAccl(Boolean enableImageAccl)
public CreateJobRequest.Builder envs(String envs)
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. Take note of the following rules:
Customize
Reference ConfigMap
sae-sys-configmap-all-<ConfigMap name>. Example: sae-sys-configmap-all-test1.configMapRef.[{"name":"envtmp","value":"0"}]
public CreateJobRequest.Builder imagePullSecrets(String imagePullSecrets)
The ID of the corresponding Secret.
example:10
public CreateJobRequest.Builder imageUrl(String imageUrl)
The URL of the image. This parameter is returned only if the PackageType parameter is set to Image.
example:registry.cn-hangzhou.aliyuncs.com/sae_test/ali_sae_test:0.0.1
public CreateJobRequest.Builder jarStartArgs(String jarStartArgs)
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
public CreateJobRequest.Builder jarStartOptions(String jarStartOptions)
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
public CreateJobRequest.Builder jdk(String jdk)
The version of the Java development kit (JDK) on which the deployment package of the application depends. The following versions are supported:
This parameter is not returned if the PackageType parameter is set to Image.
example:Open JDK 8
public CreateJobRequest.Builder memory(Integer memory)
The size of memory required by each instance. Unit: MB. You cannot set this parameter to 0. The values of this parameter correspond to the values of the Cpu parameter:
1024
public CreateJobRequest.Builder mountDesc(String mountDesc)
The configurations for mounting the NAS file system. After the application is created, you may want to call other operations to manage the application. If you do not want to change the NAS configurations in these subsequent operations, you can omit the MountDesc parameter in the requests. If you want to unmount the NAS file system, you must set the MountDesc values in the subsequent requests to an empty string ("").
example:[{mountPath: "/tmp", nasPath: "/"}]
public CreateJobRequest.Builder mountHost(String mountHost)
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.
example:10d3b4bc9****.com
public CreateJobRequest.Builder namespaceId(String namespaceId)
The ID of the Serverless App Engine (SAE) namespace. The ID can contain only lowercase letters and hyphens (-). It must start with a lowercase letter.
example:cn-beijing:test
public CreateJobRequest.Builder nasConfigs(String nasConfigs)
public CreateJobRequest.Builder nasId(String nasId)
The ID of the Apsara File Storage NAS file system. After the application is created, you may want to call other operations to manage the application. If you do not want to change the NAS configurations in these subsequent operations, you can omit the NasId parameter in the requests. If you want to unmount the NAS file system, you must set the NasId values in the subsequent requests to an empty string ("").
example:10d3b4****
public CreateJobRequest.Builder ossAkId(String ossAkId)
The AccessKey ID that is used to read data from and write data to Object Storage Service (OSS) buckets.
example:xxxxxx
public CreateJobRequest.Builder ossAkSecret(String ossAkSecret)
The AccessKey secret that is used to read data from and write data to OSS buckets.
example:xxxxxx
public CreateJobRequest.Builder ossMountDescs(String ossMountDescs)
Information of the Object Storage Service (OSS) bucket mounted to the application. The following table describes the parameters that are used in the preceding statements.
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:
[{"bucketName": "oss-bucket", "bucketPath": "data/user.data", "mountPath": "/usr/data/user.data", "readOnly": true}]
public CreateJobRequest.Builder packageType(String packageType)
The type of the deployment package. Take note of the following rules:
PhpZip IMAGE_PHP_5_4 IMAGE_PHP_5_4_ALPINE IMAGE_PHP_5_5 IMAGE_PHP_5_5_ALPINE IMAGE_PHP_5_6 IMAGE_PHP_5_6_ALPINE IMAGE_PHP_7_0 IMAGE_PHP_7_0_ALPINE IMAGE_PHP_7_1 IMAGE_PHP_7_1_ALPINE IMAGE_PHP_7_2 IMAGE_PHP_7_2_ALPINE IMAGE_PHP_7_3 IMAGE_PHP_7_3_ALPINE
This parameter is required.
example:FatJar
public CreateJobRequest.Builder packageUrl(String packageUrl)
The address of the deployment package. This parameter is required if you set PackageType to FatJar, War, or PythonZip.
example:http://myoss.oss-cn-hangzhou.aliyuncs.com/my-buc/2019-06-30/****.jar
public CreateJobRequest.Builder packageVersion(String packageVersion)
The version of the deployment package. This parameter is required if you set PackageType to FatJar, War, or PythonZip.
example:1.0.1
public CreateJobRequest.Builder phpConfig(String phpConfig)
The details of the PHP configuration file.
example:k1=v1
public CreateJobRequest.Builder phpConfigLocation(String phpConfigLocation)
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.
example:/usr/local/etc/php/php.ini
public CreateJobRequest.Builder postStart(String postStart)
The script that is run immediately after the container is started. Example: {"exec":{"command":["sh","-c","echo hello"\]}}
{"exec":{"command":["sh","-c","echo hello"]}}
public CreateJobRequest.Builder preStop(String preStop)
The script that is run before the container is stopped. Example: {"exec":{"command":["sh","-c","echo hello"\]}}
{"exec":{"command":["sh","-c","echo hello"]}}
public CreateJobRequest.Builder programmingLanguage(String programmingLanguage)
The programming language. Valid values: java, php, python, and shell.
example:java
public CreateJobRequest.Builder python(String python)
The Python environment. Set the value to PYTHON 3.9.15.
example:PYTHON 3.9.15
public CreateJobRequest.Builder pythonModules(String pythonModules)
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.
example:Flask==2.0
public CreateJobRequest.Builder refAppId(String refAppId)
The ID of the job that you reference.
example:7171a6ca-d1cd-4928-8642-7d5cfe69****
public CreateJobRequest.Builder replicas(Integer replicas)
The number of concurrent instances.
This parameter is required.
example:3
public CreateJobRequest.Builder securityGroupId(String securityGroupId)
The ID of the security group.
example:sg-wz969ngg2e49q5i4****
public CreateJobRequest.Builder slice(Boolean slice)
Specifies whether to enable job sharding.
example:true
public CreateJobRequest.Builder sliceEnvs(String sliceEnvs)
The parameters of job sharding.
example:[0,1,2]
public CreateJobRequest.Builder slsConfigs(String slsConfigs)
The logging configurations of Log Service.
[{"logDir":"","logType":"stdout"},{"logDir":"/tmp/a.log"}].[{"projectName":"test-sls","logType":"stdout","logDir":"","logstoreName":"sae","logtailName":""},{"projectName":"test","logDir":"/tmp/a.log","logstoreName":"sae","logtailName":""}].The following table describes the parameters that are used in the preceding statements.
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.
example: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"}]
public CreateJobRequest.Builder terminationGracePeriodSeconds(Integer terminationGracePeriodSeconds)
The timeout period for a graceful shutdown. Default value: 30. Unit: seconds. Valid values: 1 to 300.
example:10
public CreateJobRequest.Builder timeout(Long timeout)
The timeout period. Unit: seconds.
example:3600
public CreateJobRequest.Builder timezone(String timezone)
The time zone. Default value: Asia/Shanghai.
example:Asia/Shanghai
public CreateJobRequest.Builder tomcatConfig(String tomcatConfig)
The Tomcat configuration. If you want to cancel this configuration, set this parameter to "" or "{}". The following variables are included in the configuration: Take note of the following rules:
{"port":8080,"contextPath":"/","maxThreads":400,"uriEncoding":"ISO-8859-1","useBodyEncodingForUri":true}
public CreateJobRequest.Builder triggerConfig(String triggerConfig)
public CreateJobRequest.Builder vSwitchId(String vSwitchId)
The vSwitch to which the elastic network interface (ENI) of the application instance is connected. The vSwitch must be located in the VPC specified by the VpcId parameter. The SAE namespace is bound with this vSwitch. The default value is the ID of the vSwitch that is bound to the namespace.
example:vsw-bp12mw1f8k3jgygk9****
public CreateJobRequest.Builder vpcId(String vpcId)
The ID of the virtual private cloud (VPC) that corresponds to the SAE namespace. In SAE, once correspondence is configured between a namespace and a VPC, the namespace cannot correspond to other VPCs. When the SAE application is created within the namespace, the application is bound with the VPC. Multiple namespaces can correspond to the same VPC. The default value is the ID of the VPC that is bound to the namespace.
example:vpc-bp1aevy8sofi8mh1q****
public CreateJobRequest.Builder warStartOptions(String warStartOptions)
The startup command of the WAR package. For information about how to configure the startup command, see Configure startup commands.
example:CATALINA_OPTS="$CATALINA_OPTS $Options" catalina.sh run
public CreateJobRequest.Builder webContainer(String webContainer)
The version of the Tomcat container on which the deployment package depends. Valid values:
This parameter is not returned if the PackageType parameter is set to Image.
example:apache-tomcat-7.0.91
public CreateJobRequest.Builder workload(String workload)
Set the value to job.
This parameter is required.
example:job
public CreateJobRequest build()
Copyright © 2026. All rights reserved.