All Products
Search
Document Center

:CreateApplication

Last Updated:Dec 05, 2024

Creates an application.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

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.
OperationAccess levelResource typeCondition keyAssociated operation
sae:CreateApplicationcreate
*All Resources
*
    none
none

Request syntax

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

Request parameters

ParameterTypeRequiredDescriptionExample
AppNamestringYes

test

test
NamespaceIdstringNo

cn-beijing:test

cn-beijing:test
AppDescriptionstringNo

This is a test description.

This is a test description.
VpcIdstringNo

vpc-bp1aevy8sofi8mh1q****

vpc-bp1aevy8sofi8mh1q****
VSwitchIdstringNo

vsw-bp12mw1f8k3jgygk9****

vsw-bp12mw1f8k3jgygk9****
PackageTypestringYes

FatJar

FatJar
PackageVersionstringNo

1.0.0

1.0.0
PackageUrlstringNo

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

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

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
JdkstringNo

Open JDK 8

Open JDK 8
WebContainerstringNo

apache-tomcat-7.0.91

apache-tomcat-7.0.91
CpuintegerNo

1000

1000
MemoryintegerNo

1024

1024
ReplicasintegerYes

1

1
CommandstringNo

sleep

echo
CommandArgsstringNo

1d

["a","b"]
EnvsstringNo

[{"name":"envtmp","value":"0"}]

[{"name":"envtmp","value":"0"}]
CustomHostAliasstringNo

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

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

-Xms4G -Xmx4G

-Xms4G -Xmx4G
JarStartArgsstringNo

custom-args

custom-args
LivenessstringNo

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

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

true

true
EdasContainerVersionstringNo

3.5.3

3.5.3
TimezonestringNo

Asia/Shanghai

Asia/Shanghai
SlsConfigsstringNo

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

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

KSAK****

KSAK****
MountHoststringNo

example.com

example.com
MountDescstringNo

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

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

{"exec":{"command":["cat","/etc/group"]}}

{"exec":{"command":["cat","/etc/group"]}}
PostStartstringNo

{"exec":{"command":["cat","/etc/group"]}}

{"exec":{"command":["cat","/etc/group"]}}
WarStartOptionsstringNo

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

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

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

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

sg-wz969ngg2e49q5i4****

sg-wz969ngg2e49q5i4****
AutoConfigbooleanNo

true

true
TerminationGracePeriodSecondsintegerNo

30

30
PhpArmsConfigLocationstringNo

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

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

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

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

k1=v1

k1=v1
TomcatConfigstringNo

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

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

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

xxxxxx

xxxxxx
OssAkSecretstringNo

xxxxxx

xxxxxx
AcrInstanceIdstringNo

cri-xxxxxx

cri-xxxxxx
AcrAssumeRoleArnstringNo

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

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

true

true

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The ID of the request.

91F93257-7A4A-4BD3-9A7E-2F6EAE6D****
Messagestring

The returned message.

success
TraceIdstring

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

0a98a02315955564772843261e****
Dataobject

The returned data.

ChangeOrderIdstring

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

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

The ID of the application that is created.

017f39b8-dfa4-4e16-a84b-1dcee4b1****
ErrorCodestring

The error code. Valid values:

  • The ErrorCode parameter is not returned when the request succeeds.
  • The ErrorCode parameter is returned when the request fails. For more information, see Error codes in this topic.
Codestring

The HTTP status code. Valid values:

  • 2xx: indicates that the request was successful.
  • 3xx: indicates that the request was redirected.
  • 4xx: indicates that the request was invalid.
  • 5xx: indicates that a server error occurred.
200
Successboolean

Indicates whether the application is created. Valid values:

  • true
  • false
true

Examples

Sample success responses

JSONformat

