All Products
Search
Document Center

Serverless App Engine:DeployApplication

Last Updated:Oct 16, 2023

Deploys an application.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request headers

This operation uses only common request headers and does not have operation-specific request headers. For more information, see Common request and response headers.

Request syntax

POST /pop/v1/sam/app/deployApplication HTTP/1.1

Request parameters

Parameter

Type

Position

Required

Example

Description

AppId

String

Query

Yes

7171a6ca-d1cd-4928-8642-7d5cfe69****

The ID of the application that you want to deploy.

Jdk

String

Query

No

Open JDK 8

The version of the JDK on which the deployment package of the application depends. Valid values:

  • Open JDK 8

  • Open JDK 7

  • Dragonwell 11

  • Dragonwell 8

  • openjdk-8u191-jdk-alpine3.9

  • openjdk-7u201-jdk-alpine3.9

This parameter is unavailable if the PackageType parameter is set to Image.

WebContainer

String

Query

No

apache-tomcat-7.0.91

The version of the Tomcat container on which the deployment package depends. Valid values:

  • apache-tomcat-7.0.91

  • apache-tomcat-8.5.42

This parameter is unavailable if the PackageType parameter is set to Image.

PackageVersion

String

Query

No

1.0.1

The version of the deployment package. This parameter is required if the PackageType parameter is set to FatJar, War, or PythonZip.

PackageUrl

String

Query

No

http://myoss.oss-cn-hangzhou.aliyuncs.com/my-buc/2019-06-30/****.jar

The URL of the deployment package. This parameter is required if the PackageType parameter is set to FatJar, War, or PythonZip.

ImageUrl

String

Query

No

registry.cn-hangzhou.aliyuncs.com/sae_test/ali_sae_test:0.0.1

The URL of the image. This parameter is required if the PackageType parameter is set to Image.

Command

String

Query

No

echo

The command that is used to start the image. The command must be an existing executable object in the container. Example:


command:
      - echo
      - abc
      - >
      - file0

In this example, the Command parameter is set to Command="echo", CommandArgs=["abc", ">", "file0"].

CommandArgs

String

Query

No

["a","b"]

The parameters of the image startup command. The CommandArgs parameter specifies the parameters that are required for the Command parameter. Format:

