All Products
Search
Document Center

Platform For AI:CreateAppService

Last Updated:Nov 22, 2024

Creates an application service.

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
eas:CreateAppServicecreate
*All Resources
*
    none
none

Request syntax

POST /api/v2/app_services HTTP/1.1

Request parameters

ParameterTypeRequiredDescriptionExample
WorkspaceIdstringNo

The workspace ID.

123456
QuotaIdstringNo

The quota ID.

abcdef
bodyobjectNo

The request body.

ServiceNamestringYes

The service name.

foo
AppTypestringYes

The application service type.

Valid values:

  • LLM

LLM
AppVersionstringNo

The application version.

v1
ServiceSpecstringYes

The service specifications. Valid values:

  • llama_7b_fp16
  • llama_7b_int8
  • llama_13b_fp16
  • llama_7b_int8
  • chatglm_6b_fp16
  • chatglm_6b_int8
  • chatglm2_6b_fp16
  • baichuan_7b_int8
  • baichuan_13b_fp16
  • baichuan_7b_fp16
llama_7b_fp16
ReplicasintegerYes

The number of instances.

1
ConfigobjectNo

The additional configurations that are required for service deployment.

anyNo

The application information such as model mounting. Object Storage Service (OSS) mounting and File Storage NAS (NAS) mounting are supported.

  • For OSS mounting, the parameters are configured in the following way: { "ModelStorage": "oss", "OssPath": "oss://examplebucket/xxxx/" }
  • For NAS mounting, the parameters are configured in the following way: { "ModelStorage": "nas", "NasMountTarget": "317d14****-.cn-shanghai.nas.aliyuncs.com", "NasPath": "/", "SecurityGroupID": "sg-uf6e50fazt4u7smt", "VpcID": "vpc-uf66zxxrlv0l4nj49****", "VswitchID": "vsw-uf6fg76uu2bx84tci****" } Parameters:
  • ModelStorage: specifies the service in which the model is stored.
  • OssPath: specifies the OSS bucket directory where the model resides.
  • NasMountTarget: specifies the NAS mount target.
  • NasPath: specifies the NAS path where the files are stored.
  • SecurityGroupID: specifies the ID of the security group that is used to create the NAS file system.
  • VpcID: specifies the ID of the virtual private cloud (VPC) that is used to create the NAS file system.
  • VswitchID: specifies the ID of the vSwitch that is used to create the NAS file system.
{"ModelStorage":"oss"}

Response parameters

ParameterTypeDescriptionExample
object

Schema of Response

RequestIdstring

The request ID.

40325405-579C-4D82****
ServiceIdstring

The service ID.

eas-m-aaxxxddf
ServiceNamestring

The service name.

foo
Statusstring

The service state.

Creating
Regionstring

The region ID of the service.

cn-shanghai
InternetEndpointstring

The public endpoint of the service.

http://pai-eas.cn-shanghai.****
IntranetEndpointstring

The internal endpoint of the service.

http://pai-eas-vpc.cn-shanghai.****

Examples

Sample success responses

JSONformat

{
  "RequestId": "40325405-579C-4D82****",
  "ServiceId": "eas-m-aaxxxddf",
  "ServiceName": "foo",
  "Status": "Creating",
  "Region": "cn-shanghai",
  "InternetEndpoint": "http://pai-eas.cn-shanghai.****",
  "IntranetEndpoint": "http://pai-eas-vpc.cn-shanghai.****"
}

Error codes

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