CreateApplication - 创建PolarDB应用

更新时间:
复制 MD 格式

用于创建一个附属于PolarDB实例的应用。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

调试

授权信息

下表是API对应的授权信息,可以在RAM权限策略语句的Action元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:

  • 操作:是指具体的权限点。

  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。

  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:

    • 对于必选的资源类型,用前面加 * 表示。

    • 对于不支持资源级授权的操作,用全部资源表示。

  • 条件关键字:是指云产品自身定义的条件关键字。

  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。

操作

访问级别

资源类型

条件关键字

关联操作

polardb:CreateApplication

get

*全部资源

*

无 无

请求语法

POST  HTTP/1.1

请求参数

名称

类型

必填

描述

示例值

Description

string

否

应用描述/备注

myapp

Parameters

array<object>

否

参数列表

object

否

参数列表

ParameterName

string

否

参数名称

secret.gateway.auth.token

ParameterValue

string

否

参数值

TK***

AgenticDBBranchSpec

object

否

AgenticDB 分支规格

{"DBClusterId":"pagc-2zea920mcvd5o87","TenantId":"t-cfc2d7df0e59439681f0087f51","ProjectId":"proj-d7849d0050664c758af795d468","BranchId":"br-9054b3b7649e4c0d977bd0df37","ForkFromBranch":true,"ForkFromApplicationId":"pa-source"}

BranchId

string

否

AgenticDB 分支 ID

br-9054b3b7649e4c0d977bd0df37

DBClusterId

string

否

AgenticDB 集群 ID

pagc-2zea920mcvd5o87

ForkFromApplicationId

string

否

源应用 ID

pa-source

ForkFromBranch

boolean

否

是否基于指定 AgenticDB 分支创建应用

true

ProjectId

string

否

AgenticDB 项目 ID

proj-d7849d0050664c758af795d468

TenantId

string

否

AgenticDB 租户 ID

t-cfc2d7df0e59439681f0087f51

Storages

array<object>

否

应用存储列表

[{"StorageType":"oss","StorageInstanceId":"pfs-xxxx","EndpointId":"pe-xxxx"}]

object

否

ContainerMountPath

string

否

容器内挂载路径

/data/container

EndpointId

string

否

存储端点 ID

pe-xxxx

MountPath

string

否

存储挂载路径

/data/source

StorageCapacity

string

否

存储容量

100

StorageEndpoint

string

否

存储访问地址

polarfs.example.com

StorageInstanceId

string

否

存储实例 ID

pfs-xxxx

StoragePerformanceLevel

string

否

存储性能等级

PL1

StorageType

string

否

存储类型

oss

ApplicationType

string

是

应用类型,取值范围为

  • supabase: 若创建托管 Supabase 应用,请传入此值

  • raycluster: 若创建托管 Ray Cluster 应用,请传入此值

  • polarclaw: 若创建托管 PolarClaw 应用,请传入此值

supabase

DBClusterId

string

否

应用依赖的 PolarDB 实例 ID

pc-**************

RegionId

string

否

地域,默认为实例地域

cn-beijing

ZoneId

string

否

可用区,默认为实例主可用区

cn-beijing-k

VSwitchId

string

否

交换机,默认为实例主可用区当前的交换机

vsw-*********************

Architecture

string

是

CPU 架构,取值范围

  • x86

x86

SecurityIPList

string

否

IP 白名单。如果不填写,则会默认为127.0.0.1。

127.0.0.1,172.17.0.0/24

SecurityIPType

string

否

IP 地址的类型

ipv4

SecurityIPArrayName

string

否

IP 白名单组的名称,默认为default

default

Endpoints

array<object>

否

用户自定义的服务端点列表,默认创建一个 VPC Endpoint

object

否

服务端点

Description

string

否

服务端点备注

my_endpoint

EndpointType

string

否

服务端点类型,固定为 Primary

Primary

Components

array<object>

否

用户自定义的应用子组件列表

object

否

应用子组件

ComponentClass

string

否

应用子组件的规格

polar.app.g2.medium

ComponentMaxReplica

integer

否

同一规格应用子组件的最大数量,默认等于 ComponentReplica

  • 仅 raycluster 支持该参数

1

ComponentReplica

integer

否

应用子组件的副本数量,默认为 1

1

ComponentType

string

否

应用子组件的类型

对于 supabase,取值范围为

  • gateway

  • backend

对于 raycluster,取值范围为

  • head

  • worker

  • gpuworker

gateway

ScaleMax

string

否

组件伸缩上限。

16

ScaleMin

string

否

组件伸缩下限。

1

SecurityGroups

string

否

应用子组件的安全组列表,使用英文逗号分隔

sg-********************

SecurityIPArrayName

string

否

应用子组件白名单 IP 地址组的名称,默认为 default

default

SecurityIPList

string

否

应用子组件的白名单 IP 地址,英文逗号分隔

127.0.0.1

SecurityIPType

string

否

应用子组件的白名单 IP 的类型,默认为 ipv4

ipv4

PayType

string

否

付费类型

Postpaid

AutoRenew

boolean

否

自动续费

true

Period

string

否

包年或包月类型

Year

UsedTime

string

否

期限

1

ResourceGroupId

string

否

资源组 ID

rg-********************

DryRun

boolean

否

默认为false,设置为true后将只进行参数和资源校验,不实际创建资源。

false

PolarFSInstanceId