["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. You do not need to configure this parameter if it does not exist in the Command parameter.

Envs

String

Query

No

[ { "name": "sae-sys-configmap-all-hello", "valueFrom": { "configMapRef": { "configMapId": 100, "key": "" } } }, { "name": "hello", "valueFrom": { "configMapRef": { "configMapId": 101, "key": "php-fpm" } } }, { "name": "envtmp", "value": "newenv" } ]

The environment variables. You can configure custom environment variables or reference a ConfigMap. Before you can reference a ConfigMap, you must create a ConfigMap. For more information, see CreateConfigMap. The following parameters are involved:

  • Custom configuration

    • name: the name of the environment variable.

    • value: the value of the environment variable. The priority of the custom configuration is higher than valueFrom.

  • Reference a ConfigMap (valueFrom)

    • name: the name of the environment variable. You can reference one or all keys. To reference all keys, specify sae-sys-configmap-all-<ConfigMap name>. Example: sae-sys-configmap-all-test1.

    • valueFrom: the reference of the environment variable. Valid value: configMapRef.

    • configMapId: the ID of the ConfigMap.

    • key: the key. If you want to reference all keys, you do not need to configure this parameter.

CustomHostAlias

String

Query

No

[{"hostName":"samplehost","ip":"127.0.0.1"}]

The custom mapping between the hostname and IP address in the container. The following parameters are involved:

  • hostName: the domain name or hostname.

  • ip: the IP address.

JarStartOptions

String

Query

No

custom-option

The option settings in the JAR package. The settings are used to start the application container. The default startup command is $JAVA_HOME/bin/java $JarStartOptions -jar $CATALINA_OPTS "$package_path" $JarStartArgs.

JarStartArgs

String

Query

No

-Xms4G -Xmx4G

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.

Liveness

String

Query

No

{"exec":{"command":["sleep","5s"]},"initialDelaySeconds":10,"timeoutSeconds":11}

The liveness check settings of the container. If a container fails this health check, the container is stopped and then restarted. Supported methods:

  • Sample code of the exec method: {"exec":{"command":["sh","-c","cat/home/admin/start.sh"]},"initialDelaySeconds":30,"periodSeconds":30,"timeoutSeconds":2}

  • Sample code of the httpGet method: {"httpGet":{"path":"/","port":18091,"scheme":"HTTP","isContainKeyWord":true,"keyWord":"SAE"},"initialDelaySeconds":11,"periodSeconds":10,"timeoutSeconds":1}

  • Sample code of the tcpSocket method: {"tcpSocket":{"port":18091},"initialDelaySeconds":11,"periodSeconds":10,"timeoutSeconds":1}

Note

You can use only one method to perform the health check.

The following parameters are involved:

  • exec.command: the health check command.

  • httpGet.path: the request path.

  • httpGet.scheme: the protocol that is used to perform the health check. Valid values: HTTP and HTTPS.

  • httpGet.isContainKeyWord: specifies whether the response contains keywords. Valid values: true and false. If you do not configure this parameter, the advanced settings are not used.

  • httpGet.keyWord: the custom keywords. The isContainKeyWord parameter is required.

  • tcpSocket.port: the port that is used to check the status of TCP connections.

  • initialDelaySeconds: the delay of the health check. Default value: 10. Unit: seconds.

  • periodSeconds: the interval at which the health check is performed. Default value: 30. Unit: seconds.

  • timeoutSeconds: the timeout period of the health check. Default value: 1. Unit: seconds. If you set this parameter to 0 or do not configure this parameter, the timeout period is set to 1 second by default.

Readiness

String

Query

No

{"exec":{"command":["sleep","6s"]},"initialDelaySeconds":15,"timeoutSeconds":12}

The readiness check settings of the container. If a container fails this health check multiple times, the container is stopped and then restarted. Containers that fail this health check cannot receive traffic from Server Load Balancer (SLB) instances. You can use the exec, httpGet, or tcpSocket method to perform the health check. For more information, see the Liveness parameter.

Note

You can use only one method to perform the health check.

MinReadyInstances

Integer

Query

No

1

The minimum number of available instances. Valid values:

  • If you set the value to 0, business interruptions occur when the application is upgraded.

  • If you set the value to -1, the minimum number of available instances is automatically set to a system-recommended value. The value is the nearest integer to which the calculated result of the following formula is rounded up: Current number of instances × 25%. For example, if five instances are available, the minimum number of available instances is calculated by using the following formula: 5 × 25% = 1.25. In this case, the minimum number of available instances is 2.

Note

To ensure business continuity, make sure that at least one instance is available during application deployment and rollback.

MinReadyInstanceRatio

Integer

Query

No

-1

The ratio of the minimum number of available instances to the current number of instances. Valid values:

  • If you set the value to -1, the minimum number of available instances is not determined based on this parameter. This is the default value.

  • If you set the value to a number from 0 to 100, the minimum number of available instances is calculated by using the following formula: Current number of instances × (Value of MinReadyInstanceRatio × 100%). If the calculated result is not an integer, the result is rounded up to the nearest integer. For example, if five instances are available and the MinReadyInstanceRatio parameter is set to 50, the minimum number of available instances is 3.

Note

If the MinReadyInstance and MinReadyInstanceRatio parameters are configured and the MinReadyInstanceRatio parameter is set to a number from 0 to 100, the value of the MinReadyInstanceRatio parameter takes precedence. For example, if the MinReadyInstances parameter is set to 5, and the MinReadyInstanceRatio parameter 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%.

BatchWaitTime

Integer

Query

No

10

The interval between release batches. Unit: seconds.

EdasContainerVersion

String

Query

No

3.5.3

The version of the container, such as Ali-Tomcat, in which an application that is developed based on High-speed Service Framework (HSF) is deployed.

UpdateStrategy

String

Query

No

{"type":"GrayBatchUpdate","batchUpdate":{"batch":2,"releaseType":"auto","batchWaitTime":1},"grayUpdate":{"gray":1}}

The release 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 policies can be configured:

  • The application is deployed on an instance. The remaining instances are automatically classified into two release batches whose interval is set to 1. In this case, the parameter is set to {"type":"GrayBatchUpdate","batchUpdate":{"batch":2,"releaseType":"auto","batchWaitTime":1},"grayUpdate":{"gray":1}}.

    • The application is deployed on an instance. The remaining instances are manually classified into two release batches. In this case, the parameter is set to {"type":"GrayBatchUpdate","batchUpdate":{"batch":2,"releaseType":"manual"},"grayUpdate":{"gray":1}}.

    • All instances are automatically classified into two release batches. The application is deployed on the instances of the two batches in parallel. In this case, the parameter is set to {"type":"BatchUpdate","batchUpdate":{"batch":2,"releaseType":"auto","batchWaitTime":0}}.

The following parameters are involved:

  • type: the type of the release policy. Valid values: GrayBatchUpdate and BatchUpdate.

  • batchUpdate: the phased release policy.

    • batch: the number of batches in which you want to release the instances.

    • releaseType: the processing method for the batches. Valid values: auto and manual.

    • batchWaitTime: the interval between release batches. Unit: minutes.

  • grayUpdate: the number of batches in which you want to release the remaining instances after the canary release. This parameter is required if the type parameter is set to GrayBatchUpdate.

SlsConfigs

String

Query

No

[{"logDir":"","logType":"stdout"},{"logDir":"/tmp/a.log"}]

The logging configurations of Simple Log Service.

  • To use Simple Log Service resources that are automatically created by SAE, set this parameter to [{"logDir":"","logType":"stdout"},{"logDir":"/tmp/a.log"}].

  • To use custom Simple Log Service resources, set this parameter to [{"projectName":"test-sls","logType":"stdout","logDir":"","logstoreName":"sae","logtailName":""},{"projectName":"test","logDir":"/tmp/a.log","logstoreName":"sae","logtailName":""}].

The following parameters are involved:

  • projectName: the name of the Simple Log Service project.

  • logDir: the path in which logs are stored.

  • logType: the log type. stdout indicates the standard output (stdout) logs of the container. You can specify only one stdout value for this parameter. If you do not configure this parameter, file logs are collected.

  • logstoreName: the name of the Logstore in Simple Log Service.

  • logtailName: the name of the Logtail configuration in Simple Log Service. If you do not configure this parameter, a new Logtail configuration is created.

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 Simple Log Service, leave the SlsConfigs parameter empty in the request.

Note

The projects that are automatically created by SAE when you create applications are deleted when you delete the corresponding applications. Therefore, when you create an application, we recommend that you do not select an existing project that is automatically created by SAE for log collection.

Timezone

String

Query

No

Asia/Shanghai

The time zone. Default value: Asia/Shanghai.

NasId

String

Query

No

10d3b4****

We recommend that you configure NasConfigs instead of this parameter. The ID of the Apsara File Storage NAS (NAS) file system. If you do not need to modify the NAS configurations when you deploy the application, configure the NasId parameter only in the first request. You do not need to include this parameter in subsequent requests. If you no longer need to use NAS, leave the NasId parameter empty in the request.

MountHost

String

Query

No

10d3b4bc9****.com

We recommend that you configure NasConfigs instead of this parameter. The mount target of the NAS file system in the virtual private cloud (VPC) where the application is deployed. If you do not need to modify the NAS configurations when you deploy the application, configure the MountHost parameter only in the first request. You do not need to include this parameter in subsequent requests. If you no longer need to use NAS, leave the MountHost parameter empty in the request.

MountDesc

String

Query

No

[{mountPath: "/tmp", nasPath: "/"}]

We recommend that you configure NasConfigs instead of this parameter. The description of the mounted NAS file system. If you do not need to modify the NAS configurations when you deploy the application, configure the MountDesc parameter only in the first request. You do not need to include this parameter in subsequent requests. If you no longer need to use NAS, leave the MountDesc parameter empty in the request.

PostStart

String

Query

No

{"exec":{"command":["sh","-c","echo hello"]}}

The script that is run immediately after the container is started. Example: {"exec":{"command":["sh","-c","echo hello"]}}.

PreStop

String

Query

No

{"exec":{"command":["sh","-c","echo hello"]}}

The script that is run before the container is stopped. Example: {"exec":{"command":["sh","-c","echo hello"]}}.

ChangeOrderDesc

String

Query

No

Start Application

The description of the change order.

WarStartOptions

String

Query

No

CATALINA_OPTS=\"$CATALINA_OPTS $Options\" catalina.sh run

The startup command of the WAR package. For information about how to configure the startup command, see Configure startup commands.

AutoEnableApplicationScalingRule

Boolean

Query

No

true

Specifies whether to automatically enable an auto scaling policy for the application. Valid values:

  • true

  • false

ConfigMapMountDesc

String

FormData

No

[{"configMapId":16,"key":"test","mountPath":"/tmp"}]

The description of the ConfigMap that is mounted to the application. A ConfigMap that is created on the ConfigMaps page of a namespace is used to inject configurations into containers. The following parameters are involved:

  • configMapId: the ID of the ConfigMap. You can call the ListNamespacedConfigMaps operation to obtain the ID of a ConfigMap.

  • key: the key.

Note

You can specify sae-sys-configmap-all to mount all keys in a ConfigMap.

  • mountPath: the mount path.

TerminationGracePeriodSeconds

Integer

Query

No

10

The timeout period for a graceful shutdown. Default value: 30. Unit: seconds. Valid values: 1 to 300.

EnableAhas

String

Query

No

false

Specifies whether to enable access to Application High Availability Service (AHAS). Valid values:

  • true

  • false

PhpArmsConfigLocation

String

Query

No

/usr/local/etc/php/conf.d/arms.ini

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.

PhpConfigLocation

String

Query

No

/usr/local/etc/php/php.ini

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.

PhpConfig

String

FormData

No

k1=v1

The details of the PHP configuration file.

TomcatConfig

String

Query

No

{"port":8080,"contextPath":"/","maxThreads":400,"uriEncoding":"ISO-8859-1","useBodyEncodingForUri":true}

The Tomcat configuration. If you want to delete the configuration, set this parameter to {} or leave this parameter empty. The following parameters are involved:

  • port: the port number. Valid values: 1024 to 65535. The root permissions are required to perform operations on ports whose number is smaller than 1024. Enter a value that ranges from 1025 to 65535 because the container has only the admin permissions. If you do not configure this parameter, the default value 8080 is used.

  • contextPath: the path. Default value: /. This value indicates the root directory.

  • maxThreads: the maximum number of connections in the connection pool. Default value: 400.

  • uriEncoding: the URI encoding scheme in the Tomcat container. Valid values: UTF-8, ISO-8859-1, GBK, and GB2312. If you do not configure this parameter, the default value ISO-8859-1 is used.

  • useBodyEncodingForUri: specifies whether to use the encoding scheme that is specified by BodyEncoding for URL. Default value: true.

OssMountDescs

String

FormData

No

[{"bucketName": "oss-bucket", "bucketPath": "data/user.data", "mountPath": "/usr/data/user.data", "readOnly": true}]

The description of the mounted Object Storage Service (OSS) bucket. The following parameters are involved:

  • 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 path of the container in SAE. The parameter value that you specified overwrites the original value. If the specified path does not exist, SAE automatically creates the path.

  • readOnly: specifies whether the application can use the container path to read data from or write data to resources in the directory of the OSS bucket. Valid values:

    • true: The application has the read-only permissions.

    • false: The application has the read and write permissions.

OssAkId

String

FormData

No

xxxxxx

The AccessKey ID that is used to read data from and write data to OSS.

OssAkSecret

String

FormData

No

xxxxxx

The AccessKey secret that is used to read data from and write data to OSS.

EnableGreyTagRoute

Boolean

Query

No

false

Specifies whether to enable the traffic canary rule. Traffic canary release rules apply only to applications in Spring Cloud and Dubbo frameworks. Valid values:

  • true

  • false

Php

String

FormData

No

PHP-FPM 7.0

The PHP version on which the PHP deployment package depends. This parameter is unavailable if you deploy applications by using images.

AcrInstanceId

String

FormData

No

cri-xxxxxx

The ID of the Container Registry Enterprise Edition instance. This parameter is required if the ImageUrl parameter is set to the URL of an image in a Container Registry Enterprise Edition instance.

AcrAssumeRoleArn

String

Query

No

acs:ram::123456789012****:role/adminrole

The Alibaba Cloud Resource Name (ARN) of the RAM role that is used to pull images across accounts. For more information, see Grant permissions across Alibaba Cloud accounts by using a RAM role.

ImagePullSecrets

String

Query

No

10

The ID of the corresponding Secret.

AssociateEip

Boolean

FormData

No

true

Specifies whether to associate an elastic IP address (EIP) with the application. Valid values:

  • true

  • false

KafkaConfigs

String

Query

No

{"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"}]}

