All Products
Search
Document Center

CloudSSO:ListGroups

Last Updated:Jan 14, 2025

Queries groups.

Operation description

This topic provides an example on how to query the groups in the directory d-00fc2p61****. The returned result shows that the directory contains three groups. The groups group1 and group2 are synchronized from an external identity provider (IdP). The group TestGroup is manually created in CloudSSO.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
cloudsso:ListGroupslist
*Group
acs:cloudsso:{#regionId}:{#accountId}:directory/{#DirectoryId}/group/*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
DirectoryIdstringYes

The ID of the directory.

d-00fc2p61****
NextTokenstringNo

The pagination token that is used in the next request to retrieve a new page of results. You do not need to specify this parameter for the first request. You must specify the token that is obtained from the previous query as the value of NextToken.

When you call this operation for the first time, if the total number of entries to return is larger than the value of the MaxResults parameter, the entries are truncated. The system returns entries based on the value of the MaxResults parameter, and does not return the excess entries. In this case, the value of the response parameter IsTruncated is true, and the NextToken parameter is returned. In the next call, you can use the value of the NextToken parameter and maintain the settings of the other request parameters to query the excess entries. You can repeat the call until the value of IsTruncated becomes false. This way, all entries are returned.

K1c3o9K7pFxoTtxH1Nm7MMLb7zrDGvftYBQBPDVv7AD3a8yhRb3Mk8L9ivmN6bFSjfkZNTAg3h4****
MaxResultsintegerNo

The number of entries per page.

Valid values: 1 to 100.

Default value: 10.

10
FilterstringNo

The filter condition.

You must specify the value in the <Attribute> <Operator> <Value> format. The value is not case-sensitive. You can set <Attribute> only to GroupName and <Operator> only to eq or sw. The value eq indicates Equals, and the value sw indicates Start With.

For example, if you set Filter to GroupName sw test, the operation queries the groups whose names start with test. If you set Filter to GroupName eq testgroup, the operation queries the group whose name is testgroup.

GroupName eq testgroup
ProvisionTypestringNo

The type of the group. The type can be used to filter groups. Valid values:

  • Manual: The group is manually created.
  • Synchronized: The group is synchronized from an external IdP.
Manual

Response parameters

ParameterTypeDescriptionExample
object

The response parameters.

NextTokenstring

A pagination token. It can be used in the next request to retrieve a new page of results.

Note This parameter is returned only when the value of the IsTruncated parameter is true.
K1c3o9K7pFxoTtxH1Nm7MMLb7zrDGvftYBQBPDVv7AD3a8yhRb3Mk8L9ivmN6bFSjfkZNTAg3h4****
RequestIdstring

The request ID.

768F908D-A66A-5A5D-816C-20C93CBBFEE3
Groupsarray<object>

The groups.

Groupobject

The group.

GroupNamestring

The name of the group.

TestGroup
Descriptionstring

The description of the group.

This is a group.
CreateTimestring

The time when the group was created.

2021-11-01T02:38:27Z
ProvisionTypestring

The type of the group. Valid values:

  • Manual: The group is manually created.
  • Synchronized: The group is synchronized from an external IdP.
Manual
UpdateTimestring

The time when the information about the group was modified.

2021-11-01T02:38:27Z
GroupIdstring

The ID of the group.

g-00jqzghi2n3o5hkh****
MaxResultsinteger

The number of entries per page.

10
TotalCountsinteger

The total number of entries returned.

3
IsTruncatedboolean

Indicates whether the queried entries are truncated. Valid values:

  • true
  • false
false

Examples

Sample success responses

JSONformat

{
  "NextToken": "K1c3o9K7pFxoTtxH1Nm7MMLb7zrDGvftYBQBPDVv7AD3a8yhRb3Mk8L9ivmN6bFSjfkZNTAg3h4****",
  "RequestId": "768F908D-A66A-5A5D-816C-20C93CBBFEE3",
  "Groups": [
    {
      "GroupName": "TestGroup",
      "Description": "This is a group.",
      "CreateTime": "2021-11-01T02:38:27Z",
      "ProvisionType": "Manual",
      "UpdateTime": "2021-11-01T02:38:27Z",
      "GroupId": "g-00jqzghi2n3o5hkh****"
    }
  ],
  "MaxResults": 10,
  "TotalCounts": 3,
  "IsTruncated": false
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
No change history