Creates an application.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
sae:CreateApplication |
create |
*All Resource
|
None | None |
Request syntax
POST /pop/v1/sam/app/createApplication HTTP/1.1
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| AppName |
string |
Yes |
The application name. It can contain digits, letters, and hyphens (-). It must start with a letter and cannot end with a hyphen (-). The name cannot exceed 36 characters. |
test |
| NamespaceId |
string |
No |
The SAE namespace ID. Only namespaces with names that consist of lowercase letters and hyphens (-) are supported. The name must start with a letter. You can get the namespace by calling the DescribeNamespaceList API. |
cn-beijing:test |
| AppDescription |
string |
No |
The application description. It cannot exceed 1,024 characters. |
This is a test description. |
| VpcId |
string |
No |
The VPC associated with the SAE namespace. In SAE, one namespace can only be associated with one VPC, and this association cannot be changed. The binding relationship is established when you create the first SAE application in the namespace. Multiple namespaces can be associated with the same VPC. If you leave this field empty, the default VPC ID bound to the namespace is used. |
vpc-bp1aevy8sofi8mh1q**** |
| VSwitchId |
string |
No |
The virtual switch where the application instance's Elastic Network Interface (ENI) resides. This vSwitch must be in the VPC specified above. It has a binding relationship with the SAE namespace. If you leave this field empty, the default vSwitch ID bound to the namespace is used. |
vsw-bp12mw1f8k3jgygk9**** |
| PackageType |
string |
Yes |
The application package type. Valid values:
|
FatJar |
| PackageVersion |
string |
No |
The deployment package version. This parameter is required when Package Type is set to FatJar, War, or PythonZip. |
1.0.0 |
| PackageUrl |
string |
No |
The deployment package URL. This parameter is required when Package Type is set to FatJar, War, or PythonZip. |
http://myoss.oss-cn-****.aliyuncs.com/my-buc/2019-06-30/****.jar |
| ImageUrl |
string |
No |
The image address. This parameter is required when Package Type is set to Image. |
registry.cn-hangzhou.aliyuncs.com/sae_test/ali_sae_test:0.0.1 |
| Jdk |
string |
No |
The JDK version on which the deployment package depends. Supported versions:
This parameter is not supported when Package Type is set to Image. |
Open JDK 8 |
| WebContainer |
string |
No |
The Tomcat version on which the WebContainer deployment package depends. Supported versions:
This parameter is not supported when Package Type is set to Image. |
apache-tomcat-7.0.91 |
| Cpu |
integer |
No |
The CPU required for each instance, in milli-cores. The value cannot be 0. Only the following fixed specifications are supported:
|
1000 |
| Memory |
integer |
No |
The memory required for each instance, in MB. The value cannot be 0. Memory and CPU have a one-to-one mapping. Only the following fixed specifications are supported:
|
1024 |
| Replicas |
integer |
Yes |
The initial number of instances. |
1 |
| Command |
string |
No |
The image startup command. The command must refer to an executable object that exists in the container. Example:
Based on the preceding example, Important This parameter is required when PackageType is set to DotnetZip. |
echo |
| CommandArgs |
string |
No |
The arguments for the image startup command. These are the arguments required by the Command parameter. Format:
In the preceding example, Important This parameter is required when PackageType is set to DotnetZip. |
["a","b"] |
| Envs |
string |
No |
Container environment variables. You can define custom variables or reference configuration items. To reference a configuration item, create a ConfigMap instance first. For more information, see CreateConfigMap. Valid values:
|
[ { "name": "sae-sys-configmap-all-hello", "valueFrom": { "configMapRef": { "configMapId": 100, "key": "" } } }, { "name": "hello", "valueFrom": { "configMapRef": { "configMapId": 101, "key": "php-fpm" } } }, { "name": "envtmp", "value": "newenv" } ] |
| CustomHostAlias |
string |
No |
Custom host mapping in the container. Valid values:
|
[{"hostName":"samplehost","ip":"127.0.0.1"}] |
| JarStartOptions |
string |
No |
The JAR package startup options. The default startup command is: |
-Xms4G -Xmx4G |
| JarStartArgs |
string |
No |
The JAR package startup arguments. The default startup command is: |
custom-args |
| Liveness |
string |
No |
Container health check. Containers that fail the health check are shut down and recovered. Supported methods:
Note
You can use only one method for health checks. Parameters:
|
{"exec":{"command":["sh","-c","cat /home/admin/start.sh"]},"initialDelaySeconds":30,"periodSeconds":30,"timeoutSeconds":2} |
| Readiness |
string |
No |
Application startup status check. Containers that repeatedly fail the readiness check are shut down and restarted. Containers that fail the readiness check receive no SLB traffic. Supported methods: exec, httpGet, and tcpSocket. For examples, see the Liveness parameter. Note
You can use only one method for health checks. |
{"exec":{"command":["sh","-c","cat /home/admin/start.sh"]},"initialDelaySeconds":30,"periodSeconds":30,"timeoutSeconds":2} |
| Deploy |
boolean |
No |
Whether to deploy immediately. Valid values:
|
true |
| EdasContainerVersion |
string |
No |
The version of the application runtime environment in the HSF framework, such as the Ali-Tomcat container. |
3.5.3 |
| Timezone |
string |
No |
The time zone. Default is Asia/Shanghai. |
Asia/Shanghai |
| SlsConfigs |
string |
No |
The configuration for collecting logs to SLS.
Parameters:
If the SLS collection configuration does not change during redeployment, you do not need to set this parameter (that is, exclude the SlsConfigs field from the request). If you no longer need SLS collection, set this field to an empty string in the request (that is, set SlsConfigs to ""). Note
Projects automatically created with applications are deleted when the applications are deleted. Therefore, when selecting an existing project, do not choose a project automatically created by SAE. |
[{"logDir":"","logType":"stdout"},{"logDir":"/tmp/a.log"}] |
| NasId |
string |
No |
We do not recommend configuring this field. We recommend using NasConfigs. The ID of the NAS to mount. It must be in the same region as the cluster. It must have available mount target quotas, or its mount targets must already exist on the vSwitches in the VPC. If you leave this field empty and the mountDescs field exists, a NAS is automatically purchased and mounted to a vSwitch in the VPC. If the configuration does not change during deployment, you do not need to set this parameter (that is, exclude the NASId field from the request). If you want to clear the NAS configuration, set this field to an empty string in the request (that is, set NASId to ""). |
KSAK**** |
| MountHost |
string |
No |
We do not recommend configuring this field. We recommend using NasConfigs. The mount target of the NAS in the application VPC. If the configuration does not change during deployment, you do not need to set this parameter (that is, exclude the MountHost field from the request). If you want to clear the NAS configuration, set this field to an empty string in the request (that is, set MountHost to ""). |
example.com |
| MountDesc |
string |
No |
We do not recommend configuring this field. We recommend using NasConfigs. The NAS mount description. If the configuration does not change during deployment, you do not need to set this parameter (that is, exclude the MountDesc field from the request). If you want to clear the NAS configuration, set this field to an empty string in the request (that is, set MountDesc to ""). |
[{mountPath: "/tmp", nasPath: "/"}] |
| PreStop |
string |
No |
The script to run before the container stops. This script runs before the container is deleted. Format: |
{"exec":{"command":["cat","/etc/group"]}} |
| PostStart |
string |
No |
The script to run after the container starts. This script runs immediately after the container is created. Format: |
{"exec":{"command":["cat","/etc/group"]}} |
| WarStartOptions |
string |
No |
The startup command for WAR package deployment. The configuration steps are the same as those for image deployment. For more information, see Set startup commands. |
CATALINA_OPTS=\"$CATALINA_OPTS $Options\" catalina.sh run |
| ConfigMapMountDesc |
string |
No |
The ConfigMap mount description. Use configuration items created on the namespace configuration page to inject configuration information into containers. Parameters:
Note
You can mount all keys by passing the
|
[{"configMapId":16,"key":"test","mountPath":"/tmp"}] |
| SecurityGroupId |
string |
No |
The security group ID. |
sg-wz969ngg2e49q5i4**** |
| AutoConfig |
boolean |
No |
Whether to automatically configure the network environment. Valid values:
Note
If you set this parameter to true, any other NamespaceId you pass is ignored. |
true |
| TerminationGracePeriodSeconds |
integer |
No |
The graceful shutdown timeout, in seconds. Default is 30. Valid values: 1 to 300. |
30 |
| PhpArmsConfigLocation |
string |
No |
The mount path for PHP application monitoring. Ensure that the PHP server loads the configuration file at this path. You do not need to manage the configuration content. SAE automatically renders the correct configuration file. |
/usr/local/etc/php/conf.d/arms.ini |
| PhpConfigLocation |
string |
No |
The mount path for PHP application startup configuration. Ensure that the PHP server uses this configuration file to start. |
/usr/local/etc/php/php.ini |
| PhpConfig |
string |
No |
The PHP configuration file content. |
k1=v1 |
| TomcatConfig |
string |
No |
Tomcat file configuration. Set this to "" or "{}" to delete the configuration:
|
{"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 PHP version on which the PHP deployment package depends. This parameter is not supported for images. |
PHP-FPM 7.0 |
| AcrInstanceId |
string |
No |
The Container Registry (ACR) Enterprise Edition instance ID. This parameter is required when ImageUrl points to an ACR Enterprise Edition image. |
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 secret ID. |
10 |
| AssociateEip |
boolean |
No |
Whether to bind an EIP. Valid values:
|
true |
| ProgrammingLanguage |
string |
No |
The programming language of the application. Valid values:
|
java |
| KafkaConfigs |
string |
No |
The aggregated configuration for collecting logs to Kafka. Valid values:
|
{"kafkaEndpoint":"10.0.X.XXX:XXXX,10.0.X.XXX:XXXX,10.0.X.XXX:XXXX","kafkaInstanceId":"alikafka_pre-cn-7pp2l8kr****","kafkaConfigs":[{"logType":"file_log","logDir":"/tmp/a.log","kafkaTopic":"test2"},{"logType":"stdout","logDir":"","kafkaTopic":"test"}]} |
| PvtzDiscoverySvc |
string |
No |
Enable K8s Service registration and discovery. Valid values:
|
{"serviceName":"bwm-poc-sc-gateway-cn-beijing-front","namespaceId":"cn-beijing:front","portAndProtocol":{"18012":"TCP"},"enable":true,"portProtocols":[{"port":18012,"protocol":"TCP"}]} |
| MicroRegistration |
string |
No |
Select the Nacos registry. Valid values:
|
"0" |
| MicroRegistrationConfig |
string |
No |
Registry configuration. |
{\"instanceId\":\"mse-cn-zvp2bh6h70r\",\"namespace\":\"4c0aa74f-57cb-423c-b6af-5d9f2d0e3dbd\"} |
| NasConfigs |
string |
No |
NAS mount configuration. Valid values:
|
[{"mountPath":"/test1","readOnly":false,"nasId":"nasId1","mountDomain":"nasId1.cn-shenzhen.nas.aliyuncs.com","nasPath":"/test1"},{"nasId":"nasId2","mountDomain":"nasId2.cn-shenzhen.nas.aliyuncs.com","readOnly":false,"nasPath":"/test2","mountPath":"/test2"}] |
| Python |
string |
No |
The Python environment. Supports PYTHON 3.9.15. |
PYTHON 3.9.15 |
| PythonModules |
string |
No |
Custom module dependencies. By default, dependencies defined in requirements.txt in the root directory are installed. If you do not configure this or custom packages, you can specify dependencies to install. |
Flask==2.0 |
| Dotnet |
string |
No |
The .NET framework version:
|
.NET 3.1 |
| EnableEbpf |
string |
No |
Enable application monitoring for non-Java applications based on eBPF technology. Valid values:
|
false |
| SaeVersion |
string |
No |
The SAE version. Supported versions:
|
v1 |
| AppSource |
string |
No |
Set this to micro_service to create a microservice application. |
micro_service |
| BaseAppId |
string |
No |
The base application ID. |
ee99cce6-1c8e-4bfa-96c3-3e2fa9de8a41 |
| ServiceTags |
string |
No |
The grayscale tags configured for the application. |
{\"alicloud.service.tag\":\"g1\"} |
| EnableNewArms |
boolean |
No |
Whether to enable the new ARMS feature:
|
false |
| EnableCpuBurst |
boolean |
No |
Whether to enable the CPU Burst feature:
|
true |
| OidcRoleName |
string |
No |
Set the RAM role for identity authentication. Note
You must create an OIDC identity provider and an identity provider role in the same region in advance. For more information, see Create an OIDC identity provider and Create a role SSO identity provider. |
sae-test |
| SidecarContainersConfig |
array |
No |
Container configuration. |
|
| SidecarContainerConfig |
No |
Container configuration. |
||
| SecretMountDesc |
string |
No |
Secret mount description. Use secrets created on the namespace secret page to inject confidential information into containers. Parameters:
Note
You can mount all keys by passing the
|
[{“secretId":10,”key":"test","mountPath":"/tmp"}] |
| EnableSidecarResourceIsolated |
boolean |
No |
Whether to enable Sidecar resource isolation:
|
true |
| CustomImageNetworkType |
string |
No |
The custom image type. If the image is not custom, set this to an empty string:
|
internet |
| ResourceType |
string |
No |
The resource type. Supported types: NULL (default), default (default), and haiguang (Hygon server). |
NULL |
| NewSaeVersion |
string |
No |
The application edition:
|
pro |
| MicroserviceEngineConfig |
string |
No |
Configure microservice governance.
|
{"enable": true,"mseLosslessRule": {"delayTime": 0,"enable": false,"notice": false,"warmupTime": 120}} |
| DiskSize |
integer |
No |
Disk storage size, in GB. |
50 |
| InitContainersConfig |
array |
No |
Initialization container configuration. |
|
|
InitContainerConfig |
No |
Initialization container configuration |
||
| GpuConfig |
string |
No |
||
| StartupProbe |
string |
No |
Enable application startup probe.
Note
|
{"exec":{"command":["sh","-c","cat /home/admin/start.sh"]},"initialDelaySeconds":30,"periodSeconds":30,"timeoutSeconds":2} |
| IsStateful |
boolean |
No |
Whether the application is stateful. |
|
| EnablePrometheus |
boolean |
No |
Whether to enable Prometheus custom metric collection. |
false |
| HeadlessPvtzDiscoverySvc |
string |
No |
K8s Headless Service registration and discovery
|
{\"serviceName\":\"leaf-test-headless\",\"namespaceId\":\"cn-zhangjiakou:prod\"} |
| Html |
string |
No |
Nginx version
|
nginx 1.28 |
| EmptyDirDesc |
string |
No |
Shared temporary storage configuration. |
[{\"name\":\"workdir\",\"mountPath\":\"/usr/local/tomcat/webapps\"}] |
| AgentVersion |
string |
No |
AliyunAgent version |
4.4.2 |
| EnableNamespaceAgentVersion |
boolean |
No |
Whether to reuse the namespace Agent version configuration. |
true |
| EnableNamespaceSlsConfig |
boolean |
No |
Whether to reuse the namespace SLS log configuration. |
true |
| SlsLogEnvTags |
string |
No |
sls log tags |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The created application information. |
||
| RequestId |
string |
The request ID. |
91F93257-7A4A-4BD3-9A7E-2F6EAE6D**** |
| Message |
string |
Additional information. Valid values:
|
success |
| TraceId |
string |
The trace ID, used for precise query of call information. |
0a98a02315955564772843261e**** |
| Data |
object |
The response result. |
|
| ChangeOrderId |
string |
The deployment order ID returned, used to query task execution status. |
01db03d3-3ee9-48b3-b3d0-dfce2d88**** |
| AppId |
string |
The ID of the created application. |
017f39b8-dfa4-4e16-a84b-1dcee4b1**** |
| ErrorCode |
string |
The error code. Valid values:
|
空 |
| Code |
string |
The API status or POP error code. Valid values:
|
200 |
| Success |
boolean |
Whether the application was created successfully. Valid values:
|
true |
Examples
Success response
JSON format
{
"RequestId": "91F93257-7A4A-4BD3-9A7E-2F6EAE6D****",
"Message": "success",
"TraceId": "0a98a02315955564772843261e****",
"Data": {
"ChangeOrderId": "01db03d3-3ee9-48b3-b3d0-dfce2d88****",
"AppId": "017f39b8-dfa4-4e16-a84b-1dcee4b1****"
},
"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 | InvalidPackageType.NotFound | The package type must be War, FatJar, or Image. | |
| 400 | InvalidParameter.NotEmpty | You must specify the parameter %s. | |
| 400 | InvalidParameter.Obviously | The specified parameter is invalid {%s}. | |
| 400 | JarApplication.MissingJdk | A FatJar application must contain JDK. | |
| 400 | NoAvailableCluster.NotFound | No clusters are available for the current region. | |
| 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 | InvalidParameter.WithMessage | The parameter is invalid {%s}: %s | |
| 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 | InvalidServerlessRegion.Unsupported | The current region is not supported: %s | |
| 400 | WarApplication.MissingJdkWebcontainer | A War application must contain JDK and Tomcat. | |
| 400 | InvalidNamespace.WithUppercase | This namespace does not support creating SAE apps because it contains uppercase letters. | |
| 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 | 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 | 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 | InvalidImageUrl.AcrInstanceId.Domain.NotMatch | The specified domain of ImageUrl does not match AcrInstanceId domains. | |
| 400 | PhpApplication.MissingPhpRuntime | A PHP application must contain PHP Runtime. | |
| 400 | InvalidParameter.FileName | The application deployment package name is invalid. This name can contain only alphanumeric characters, hyphens (-), and underscores (_). For deploying java package, you can upload JAR files only if the selected deployment version supports JAR file. Otherwise, upload WAR files only. For deploying php package, you can upload ZIP files only if the selected deployment version supports ZIP file. | |
| 400 | Sls.Logtail.Name.Invalid | The specified name of Logtail is invalid. The Logtail name must not contain the prefix sae-. | |
| 400 | vswitch.not.exist | The specified vSwitch does not exist. | The specified vSwitch does not exist. Please change the vSwitch. |
| 400 | InvalidImageUrl.MissingAcrInstanceId | The specified domain of ImageUrl is from ACREE, but you are not specified AcrInstanceId. | |
| 400 | EnvFromSecretIdConflict.AlreadyExist | The specified SecretId [%s] already exist in the specified Envs. | |
| 400 | MountConflict.Secret | Conflict detected for Secret path %s. | Secret mount path% s has conflict. |
| 404 | Associate.Eip.Not.Enough | No sufficient EIPs are available. | |
| 404 | InvalidNamespaceId.NotFound | The specified NamespaceId does not exist. | |
| 404 | InvalidVpcId.NotFound | The specified VpcId does not exist. | |
| 404 | InvalidAcrInstanceId.NotFound | The specified AcrInstanceId does not exist. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.