The logging configurations of ApsaraMQ for Kafka. The following parameters are involved:

  • kafkaEndpoint: the endpoint of the ApsaraMQ for Kafka API.

  • kafkaInstanceId: the ID of the ApsaraMQ for Kafka instance.

  • kafkaConfigs: One or more logging configurations of ApsaraMQ for Kafka. For information about sample values and parameters, see the request parameter KafkaLogfileConfig in this topic.

PvtzDiscoverySvc

String

Query

No

{"portProtocols":[{"port":18012,"protocol":"TCP"}],"portAndProtocol":{"18012":"TCP"},"enable":true}

The configurations of Kubernetes Service-based service registration and discovery. The following parameters are involved:

  • portProtocols: the port number and protocol. Valid values of the port number: 1 to 65535. Valid values of the protocol: TCP and UDP.

  • portAndProtocol: the port number and protocol. Valid values of the port number: 1 to 65535. Valid values of the protocol: TCP and UDP. We recommend that you configure portProtocols. If you configure both portProtocols and portAndProtocol, only portProtocols takes effect.

  • enable: enables the Kubernetes Service-based registration and discovery feature.

MicroRegistration

String

Query

No

"0"

The Nacos registry. Valid values:

  • 0: SAE built-in Nacos registry

  • 1: Self-managed Nacos registry

  • 2: MSE Nacos registry

