Deploy an application.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
sae:DeployApplication |
update |
*All Resource
|
None | 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 to deploy. |
7171a6ca-d1cd-4928-8642-7d5cfe69**** |
| Jdk |
string |
No |
The JDK version that your deployment package depends on. Supported versions include the following:
This parameter is not supported when Package Type is Image. |
Open JDK 8 |
| WebContainer |
string |
No |
The Tomcat version that your deployment package depends on. Supported versions include the following:
This parameter is not supported when Package Type is Image. |
apache-tomcat-7.0.91 |
| PackageVersion |
string |
No |
The version number of your deployment package. Required when Package Type is FatJar, War, or PythonZip. |
1.0.1 |
| PackageUrl |
string |
No |
The URL of your 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 registry address of your image. 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 your image. This command must be an executable object inside the container. Example:
In this example, Command="echo" and |
echo |
| CommandArgs |
string |
No |
The arguments for the startup command Command. Format:
In the earlier example, |
["a","b"] |
| Envs |
string |
No |
The environment variables for your container. You can define custom variables or reference configuration items. To reference a configuration item, first create a ConfigMap instance. For more information, see CreateConfigMap. Values:
|
[ { "name": "sae-sys-configmap-all-hello", "valueFrom": { "configMapRef": { "configMapId": 100, "key": "" } } }, { "name": "hello", "valueFrom": { "configMapRef": { "configMapId": 101, "key": "php-fpm" } } }, { "name": "sae-sys-secret-all-hello", "valueFrom": { “secretRef": { “secretId": 100, "key": "" } } }, { "name": “password”, "valueFrom": { “secretRef": { “secretId": 101, "key": “password” } } }, { "name": "envtmp", "value": "newenv" } ] |
| CustomHostAlias |
string |
No |
Custom host mappings inside your container. Values:
|
[{"hostName":"samplehost","ip":"127.0.0.1"}] |
| JarStartOptions |
string |
No |
Startup options for your JAR package. Default startup command: |
custom-option |
| JarStartArgs |
string |
No |
Startup arguments for your JAR package. Default startup command: |
-Xms4G -Xmx4G |
| Liveness |
string |
No |
Health checks for your container. Containers that fail health checks are terminated and restarted. Supported methods:
Note
You can select only one health check method. Parameters:
|
{"exec":{"command":["sleep","5s"]},"initialDelaySeconds":10,"timeoutSeconds":11} |
| Readiness |
string |
No |
Startup status checks for your application. Containers that repeatedly fail readiness checks are terminated and restarted. Containers that fail readiness checks receive no SLB traffic. Supports exec, httpGet, and tcpSocket. For examples, see the Liveness parameter. Note
You can select only one health check method. |
{"exec":{"command":["sleep","6s"]},"initialDelaySeconds":15,"timeoutSeconds":12} |
| MinReadyInstances |
integer |
No |
The minimum number of instances that remain available during a rolling update. Values:
Note
We recommend setting this value to at least 1 to avoid service interruptions. |
1 |
| MinReadyInstanceRatio |
integer |
No |
The minimum number of available instances as a percentage of total instances. Values:
Note
If both MinReadyInstances and MinReadyInstanceRatio are provided, and MinReadyInstanceRatio is not -1, then MinReadyInstanceRatio takes precedence. For example, if MinReadyInstances is 5 and MinReadyInstanceRatio is 50, the system calculates the minimum based on 50%. |
-1 |
| BatchWaitTime |
integer |
No |
The wait time between batches, in seconds. |
10 |
| EdasContainerVersion |
string |
No |
The version of the application runtime environment for HSF applications, such as Ali-Tomcat containers. |
3.5.3 |
| UpdateStrategy |
string |
No |
The release strategy. When MinReadyInstances equals 1, set UpdateStrategy to an empty string. When MinReadyInstances is greater than 1, examples include the following:
Parameters:
|
{"type":"GrayBatchUpdate","batchUpdate":{"batch":2,"releaseType":"auto","batchWaitTime":1},"grayUpdate":{"gray":1}} |
| SlsConfigs |
string |
No |
The configuration for collecting logs to Simple Log Service (SLS).
Parameters:
If your SLS collection configuration remains unchanged across deployments, omit this parameter. To disable SLS collection, set this field to an empty string. Note
Projects automatically created by SAE are deleted when the application is deleted. Do not select these projects when choosing an existing project. |
[{"logDir":"","logType":"stdout"},{"logDir":"/tmp/a.log"}] |
| Timezone |
string |
No |
The time zone. Default is Asia/Shanghai. |
Asia/Shanghai |
| NasId |
string |
No |
We recommend using NasConfigs instead of this field. The ID of the NAS file system. If your NAS configuration remains unchanged, omit this parameter. To clear your NAS configuration, set this field to an empty string. |
10d3b4**** |
| MountHost |
string |
No |
We recommend using NasConfigs instead of this field. The mount target of the NAS in your application's VPC. If your NAS configuration remains unchanged, omit this parameter. To clear your NAS configuration, set this field to an empty string. |
10d3b4bc9****.com |
| MountDesc |
string |
No |
We recommend using NasConfigs instead of this field. The NAS mount description. If your NAS configuration remains unchanged, omit this parameter. To clear your NAS configuration, set this field to an empty string. |
[{mountPath: "/tmp", nasPath: "/"}] |
| PostStart |
string |
No |
A script that runs after your container starts. It executes immediately after the container is created. Format: |
{"exec":{"command":["sh","-c","echo hello"]}} |
| PreStop |
string |
No |
A script that runs before your container stops. It executes just before the container is deleted. Format: |
{"exec":{"command":["sh","-c","echo hello"]}} |
| ChangeOrderDesc |
string |
No |
The description of the release task. |
启动应用 |
| WarStartOptions |
string |
No |
The startup command for your WAR package. Configure it the same way as the startup command for images. For more information, see Set the startup command. |
CATALINA_OPTS=\"$CATALINA_OPTS $Options\" catalina.sh run |
| AutoEnableApplicationScalingRule |
boolean |
No |
Whether to automatically enable application Auto Scaling rules. Values:
|
true |
| ConfigMapMountDesc |
string |
No |
The mount description for a ConfigMap. Use configuration items created on the namespace configuration page to inject configuration into your container. Parameters:
Note
You can mount all keys by passing
|
[{"configMapId":16,"key":"test","mountPath":"/tmp"}] |
| TerminationGracePeriodSeconds |
integer |
No |
The graceful shutdown timeout, in seconds. Default is 30. Valid values: 1–300. |
10 |
| EnableAhas |
string |
No |
Whether to integrate with AHAS. Values:
|
false |
| PhpArmsConfigLocation |
string |
No |
The mount path for PHP application monitoring. Ensure your PHP server loads the configuration file at this path. You do not need to manage the configuration content. SAE renders the correct configuration automatically. |
/usr/local/etc/php/conf.d/arms.ini |
| PhpConfigLocation |
string |
No |
The mount path for the PHP startup configuration. Ensure your 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 |
The Tomcat configuration. Set to an empty string or {} to delete the configuration. Values:
|
{"port":8080,"contextPath":"/","maxThreads":400,"uriEncoding":"ISO-8859-1","useBodyEncodingForUri":true} |
| OssMountDescs |
string |
No |
The 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 |
| EnableGreyTagRoute |
boolean |
No |
Whether to enable traffic canary rules. These rules apply only to Spring Cloud and Dubbo applications. Values:
|
false |
| Php |
string |
No |
The PHP version that your PHP deployment package depends on. Not supported for images. |
PHP-FPM 7.0 |
| AcrInstanceId |
string |
No |
The Container Registry Enterprise Edition instance ID. Required when ImageUrl is from Container Registry Enterprise Edition. |
cri-xxxxxx |
| AcrAssumeRoleArn |
string |
No |
The ARN of the RAM role required to pull images across accounts. For more information, see Authorize cross-account image pulls using RAM roles. |
acs:ram::123456789012****:role/adminrole |
| ImagePullSecrets |
string |
No |
The ID of the corresponding secret. |
10 |
| AssociateEip |
boolean |
No |
Whether to associate an EIP. Values:
|
true |
| KafkaConfigs |
string |
No |
The configuration for collecting logs to Kafka. 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. Values:
|
{"portProtocols":[{"port":18012,"protocol":"TCP"}],"portAndProtocol":{"18012":"TCP"},"enable":true} |
| SwimlanePvtzDiscoverySvc |
string |
No |
Configures service discovery and end-to-end canary release based on a Kubernetes Service:
|
{\"enable\":\"false\",\"namespaceId\":\"cn-beijing:test\",\"portAndProtocol\":{\"2000:TCP\":\"18081\"},\"portProtocols\":[{\"port\":2000,\"protocol\":\"TCP\",\"targetPort\":18081}],\"pvtzDiscoveryName\":\"cn-beijing-1421801774382676\",\"serviceId\":\"3513\",\"serviceName\":\"demo-gray.test\"} |
| MicroRegistration |
string |
No |
Select a Nacos registry center. Values:
Note
If you select built-in Nacos in SAE, you cannot retrieve its configuration. |
"0" |
| MicroRegistrationConfig |
string |
No |
The registry configuration. Applies only when the registry type is MSE Nacos Enterprise Edition. |
{\"instanceId\":\"mse-cn-zvp2bh6h70r\",\"namespace\":\"4c0aa74f-57cb-423c-b6af-5d9f2d0e3dbd\"} |
| NasConfigs |
string |
No |
The configuration for mounting NAS. 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 runtime environment. Supported: 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 no configuration or custom packages exist, specify the dependencies to install. |
Flask==2.0 |
| Dotnet |
string |
No |
The .NET framework version:
|
.NET 3.1 |
| Deploy |
string |
No |
This parameter applies only to stopped applications. If you call DeployApplication on a running application, it deploys immediately.
|
true |
| PackageType |
string |
No |
The type of your application package. Values:
|
FatJar |
| Cpu |
integer |
No |
The CPU required per instance, in milliCPU. Cannot be zero. Supported fixed specifications:
|
1000 |
| Memory |
integer |
No |
The memory required per instance, in MB. Cannot be zero. Memory and CPU are paired. Supported fixed specifications:
|
1024 |
| Replicas |
integer |
No |
The number of instances. |
1 |
| SecurityGroupId |
string |
No |
The security group ID. |
sg-wz969ngg2e49q5i4**** |
| VSwitchId |
string |
No |
The virtual switch where your application instance elastic network interfaces reside. This switch must be in the specified VPC. |
vsw-bp12mw1f8k3jgygk9**** |
| ServiceTags |
string |
No |
The canary tags configured for your application. |
{\"alicloud.service.tag\":\"g1\"} |
| EnableNewArms |
boolean |
No |
Whether to enable the new ARMS feature:
|
true |
| EnableCpuBurst |
boolean |
No |
Whether to enable CPU Burst:
|
true |
| OidcRoleName |
string |
No |
The RAM role for identity authentication. Note
Create an OIDC identity provider and an associated role in the same region before using this parameter. For more information, see Create an OIDC identity provider and Create a role for SSO identity providers. |
sae-test |
| SidecarContainersConfig |
array |
No |
Container configuration information. |
|
| SidecarContainerConfig |
No |
The container configuration. |
||
| SecretMountDesc |
string |
No |
The mount description for a Secret. Use secrets created on the namespace secrets page to inject sensitive information into your container. Parameters:
Note
You can mount all keys by passing
|
[{“secretId":10,”key":"test","mountPath":"/tmp"}] |
| EnableSidecarResourceIsolated |
boolean |
No |
Whether to isolate sidecar resources:
|
true |
| CustomImageNetworkType |
string |
No |
The custom image type. Set to an empty string for non-custom images:
|
internet |
| MicroserviceEngineConfig |
string |
No |
Configure microservice governance features.
|
{"enable": true,"mseLosslessRule": {"delayTime": 0,"enable": false,"notice": false,"warmupTime": 120}} |
| NewSaeVersion |
string |
No |
The application version:
|
pro |
| InitContainersConfig |
array |
No |
The initialization container configuration. |
|
| InitContainerConfig |
No |
The initialization container configuration. |
||
| GpuConfig |
string |
No |
||
| StartupProbe |
string |
No |
Enable application startup probing.
Note
Description
|
{"exec":{"command":["sh","-c","cat /home/admin/start.sh"]},"initialDelaySeconds":30,"periodSeconds":30,"timeoutSeconds":2} |
| EnablePrometheus |
boolean |
No |
Whether to enable Prometheus custom metric collection. |
false |
| Html |
string |
No |
The Nginx version:
|
nginx 1.28 |
| EmptyDirDesc |
string |
No |
The configuration for shared temporary storage. |
[{\"name\":\"workdir\",\"mountPath\":\"/usr/local/tomcat/webapps\"}] |
| AlbIngressReadinessGate |
string |
No |
The ALB gateway readiness gate configuration. |
default |
| MaxSurgeInstances |
integer |
No |
The maximum number of surge instances during a rolling update. Values: If the minimum available instances is 100%, the maximum surge cannot be set to 0. If set to -1, the system uses its recommended value: 30% of your current instance count. For example, with 10 instances, 10 × 30% = 3. |
-1 |
| MaxSurgeInstanceRatio |
integer |
No |
The maximum number of surge instances as a percentage of total instances. Values: If the minimum available instances is 100%, the maximum surge cannot be set to 0. If set to -1, the system uses its recommended value: 30% of your current instance count. For example, with 10 instances, 10 × 30% = 3. |
-1 |
| AgentVersion |
string |
No |
The AliyunAgent version. |
4.4.2 |
| EnableNamespaceAgentVersion |
boolean |
No |
Whether to reuse the namespace Agent version configuration. |
true |
| SlsLogEnvTags |
string |
No |
The SLS log tags. |
|
| LokiConfigs |
string |
No |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The deployed application information. |
||
| RequestId |
string |
The request ID. |
01CF26C7-00A3-4AA6-BA76-7E95F2A3*** |
| Message |
string |
Additional information. Values:
|
success |
| TraceId |
string |
The trace ID for precise query of call information. |
ac1a0b2215622246421415014e**** |
| Data |
object |
The response data. |
|
| ChangeOrderId |
string |
The returned change order ID. Use it to query task execution status. |
01db03d3-3ee9-48b3-b3d0-dfce2d88**** |
| AppId |
string |
The application ID. |
7171a6ca-d1cd-4928-8642-7d5cfe69**** |
| IsNeedApproval |
boolean |
Whether RAM users need approval to deploy changes. Values:
|
true |
| ErrorCode |
string |
The error code. Values:
|
空 |
| Code |
string |
The API status or POP error code. Values:
|
200 |
| Success |
boolean |
Whether the deployment succeeded. 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****",
"IsNeedApproval": true
},
"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.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. | |
| 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 | 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.