search_principals
async
¶
search_principals(
domain_id: DomainId,
search_query: str,
*,
config_overrides: Optional[AsyncCloudWatchOmniClientConfig] = None,
max_results: Optional[int] = None,
next_token: Optional[SearchPrincipalsNextToken] = None,
) -> SearchPrincipalsOutput
Searches Identity Center for users and groups in a domain. The domain must be configured with Identity Center. To grant access to a result, pass its principalId to CreateAccessGrant with a principalType of IDC_USER for a user or IDC_GROUP for a group.
Parameters:
-
domain_id(DomainId) –The ID of the domain to search within.
-
search_query(str) –A search term to match against user names, display names, and IDs. Pass * to list all principals. Maximum 128 characters.
-
max_results(Optional[int], default:None) –The maximum number of results to return. Defaults to 100.
-
next_token(Optional[SearchPrincipalsNextToken], default:None) –A token to retrieve the next page of results. Supply the same searchQuery used on the request that returned it. Tokens expire after 24 hours.
Raises:
-
AccessDeniedException–The caller is not authorized to perform this action.
-
InternalServerException–An unexpected error occurred while processing the request.
-
ResourceNotFoundException–The specified resource does not exist.
-
ThrottlingException–The request was throttled due to exceeding the allowed request rate.
-
ValidationException–A parameter is specified incorrectly.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
Search principals by name The following example searches a domain for principals whose name matches a text query. No nextToken is returned, so there are no more results. To grant access to a result, pass its principalId to CreateAccessGrant with a principalType of IDC_USER for a user or IDC_GROUP for a group. Payloads are shown as JSON; on the wire they are CBOR-encoded.
Source code in docs_src/capo_cloudwatchomni/_services/async_cloud_watch_omni.py
5290 5291 5292 5293 5294 5295 5296 5297 5298 5299 5300 5301 5302 5303 5304 5305 5306 5307 5308 5309 5310 5311 5312 5313 5314 5315 5316 5317 5318 5319 5320 5321 5322 5323 5324 5325 5326 5327 5328 5329 5330 5331 5332 5333 5334 5335 5336 5337 5338 5339 5340 5341 5342 5343 5344 5345 5346 5347 5348 5349 5350 5351 5352 5353 5354 5355 5356 5357 | |