NasConfigs

String

Query

No

[{"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"}]

The configurations for mounting the NAS file system. The following parameters are involved:

  • mountPath: the mount path of the container.

  • readOnly: If you set the value to false, the application has the read and write permissions.

  • nasId: the ID of the NAS file system.

  • mountDomain: the domain name of the mount target. For more information, see DescribeMountTargets.

  • nasPath: the directory in the NAS file system.

Python

String

Query

No

PYTHON 3.9.15

The Python environment. Valid value: PYTHON 3.9.15.

PythonModules

String

Query

No

Flask==2.0

The configurations for installing custom module dependencies. By default, the dependencies defined by the requirements.txt file in the root directory are installed. If no software package is configured or customized, you can specify dependencies based on your business requirements.

Deploy

String

Query

No

true

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 (default): specifies that the system immediately deploys the application, enables new configurations, and immediately pulls application instances.

  • false: specifies that the system only enables the new configurations, but does not pull application instances.

PackageType

String

Query

No

FatJar

The type of the deployment package. Valid values:

  • If you deploy a Java application, you can set this parameter to FatJar, War, or Image.

  • If you deploy a PHP application, you can set this parameter to one of the following values:

    • 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

  • If you deploy a Python application, you can set this parameter to PythonZip or Image.

Cpu

