文档

CreateWorkspace - 创建工作空间

更新时间:

可以创建工作空间。

调试

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

授权信息

当前API暂无授权信息透出。

请求语法

POST /api/workspaces

请求参数

名称类型必填描述示例值
namestring

工作空间名称

Demo
workspaceTemplatestring

技术栈

all-in-one
codeUrlstring

代码来源 URL(当前仅支持云效 Codeup 来源)

git@codeup.aliyun.com:demo/Codeup-Demo.git
codeVersionstring

代码版本,支持 commitSHA、分支、标签

master
filePathstring

打开空间默认打开的文件相对路径

src/Test.java
reuseboolean

工作空间复用标识,按照"用户+技术栈+代码地址+版本"进行复用

  • true-复用
  • false-不复用,每次均为新创建
false
resourceIdentifierstring

资源标识,提供给非标代码源作为空间复用的唯一标识

acs:fc:cn-shenzhen:XXX:services/demo.LATEST/functions/demo
requestFromstring

请求来源(用于统计,云产品集成时需要传入)

fc

返回参数

名称类型描述示例值
object

Schema of Response

workspaceobject

工作空间信息

idstring

工作空间唯一标识,字符串形式,可在云效 DevStudio 访问空间链接中获取

6ed82817-ab75-4563-865d-81e60dxxxxxx
namestring

工作空间名称

Demo
statusstring

空间状态,枚举:CREATING-创建中, SUCCESS-运行中, FROZEN-冻结中, RECOVERING-恢复中

SUCCESS
templatestring

工作空间模板

all-in-one
creatorstring

创建者,阿里云 PK

1470227819xxxxxx
createTimestring

创建时间戳

1628564442000
requestIdstring

请求 ID

F7B85D1B-D1C2-140F-A039-341859F130B9
successboolean

请求是否成功

true
errorCodestring

错误码

WorkspaceQuotaExceeded
errorMessagestring

错误信息

The maximum number of workspace per user is exceeded.

示例

正常返回示例

JSON格式

{
  "workspace": {
    "id": "6ed82817-ab75-4563-865d-81e60dxxxxxx",
    "name": "Demo",
    "status": "SUCCESS",
    "template": "all-in-one",
    "creator": "1470227819xxxxxx",
    "createTime": "1628564442000"
  },
  "requestId": "F7B85D1B-D1C2-140F-A039-341859F130B9",
  "success": true,
  "errorCode": "WorkspaceQuotaExceeded",
  "errorMessage": "The maximum number of workspace per user is exceeded."
}

错误码

HTTP status code错误码错误信息描述
400InvalidResource.NotFoundNo resource is found. You cannot create the workspace. Please try again later.没有资源,无法创建工作空间,请稍后尝试
400InvalidCluster.NotFoundNo cluster is available to generate the workspace.没有可用的集群,无法创建工作空间
400InvalidCodeUrl.NotSupportSVNThe parameter codeUrl is invalid. SVN is not supported.参数错误,不支持svn
400InvalidWorkspaceTemplate.NotFoundThe parameter workspaceTemplate is not found.技术栈(即空间模板)不存在
403WorkspaceQuotaExceededThe maximum number of workspace per user is exceeded.单用户的工作空间数量已达到配额

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

  • 本页导读 (0)
文档反馈