创建工作空间
功能介绍
创建工作空间。用户可通过该接口创建工作空间,支持传入名称、描述、MetaStoreID、企业项目ID和标签,返回工作空间详情。此接口为同步接口,无配套使用接口。创建工作空间接口存在同名校验,不支持创建重复名称的工作空间,并且同一账户下创建工作空间数量存在上限。
调试
您可以在API Explorer中调试该接口,支持自动认证鉴权。API Explorer可以自动生成SDK代码示例,并提供SDK代码示例调试功能。
URI
POST https://localhost.com/v1/workspaces
请求参数
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
X-Auth-Token |
否 |
String |
|
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
name |
是 |
String |
|
description |
否 |
String |
|
metastore_id |
否 |
String |
|
enterprise_project_id |
否 |
String |
|
tags |
否 |
Array of ResourceTag objects |
|
响应参数
状态码:200
参数 |
参数类型 |
描述 |
---|---|---|
id |
String |
|
name |
String |
|
description |
String |
|
create_time |
String |
|
create_domain_name |
String |
|
create_user_name |
String |
|
metastore_id |
String |
|
access_url |
String |
|
enterprise_project_id |
String |
|
tags |
Array of ResourceTag objects |
|
参数 |
参数类型 |
描述 |
---|---|---|
key |
String |
|
value |
String |
|
状态码:400
参数 |
参数类型 |
描述 |
---|---|---|
error_code |
String |
|
error_msg |
String |
|
solution_msg |
String |
|
状态码:401
参数 |
参数类型 |
描述 |
---|---|---|
error_code |
String |
|
error_msg |
String |
|
solution_msg |
String |
|
状态码:404
参数 |
参数类型 |
描述 |
---|---|---|
error_code |
String |
|
error_msg |
String |
|
solution_msg |
String |
|
状态码:408
参数 |
参数类型 |
描述 |
---|---|---|
error_code |
String |
|
error_msg |
String |
|
solution_msg |
String |
|
状态码:500
参数 |
参数类型 |
描述 |
---|---|---|
error_code |
String |
|
error_msg |
String |
|
solution_msg |
String |
|
请求示例
创建工作空间。其名称为fabric,描述为fabric-description,对应的MetastoreID为xxxxxx,对应企业项目ID为01049549-82cd-4b2b-9733-ddb94350c125,对应标签有key1,值为value1,key2,值为value2。
POST https://{endpoint}/v1/workspaces { "name" : "fabric", "description" : "fabric-description", "metastore_id" : "xxxxxx", "enterprise_project_id" : "01049549-82cd-4b2b-9733-ddb94350c125", "tags" : [ { "key" : "key1", "value" : "value1" }, { "key" : "key2", "value" : "value2" } ] }
响应示例
状态码:200
创建工作空间列表响应体。
{ "id" : "90a827a1-ca72-4be8-943b-774f94xxxxxx", "name" : "workspace1", "description" : "workspace1-description", "create_time" : "2025-01-10T03:37:12.000+00:00", "create_domain_name" : "create_domain_name_001", "create_user_name" : "create_user_name_001", "metastore_id" : "2180518f-42b8-4947-b20b-adfc539xxxxx", "access_url" : "https://:test.fabric.com/", "enterprise_project_id" : 0 }
状态码:400
BadRequest
{ "error_code" : "common.01000001", "error_msg" : "failed to read http request, please check your input, code: 400, reason: Type mismatch., cause: TypeMismatchException" }
状态码:401
Unauthorized
{ "error_code" : "APIG.1002", "error_msg" : "Incorrect token or token resolution failed" }
状态码:403
Forbidden
{ "error" : { "code" : "403", "message" : "X-Auth-Token is invalid in the request", "title" : "Forbidden" }, "error_code" : 403, "error_msg" : "X-Auth-Token is invalid in the request", "title" : "Forbidden" }
状态码:404
NotFound
{ "error_code" : "common.01000001", "error_msg" : "response status exception, code: 404" }
状态码:408
Request Time-out
{ "error_code" : "common.00000408", "error_msg" : "timeout exception occurred" }
状态码:500
InternalServerError
{ "error_code" : "common.00000500", "error_msg" : "internal error" }
状态码
状态码 |
描述 |
---|---|
200 |
创建工作空间列表响应体。 |
400 |
BadRequest |
401 |
Unauthorized |
403 |
Forbidden |
404 |
NotFound |
408 |
Request Time-out |
500 |
InternalServerError |
错误码
请参见错误码。