Integer

Query

No

1000

The CPU specifications that are required for each instance. Unit: millicores. You cannot set this parameter to 0. Valid values:

  • 500

  • 1000

  • 2000

  • 4000

  • 8000

  • 12000

  • 16000

  • 32000

Memory

Integer

Query

No

1024

The size of memory that is 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:

  • Set this parameter to 1024 if the Cpu parameter is set to 500 or 1000.

  • Set this parameter to 2048 if the Cpu parameter is set to 500, 1000, or 2000.

  • Set this parameter to 4096 if the Cpu parameter is set to 1000, 2000, or 4000.

  • Set this parameter to 8192 if the Cpu parameter is set to 2000, 4000, or 8000.

  • Set this parameter to 12288 if the Cpu parameter is set to 12000.

  • Set this parameter to 16384 if the Cpu parameter is set to 4000, 8000, or 16000.

  • Set this parameter to 24576 if the Cpu parameter is set to 12000.

  • Set this parameter to 32768 if the Cpu parameter is set to 16000.

  • Set this parameter to 65536 if the Cpu parameter is set to 8000, 16000, or 32000.

  • Set this parameter to 131072 if the Cpu parameter is set to 32000.

Replicas

Integer

Query

No

1

The number of instances.

SecurityGroupId

String

Query

No

sg-wz969ngg2e49q5i4****

The ID of the security group.

VSwitchId

String

Query

No

vsw-bp12mw1f8k3jgygk9****

The ID of the vSwitch to which the elastic network interface (ENI) of an application instance is connected. You can specify only a vSwitch that resides in the VPC specified by the VpcId parameter.

Response parameters

Parameter

Type

Example

Description

RequestId

String

01CF26C7-00A3-4AA6-BA76-7E95F2A3***

The request ID.

Message

String

success

The returned message. Valid values:

  • success: If the call is successful, success is returned.

  • An error code: If the call fails, an error code is returned.

TraceId

String

ac1a0b2215622246421415014e****

