Copyright | (c) 2013-2023 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
API to emit metering records. For identical requests, the API is idempotent. It simply returns the metering record ID.
MeterUsage
is authenticated on the buyer's AWS account using
credentials from the EC2 instance, ECS task, or EKS pod.
MeterUsage
can optionally include multiple usage allocations, to
provide customers with usage data split into buckets by tags that you
define (or allow the customer to define).
Usage records are expected to be submitted as quickly as possible after the event that is being recorded, and are not accepted more than 6 hours after the event.
Synopsis
- data MeterUsage = MeterUsage' {}
- newMeterUsage :: Text -> UTCTime -> Text -> MeterUsage
- meterUsage_dryRun :: Lens' MeterUsage (Maybe Bool)
- meterUsage_usageAllocations :: Lens' MeterUsage (Maybe (NonEmpty UsageAllocation))
- meterUsage_usageQuantity :: Lens' MeterUsage (Maybe Natural)
- meterUsage_productCode :: Lens' MeterUsage Text
- meterUsage_timestamp :: Lens' MeterUsage UTCTime
- meterUsage_usageDimension :: Lens' MeterUsage Text
- data MeterUsageResponse = MeterUsageResponse' {}
- newMeterUsageResponse :: Int -> MeterUsageResponse
- meterUsageResponse_meteringRecordId :: Lens' MeterUsageResponse (Maybe Text)
- meterUsageResponse_httpStatus :: Lens' MeterUsageResponse Int
Creating a Request
data MeterUsage Source #
See: newMeterUsage
smart constructor.
MeterUsage' | |
|
Instances
:: Text | |
-> UTCTime | |
-> Text | |
-> MeterUsage |
Create a value of MeterUsage
with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
$sel:dryRun:MeterUsage'
, meterUsage_dryRun
- Checks whether you have the permissions required for the action, but
does not make the request. If you have the permissions, the request
returns DryRunOperation
; otherwise, it returns
UnauthorizedException
. Defaults to false
if not specified.
MeterUsage
, meterUsage_usageAllocations
- The set of UsageAllocations
to submit.
The sum of all UsageAllocation
quantities must equal the
UsageQuantity
of the MeterUsage
request, and each UsageAllocation
must have a unique set of tags (include no tags).
$sel:usageQuantity:MeterUsage'
, meterUsage_usageQuantity
- Consumption value for the hour. Defaults to 0
if not specified.
$sel:productCode:MeterUsage'
, meterUsage_productCode
- Product code is used to uniquely identify a product in AWS Marketplace.
The product code should be the same as the one used during the
publishing of a new product.
MeterUsage
, meterUsage_timestamp
- Timestamp, in UTC, for which the usage is being reported. Your
application can meter usage for up to one hour in the past. Make sure
the timestamp
value is not before the start of the software usage.
$sel:usageDimension:MeterUsage'
, meterUsage_usageDimension
- It will be one of the fcp dimension name provided during the publishing
of the product.
Request Lenses
meterUsage_dryRun :: Lens' MeterUsage (Maybe Bool) Source #
Checks whether you have the permissions required for the action, but
does not make the request. If you have the permissions, the request
returns DryRunOperation
; otherwise, it returns
UnauthorizedException
. Defaults to false
if not specified.
meterUsage_usageAllocations :: Lens' MeterUsage (Maybe (NonEmpty UsageAllocation)) Source #
The set of UsageAllocations
to submit.
The sum of all UsageAllocation
quantities must equal the
UsageQuantity
of the MeterUsage
request, and each UsageAllocation
must have a unique set of tags (include no tags).
meterUsage_usageQuantity :: Lens' MeterUsage (Maybe Natural) Source #
Consumption value for the hour. Defaults to 0
if not specified.
meterUsage_productCode :: Lens' MeterUsage Text Source #
Product code is used to uniquely identify a product in AWS Marketplace. The product code should be the same as the one used during the publishing of a new product.
meterUsage_timestamp :: Lens' MeterUsage UTCTime Source #
Timestamp, in UTC, for which the usage is being reported. Your
application can meter usage for up to one hour in the past. Make sure
the timestamp
value is not before the start of the software usage.
meterUsage_usageDimension :: Lens' MeterUsage Text Source #
It will be one of the fcp dimension name provided during the publishing of the product.
Destructuring the Response
data MeterUsageResponse Source #
See: newMeterUsageResponse
smart constructor.
MeterUsageResponse' | |
|
Instances
newMeterUsageResponse Source #
Create a value of MeterUsageResponse
with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
MeterUsageResponse
, meterUsageResponse_meteringRecordId
- Metering record id.
$sel:httpStatus:MeterUsageResponse'
, meterUsageResponse_httpStatus
- The response's http status code.
Response Lenses
meterUsageResponse_meteringRecordId :: Lens' MeterUsageResponse (Maybe Text) Source #
Metering record id.
meterUsageResponse_httpStatus :: Lens' MeterUsageResponse Int Source #
The response's http status code.