Create a Metering Record (legacy)
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
If you need to send metering records to AWS, you'll need to 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
If you need to send metering records to Azure or GCP, you'll need to 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!
How to confirm metering records?
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.
Updated almost 2 years ago