Create a Metering Record
Before you get started
You'll need to make sure you have the correct listing type and usage-based SKUs configured, as well as having your Access Token
Send a Metering Record
AWS
To send metering records to AWS, send a POST request to https://api.tackle.io/v1/metering/meter
with the right authorization header and a body similar to the following example:
{
"cloud": "aws",
"customerid": "ij3sXMkN3or",
"productid": "1test1a2b3c4d5e6f7g8h9ijk",
"records": [
{
"CustomerIdentifier": "ij3sXMkN3or",
"ProductIdentifier": "1test1a2b3c4d5e6f7g8h9ijk",
"Dimension": "example_dimension_name",
"Timestamp": "2019-07-15T15:00:00.000000+00:00",
"Quantity": 1
}
]
}
Ready to see the code in action? Check out our Create a metering record (AWS) recipe!
Azure & GCP
To send metering records to Azure or GCP, send a POST request to https://api.tackle.io/v2/metering/meter
with the right authorization header and a body similar to the following example:
{
"cloud": "azure",
"customerid": "1b3gs3f4-2794-abcd-3fa3-063ga0s3t3re",
"productid": "tackle-azure-platform",
"records": [
{
"customerid": "1b3gs3f4-2794-abcd-3fa3-063ga0s3t3re",
"productid": "tackle-azure-platform",
"dimension": "usage-per-unit",
"quantity": 2
}
]
}
{
"cloud": "gcp",
"customerid": "E-ABC2-D330-E2FG-H2Q2",
"productid": "tackle-for-gcp",
"records": [
{
"customerid": "E-ABC2-D330-E2FG-H2Q2",
"productid": "tackle-for-gcp",
"dimension": "usage-per-unit",
"quantity": 2
}
]
}
Ready to see the code in action? Check out our Create a metering record (GCP) recipe!
Red Hat
To send one or more usage records to Red Hat, send a POST request to https://api.tackle.io/v1/metering/usage-records
with the right authorization header and body similar to the following example:
[
{
"cloud": "redhat",
"product_id": "e2fc31adc8dc32e281e3a6c27d003d7c",
"customer_id": "6182cde02709282f5baf7329",
"start_time": "2021-12-09 18:31:12.789942",
"end_time": "2021-12-09 18:35:12.789942",
"dimension": {
"name": "Metering-Test-Charge-1-Users",
"quantity": 42
}
}
]
Ready to see the code in action? Check out our
How to confirm metering records?
AWS, Azure, GCP
To confirm the metering record was sent to the Cloud Marketplace, send the same payload until the HTTP 200 response includes the sent_at
field with a UTC timestamp string.
You'll be able to find more examples of different possible responses in the AWS or Azure/GCP metering API reference.
Red Hat
To see what metering records are present, see List Usage Records.
To see a specific usage record, see Get a Usage Record.
Updated 1 day ago