get_software_statistics_v2
async
¶
get_software_statistics_v2(
*,
config_overrides: Optional[AsyncSecurityHubClientConfig] = None,
group_by_rules: Optional[SoftwareGroupByRules] = None,
scopes: Optional[SoftwareScopes] = None,
sort_order: Optional[SortOrder] = None,
max_statistic_results: Optional[MaxStatisticResults] = None,
) -> GetSoftwareStatisticsV2Response
Retrieves aggregated counts of software packages installed on your resources, grouped by a field that you specify. For example, you can return the most common package types or the accounts with the most installed packages.
Each count is the number of package-to-resource pairs that match the grouping value. A package installed on three resources contributes three to the count.
You can use the Scopes parameter to define the data boundary for the query. Currently, Scopes supports AwsOrganizations. With AwsOrganizations, you can aggregate software from your entire organization or from specific organizational units. Only the delegated administrator account can use Scopes.
This operation doesn't paginate. Use MaxStatisticResults to control how many grouping values are returned.
Parameters:
-
group_by_rules(Optional[SoftwareGroupByRules], default:None) –How software statistics should be aggregated and organized in the response.
-
scopes(Optional[SoftwareScopes], default:None) –Limits the results to software on 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 software on 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 by count. The default is descending, which returns the values with the highest counts first.
-
max_statistic_results(Optional[MaxStatisticResults], default:None) –The maximum number of grouping values to return. Valid values are 1–400. The default is 400.
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/async_security_hub.py
6243 6244 6245 6246 6247 6248 6249 6250 6251 6252 6253 6254 6255 6256 6257 6258 6259 6260 6261 6262 6263 6264 6265 6266 6267 6268 6269 6270 6271 6272 6273 6274 6275 6276 6277 6278 6279 6280 6281 6282 6283 6284 6285 6286 6287 6288 6289 6290 6291 6292 6293 6294 6295 6296 6297 6298 6299 6300 6301 6302 6303 6304 6305 6306 6307 6308 6309 6310 6311 6312 | |