Usage Statistics - Amazon Macie

Usage Statistics

The Usage Statistics resource provides information about current quotas and usage statistics for an account. This includes data for metrics that report the estimated cost of using Amazon Macie to perform specific types of tasks, and the current account quotas for those tasks. The data can help you track your use of the service and determine whether to adjust your quotas or use of the service. If you're participating in a free trial of Macie, this resource also provides information about your free trial.

You can use the Usage Statistics resource to retrieve (query) aggregated data for usage metrics and the quotas that correspond to those metrics. The query results provide data for the past 30 days. You can customize your query and the query results by using supported parameters to filter and sort the data. If you're a user of a master account, this means that you can use this resource to get a breakdown of the data for each account in your Macie organization.

URI

/usage/statistics

HTTP Methods

POST

Operation ID: GetUsageStatistics

Retrieves (queries) quotas and aggregated usage data for one or more accounts.

Responses
Status Code Response Model Description
200 GetUsageStatisticsResponse

The request succeeded.

400 ValidationException

The request failed because it contains a syntax error.

402 ServiceQuotaExceededException

The request failed because fulfilling the request would exceed one or more service quotas for your account.

403 AccessDeniedException

The request was denied because you don't have sufficient access to the specified resource.

404 ResourceNotFoundException

The request failed because the specified resource wasn't found.

409 ConflictException

The request failed because it conflicts with the current state of the specified resource.

429 ThrottlingException

The request failed because you sent too many requests during a certain amount of time.

500 InternalServerException

The request failed due to an unknown internal server error, exception, or failure.

Schemas

Request Bodies

Example POST

{ "nextToken": "string", "maxResults": integer, "sortBy": { "orderBy": enum, "key": enum }, "filterBy": [ { "comparator": enum, "values": [ "string" ], "key": enum } ] }

Response Bodies

Example GetUsageStatisticsResponse

{ "records": [ { "accountId": "string", "freeTrialStartDate": "string", "usage": [ { "serviceLimit": { "unit": enum, "isServiceLimited": boolean, "value": integer }, "currency": enum, "estimatedCost": "string", "type": enum } ] } ], "nextToken": "string" }

Example ValidationException

{ "message": "string" }

Example ServiceQuotaExceededException

{ "message": "string" }

Example AccessDeniedException

{ "message": "string" }

Example ResourceNotFoundException

{ "message": "string" }

Example ConflictException

{ "message": "string" }

Example ThrottlingException

{ "message": "string" }

Example InternalServerException

{ "message": "string" }

Properties

AccessDeniedException

Provides information about an error that occurred due to insufficient access to a specified resource.

Property Type Required Description
message

string

False

The explanation of the error that occurred.

ConflictException

Provides information about an error that occurred due to a versioning conflict for a specified resource.

Property Type Required Description
message

string

False

The explanation of the error that occurred.

Currency

The type of currency that data for a usage metric is reported in. Possible values are:

  • USD

GetUsageStatisticsRequest

Specifies criteria for filtering, sorting, and paginating the results of a query for quotas and aggregated usage data for one or more accounts.

Property Type Required Description
nextToken

string

False

The nextToken string that specifies which page of results to return in a paginated response.

maxResults

integer

Format: int32

False

The maximum number of items to include in each page of the response.

sortBy

UsageStatisticsSortBy

False

The criteria to use to sort the query results.

filterBy

Array of type UsageStatisticsFilter

False

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.

GetUsageStatisticsResponse

Provides the results of a query that retrieved quotas and aggregated usage data for one or more accounts.

Property Type Required Description
records

Array of type UsageRecord

False

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.

nextToken

string

False

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.

InternalServerException

Provides information about an error that occurred due to an unknown internal server error, exception, or failure.

Property Type Required Description
message

string

False

The explanation of the error that occurred.

ResourceNotFoundException

Provides information about an error that occurred because a specified resource wasn't found.

Property Type Required Description
message

string

False

The explanation of the error that occurred.

ServiceLimit

Specifies a current quota for an account.

Property Type Required Description
unit

string

Values: TERABYTES

False

The unit of measurement for the value specified by the value field.

isServiceLimited

boolean

False

Specifies whether the account has met the quota that corresponds to the metric specified by the UsageByAccount.type field in the response.

value

integer

Format: int64

False

The value for the metric specified by the UsageByAccount.type field in the response.

ServiceQuotaExceededException

Provides information about an error that occurred due to one or more service quotas for an account.

Property Type Required Description
message

string

False

The explanation of the error that occurred.

ThrottlingException

Provides information about an error that occurred because too many requests were sent during a certain amount of time.

Property Type Required Description
message

string

False

The explanation of the error that occurred.

UsageByAccount

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.

Property Type Required Description
serviceLimit

ServiceLimit

False

The current value for the quota that corresponds to the metric specified by the type field.

currency

Currency

False

The type of currency that the value for the metric (estimatedCost) is reported in.

estimatedCost

string

False

The estimated value for the metric.

type

UsageType

False

The name of the metric. Possible values are: DATA_INVENTORY_EVALUATION, for monitoring S3 buckets; and, SENSITIVE_DATA_DISCOVERY, for analyzing sensitive data.

UsageRecord

Provides quota and aggregated usage data for an account.

Property Type Required Description
accountId

string

False

The unique identifier for the AWS account that the data applies to.

freeTrialStartDate

string

Format: date-time

False

The date and time, in UTC and extended ISO 8601 format, when the free trial started for the account.

usage

Array of type UsageByAccount

False

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.

UsageStatisticsFilter

Specifies a condition for filtering the results of a query for account quotas and usage data.

Property Type Required Description
comparator

UsageStatisticsFilterComparator

False

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.

values

Array of type string

False

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.

key

UsageStatisticsFilterKey

False

The field to use in the condition.

UsageStatisticsFilterComparator

The operator to use in a condition that filters the results of a query for account quotas and usage data. Valid values are:

  • GT

  • GTE

  • LT

  • LTE

  • EQ

  • NE

  • CONTAINS

UsageStatisticsFilterKey

The field to use in a condition that filters the results of a query for account quotas and usage data. Valid values are:

  • accountId

  • serviceLimit

  • freeTrialStartDate

  • total

UsageStatisticsSortBy

Specifies criteria for sorting the results of a query for account quotas and usage data.

Property Type Required Description
orderBy

string

Values: ASC | DESC

False

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.

key

UsageStatisticsSortKey

False

The field to sort the results by.

UsageStatisticsSortKey

The field to use to sort the results of a query for account quotas and usage data. Valid values are:

  • accountId

  • total

  • serviceLimitValue

  • freeTrialStartDate

UsageType

The name of a usage metric for an account. Possible values are:

  • DATA_INVENTORY_EVALUATION

  • SENSITIVE_DATA_DISCOVERY

ValidationException

Provides information about an error that occurred due to a syntax error in a request.

Property Type Required Description
message

string

False

The explanation of the error that occurred.

See Also

For more information about using this API in one of the language-specific AWS SDKs and references, see the following:

GetUsageStatistics