search_inventory
¶
search_inventory(
*,
config_overrides: Optional[ACMClientConfig] = None,
filter: Optional[InventoryFilterStatement] = None,
sort_by: Optional[SortField] = None,
sort_order: Optional[InventorySortOrder] = None,
max_results: Optional[int] = None,
next_token: Optional[str] = None,
) -> SearchInventoryOutput
Searches Certificate inventory for organizations and returns one page of certificates, with the number that match. The certificate inventory is the set of certificates observed in the organization's accounts. Filter combines typed predicates with And, Or, and Not. Omit it to search every certificate. These limits apply: - An And or Or list holds 1 to 15 statements. - Statements nest at most 3 levels deep. Filter itself is level 1, and each statement inside an And, Or, or Not is one level deeper. For example, an And of Not statements that each hold a predicate is 3 levels deep. - A filter holds at most 20 predicates in total. Results are sorted by NotAfter, latest first, unless SortBy and SortOrder say otherwise. To read the next page, repeat the request with the NextToken from the previous response. Keep the same Filter, SortBy, and SortOrder. A NextToken from a search with a different Filter, SortBy, or SortOrder returns ValidationException. The caller must be the organization's management account or its delegated administrator. If the caller's account is not in an organization, or the caller is neither of these accounts, the operation returns AccessDeniedException. The message names the unmet condition. Before the first PutInventoryConfiguration call, the operation returns ResourceNotFoundException. Until then, only the management account can call it; a delegated administrator receives AccessDeniedException.
Parameters:
-
filter(Optional[InventoryFilterStatement], default:None) –Which certificates to return. Omit it to return every certificate.
-
sort_by(Optional[SortField], default:None) –The field to sort by. Defaults to NOT_AFTER.
-
sort_order(Optional[InventorySortOrder], default:None) –The sort direction. Defaults to DESCENDING.
-
max_results(Optional[int], default:None) –The maximum number of certificates to return, 1 to 100. Defaults to 25.
-
next_token(Optional[str], default:None) –The NextToken from the previous response, to read the next page.
Raises:
-
AccessDeniedException–You do not have access required to perform this action.
-
InternalServerException–The request processing has failed because of an unknown error, exception, or failure.
-
ResourceNotFoundException–The specified certificate cannot be found in the caller's account or the caller's account cannot be found.
-
ThrottlingException–The request was denied because it exceeded a quota.
-
ValidationException–The supplied input failed to satisfy constraints of an Amazon Web Services service.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
Find certificates for a domain that expire soon Certificates for example.com and its subdomains that expire before December 1, 2026. Results are soonest first, one per page.
>>> client.search_inventory(filter={'And': [{'Filter': {'Domain': {'Value': 'example.com', 'Match': 'IN_DOMAIN'}}}, {'Filter': {'NotAfter': {'Before': 1796083200}}}]}, sort_by='NOT_AFTER', sort_order='ASCENDING', max_results=1)
Search before inventory is set up
The organization has never called PutInventoryConfiguration.
Source code in docs_src/capo_acm/_services/acm.py
3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 | |