Marketplace Metering API, gRPC: ImageProductUsageService.Write
Writes image product's usage. Authentication is by user's service account.
gRPC request
rpc Write (WriteImageProductUsageRequest) returns (WriteImageProductUsageResponse)
WriteImageProductUsageRequest
{
"validateOnly": "bool",
"productId": "string",
"usageRecords": [
{
"uuid": "string",
"skuId": "string",
"quantity": "int64",
"timestamp": "google.protobuf.Timestamp"
}
]
}
Field |
Description |
validateOnly |
bool Checks whether you have the access required for the emit usage. |
productId |
string Required field. Marketplace Product's ID. |
usageRecords[] |
List of product usage records (up to 25 per request). |
UsageRecord
Field |
Description |
uuid |
string Required field. Unique identifier of the usage record (UUID format). |
skuId |
string Required field. Consumed Marketplace SKU ID, linked to |
quantity |
int64 Quantity of SKU consumed, measured in |
timestamp |
Required field. Timestamp in UTC for which the usage is being reported. |
WriteImageProductUsageResponse
{
"accepted": [
{
"uuid": "string"
}
],
"rejected": [
{
"uuid": "string",
"reason": "Reason"
}
]
}
Field |
Description |
accepted[] |
List of accepted product usage records. |
rejected[] |
List of rejected product usage records (with reason). |
AcceptedUsageRecord
Field |
Description |
uuid |
string Unique identifier of the usage record (UUID format). |
RejectedUsageRecord
Field |
Description |
uuid |
string Unique identifier of the usage record (UUID format). |
reason |
enum Reason The reason of rejection.
|