全部产品
Search
文档中心

大数据开发治理平台 DataWorks:GetProject

更新时间:Oct 12, 2023

调用GetProject查询一个DataWorks工作空间的信息。

调试

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

请求参数

名称

类型

是否必选

示例值

描述

Action String GetProject

系统规定参数。取值:GetProject

ProjectId Long 27

DataWorks工作空间ID。您可以通过ListProjects接口获取工作空间ID。

ProjectIdentifier String dw_project

DataWorks工作空间名称。您可以登录DataWorks控制台,进入工作空间配置页面获取工作空间名称。

返回数据

名称

类型

示例值

描述

HttpStatusCode Integer 200

HTTP状态码。

RequestId String 0bc1411515937635973****

请求的ID。用于定位日志,排查问题。

Success Boolean true

是否成功查询工作空间的信息。

Data Object

工作空间的描述信息。

Status Integer 0

工作空间的状态,取值如下:

  • AVAILABLE(0),工作空间运行正常。
  • DELETED(1),工作空间已被删除。
  • INITIALIZING(2),初始化工作空间。
  • INIT_FAILED(3),工作空间初始化失败。
  • FORBIDDEN(4),手动禁用工作空间。
  • DELETING(5),正在删除工作空间。
  • DEL_FAILED(6),工作空间删除失败。
  • FROZEN(7),工作空间欠费冻结。
  • UPDATING(8),更新工作空间(为工作空间添加并初始化计算引擎)。
  • UPDATE_FAILED(9),更新工作空间(为工作空间添加并初始化计算引擎)失败。
MaxFlowNode Integer 1

该字段已废弃。

ProjectId Integer 27

工作空间的ID。

IsAllowDownload Integer 1

是否允许下载ide上查询的结果,取值如下:

  • 1,允许下载。
  • 0,不允许下载。
ProjectMode Integer 2

工作空间的模式,取值如下:

  • 2,表示简单工作空间模式。
  • 3,表示标准工作空间模式。
GmtModified String Dec 3, 2019 9:12:20 PM

修改工作空间的时间,示例格式为Dec 3, 2019 9:12:20 PM。

ProdStorageQuota String 1

该字段已废弃。

ProjectDescription String abc

工作空间的描述。

DevelopmentType Integer 4

工作空间的开发类型,目前均为4。该字段已废弃。

TablePrivacyMode Integer 1

MaxCompute表的可见性权限,取值如下:

  • 0,租户内用户不可见MaxCompute表。
  • 1,租户内用户可见MaxCompute表。
DefaultDiResourceGroupIdentifier String group_280749521****

购买MaxCompute独享资源组时,默认分配的资源组的标识。

SchedulerMaxRetryTimes Integer 3

默认出错自动重跑的次数。

ProtectedMode Integer 1

工作空间是否开启了保护模式,取值如下:

  • 1,开启保护模式。
  • 0,未开启保护模式。
SchedulerRetryInterval Integer 120000

默认出错自动重跑的时间间隔,单位为ms。取值最大为30分钟,注意单位转换。

Appkey String 0

该字段已废弃。

DevStorageQuota String 0

该字段已废弃。

ResidentArea String private

工作空间的类型,private为私有区,swap为交换区。

IsDefault Integer 1

是否为默认工作空间,取值如下:

  • 1,是。
  • 0,否。
Destination Integer 0

该字段已废弃。

ProjectName String abc

工作空间的显示名称。

ProjectIdentifier String abc

工作空间的标识。

DisableDevelopment Boolean true

是否禁用开发角色,取值如下:

  • false,开启开发角色。
  • true,禁用开发角色。
  • 默认值为false。
ProjectOwnerBaseId String 18229311****

工作空间所有者的阿里云ID。

BaseProject Boolean false

该字段已废弃。

UseProxyOdpsAccount Boolean true

访问MaxCompute引擎是否使用代理账号。

GmtCreate String Oct 10, 2019 3:42:53 PM

创建工作空间时间,示例格式Dec 3, 2019 9:12:20 PM。

TenantId Long 280749521

租户ID。

EnvTypes Array of String ["PROD"]

工作空间包含的环境:

  • 简单模式只有生产环境(PROD)。
  • 标准模式包含开发环境(DEV)和生产环境(PROD)。
ResourceManagerResourceGroupId String rg-acfmzbn7pti3zfa

资源组ID。

Tags Array of Tag

标签。

用于给资源打标签,为权限鉴权与分账时使用。

Key String Env

资源的标签键。使用如下:

  • 取值范围:1~20。
  • 最多支持128个字符。
  • 不能以acs:和aliyun:开头。
  • 不能包含http://或者https://。
