get_resources_statistics_v2
¶
get_resources_statistics_v2(
*,
config_overrides: Optional[SecurityHubClientConfig] = None,
group_by_rules: Optional[ResourceGroupByRules] = None,
scopes: Optional[ResourceScopes] = None,
sort_order: Optional[SortOrder] = None,
max_statistic_results: Optional[MaxStatisticResults] = None,
) -> GetResourcesStatisticsV2Response
Retrieves statistical information about Amazon Web Services resources and their associated security findings.
You can use the Scopes parameter to define the data boundary for the query. Currently, Scopes supports AwsOrganizations, which lets you aggregate resources from your entire organization or from specific organizational units. Only the delegated administrator account can use Scopes.
If you set GroupByField to ResourceSubCategory, ResourceInfo.AIDetails.HostResourceType, or ResourceInfo.AIDetails.CanonicalId, you must include a ResourceCategory string filter with comparison set to EQUALS and value AI/ML in the corresponding ResourceGroupByRule.
Parameters:
-
group_by_rules(Optional[ResourceGroupByRules], default:None) –How resource statistics should be aggregated and organized in the response.
-
scopes(Optional[ResourceScopes], default:None) –Limits the results to resources from specific organizational units or from the delegated administrator's organization. Only the delegated administrator account can use this parameter. Other accounts receive an
AccessDeniedException.This parameter is optional. If you omit it, the delegated administrator sees statistics from all accounts across the entire organization. Other accounts see only statistics for their own resources.
You can specify up to 10 entries in
Scopes.AwsOrganizations. If multiple entries are specified, the entries are combined using OR logic. -
sort_order(Optional[SortOrder], default:None) –Sorts aggregated statistics.
-
max_statistic_results(Optional[MaxStatisticResults], default:None) –The maximum number of results to be returned.
Raises:
-
AccessDeniedException–You don't have permission to perform the action specified in the request.
-
ConflictException–The request causes conflict with the current state of the service resource.
-
InternalServerException–The request has failed due to an internal failure of the service.
-
OrganizationalUnitNotFoundException–The request failed because one or more organizational units specified in the request don't exist within the caller's organization.
-
OrganizationNotFoundException–The request failed because one or more organizations specified in the request don't exist or don't belong to the caller's organization.
-
ResourceNotFoundException–The request was rejected because we can't find the specified resource.
-
ThrottlingException–The limit on the number of requests per second was exceeded.
-
ValidationException–The request has failed validation because it's missing required fields or has invalid inputs.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_securityhub/_services/security_hub.py
5665 5666 5667 5668 5669 5670 5671 5672 5673 5674 5675 5676 5677 5678 5679 5680 5681 5682 5683 5684 5685 5686 5687 5688 5689 5690 5691 5692 5693 5694 5695 5696 5697 5698 5699 5700 5701 5702 5703 5704 5705 5706 5707 5708 5709 5710 5711 5712 5713 5714 5715 5716 5717 5718 5719 5720 5721 5722 5723 5724 5725 5726 5727 5728 5729 5730 5731 5732 5733 | |