diff --git a/_proto/aaa.proto b/_proto/aaa.proto new file mode 100644 index 000000000..162b94b77 --- /dev/null +++ b/_proto/aaa.proto @@ -0,0 +1,53 @@ +syntax = "proto3"; +package hapi; + +message Chartfile { + string name = 1; + string version = 2; +} + +message Chart { + // Option 1: Chart is raw []byte data + // Option 2: List of files as []byte data, with special treatment for Chart.yaml + // Option 3: Completely parsed out (probably very inflexible, ultimately) + + // Option 2: + Chartfile chartfile = 1; + Values defaultValues = 2; + map templates = 3; // filename => []bytes + repeated Chart charts = 4; +} + +// Values represents a set of values that will be passed into the template. +message Values { + // Option 1: "values" is unparsed TOML data (raw []byte) + // Option 2: Model TOML in Protobuf (not _too_ bad) + // Option 3: Force everything into a map[string]string model +} + +message Release { + string name = 1; +} + +message Status { + StatusCode code = 1; + string msg = 2; +} + +message Error { + ErrorCode errror_code = 1; + string error_msg = 2; +} + +enum ErrorCode { + ERROR_CODE_UNSET = 0; + BAD_REQUEST = 1; +} + +enum StatusCode { + STATUS_CODE_UNSET = 0; + UNKNOWN = 1; + DEPLOYED = 2; + DELETED = 3; + SUPERSEDED = 4; +} diff --git a/_proto/chartfile.proto b/_proto/chartfile.proto new file mode 100644 index 000000000..df84dd387 --- /dev/null +++ b/_proto/chartfile.proto @@ -0,0 +1,3 @@ +syntax = "proto3"; +package hapi; + diff --git a/_proto/get.proto b/_proto/get.proto new file mode 100644 index 000000000..e66fcc03e --- /dev/null +++ b/_proto/get.proto @@ -0,0 +1,20 @@ +syntax = "proto3"; +package hapi; + +import "aaa.proto"; + +message GetRequest { + string name = 1; +} + +message GetResponseError { + oneof response { + Error err = 1; + GetResponse get_response = 2; + } +} + +message GetResponse { + Chart chart = 1; + Values values = 2; +} diff --git a/_proto/helm.proto b/_proto/helm.proto index bf6f4bbeb..7abfe35e3 100644 --- a/_proto/helm.proto +++ b/_proto/helm.proto @@ -1,10 +1,36 @@ syntax = "proto3"; -option java_package = "sh.helm"; +/* +// No server +helm init +helm create +helm fetch // Fetch chart from repo +helm search +helm package + +// Server + +// Releases +helm install CHART +helm list +helm uninstall RELEASE +helm status RELEASE +helm get RELEASE +helm update RELEASE +*/ // hapi: The Helm API package hapi; +service ReleaseService { + rpc Install (InstallRequest) returns (InstallResponseError) {} + rpc List (ListRequest) returns (ListResponseError) {} + rpc Uninstall (UninstallRequest) returns (UninstallResponseError) {} + rpc Status (StatusRequest) returns (StatusResponseError) {} + rpc Get (GetRequest) returns (GetResponseError) {} + // rpc Update (UpdateRequest) returns (UpdateResponseError) {} +} + // Probe is used to check liveness and readiness. service Probe { // Run a readiness test. @@ -20,13 +46,3 @@ message PingRequest { message PingResponse { string status = 1; } - -message Chart { - string name = 1; -} -message Values { - string name = 1; -} -message Release { - string name = 1; -} diff --git a/_proto/install.proto b/_proto/install.proto new file mode 100644 index 000000000..1d6459671 --- /dev/null +++ b/_proto/install.proto @@ -0,0 +1,20 @@ +syntax = "proto3"; +package hapi; + +message InstallRequest{ + string name = 1 + Chart chart = 2 + Values values = 3 +} + +message InstallResponseError { + oneof response { + Error = 1 + InstallResponse = 2 + } +} + +message InstallResponse{ + string name = 1 + Status status = 2 +} diff --git a/_proto/list.proto b/_proto/list.proto new file mode 100644 index 000000000..6dc0b9f5d --- /dev/null +++ b/_proto/list.proto @@ -0,0 +1,20 @@ +syntax = "proto3"; +package hapi; + +message ListRequest { + int64 limit = 1; + int64 offset = 2; +} + +message ListResponseError { + oneof response { + Error = 1 + ListResponse = 2 + } +} +message ListResponse { + repeated Release releases = 1; + int64 count = 2; + int64 offset = 3; + int64 total = 4; +} diff --git a/_proto/status.proto b/_proto/status.proto new file mode 100644 index 000000000..87ae4d5f9 --- /dev/null +++ b/_proto/status.proto @@ -0,0 +1,17 @@ +syntax = "proto3"; +package hapi; + +message StatusRequest { + string name = 1 +} + +message StatusResponseError { + oneof response { + Error = 1 + StatusResponse = 2 + } +} +message StatusResponse { + Release release = 1; + Status status = 2 +} diff --git a/_proto/uninstall.proto b/_proto/uninstall.proto new file mode 100644 index 000000000..60a348f3d --- /dev/null +++ b/_proto/uninstall.proto @@ -0,0 +1,17 @@ +syntax = "proto3"; +package hapi; + +message UninstallRequest{ + string name = 1 +} + +message UninstallResponseError { + oneof response { + Error = 1 + UninstallResponse = 2 + } +} + +message UninstallResponse{ + Status status = 1 +}