Skip to content

Commit

Permalink
Generate Connect code for the KargoService (#359)
Browse files Browse the repository at this point in the history
Signed-off-by: Sunghoon Kang <[email protected]>
Co-authored-by: Kent Rancourt <[email protected]>
  • Loading branch information
Sunghoon Kang and krancour authored May 10, 2023
1 parent bdb0194 commit d571868
Show file tree
Hide file tree
Showing 14 changed files with 589 additions and 1,487 deletions.
57 changes: 3 additions & 54 deletions api/proto/kargo/v1alpha1/kargo.proto
Original file line number Diff line number Diff line change
Expand Up @@ -6,39 +6,16 @@ import "google/api/annotations.proto";
import "kargo/v1alpha1/types.proto";

service KargoService {
rpc ListEnvironments(ListEnvironmentsRequest) returns (ListEnvironmentsResponse) {
option (google.api.http) = {
get: "/api/kargo/v1alpha1/namespaces/{namespace}/environments"
};
}
rpc GetEnvironment(GetEnvironmentRequest) returns (GetEnvironmentResponse) {
option (google.api.http) = {
get: "/api/kargo/v1alpha1/namespaces/{namespace}/environments/{name}"
};
}
rpc CreateEnvironment(CreateEnvironmentRequest) returns (CreateEnvironmentResponse) {
option (google.api.http) = {
post: "/api/kargo/v1alpha1/namespaces/{namespace}/environments"
};
}
rpc UpdateEnvironment(UpdateEnvironmentRequest) returns (UpdateEnvironmentResponse) {
option (google.api.http) = {
put: "/api/kargo/v1alpha1/namespaces/{namespace}/environments/{name}"
};
}
rpc DeleteEnvironment(DeleteEnvironmentRequest) returns (DeleteEnvironmentResponse) {
option (google.api.http) = {
delete: "/api/kargo/v1alpha1/namespaces/{namespace}/environments/{name}"
};
}
rpc ListEnvironments(ListEnvironmentsRequest) returns (ListEnvironmentsResponse);
rpc GetEnvironment(GetEnvironmentRequest) returns (GetEnvironmentResponse);
}

message ListEnvironmentsRequest {
string namespace = 1;
}

message ListEnvironmentsResponse {
repeated akuity.io.kargo.v1alpha1.Environment environment = 1;
repeated akuity.io.kargo.v1alpha1.Environment environments = 1;
}

message GetEnvironmentRequest {
Expand All @@ -49,31 +26,3 @@ message GetEnvironmentRequest {
message GetEnvironmentResponse {
akuity.io.kargo.v1alpha1.Environment environment = 1;
}

message CreateEnvironmentRequest {
string namespace = 1;
// TODO: Payload
}

message CreateEnvironmentResponse {
akuity.io.kargo.v1alpha1.Environment environment = 1;
}

message UpdateEnvironmentRequest {
string namespace = 1;
string name = 2;
// TODO: Payload
}

message UpdateEnvironmentResponse {
akuity.io.kargo.v1alpha1.Environment environment = 1;
}

message DeleteEnvironmentRequest {
string namespace = 1;
string name = 2;
}

message DeleteEnvironmentResponse {
/* explicitly empty */
}
15 changes: 9 additions & 6 deletions buf.gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,20 @@ managed:
default: github.com/akuity/kargo/pkg/api/gen
except:
- buf.build/googleapis/googleapis
- buf.build/grpc-ecosystem/grpc-gateway
plugins:
- plugin: buf.build/grpc-ecosystem/gateway
- plugin: buf.build/protocolbuffers/go:v1.30.0
out: pkg/api/gen
opt:
- paths=source_relative
- plugin: buf.build/grpc/go
- plugin: buf.build/bufbuild/connect-go:v1.7.0
out: pkg/api/gen
opt:
- paths=source_relative
- plugin: buf.build/protocolbuffers/go
out: pkg/api/gen
- plugin: buf.build/bufbuild/es:v1.2.0
out: ui/src/gen
opt:
- paths=source_relative
- target=ts
- plugin: buf.build/bufbuild/connect-query:v0.2.1
out: ui/src/gen
opt:
- target=ts
2 changes: 2 additions & 0 deletions buf.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Generated by buf. DO NOT EDIT.
version: v1
7 changes: 7 additions & 0 deletions buf.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: v1
breaking:
use:
- FILE
lint:
use:
- DEFAULT
Loading

0 comments on commit d571868

Please sign in to comment.