syntax = "proto3"; import "google/api/annotations.proto"; // Apps is the master service that svc provides. It allows a user to list, create, update service Apps { rpc List(AppsListParams) returns (AppsList) { option (google.api.http) = { get: "/api/v1/apps/list" }; } rpc Create(Manifest) returns (App) { option (google.api.http) = { post: "/api/v1/apps/create" body: "*" }; } rpc Update(AppUpdate) returns (App) { option (google.api.http) = { post: "/api/v1/apps/{name}/update" body: "*" }; } rpc Inspect(AppInspect) returns (App) { option (google.api.http) = { get: "/api/v1/apps/{name}/inspect" }; } rpc Delete(AppDelete) returns(Ok) { option (google.api.http) = { delete: "/api/v1/apps/{name}/delete" }; } } message AppsListParams { string labelKey = 1; string labelVal = 2; // will be matched to app names string name = 3; } message AppsList { string message = 1; repeated App apps = 2; } message Manifest { map environment = 1; map labels = 2; string dockerImage = 3; string name = 4; } message App { string id = 1; string name = 2; string dockerImage = 3; map environment = 4; map labels = 5; repeated string authorizedUsers = 6; int32 instances = 7; string status = 8; } message AppUpdate { string name = 1; string newImage = 2; map envAdd = 3; repeated string envRm = 4; map labelAdd = 5; map labelRm = 6; repeated string grantUsers = 7; repeated string revokeUsers = 8; int32 newInstanceCount = 9; } message AppInspect { string name = 1; } message AppDelete { string name = 1; } message Ok { string message = 1; }