文档

ListUserResources - 获取用户有权限的资源

获取指定用户名下的有权限的代码库和代码组信息,以及角色信息,支持分页,以用户维度进行分页。请注意,仅限企业管理员以上权限的用户可调用。

调试

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

授权信息

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

请求语法

GET /api/v4/user/vision/user_resources

请求参数

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

企业标识,也称企业 id,字符串形式,可在云效访问链接中获取,如 https://devops.aliyun.com/organization/【OrganizationId】

5ebbc0228123212b59xxxxx
accessTokenstring

个人访问令牌。 使用阿里云 AK+SK 或使用 STS 临时授权方式不需要传该字段

f0b1e61db5961df5975a93f9129d2513
userIdsstring

用户的阿里云账号 ID 列表,多个账号以逗号隔开

1,2,3
pagelong

页码,默认值为 1,从第 1 页开始

1
pageSizelong

每页大小,默认值为 20,取值范围【1,100】

10

返回参数

名称类型描述示例值
object

Schema of Response

requestIdstring

请求 ID

A35869D5-BB29-5F84-A4DD-B09985EA2AFA
successboolean

请求是否成功

true
errorMessagestring

错误信息

”“
errorCodestring

错误码

success
totallong

总记录数

2
resultobject []

返回结果列表

userInfoobject

用户信息

idlong

用户 ID

19230
namestring

用户名称

test-codeup
usernamestring

用户登录名

test-codeup
statestring

用户状态,可选值:

  • active
  • blocked
active
avatarUrlstring

头像地址

https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100
emailstring

用户邮箱

username@example.com
groupInfosobject []

用户有权限的代码组列表

groupInfoobject

代码组信息

idlong

代码组 ID

35268
namestring

代码组名称

test-group
pathstring

代码组路径

test-group
nameWithNamespacestring

代码组完整名称(含完整组名称)

test-org / test-group(斜杠两侧有空格)
pathWithNamespacestring

代码组完整路径(含父路径)

test-org/test-group
parentIdlong

父路径 ID

1183319
ownerIdlong

代码组拥有者 ID

1234
createdAtstring

创建时间

2022-01-14T21:08:26+08:00
updatedAtstring

更新时间

2022-01-14T21:08:26+08:00
visibilityLevelinteger

代码组的可见性

  • 0:私有
  • 10:企业可见
0
descriptionstring

代码组的描述信息

test-group
groupRoleobject

用户在代码组的角色信息

sourceIdlong

关联的 ID,指代码库或代码组 ID

35268
sourceTypestring

关联的类型,可选值:

  • Project:指代码库
  • Namespace:指代码组
Namespace
accessLevelinteger

权限类型

  • 20:浏览者
  • 30:开发者
  • 40:管理员
40
cnRoleNamestring

角色中文名

  • 浏览者
  • 开发者
  • 管理员
管理员
enRoleNamestring

角色英文名

  • Viewer - 浏览者
  • Developer - 开发者
  • Admin - 管理员
Admin
repositoryInfosobject []

用户有权限的代码库列表

repositoryInfoobject

代码库信息

idlong

代码库 ID

37229
namestring

代码库名称

test-repo
pathstring

代码库路径

test-repo
descriptionstring

代码库描述

具体的描述内容
nameWithNamespacestring

代码库完整名称(含完整组名称)

test-org / test-group / test-repo(斜杠两侧有空格)
pathWithNamespacestring

代码库完整路径(含完整组路径)

test-org/test-group/test-repo
visibilityLevelinteger

可见性

  • 0:私有,仅代码库成员可见
  • 10:企业内公开,企业成员可见
0
lastActivityAtstring

最后活跃时间

2022-01-14T21:08:26+08:00
namespaceIdlong

上级路径的 ID

600002
accessLevelinteger

成员权限

  • 20:浏览者
  • 30:开发者
  • 40:管理员
40
createdAtstring

创建时间

2022-01-14T21:08:26+08:00
updatedAtstring

更新时间

2022-01-14T21:08:26+08:00
archivedboolean

归档标识

false
creatorIdlong

创建者 ID

12679
encryptedboolean

加密标识

false
repositoryRoleobject

用户在代码库的角色信息

sourceIdlong

来源 ID,指代码库或代码组 ID

37229
sourceTypestring

关联的类型,可选值:

  • Project:指代码库
  • Namespace:指代码组
Project
accessLevelinteger

权限类型

  • 20:浏览者
  • 30:开发者
  • 40:管理员
40
cnRoleNamestring

角色中文名

  • 浏览者
  • 开发者
  • 管理员
管理员
enRoleNamestring

角色英文名

  • Viewer - 浏览者
  • Developer - 开发者
  • Admin - 管理员
Admin

示例

正常返回示例

JSON格式

{
  "requestId": "A35869D5-BB29-5F84-A4DD-B09985EA2AFA",
  "success": true,
  "errorMessage": "”“",
  "errorCode": "success",
  "total": 2,
  "result": [
    {
      "userInfo": {
        "id": 19230,
        "name": "test-codeup",
        "username": "test-codeup",
        "state": "active",
        "avatarUrl": "https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100",
        "email": "username@example.com"
      },
      "groupInfos": [
        {
          "groupInfo": {
            "id": 35268,
            "name": "test-group",
            "path": "test-group",
            "nameWithNamespace": "test-org / test-group(斜杠两侧有空格)",
            "pathWithNamespace": "test-org/test-group",
            "parentId": 1183319,
            "ownerId": 1234,
            "createdAt": "2022-01-14T21:08:26+08:00\n",
            "updatedAt": "2022-01-14T21:08:26+08:00\n",
            "visibilityLevel": 0,
            "description": "test-group"
          },
          "groupRole": {
            "sourceId": 35268,
            "sourceType": "Namespace",
            "accessLevel": 40,
            "cnRoleName": "管理员",
            "enRoleName": "Admin"
          }
        }
      ],
      "repositoryInfos": [
        {
          "repositoryInfo": {
            "id": 37229,
            "name": "test-repo",
            "path": "test-repo",
            "description": "具体的描述内容",
            "nameWithNamespace": "test-org / test-group / test-repo(斜杠两侧有空格)",
            "pathWithNamespace": "test-org/test-group/test-repo",
            "visibilityLevel": 0,
            "lastActivityAt": "2022-01-14T21:08:26+08:00\n",
            "namespaceId": 600002,
            "accessLevel": 40,
            "createdAt": "2022-01-14T21:08:26+08:00",
            "updatedAt": "2022-01-14T21:08:26+08:00",
            "archived": false,
            "creatorId": 12679,
            "encrypted": false
          },
          "repositoryRole": {
            "sourceId": 37229,
            "sourceType": "Project",
            "accessLevel": 40,
            "cnRoleName": "管理员",
            "enRoleName": "Admin"
          }
        }
      ]
    }
  ]
}

错误码

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

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