string

否

Polarlakebase 冷存版/高性能版实例 ID,默认为空,若传入则将相应存储挂载到应用中

目前仅如下应用支持

  • supabase

  • raycluster

pcs-********************

VpcId

string

否

专有网络 VPC ID。

vpc-********************

AutoCreatePolarFs

boolean

否

是否自动创建冷存版 Polarlakebase,取值:

  • false(默认):不自动创建。

  • true:自动创建。

false

AutoUseCoupon

boolean

否

是否自动使用优惠券,取值:

  • true(默认):使用优惠券。

  • false:不使用优惠券。

true

PromotionCode

string

否

优惠券编号,不填时使用默认优惠券

727xxxxxx934

SecurityGroupId

string

否

安全组 ID

sg-********************

MemApplicationSpec

object

否

mem0 应用必传

DbName

string

否

数据库名

test-database-name

DbPassword

string

否

密码

test-user-password

DbUser

string

否

用户名

test-user

EmbedderModel

string

否

mem0 应用必传,embdder 模型名称,如 text-embedding-v4

text-embedding-v4

EmbedderModelDimension

integer

否

向量维度

1024

GraphLlmModel

string

否

图 LLM 模型

qwen-plus

LlmModel

string

否

mem0 应用必传,llm 模型名称,如 qwen3-max

qwen3-max

ProjectName

string

否

项目名称,对应数据库存放项目数据的 schema

test-project-name

RerankerModel

string

否

mem0 应用必传,reranker 模型名称,如 qwen3-rerank

qwen3-rerank

Shard

integer

否

分表数量

1

KnowledgeApplicationSpec

object

否

knowledge 应用必传

DashboardPassword

string

否

dashboard 密码

DbPassword

string

否

密码

LlmModel

string

否

knowledge 应用必传,llm 模型名称,如 qwen3-max

ModelFrom

string

否

模型来源,取值:

  • bailian:百炼模型

  • custom:自定义模型

  • maas:PolarDB 模型算子

bailian

AIDBClusterId

string

否

关联已有模型算子实例 id,仅当 ApplicationType 为 polarclaw 时生效

pm-xxxxxx

ModelApiKey

string

否

模型 API KEY,仅当 ApplicationType 为 polarclaw 时生效

sk-xxxxxx

ModelBaseUrl

string

否

模型地址,仅当 ApplicationType 为 polarclaw 时生效

https://dashscope.aliyuncs.com/compatible-mode/v1

ModelApi

string

否

模型 api,仅当 ApplicationType 为 polarclaw 时生效

openai-completions

ModelName

string

否

模型名称,仅当 ApplicationType 为 polarclaw 时生效

qwen3-max

AutoAllocatePublicEip

boolean

否

是否自动创建并绑定弹性公网 IP

qwen3-max

Tag

array<object>

否

标签

object

否

标签

Key

string

否

标签键

testKey

Value

string

否

标签值

testValue

TargetVersion

string

否

目标版本

latest

AuthProvider

string

否

认证服务提供者

feishu

AuthProviderConfig

string

否

认证提供者配置

xxx

SkillTemplateId

string

否

Skill 模版 ID

xxx

VpcNatGatewayId

string

否

NAT 映射:客户自建的 VPC NAT 网关 ID,传入则在创建实例时一并开通 NAT 映射。须与应用同 VPC、私网类型(intranet)、可用状态

ngw-xxx

DnatIpAddress

string

否

NAT 映射:客户已分配的 DNAT 专用 NAT IP 地址(与 SNAT IP 分离)。须属于该网关、可用状态,且网关所在交换机属于办公网可达的主网段。与 VpcNatGatewayId 同时传入。前置条件:客户已为应用所在交换机绑定 SNAT 条目

10.64.0.10

DnatEntries

array<object>

否

NAT 映射:DNAT 条目期望清单,与 VpcNatGatewayId 同时传入。可为空,表示不创建 DNAT 条目

object

否

DNAT 条目

FrontPort

integer

否

前端端口,可选。缺省由管控自动分配(避开网关已占端口),分配结果可通过 DescribeApplicationAttribute 查询

10001

PortName

string

否

端口名称,取值:webui | hermesagent | dashboard | ssh

webui

AgenticDBClusterId

string

否

AgenticDB 集群 ID

pagc-xxx

返回参数

名称

类型

描述

示例值

object

Schema of Response

ApplicationId

string

应用 ID

pa-********************

Components

array<object>

子组件列表

object

子组件

ComponentId

string

子组件 ID

pac-********************

Description

string

应用备注

myapp

OrderId

string

生成的订单 ID

2148126708*****

RequestId

string

请求 ID

3E5CD764-FCCA-5C9C-838E-20E0DE84B2AF

ResourceAvailable

boolean

资源是否满足,仅DryRun为true时返回

true

ResourceGroupId

string

资源组 ID

rg-********************

示例

正常返回示例

JSON格式

{
  "ApplicationId": "pa-********************",
  "Components": [
    {
      "ComponentId": "pac-********************"
    }
  ],
  "Description": "myapp",
  "OrderId": "2148126708*****",
  "RequestId": "3E5CD764-FCCA-5C9C-838E-20E0DE84B2AF",
  "ResourceAvailable": true,
  "ResourceGroupId": "rg-********************"
}

错误码

访问错误中心查看更多错误码。

变更历史

更多信息,参考变更详情。