ListUserResources

Updated at:

Retrieves the code repositories and code groups accessible to a specified user, along with role information. This operation supports pagination by user. Only users with enterprise administrator permissions or higher can call this operation.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

No authorization for this operation. If you encounter issues with this operation, contact technical support.

Request syntax

GET /api/v4/user/vision/user_resources HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

organizationId

string

Yes

The organization ID. You can obtain this string from the Yunxiao URL, such as https://devops.aliyun.com/organization/[OrganizationId].

5ebbc0228123212b59xxxxx

accessToken

string

No

The personal access token. This parameter is not required if you use an Alibaba Cloud AccessKey pair or Security Token Service (STS) for temporary authorization.

f0b1e61db5961df5975a93f9129d2513

userIds

string

No

The list of Alibaba Cloud account IDs of the users. Separate multiple IDs with commas.

1,2,3

page

integer

No

The page number. Default value: 1.

1

pageSize

integer

No

The number of entries per page. Valid values: 1 to 100. Default value: 20.

10

Response elements

Element

Type

Description

Example

object

Schema of Response

requestId

string

The request ID.

A35869D5-BB29-5F84-A4DD-B09985EA2AFA

success

boolean

Indicates whether the request is successful.

true

errorMessage

string

The error message.

”“

errorCode

string

The error code.

success

total

integer

The total number of records.

2

result

array<object>

The list of returned results.

array<object>

The returned result.

userInfo

object

The user information.

id

integer

The user ID.

19230

name

string

The username.

test-codeup

username

string

The logon name of the user.

test-codeup

state

string

The status of the user. Valid values:

  • active: Active.

  • blocked: Blocked.

active

avatarUrl

string

The URL of the avatar.

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

email

string

The email address of the user.

username@example.com

groupInfos

array<object>

The list of code groups that the user has permissions for.

array<object>

The code group and role information.

groupInfo

object

The code group information.

id

integer

The code group ID.

35268

name

string

The name of the code group.

test-group

path

string

The path of the code group.

test-group

nameWithNamespace

string

The full name of the code group, including the full group name.

test-org / test-group (spaces on both sides of the slash)

pathWithNamespace

string

The full path of the code group, including the parent path.

test-org/test-group

parentId

integer

The ID of the parent path.

1183319

ownerId

integer

The ID of the code group owner.

1234

createdAt

string

The creation time, in ISO 8601 format with a time zone offset.

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

updatedAt

string

The update time, in ISO 8601 format with a time zone offset.

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

visibilityLevel

integer

The visibility of the code group. Valid values:

  • 0: Private.

  • 10: Visible to the enterprise.

0

description

string

The description of the code group.

test-group

groupRole

object

The role information of the user in the code group.

sourceId

integer

The associated ID, which refers to the ID of the code repository or code group.

35268

sourceType

string

The associated type. Valid values:

  • Project: Code repository.

  • Namespace: Code group.

Namespace

accessLevel

integer

The permission type. Valid values:

  • 20: Viewer.

  • 30: Developer.

  • 40: Administrator.

40

cnRoleName

string

The Chinese name of the role. Valid values:

  • Viewer

  • Developer

  • Administrator

管理员

enRoleName

string

The English name of the role. Valid values:

  • Viewer: Viewer.

  • Developer: Developer.

  • Admin: Administrator.

Admin

repositoryInfos

array<object>

The list of code repositories that the user has permissions for.

array<object>

The code repository and role information.

repositoryInfo

object

The code repository information.

id

integer

The code repository ID.

37229

name

string

The name of the code repository.

test-repo

path

string

The path of the code repository.

test-repo

description

string

The description of the code repository.

Specific description

nameWithNamespace

string

The full name of the code repository, including the full group name.

test-org / test-group / test-repo (spaces on both sides of the slash)

pathWithNamespace

string

The full path of the code repository, including the full group path.

test-org/test-group/test-repo

visibilityLevel

integer

The visibility. Valid values:

  • 0: Private. Visible only to code repository members.

  • 10: Public within the enterprise. Visible to enterprise members.

0

lastActivityAt

string

The last activity time.

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

namespaceId

integer

The ID of the parent path.

600002

accessLevel

integer

The member permissions. Valid values:

  • 20: Viewer.

  • 30: Developer.

  • 40: Administrator.

40

createdAt

string

The creation time, in ISO 8601 format with a time zone offset.

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

updatedAt

string

The update time, in ISO 8601 format with a time zone offset.

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

archived

boolean

Indicates whether the code repository is archived.

false

creatorId

integer

The ID of the creator.

12679

encrypted

boolean

Indicates whether the code repository is encrypted.

false

repositoryRole

object

The role information of the user in the code repository.

sourceId

integer

The source ID, which refers to the ID of the code repository or code group.

37229

sourceType

string

The associated type. Valid values:

  • Project: Code repository.

  • Namespace: Code group.

Project

accessLevel

integer

The permission type. Valid values:

  • 20: Viewer.

  • 30: Developer.

  • 40: Administrator.

40

cnRoleName

string

The Chinese name of the role. Valid values:

  • Viewer

  • Developer

  • Administrator

管理员

enRoleName

string

The English name of the role. Valid values:

  • Viewer: viewer

  • Developer: developer

  • Admin: administrator

Admin

Examples

Success response

JSON format

{
  "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 (spaces on both sides of the slash)",
            "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": "Specific description",
            "nameWithNamespace": "test-org / test-group / test-repo (spaces on both sides of the slash)",
            "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"
          }
        }
      ]
    }
  ]
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.