list_groups
async
¶
list_groups(
directory_id: DirectoryId,
*,
config_overrides: Optional[AsyncDirectoryServiceDataClientConfig] = None,
realm: Optional[Realm] = None,
next_token: Optional[NextToken] = None,
max_results: Optional[MaxResults] = None,
) -> ListGroupsResult
Returns group information for the specified directory.
This operation supports pagination with the use of the NextToken request and response parameters. If more results are available, the ListGroups.NextToken member contains a token that you pass in the next call to ListGroups. This retrieves the next set of items.
You can also specify a maximum number of return results with the MaxResults parameter.
Parameters:
-
directory_id(DirectoryId) –The identifier (ID) of the directory that's associated with the group.
-
realm(Optional[Realm], default:None) –The domain name associated with the directory.
This parameter is optional, so you can return groups outside of your Managed Microsoft AD domain. When no value is defined, only your Managed Microsoft AD groups are returned.
This value is case insensitive.
-
next_token(Optional[NextToken], default:None) –An encoded paging token for paginated calls that can be passed back to retrieve the next page.
-
max_results(Optional[MaxResults], default:None) –The maximum number of results to be returned per request.
Raises:
-
AccessDeniedException–You don't have permission to perform the request or access the directory. It can also occur when the
DirectoryIddoesn't exist or the user, member, or group might be outside of your organizational unit (OU).Make sure that you have the authentication and authorization to perform the action. Review the directory information in the request, and make sure that the object isn't outside of your OU.
-
DirectoryUnavailableException–The request could not be completed due to a problem in the configuration or current state of the specified directory.
-
InternalServerException–The operation didn't succeed because an internal error occurred. Try again later.
-
ThrottlingException–The limit on the number of requests per second has been exceeded.
-
ValidationException–The request isn't valid. Review the details in the error message to update the invalid parameters or values in your request.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
To list domain groups The following command lists the name and default attributes for groups on the examplecorp.com domain.
>>> await client.list_groups(directory_id='d-12233abcde', max_results=123, next_token='123456', realm='examplecorp.com')
Source code in docs_src/capo_directory_service_data/_services/async_directory_service_data.py
989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 | |