The trace ID that is used to query the details of the request.

Data

Object

The returned result.

ChangeOrderId

String

01db03d3-3ee9-48b3-b3d0-dfce2d88****

The ID of the change order. The ID can be used to query the status of the change task.

AppId

String

7171a6ca-d1cd-4928-8642-7d5cfe69****

The ID of the application.

IsNeedApproval

Boolean

true

Indicates whether approval is required when you release a change order as a RAM user. Valid values:

  • true

  • false

ErrorCode

String

Null

The error code. Valid values:

  • If the call is successful, the ErrorCode parameter is not returned.

  • If the call fails, the ErrorCode parameter is returned. For more information, see the Error codes section in this topic.

Code

String

200

The HTTP status code. Valid values:

  • 2xx: The call was successful.

  • 3xx: The call was redirected.

  • 4xx: The call failed.

  • 5xx: A server error occurred.

Success

Boolean

true

Indicates whether the application was deployed. Valid values:

  • true: The application was deployed.

  • false: The application failed to be deployed.

Examples

Sample requests

POST /pop/v1/sam/app/deployApplication?AppId=7171a6ca-d1cd-4928-8642-7d5cfe69****&Jdk=Open JDK 8&WebContainer=apache-tomcat-7.0.91&PackageVersion=1.0.1&PackageUrl=http://myoss.oss-cn-hangzhou.aliyuncs.com/my-buc/2019-06-30/****.jar&ImageUrl=registry.cn-hangzhou.aliyuncs.com/sae_test/ali_sae_test:0.0.1&Command=echo&CommandArgs=["a","b"]&Envs=[     {         "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=[{"hostName":"samplehost","ip":"127.0.0.1"}]&JarStartOptions=custom-option&JarStartArgs=-Xms4G -Xmx4G&Liveness={"exec":{"command":["sleep","5s"]},"initialDelaySeconds":10,"timeoutSeconds":11}&Readiness={"exec":{"command":["sleep","6s"]},"initialDelaySeconds":15,"timeoutSeconds":12}&MinReadyInstances=1&MinReadyInstanceRatio=-1&BatchWaitTime=10&EdasContainerVersion=3.5.3&UpdateStrategy={"type":"GrayBatchUpdate","batchUpdate":{"batch":2,"releaseType":"auto","batchWaitTime":1},"grayUpdate":{"gray":1}}&SlsConfigs=[{"logDir":"","logType":"stdout"},{"logDir":"/tmp/a.log"}]&Timezone=Asia/Shanghai&NasId=10d3b4****&MountHost=10d3b4bc9****.com&MountDesc=[{mountPath: "/tmp", nasPath: "/"}]&PostStart={"exec":{"command":["sh","-c","echo hello"]}}&PreStop={"exec":{"command":["sh","-c","echo hello"]}}&ChangeOrderDesc=Start Application&WarStartOptions=CATALINA_OPTS=\"$CATALINA_OPTS $Options\" catalina.sh run&AutoEnableApplicationScalingRule=true&TerminationGracePeriodSeconds=10&EnableAhas=false&PhpArmsConfigLocation=/usr/local/etc/php/conf.d/arms.ini&PhpConfigLocation=/usr/local/etc/php/php.ini&TomcatConfig={"port":8080,"contextPath":"/","maxThreads":400,"uriEncoding":"ISO-8859-1","useBodyEncodingForUri":true}&EnableGreyTagRoute=false&AcrAssumeRoleArn=acs:ram::123456789012****:role/adminrole&ImagePullSecrets=10&KafkaConfigs={"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={"portProtocols":[{"port":18012,"protocol":"TCP"}],"portAndProtocol":{"18012":"TCP"},"enable":true}&MicroRegistration="0"&NasConfigs=[{"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=PYTHON 3.9.15&PythonModules=Flask==2.0&Deploy=true&PackageType=FatJar&Cpu=1000&Memory=1024&Replicas=1&SecurityGroupId=sg-wz969ngg2e49q5i4****&VSwitchId=vsw-bp12mw1f8k3jgygk9**** HTTP/1.1
Host:sae.aliyuncs.com
Content-Type:application/json

