Skip to content

Commit

Permalink
fragment usage and fragment version
Browse files Browse the repository at this point in the history
  • Loading branch information
ehhong committed Jan 9, 2025
1 parent 3f0b40a commit 2939148
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions proto/viam/app/v1/app.proto
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,9 @@ service AppService {
// Gets a single fragment
rpc GetFragment(GetFragmentRequest) returns (GetFragmentResponse);

// Gets usage for a fragment across versions
rpc GetFragmentUsage(GetFragmentUsageRequest) returns (GetFragmentUsageResponse);

// Creates a fragment
rpc CreateFragment(CreateFragmentRequest) returns (CreateFragmentResponse);

Expand Down Expand Up @@ -813,6 +816,7 @@ message Fragment {
FragmentVisibility visibility = 12;
// latest timestamp when fragment was updated
google.protobuf.Timestamp last_updated = 13 [(tagger.v1.tags) = "bson:\"last_updated_at\""];
string revision = 14;
}

message FragmentHistoryEntry {
Expand All @@ -822,6 +826,18 @@ message FragmentHistoryEntry {
AuthenticatorInfo edited_by = 4 [(tagger.v1.tags) = "bson:\"edited_by\" json:\"edited_by\""];
}

message FragmentRevision {
string revision = 1;
google.protobuf.Timestamp created_at = 2;
}

message FragmentTag {
string tag = 1;
string revision = 2;
google.protobuf.Timestamp created_at = 3;
google.protobuf.Timestamp updated_at = 4;
}

enum FragmentVisibility {
FRAGMENT_VISIBILITY_UNSPECIFIED = 0;
FRAGMENT_VISIBILITY_PRIVATE = 1;
Expand All @@ -843,11 +859,13 @@ enum FragmentErrorType {
FRAGMENT_ERROR_TYPE_CYCLE_DETECTED = 4;
}

// Cached fragment usage statistics
message FragmentUsage {
string fragment_id = 1;
int32 organizations = 2;
int32 machines = 3;
int32 machines_in_current_org = 4;
string version = 5;
}

message ResolvedFragment {
Expand All @@ -870,11 +888,22 @@ message ListFragmentsResponse {
message GetFragmentRequest {
string id = 1;
string current_organization_id = 2;
optional string version = 3;
}

message GetFragmentResponse {
Fragment fragment = 1;
FragmentUsage fragment_usage = 2;
repeated FragmentRevision revisions = 3;
repeated FragmentTag tags = 4;
}

message GetFragmentUsageRequest {
string fragment_id = 1;
}

message GetFragmentUsageResponse {
repeated FragmentUsage version_usages = 1;
}

message CreateFragmentRequest {
Expand Down

0 comments on commit 2939148

Please sign in to comment.