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
{
"validate_only": "bool",
"product_id": "string",
"usage_records": [
{
"uuid": "string",
"sku_id": "string",
"quantity": "int64",
"timestamp": "google.protobuf.Timestamp"
}
]
}
Field |
Description |
validate_only |
bool Checks whether you have the access required for the emit usage. |
product_id |
string Required field. Marketplace Product's ID. |
usage_records[] |
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). |
sku_id |
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.
|