ConfigMapMountDesc=[{"configMapId":16,"key":"test","mountPath":"/tmp"}]&PhpConfig=k1=v1&OssMountDescs=[{"bucketName": "oss-bucket", "bucketPath": "data/user.data", "mountPath": "/usr/data/user.data", "readOnly": true}]&OssAkId=xxxxxx&OssAkSecret=xxxxxx&Php=PHP-FPM 7.0&AcrInstanceId=cri-xxxxxx&AssociateEip=true

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<DeployApplicationResponse>
    <RequestId>01CF26C7-00A3-4AA6-BA76-7E95F2A3***</RequestId>
    <Message>success</Message>
    <TraceId>ac1a0b2215622246421415014e****</TraceId>
    <Data>
        <ChangeOrderId>01db03d3-3ee9-48b3-b3d0-dfce2d88****</ChangeOrderId>
        <AppId>7171a6ca-d1cd-4928-8642-7d5cfe69****</AppId>
        <IsNeedApproval>true</IsNeedApproval>
    </Data>
    <Code>200</Code>
    <Success>true</Success>
</DeployApplicationResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "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
  },
  "Code" : "200",
  "Success" : true
}

Error codes

HttpCode

Error code

Error message

Description

400

Application.MissingJdk

Your application must at least contain a JDK component.

No JDK component is specified.

400

InvalidApplication.NotFound

The current application does not exist.

The specified application is not found.

400

InvalidComponent.NotFound

The current component (such as JDK, Tomcat, or EDASWebContainer) does not exist.

The specified component (JDK, Tomcat, or EDASWebContainer) is not found.

400

InvalidHostnameIp.Invalid

The hostname and/or IP is invalid: Hostname [%s], IP [%s].

The hostname [%s] or the IP address [%s] is invalid.

400

InvalidInstanceSpecification.Unsupported

The instance specification is not supported: CPU [%s], memory [%s].

The following instance type is not supported: CPU[%s], Memory[%s].

400

InvalidPackageType.NotFound

The package type must be War, FatJar, or Image.

The PackageType parameter is not set to War, FatJar, or Image.

400

InvalidParameter.NotEmpty

You must specify the parameter %s.

The value of the %s parameter is invalid. This parameter cannot be left empty.

400

InvalidParameter.Obviously

The specified parameter is invalid {%s}.

The value of the {%s} parameter is invalid.

400

InvalidParameter.WithMessage

The parameter is invalid {%s}: %s

The value %s of the {%s} parameter is invalid.

400

JarApplication.MissingJdk

A FatJar application must contain JDK.

No JDK is specified for the application whose package type is FatJar.

400

PandoraApplication.MissingJdk

The Pandora application is missing a JDK component.

No JDK is found for the Pandora application.

400

PandoraApplication.OnlyJdk

A Pandora application only requires JDK component.

Components other than JDK were specified for the Pandora application.

400

WarApplication.MissingJdkWebcontainer

A War application must contain JDK and Tomcat.

No JDK or Tomcat is specified for the WAR application. You must specify both JDK and Tomcat.

400

LogService.ConfigQuotaExceed

The maximum number of Log Service configs is exceeded.

The number of logging configurations of Simple Log Service exceeds the limit. 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.

Simple Log Service failed to be called. Join the DingTalk group 32874633 for technical support.

400

LogService.LogDirInvalid

The log collection path is invalid.

The path for log collection is invalid.

400

LogService.NotAvailable

Log Service is unavailable. Please activate Log Service first.

Simple Log Service is unavailable. Activate Simple Log Service.

400

LogService.ProjectNumQuotaExceed

The maximum number of Log Service projects is exceeded.

The number of Simple Log Service projects exceeds the limit. Join the DingTalk group 32874633 for technical support.

400

user.indebt

The user has an outstanding payment.

The current user has overdue payments.

400

NoComputeResourceQuota.App.Exceed

You can create %s instances for each application. Please submit a ticket to raise the quota.

A maximum of %s instances can be created for each application. 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.

A maximum of %s instances can be created within your account. Join the DingTalk group 32874633 for technical support.

400

System.Upgrading

The system is being upgraded. Please try again later.

The system is being upgraded. Try again later.

400

VolumnPath.Conflict

Conflict between log collection directory and persistent storage directory.

The log collection directory conflicts with the persistent storage directory.

400

Application.ChangerOrderRunning

An application change process is in progress. Please try again later.

An application change is in progress. Try again later.

400

Application.InvalidStatus

The application status is abnormal. Please try again later.

The application is in an abnormal state. Try again later.

400

MountConflict.ConfigMap

Conflict detected for ConfigMap path %s.

