2020/07/24 - Amazon Macie 2 - 1 updated api methods
Changes Update macie2 client to latest version
{'filterBy': {'comparator': 'GT | GTE | LT | LTE | EQ | NE | CONTAINS', 'key': {'total', 'freeTrialStartDate', 'serviceLimit'}}, 'sortBy': {'key': {'serviceLimitValue', 'freeTrialStartDate'}}}
Retrieves (queries) quotas and aggregated usage data for one or more accounts.
See also: AWS API Documentation
Request Syntax
client.get_usage_statistics( filterBy=[ { 'comparator': 'GT'|'GTE'|'LT'|'LTE'|'EQ'|'NE'|'CONTAINS', 'key': 'accountId'|'serviceLimit'|'freeTrialStartDate'|'total', 'values': [ 'string', ] }, ], maxResults=123, nextToken='string', sortBy={ 'key': 'accountId'|'total'|'serviceLimitValue'|'freeTrialStartDate', 'orderBy': 'ASC'|'DESC' } )
list
An array of objects, one for each condition to use to filter the query results. If the array contains more than one object, Amazon Macie uses an AND operator to join the conditions specified by the objects.
(dict) --
Specifies a condition for filtering the results of a query for account quotas and usage data.
comparator (string) --
The operator to use in the condition. If the value for the key property is accountId, this value must be CONTAINS. If the value for the key property is any other supported field, this value can be EQ, GT, GTE, LT, LTE, or NE.
key (string) --
The field to use in the condition.
values (list) --
An array that lists values to use in the condition, based on the value for the field specified by the key property. If the value for the key property is accountId, this array can specify multiple values. Otherwise, this array can specify only one value.
Valid values for each supported field are:
accountId - The unique identifier for an AWS account.
freeTrialStartDate - The date and time, in UTC and extended ISO 8601 format, when the free trial started for an account.
serviceLimit - A Boolean (true or false) value that indicates whether an account has reached its monthly quota.
total - A string that represents the current, estimated month-to-date cost for an account.
(string) --
integer
The maximum number of items to include in each page of the response.
string
The nextToken string that specifies which page of results to return in a paginated response.
dict
The criteria to use to sort the query results.
key (string) --
The field to sort the results by.
orderBy (string) --
The sort order to apply to the results, based on the value for the field specified by the key property. Valid values are: ASC, sort the results in ascending order; and, DESC, sort the results in descending order.
dict
Response Syntax
{ 'nextToken': 'string', 'records': [ { 'accountId': 'string', 'freeTrialStartDate': datetime(2015, 1, 1), 'usage': [ { 'currency': 'USD', 'estimatedCost': 'string', 'serviceLimit': { 'isServiceLimited': True|False, 'unit': 'TERABYTES', 'value': 123 }, 'type': 'DATA_INVENTORY_EVALUATION'|'SENSITIVE_DATA_DISCOVERY' }, ] }, ] }
Response Structure
(dict) --
The request succeeded.
nextToken (string) --
The string to use in a subsequent request to get the next page of results in a paginated response. This value is null if there are no additional pages.
records (list) --
An array of objects that contains the results of the query. Each object contains the data for an account that meets the filter criteria specified in the request.
(dict) --
Provides quota and aggregated usage data for an account.
accountId (string) --
The unique identifier for the AWS account that the data applies to.
freeTrialStartDate (datetime) --
The date and time, in UTC and extended ISO 8601 format, when the free trial started for the account.
usage (list) --
An array of objects that contains usage data and quotas for the account. Each object contains the data for a specific usage metric and the corresponding quota.
(dict) --
Provides data for a specific usage metric and the corresponding quota for an account. The value for the metric is an aggregated value that reports usage during the past 30 days.
currency (string) --
The type of currency that the value for the metric (estimatedCost) is reported in.
estimatedCost (string) --
The estimated value for the metric.
serviceLimit (dict) --
The current value for the quota that corresponds to the metric specified by the type field.
isServiceLimited (boolean) --
Specifies whether the account has met the quota that corresponds to the metric specified by the UsageByAccount.type field in the response.
unit (string) --
The unit of measurement for the value specified by the value field.
value (integer) --
The value for the metric specified by the UsageByAccount.type field in the response.
type (string) --
The name of the metric. Possible values are: DATA_INVENTORY_EVALUATION, for monitoring S3 buckets; and, SENSITIVE_DATA_DISCOVERY, for analyzing sensitive data.