{
  "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 codeError codeError messageDescription
400Application.MissingJdkYour application must at least contain a JDK component.-
400InvalidPackageType.NotFoundThe package type must be War, FatJar, or Image.-
400InvalidParameter.NotEmptyYou must specify the parameter %s.-
400InvalidParameter.ObviouslyThe specified parameter is invalid {%s}.-
400JarApplication.MissingJdkA FatJar application must contain JDK.-
400NoAvailableCluster.NotFoundNo clusters are available for the current region.-
400NoComputeResourceQuota.ExceedYour compute resource is insufficient. Please contact us to raise the quota.-
400PandoraApplication.MissingJdkThe Pandora application is missing a JDK component.-
400PandoraApplication.OnlyJdkA Pandora application only requires JDK component.-
400InvalidParameter.WithMessageThe parameter is invalid {%s}: %s-
400InvalidComponent.NotFoundThe current component (such as JDK, Tomcat, or EDASWebContainer) does not exist.-
400InvalidHostnameIp.InvalidThe hostname and/or IP is invalid: Hostname [%s], IP [%s].-
400InvalidInstanceSpecification.UnsupportedThe instance specification is not supported: CPU [%s], memory [%s].-
400InvalidServerlessRegion.UnsupportedThe current region is not supported: %s-
400WarApplication.MissingJdkWebcontainerA War application must contain JDK and Tomcat.-
400InvalidNamespace.WithUppercaseThis namespace does not support creating SAE apps because it contains uppercase letters.-
400LogService.ConfigQuotaExceedThe 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.
400LogService.InternalErrorAn 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.
400LogService.LogDirInvalidThe log collection path is invalid.The log collection path is invalid.
400LogService.NotAvailableLog Service is unavailable. Please activate Log Service first.The log service is not available. Please open the log service first.
400LogService.ProjectNumQuotaExceedThe 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.
400user.indebtThe user has an outstanding payment.-
400NoComputeResourceQuota.App.ExceedYou 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.
400NoComputeResourceQuota.User.ExceedYour 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.
400System.UpgradingThe system is being upgraded. Please try again later.-
400VolumnPath.ConflictConflict between log collection directory and persistent storage directory.Conflict between log collection directory and persistent storage directory.
400MountConflict.ConfigMapConflict detected for ConfigMap path %s.-
400NotFound.ConfigMapThe ConfigMap object (ID: %s) does not exist.-
400NotFound.ConfigMapKeyThe key %s of ConfigMap object (ID: %s) does not exist.-
400Sls.Config.Mixed.Multi.ProjectThe specified Config contains multiple projects.-
400Sls.Config.User.Defined.Missing.Logstore.InfoThe specified Config is invalid. Both Project and Logstore must be specified.-
400Sls.Config.User.Defined.Missing.Project.InfoThe specified Config is invalid. Both Project and Logstore must be specified.-
400Sls.Logstore.Name.InvalidThe specified name of Logstore is invalid. The Logstore name must not contain the prefix "sae-".-
400Sls.Logstore.User.Defined.Not.ExistThe user defined Logstore does not exist.-
400Sls.Project.Name.InvalidThe specified project name is invalid. The project name must not contain the prefix "sae-".-
400Sls.Project.User.Defined.Not.ExistThe user defined project does not exist.-
400InvalidImageUrl.AcrInstanceId.Domain.NotMatchThe specified domain of ImageUrl does not match AcrInstanceId domains.-
400PhpApplication.MissingPhpRuntimeA PHP application must contain PHP Runtime.-
400InvalidParameter.FileNameThe 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.-
400Sls.Logtail.Name.InvalidThe specified name of Logtail is invalid. The Logtail name must not contain the prefix sae-.-
400vswitch.not.existThe specified vSwitch does not exist.The specified vSwitch does not exist. Please change the vSwitch.
400InvalidImageUrl.MissingAcrInstanceIdThe specified domain of ImageUrl is from ACREE, but you are not specified AcrInstanceId.-
404Associate.Eip.Not.EnoughNo sufficient EIPs are available.-
404InvalidNamespaceId.NotFoundThe specified NamespaceId does not exist.-
404InvalidVpcId.NotFoundThe specified VpcId does not exist.-
404InvalidAcrInstanceId.NotFoundThe specified AcrInstanceId does not exist.-

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2024-11-08The Error code has changed. The request parameters of the API has changedView Change Details
2024-10-11The Error code has changed. The request parameters of the API has changedView Change Details
2024-09-12The Error code has changed. The request parameters of the API has changedView Change Details
2024-08-28The Error code has changed. The request parameters of the API has changedView Change Details
2024-05-21The Error code has changed. The request parameters of the API has changedView Change Details
2024-01-22The Error code has changed. The request parameters of the API has changedView Change Details
2023-10-24The Error code has changed. The request parameters of the API has changedView Change Details
2023-06-07The Error code has changed. The request parameters of the API has changedView Change Details
2023-03-30The Error code has changed. The request parameters of the API has changedView Change Details
2022-08-02The Error code has changed. The request parameters of the API has changedView Change Details
2021-11-17The Error code has changedView Change Details