获取工作空间内已关联的资源列表。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
paiworkspace:ListResources |
list |
*全部资源
|
无 | 无 |
请求语法
GET /api/v1/resources HTTP/1.1
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| WorkspaceId |
string |
否 |
工作空间 ID。如何获取工作空间 ID,请参见 ListWorkspaces 。
|
123 |
| PageNumber |
integer |
否 |
资源列表的页码,起始值为 1,默认为 1。 |
1 |
| PageSize |
integer |
否 |
分页查询时设置的每页行数,默认为 20。 |
20 |
| ProductTypes |
string |
否 |
该字段已废弃,将会下线,请使用 ResourceType 字段。 |
MaxCompute |
| GroupName |
string |
否 |
资源分组名。如何获取资源分组名,请参见 ListResources 。 |
group |
| ResourceName |
string |
否 |
资源名。格式为:
|
resource |
| Option |
string |
否 |
选项,取值如下:
|
ListResourceByWorkspace |
| Verbose |
boolean |
否 |
是否展示详细信息,目前详细信息包含字段 Quotas。取值如下:
|
true |
| ResourceTypes |
string |
否 |
资源类型列表。取值如下:
|
MaxCompute |
| QuotaIds |
string |
否 |
QuotaId 集合,用逗号分割。只有同时具有这些 QuotaId 的资源才会被返回。 说明
目前只有 ResourceTypes=ACS 的资源才支持用该参数过滤。 |
quota-k******da,quota-cd******w |
| Labels |
string |
否 |
Label 过滤条件集合,多个条件用逗号分隔。只有同时满足这些标签的资源才会被返回。 目前只有 ProductType=ACS 的资源才支持用该参数过滤。 |
system.supported.dsw=true,system.supported.dlc=true |
| VerboseFields |
string |
否 |
逗号分隔的集合,表明要返回的字段。目前支持:
|
Quota,IsDefault |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
返回结构体。 |
||
| RequestId |
string |
请求 ID。 |
1e195c5116124202371861018d5bde |
| Resources |
array<object> |
资源列表。 |
|
|
array<object> |
资源信息。 |
||
| Id |
string |
资源 ID。 |
123 |
| Name |
string |
资源名。 |
ResourceName |
| ProductType |
string |
该字段已废弃,将会下线,请使用 ResourceType 字段。 |
MaxCompute |
| EnvType |
string |
环境类型,可能值:
|
prod |
| WorkspaceId |
string |
所属的工作空间 ID。 |
123 |
| IsDefault |
boolean |
是否为默认资源,每种资源类型都有一个默认的资源。可能值:
|
true |
| Quotas |
array<object> |
配额列表。 |
|
|
array<object> |
配额信息。 |
||
| Name |
string |
配额名称。 |
QuotaName |
| ProductCode |
string |
产品名,可能值:
|
MaxCompute_isolate |
| QuotaType |
string |
资源配额类型, 可能值:
|
MaxCompute |
| Mode |
string |
付费模式,可能值:
|
isolate |
| Specs |
array<object> |
规格描述列表。 |
{\"cu\":\"11500\",\"minCu\":\"2300\",\"parentId\":\"0\"} |
|
object |
规格描述信息。 |
||
| Name |
string |
规格名字。 |
cu |
| Value |
string |
规格描述。 |
11500 |
| CardType |
string |
卡类型,可能值:
|
CPU |
| Id |
string |
资源配额 ID。 |
123 |
| DisplayName |
string |
资源配额别名。 |
默认后付费Quota |
| Spec |
object |
规格说明。 |
对于MaxCompute {"Endpoint": "odps.alibaba-inc.com", "Project": "mignshi"} |
| GroupName |
string |
资源分组名,主账户内唯一。 |
groupName |
| GmtCreateTime |
string |
创建 UTC 时间,时间格式为 ISO8601。 |
2021-01-21T17:12:35.232Z |
| Executor |
object |
该字段无效,已废弃。 |
|
| OwnerId |
string |
该字段无效,已废弃。 |
110973******7793 |
| Encryption |
object |
加密信息,目前只对 MaxCompute 资源有效。 |
|
| Enabled |
boolean |
是否加密。 |
false |
| Algorithm |
string |
加密算法。 |
AESCTR |
| Key |
string |
加密主键。 |
DEFAULT |
| ResourceType |
string |
资源类型,可能值:
|
MaxCompute |
| Labels |
array<object> |
标签集合。 |
|
|
object |
标签。 |
||
| Key |
string |
标签的 Key。 |
system.supported.dsw |
| Value |
string |
标签的 Value。 |
true |
| TotalCount |
integer |
符合过滤条件的资源数量。 |
2 |
示例
正常返回示例
JSON格式
{
"RequestId": "1e195c5116124202371861018d5bde",
"Resources": [
{
"Id": "123",
"Name": "ResourceName",
"ProductType": "MaxCompute",
"EnvType": "prod",
"WorkspaceId": "123",
"IsDefault": true,
"Quotas": [
{
"Name": "QuotaName",
"ProductCode": "MaxCompute_isolate",
"QuotaType": "MaxCompute",
"Mode": "isolate",
"Specs": [
{
"Name": "cu",
"Value": "11500"
}
],
"CardType": "CPU",
"Id": "123",
"DisplayName": "默认后付费Quota"
}
],
"Spec": {
"test": "test",
"test2": 1
},
"GroupName": "groupName",
"GmtCreateTime": "2021-01-21T17:12:35.232Z",
"Executor": {
"OwnerId": "110973******7793"
},
"Encryption": {
"Enabled": false,
"Algorithm": "AESCTR",
"Key": "DEFAULT"
},
"ResourceType": "MaxCompute",
"Labels": [
{
"Key": "system.supported.dsw",
"Value": "true"
}
]
}
],
"TotalCount": 2
}
错误码
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。