search_principals
¶
search_principals(
domain_id: DomainId,
search_query: str,
*,
config_overrides: Optional[CloudWatchOmniClientConfig] = 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/cloud_watch_omni.py
5228 5229 5230 5231 5232 5233 5234 5235 5236 5237 5238 5239 5240 5241 5242 5243 5244 5245 5246 5247 5248 5249 5250 5251 5252 5253 5254 5255 5256 5257 5258 5259 5260 5261 5262 5263 5264 5265 5266 5267 5268 5269 5270 5271 5272 5273 5274 5275 5276 5277 5278 5279 5280 5281 5282 5283 5284 5285 5286 5287 5288 5289 5290 5291 5292 5293 5294 | |