All Products
Search
Document Center

Bastionhost:ListUserGroupsForUser

Last Updated:Aug 14, 2026

Queries the list of user groups that a user has joined.

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 parameters

Parameter

Type

Required

Description

Example

InstanceId

string

Yes

The ID of the bastion host instance.

Note

You can call the DescribeInstances operation to obtain this parameter.

bastionhost-cn-m413tuhlo03

RegionId

string

No

The region ID of the bastion host.

Note

For the mapping between region IDs and region names, see Regions and zones.

cn-hangzhou

UserId

string

Yes

The user ID.

1

PageNumber

string

Yes

The page number for a paged query. Default value: 1.

1

PageSize

string

Yes

The maximum number of entries per page for a paged query.
The maximum value of PageSize is 100. The default number of entries per page is 20. If PageSize is left empty, 20 entries are returned by default.

Note

Do not leave PageSize empty.

20

Keyword

string

No

The name of the user group to query. Fuzzy match is supported.

test

PagingOff

string

No

Specifies whether to disable paging. Valid values:

  • true: Disables paging and returns all data.

  • false: Enables paging and returns the number of user groups specified by PageSize.

true

ProjectId

integer

No

The project ID.

1

Response elements

Element

Type

Description

Example

object

Count

integer

The total number of user groups returned.

12

RequestId

string

The request ID.

EC9BF0F4-8983-491A-BC8C-1B4DD94976DE

UserGroups

array<object>

The list of user groups.

object

The list of user groups.

UserGroupName

string

The name of the user group.

group

Comment

string

The remarks of the user group.

comment

UserGroupId

string

The ID of the user group.

2

ProjectId

string

The ID of the project to which the user group belongs.

2

ProjectName

string

The name of the project to which the user group belongs.

test

Examples

Success response

JSON format

{
  "Count": 12,
  "RequestId": "EC9BF0F4-8983-491A-BC8C-1B4DD94976DE",
  "UserGroups": [
    {
      "UserGroupName": "group",
      "Comment": "comment",
      "UserGroupId": "2",
      "ProjectId": "2",
      "ProjectName": "test"
    }
  ]
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.