The %s path on which you want to mount the ConfigMap is occupied.

400

NotFound.ConfigMap

The ConfigMap object (ID: %s) does not exist.

The specified ConfigMap whose ID is %s does not exist.

400

NotFound.ConfigMapKey

The key %s of ConfigMap object (ID: %s) does not exist.

The %s key of the ConfigMap whose ID is %s does not exist.

400

Package.Version.Too.Long

The maximum length of package version is exceeded.

The length of the version number of the deployment package exceeds the limit.

400

App.Package.Version.Exists

The package version of application already exists.

The version number of the deployment package already exists.

400

Slb.Occupied

The SLB instance is occupied.

The SLB instance is occupied.

400

Slb.Tag.Not.Qualified

The current SLB instance cannot be reused because it may have been occupied by %s.

The SLB instance is being used by %s. We recommend that you choose another SLB instance.

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 is larger than or equal to the total number of instances.

400

MinReadyInstanceRatio.Invalid

The ratio of minimum available instances must be between 0 and 100.

The value of the MinReadyInstanceRatio parameter is invalid. The parameter value must be an integer from 0 to 100.

400

BatchWaitTime.Not.Smaller.Zero

BatchWaitTime must not be smaller than zero.

The value of the BatchWaitTime parameter is smaller than or equal to 0.

400

Sls.Config.Mixed.Multi.Project

The specified Config contains multiple projects.

Multiple projects are specified in the SlsConfigs parameter.

400

Sls.Config.User.Defined.Missing.Logstore.Info

The specified Config is invalid. Both Project and Logstore must be specified.

The logstoreName parameter is not specified in the custom configurations of the SlsConfigs parameter.

400

Sls.Config.User.Defined.Missing.Project.Info

The specified Config is invalid. Both Project and Logstore must be specified.

The projectName parameter is not specified in the custom configurations of the SlsConfigs parameter.

400

Sls.Logstore.Name.Invalid

The specified name of Logstore is invalid. The Logstore name must not contain the prefix "sae-".

The specified Logstore name is prefixed by "sae-". This prefix can only be used for the Logstores automatically created by SAE.

400

Sls.Logstore.User.Defined.Not.Exist

The user defined Logstore does not exist.

The specified Logstore does not exist.

400

Sls.Project.Name.Invalid

The specified project name is invalid. The project name must not contain the prefix "sae-".

The specified project name is prefixed by "sae-". This prefix can only be used for the projects automatically created by SAE.

400

Sls.Project.User.Defined.Not.Exist

The user defined project does not exist.

The specified project does not exist.

400

Sae.Errorcode.Ahas.Create.Error.Message

Failed to create AHAS.

Access to AHAS failed to be enabled.

400

InvalidImageUrl.AcrInstanceId.Domain.NotMatch

The specified domain of ImageUrl does not match AcrInstanceId domains.

The domain name in the value of the ImageURL parameter does not match the domain name in the value of the AcrInstanceId parameter.

400

PhpApplication.MissingPhpRuntime

A PHP application must contain PHP Runtime.

The PHP runtime is not specified for the PHP application.

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.

The name of the application package is invalid. The name can contain only letters, digits, hyphens (-), and underscores (_). To use JAR packages, make sure that the specified version supports JAR packages. Otherwise, you can only use WAR packages to deploy Java applications. To use zip files to deploy PHP packages, make sure that the specified version supports using zip files.

400

Sls.Logtail.Name.Invalid

The specified name of Logtail is invalid. The Logtail name must not contain the prefix sae-.

The specified Logtail configuration name is prefixed by "sae-". This prefix can only be used for the Logtail configurations automatically created by SAE.

400

InvalidImageUrl.MissingAcrInstanceId

The specified domain of ImageUrl is from ACREE, but you are not specified AcrInstanceId.

The domain name in the value of the ImageUrl parameter is the domain name of a Container Registry Enterprise Edition instance, but the AcrInstanceId parameter is not configured.

404

InvalidNamespaceId.NotFound

The specified NamespaceId does not exist.

The specified namespace ID does not exist.

404

InvalidAcrInstanceId.NotFound

The specified AcrInstanceId does not exist.

The specified Container Registry instance ID does not exist.

404

Associate.Eip.Not.Enough

No sufficient EIPs are available.

No EIP is available to be associated with the application. Purchase EIPs.

For a list of error codes, see Service error codes.