Creates an application.
Debugging
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:
- The required resource types are displayed in bold characters.
- 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.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
sae:CreateApplication | create |
|
| none |
Request syntax
POST /pop/v1/sam/app/createApplication HTTP/1.1
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
AppName | string | Yes | test | test |
NamespaceId | string | No | cn-beijing:test | cn-beijing:test |
AppDescription | string | No | This is a test description. | This is a test description. |
VpcId | string | No | vpc-bp1aevy8sofi8mh1q**** | vpc-bp1aevy8sofi8mh1q**** |
VSwitchId | string | No | vsw-bp12mw1f8k3jgygk9**** | vsw-bp12mw1f8k3jgygk9**** |
PackageType | string | Yes | FatJar | FatJar |
PackageVersion | string | No | 1.0.0 | 1.0.0 |
PackageUrl | string | No | http://myoss.oss-cn-****.aliyuncs.com/my-buc/2019-06-30/****.jar | http://myoss.oss-cn-****.aliyuncs.com/my-buc/2019-06-30/****.jar |
ImageUrl | string | No | registry.cn-hangzhou.aliyuncs.com/sae_test/ali_sae_test:0.0.1 | registry.cn-hangzhou.aliyuncs.com/sae_test/ali_sae_test:0.0.1 |
Jdk | string | No | Open JDK 8 | Open JDK 8 |
WebContainer | string | No | apache-tomcat-7.0.91 | apache-tomcat-7.0.91 |
Cpu | integer | No | 1000 | 1000 |
Memory | integer | No | 1024 | 1024 |
Replicas | integer | Yes | 1 | 1 |
Command | string | No | sleep | echo |
CommandArgs | string | No | 1d | ["a","b"] |
Envs | string | No | [{"name":"envtmp","value":"0"}] | [{"name":"envtmp","value":"0"}] |
CustomHostAlias | string | No | [{"hostName":"samplehost","ip":"127.0.0.1"}] | [{"hostName":"samplehost","ip":"127.0.0.1"}] |
JarStartOptions | string | No | -Xms4G -Xmx4G | -Xms4G -Xmx4G |
JarStartArgs | string | No | custom-args | custom-args |
Liveness | string | No | {"exec":{"command":["sh","-c","cat /home/admin/start.sh"]},"initialDelaySeconds":30,"periodSeconds":30,"timeoutSeconds":2} | {"exec":{"command":["sh","-c","cat /home/admin/start.sh"]},"initialDelaySeconds":30,"periodSeconds":30,"timeoutSeconds":2} |
Readiness | string | No | {"exec":{"command":["sh","-c","cat /home/admin/start.sh"]},"initialDelaySeconds":30,"periodSeconds":30,"timeoutSeconds":2} | {"exec":{"command":["sh","-c","cat /home/admin/start.sh"]},"initialDelaySeconds":30,"periodSeconds":30,"timeoutSeconds":2} |
Deploy | boolean | No | true | true |
EdasContainerVersion | string | No | 3.5.3 | 3.5.3 |
Timezone | string | No | Asia/Shanghai | Asia/Shanghai |
SlsConfigs | string | No | [{"logDir":"","logType":"stdout"},{"logDir":"/tmp/a.log"}] | [{"logDir":"","logType":"stdout"},{"logDir":"/tmp/a.log"}] |
NasId | string | No | KSAK**** | KSAK**** |
MountHost | string | No | example.com | example.com |
MountDesc | string | No | [{mountPath: "/tmp", nasPath: "/"}] | [{mountPath: "/tmp", nasPath: "/"}] |
PreStop | string | No | {"exec":{"command":["cat","/etc/group"]}} | {"exec":{"command":["cat","/etc/group"]}} |
PostStart | string | No | {"exec":{"command":["cat","/etc/group"]}} | {"exec":{"command":["cat","/etc/group"]}} |
WarStartOptions | string | No | CATALINA_OPTS=\"$CATALINA_OPTS $Options\" catalina.sh run | CATALINA_OPTS=\"$CATALINA_OPTS $Options\" catalina.sh run |
ConfigMapMountDesc | string | No | [{"configMapId":16,"key":"test","mountPath":"/tmp"}] | [{"configMapId":16,"key":"test","mountPath":"/tmp"}] |
SecurityGroupId | string | No | sg-wz969ngg2e49q5i4**** | sg-wz969ngg2e49q5i4**** |
AutoConfig | boolean | No | true | true |
TerminationGracePeriodSeconds | integer | No | 30 | 30 |
PhpArmsConfigLocation | string | No | /usr/local/etc/php/conf.d/arms.ini | /usr/local/etc/php/conf.d/arms.ini |
PhpConfigLocation | string | No | /usr/local/etc/php/php.ini | /usr/local/etc/php/php.ini |
PhpConfig | string | No | k1=v1 | k1=v1 |
TomcatConfig | string | No | {"port":8080,"contextPath":"/","maxThreads":400,"uriEncoding":"ISO-8859-1","useBodyEncodingForUri":true} | {"port":8080,"contextPath":"/","maxThreads":400,"uriEncoding":"ISO-8859-1","useBodyEncodingForUri":true} |
OssMountDescs | string | No | [{"bucketName": "oss-bucket", "bucketPath": "data/user.data", "mountPath": "/usr/data/user.data", "readOnly": true}] | [{"bucketName": "oss-bucket", "bucketPath": "data/user.data", "mountPath": "/usr/data/user.data", "readOnly": true}] |
OssAkId | string | No | xxxxxx | xxxxxx |
OssAkSecret | string | No | xxxxxx | xxxxxx |
AcrInstanceId | string | No | cri-xxxxxx | cri-xxxxxx |
AcrAssumeRoleArn | string | No | acs:ram::123456789012****:role/adminrole | acs:ram::123456789012****:role/adminrole |
AssociateEip | boolean | No | true | true |
Response parameters
Examples
Sample success responses
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. | - |
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. | - |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2024-10-11 | The Error code has changed. The request parameters of the API has changed | View Change Details |
2024-09-12 | The Error code has changed. The request parameters of the API has changed | View Change Details |
2024-08-28 | The Error code has changed. The request parameters of the API has changed | View Change Details |
2024-05-21 | The Error code has changed. The request parameters of the API has changed | View Change Details |
2024-01-22 | The Error code has changed. The request parameters of the API has changed | View Change Details |
2023-10-24 | The Error code has changed. The request parameters of the API has changed | View Change Details |
2023-06-07 | The Error code has changed. The request parameters of the API has changed | View Change Details |
2023-03-30 | The Error code has changed. The request parameters of the API has changed | View Change Details |
2022-08-02 | The Error code has changed. The request parameters of the API has changed | View Change Details |
2021-11-17 | The Error code has changed | View Change Details |