mirror of
https://github.com/gitpod-io/gitpod.git
synced 2025-12-08 17:36:30 +00:00
67 lines
1.8 KiB
Protocol Buffer
67 lines
1.8 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
package usage.v1;
|
|
|
|
option go_package = "github.com/gitpod-io/gitpod/usage-api/v1";
|
|
|
|
import "google/protobuf/timestamp.proto";
|
|
|
|
service UsageService {
|
|
// ListBilledUsage retrieves all usage for the specified attributionId
|
|
rpc ListBilledUsage(ListBilledUsageRequest) returns (ListBilledUsageResponse) {}
|
|
|
|
// CollectUsage collects usage for the specified time period, and stores the usage records in the database, returning the records.
|
|
rpc CollectUsage(CollectUsageRequest) returns (CollectUsageResponse) {}
|
|
}
|
|
|
|
message ListBilledUsageRequest {
|
|
string attribution_id = 1;
|
|
|
|
// from specifies the starting time range for this request.
|
|
// All instances which existed starting at from will be returned.
|
|
google.protobuf.Timestamp from = 2;
|
|
|
|
// to specifies the end time range for this request.
|
|
// All instances which existed ending at to will be returned.
|
|
google.protobuf.Timestamp to = 3;
|
|
|
|
enum Ordering {
|
|
ORDERING_DESCENDING = 0;
|
|
ORDERING_ASCENDING = 1;
|
|
}
|
|
|
|
Ordering order = 4;
|
|
}
|
|
|
|
message ListBilledUsageResponse {
|
|
repeated BilledSession sessions = 1;
|
|
}
|
|
|
|
message BilledSession {
|
|
string attribution_id = 1;
|
|
|
|
string user_id = 2;
|
|
string team_id = 3;
|
|
|
|
string workspace_id = 4;
|
|
string workspace_type = 5;
|
|
string project_id = 6;
|
|
|
|
string instance_id = 7;
|
|
string workspace_class = 8;
|
|
google.protobuf.Timestamp start_time = 9;
|
|
google.protobuf.Timestamp end_time = 10;
|
|
|
|
int64 credits_deprecated = 11 [deprecated=true]; // insufficient precision to represent credits for workspace time
|
|
double credits = 12;
|
|
}
|
|
|
|
message CollectUsageRequest {
|
|
google.protobuf.Timestamp start_time = 1;
|
|
google.protobuf.Timestamp end_time = 2;
|
|
}
|
|
|
|
message CollectUsageResponse {
|
|
repeated BilledSession sessions = 1;
|
|
}
|