Deploys 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:DeployApplication | update | *All Resources * |
| none |
Request syntax
POST /pop/v1/sam/app/deployApplication HTTP/1.1
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
AppId | string | Yes | The ID of the application. | 7171a6ca-d1cd-4928-8642-7d5cfe69**** |
Jdk | string | No | 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. | Open JDK 8 |
WebContainer | string | No | 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. | apache-tomcat-7.0.91 |
PackageVersion | string | No | The version of the deployment package. This parameter is required when the PackageType parameter is set to FatJar, War, or PythonZip. | 1.0.1 |
PackageUrl | string | No | The address of the deployment package. This parameter is required when the PackageType parameter 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 returned only if the PackageType parameter is set to Image. | registry.cn-hangzhou.aliyuncs.com/sae_test/ali_sae_test:0.0.1 |
Command | string | No | The command that is used to start the image. The command must be an existing executable object in the container. Sample statements:
In this example, the Command parameter is set to | echo |
CommandArgs | string | No | 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:
In the preceding example, the CommandArgs parameter is set to | ["a","b"] |
Envs | string | No | 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:
| [{"name":"envtmp","value":"0"}] |
CustomHostAlias | string | No | The custom mappings between hostnames and IP addresses in the container. Take note of the following rules:
| [{"hostName":"samplehost","ip":"127.0.0.1"}] |
JarStartOptions | string | No | The option settings in the JAR package. The settings are used to start the application container. The default startup command for application deployment is | custom-option |
JarStartArgs | string | No | The arguments in the JAR package. The arguments are used to start the application container. The default startup command is | -Xms4G -Xmx4G |
Liveness | string | No | The details of the availability check that was performed on the container. If the container fails this health check multiple times, the system disables and restarts the container. You can use one of the following methods to perform the health check:
Note
You can use only one method to perform the health check.
The following table describes the parameters that are used in the preceding statements.
| {"exec":{"command":["sleep","5s"]},"initialDelaySeconds":10,"timeoutSeconds":11} |
Readiness | string | No | The details of the health check that was performed on the container. If the container fails this health check multiple times, the system disables and restarts the container. Containers that fail health checks cannot receive traffic from Server Load Balancer (SLB) instances. You can use the exec, httpGet, or tcpSocket method to perform health checks. For more information, see the description of the Liveness parameter. Note
You can use only one method to perform the health check.
| {"exec":{"command":["sleep","6s"]},"initialDelaySeconds":15,"timeoutSeconds":12} |
MinReadyInstances | integer | No | The minimum number of available instances. Special values:
Note
Make sure that at least one instance is available during application deployment and rollback to prevent business interruptions.
| 1 |
MinReadyInstanceRatio | integer | No | The percentage of the minimum number of available instances. Take note of the following rules:
Note
When both MinReadyInstance and MinReadyInstanceRatio are specified and MinReadyInstanceRatio is set to a number from 0 to 100, the value of MinReadyInstanceRatio** takes precedence. For example, if MinReadyInstances is set to **5, and MinReadyInstanceRatio is set to 50, the minimum number of available instances is set to the nearest integer rounded up from the calculated result of the following formula: Current number of instances × 50%.
| -1 |
BatchWaitTime | integer | No | The interval between batches during a batch release. Unit: minutes. | 10 |
EdasContainerVersion | string | No | The version of the container, such as Ali-Tomcat, in which an application developed based on High-speed Service Framework (HSF) is deployed. | 3.5.3 |
UpdateStrategy | string | No | The deployment policy. If the minimum number of available instances is 1, the value of the UpdateStrategy parameter is an empty string (""). If the minimum number of available instances is greater than 1, the following strategies can be configured:
The following table describes the parameters that are used in the preceding statements.
| {"type":"GrayBatchUpdate","batchUpdate":{"batch":2,"releaseType":"auto","batchWaitTime":1},"grayUpdate":{"gray":1}} |
SlsConfigs | string | No | The logging configurations of Log Service.
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. Note
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"}] |
Timezone | string | No | The time zone. Default value: Asia/Shanghai. | Asia/Shanghai |
NasId | string | No | The ID of the 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 (""). | 10d3b4**** |
MountHost | string | No | 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. | 10d3b4bc9****.com |
MountDesc | string | No | 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 (""). | [{mountPath: "/tmp", nasPath: "/"}] |
PostStart | string | No | The script that is run immediately after the container is started. Example: | {"exec":{"command":["sh","-c","echo hello"]}} |
PreStop | string | No | The script that is run before the container is stopped. Example: | {"exec":{"command":["sh","-c","echo hello"]}} |
ChangeOrderDesc | string | No | The description of the change order. | Start the application |
WarStartOptions | string | No | The startup command of the WAR package. For information about how to configure the startup command, see Configure startup commands. | CATALINA_OPTS=\"$CATALINA_OPTS $Options\" catalina.sh run |
AutoEnableApplicationScalingRule | boolean | No | Specifies whether to automatically enable an auto scaling policy for the application. Take note of the following rules:
| true |
ConfigMapMountDesc | string | No | 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.
Note
You can use sae-sys-configmap-all to mount all keys.
| [{"configMapId":16,"key":"test","mountPath":"/tmp"}] |
TerminationGracePeriodSeconds | integer | No | The timeout period for a graceful shutdown. Default value: 30. Unit: seconds. Valid values: 1 to 300. | 10 |
EnableAhas | string | No | Indicates whether access to Application High Availability Service (AHAS) is enabled. Take note of the following rules:
| false |
PhpArmsConfigLocation | string | No | The path on which the PHP configuration file for application monitoring is mounted. Make sure that the PHP server loads the configuration file. SAE automatically generates the corresponding configuration file. No manual operations are required. | /usr/local/etc/php/conf.d/arms.ini |
PhpConfigLocation | string | No | 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. | /usr/local/etc/php/php.ini |
PhpConfig | string | No | The details of the PHP configuration file. | k1=v1 |
TomcatConfig | string | No | 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} |
OssMountDescs | string | No | 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": "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 Object Storage Service (OSS) buckets. | xxxxxx |
OssAkSecret | string | No | The AccessKey secret that is used to read data from and write data to OSS buckets. | xxxxxx |
EnableGreyTagRoute | boolean | No | Indicates whether canary release rules are enabled. Canary release rules apply only to applications in Spring Cloud and Dubbo frameworks. Take note of the following rules:
| false |
AcrInstanceId | string | No | 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. | cri-xxxxxx |
AcrAssumeRoleArn | string | No | 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. | acs:ram::123456789012****:role/adminrole |
ImagePullSecrets | string | No | The ID of the corresponding Secret. | 10 |
AssociateEip | boolean | No | Specifies whether to associate an EIP with the node pool. Take note of the following rules:
| true |
KafkaConfigs | string | No | The logging configurations of Message Queue for Apache Kafka. Take note of the following rules:
| {"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 | The configurations of Kubernetes Service-based service registration and discovery. Take note of the following rules:
| {"serviceName":"bwm-poc-sc-gateway-cn-beijing-front","namespaceId":"cn-beijing:front","portAndProtocol":{"18012":"TCP"},"enable":true} |
MicroRegistration | string | No | The Nacos registry. Valid values:
| "0" |
NasConfigs | string | No | The configurations of mounting the NAS file system. Take note of the following rules:
| [{"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. Set the value to PYTHON 3.9.15. | PYTHON 3.9.15 |
PythonModules | string | No | 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. | Flask==2.0 |
Deploy | string | No | This parameter takes effect only for applications that are in the Stopped state. If you call the DeployApplication operation to manage a running application, the application is immediately redeployed.
| true |
Response parameters
Examples
Sample success responses
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****",
"IsNeedApproval": true
},
"ErrorCode": "Null\n",
"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.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 | MinReadyInstanceRatio.Invalid | The ratio of minimum available instances must be between 0 and 100. | - |
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. | - |
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 | InvalidImageUrl.MissingAcrInstanceId | The specified domain of ImageUrl is from ACREE, but you are not specified AcrInstanceId. | - |
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. | - |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2024-11-08 | The Error code has changed. The request parameters of the API has changed | View Change Details |
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 |
2023-06-07 | The Error code has changed. The request parameters of the API has changed | View Change Details |
2023-06-05 | 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 |