Value String Test

资源的标签值。使用如下:

  • 取值范围:1~20。
  • 最多支持128个字符。
  • 不能以acs:开头。
  • 不能包含http://或者https://。

示例

请求示例

http(s)://[Endpoint]/?Action=GetProject
&ProjectId=27
&公共请求参数

正常返回示例

XML格式

HTTP/1.1 200 OK
Content-Type:application/xml

<GetProjectResponse>
    <HttpStatusCode>200</HttpStatusCode>
    <RequestId>0bc1411515937635973****</RequestId>
    <Success>true</Success>
    <Data>
        <Status>0</Status>
        <MaxFlowNode>1</MaxFlowNode>
        <ProjectId>27</ProjectId>
        <IsAllowDownload>1</IsAllowDownload>
        <ProjectMode>2</ProjectMode>
        <GmtModified>Dec 3, 2019 9:12:20 PM</GmtModified>
        <ProdStorageQuota> 1</ProdStorageQuota>
        <ProjectDescription>abc</ProjectDescription>
        <DevelopmentType>4</DevelopmentType>
        <TablePrivacyMode>1</TablePrivacyMode>
        <DefaultDiResourceGroupIdentifier>group_280749521****</DefaultDiResourceGroupIdentifier>
        <SchedulerMaxRetryTimes>3</SchedulerMaxRetryTimes>
        <ProtectedMode>1</ProtectedMode>
        <SchedulerRetryInterval>120000</SchedulerRetryInterval>
        <Appkey>0</Appkey>
        <DevStorageQuota>0</DevStorageQuota>
        <ResidentArea>private</ResidentArea>
        <IsDefault>1</IsDefault>
        <Destination>0</Destination>
        <ProjectName>abc</ProjectName>
        <ProjectIdentifier>abc</ProjectIdentifier>
        <DisableDevelopment>true</DisableDevelopment>
        <ProjectOwnerBaseId>18229311****</ProjectOwnerBaseId>
        <BaseProject>false</BaseProject>
        <UseProxyOdpsAccount>true</UseProxyOdpsAccount>
        <GmtCreate>Oct 10, 2019 3:42:53 PM</GmtCreate>
        <TenantId>280749521</TenantId>
        <EnvTypes>["PROD"]</EnvTypes>
        <ResourceManagerResourceGroupId>rg-acfmzbn7pti3zfa</ResourceManagerResourceGroupId>
        <Tags>
            <Key>Env</Key>
            <Value>Test</Value>
        </Tags>
    </Data>
</GetProjectResponse>

JSON格式

HTTP/1.1 200 OK
Content-Type:application/json

{
  "HttpStatusCode" : 200,
  "RequestId" : "0bc1411515937635973****",
  "Success" : true,
  "Data" : {
    "Status" : 0,
    "MaxFlowNode" : 1,
    "ProjectId" : 27,
    "IsAllowDownload" : 1,
    "ProjectMode" : 2,
    "GmtModified" : "Dec 3, 2019 9:12:20 PM",
    "ProdStorageQuota" : 1,
    "ProjectDescription" : "abc",
    "DevelopmentType" : 4,
    "TablePrivacyMode" : 1,
    "DefaultDiResourceGroupIdentifier" : "group_280749521****",
    "SchedulerMaxRetryTimes" : 3,
    "ProtectedMode" : 1,
    "SchedulerRetryInterval" : 120000,
    "Appkey" : 0,
    "DevStorageQuota" : 0,
    "ResidentArea" : "private",
    "IsDefault" : 1,
    "Destination" : 0,
    "ProjectName" : "abc",
    "ProjectIdentifier" : "abc",
    "DisableDevelopment" : true,
    "ProjectOwnerBaseId" : "18229311****",
    "BaseProject" : false,
    "UseProxyOdpsAccount" : true,
    "GmtCreate" : "Oct 10, 2019 3:42:53 PM",
    "TenantId" : 280749521,
    "EnvTypes" : "[\"PROD\"]",
    "ResourceManagerResourceGroupId" : "rg-acfmzbn7pti3zfa",
    "Tags" : {
      "Key" : "Env",
      "Value" : "Test"
    }
  }
}

错误码

HttpCode

错误码

错误信息

描述

400 Invalid.Tenant.ProjectNotExists The project does not exist. 项目不存在。
400 Invalid.Tenant.UserNotInProject The user is not in the project. 用户不在项目中。
403 Invalid.Tenant.UserIsNotProjectOwnerOrAdmin The user is not a project administrator or owner. 用户不是项目负责人或者项目管理员。
403 Invalid.Tenant.UserNotInTenant The user is not in tenant. 用户不在租户中。

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