From a1e62db34b789fe0b570a331ff98824be0cf6976 Mon Sep 17 00:00:00 2001 From: Ping-Lin Chang Date: Mon, 12 Feb 2024 15:04:55 +0000 Subject: [PATCH] chore(vdp): remove controller --- vdp/controller/v1beta/controller.proto | 108 ------------------ .../v1beta/controller_service.proto | 55 --------- 2 files changed, 163 deletions(-) delete mode 100644 vdp/controller/v1beta/controller.proto delete mode 100644 vdp/controller/v1beta/controller_service.proto diff --git a/vdp/controller/v1beta/controller.proto b/vdp/controller/v1beta/controller.proto deleted file mode 100644 index b58f8bcf..00000000 --- a/vdp/controller/v1beta/controller.proto +++ /dev/null @@ -1,108 +0,0 @@ -syntax = "proto3"; - -package vdp.controller.v1beta; - -import "common/healthcheck/v1beta/healthcheck.proto"; -// Google api -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -// Protobuf standard -import "protoc-gen-openapiv2/options/annotations.proto"; -import "vdp/pipeline/v1beta/connector.proto"; -import "vdp/pipeline/v1beta/pipeline.proto"; - -// LivenessRequest represents a request to check a service liveness status -message LivenessRequest { - // HealthCheckRequest message - optional common.healthcheck.v1beta.HealthCheckRequest health_check_request = 1 [(google.api.field_behavior) = OPTIONAL]; -} - -// LivenessResponse represents a response for a service liveness status -message LivenessResponse { - // HealthCheckResponse message - common.healthcheck.v1beta.HealthCheckResponse health_check_response = 1; -} - -// ReadinessRequest represents a request to check a service readiness status -message ReadinessRequest { - // HealthCheckRequest message - optional common.healthcheck.v1beta.HealthCheckRequest health_check_request = 1 [(google.api.field_behavior) = OPTIONAL]; -} - -// ReadinessResponse represents a response for a service readiness status -message ReadinessResponse { - // HealthCheckResponse message - common.healthcheck.v1beta.HealthCheckResponse health_check_response = 1; -} - -// Resource represents the current information of a resource -message Resource { - option (google.api.resource) = { - type: "api.instill.tech/Resource" - pattern: "resources/{resource_uuid}/types/{type}" - }; - - // Permalink of a resouce. For example: - // "resources/{resource_uuid}/types/{type}" - string resource_permalink = 1 [(google.api.field_behavior) = REQUIRED]; - // Resource state - oneof state { - // Pipeline state - vdp.pipeline.v1beta.State pipeline_state = 3; - // Connector state - vdp.pipeline.v1beta.Connector.State connector_state = 4; - // Backend service state - common.healthcheck.v1beta.HealthCheckResponse.ServingStatus backend_state = 5; - } - // Resource longrunning progress - optional int32 progress = 6 [(google.api.field_behavior) = OPTIONAL]; -} - -// GetResourceRequest represents a request to query a resource's state -message GetResourceRequest { - // Permalink of a resouce. For example: - // "resources/{resource_uuid}/types/{type}" - string resource_permalink = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = {type: "api.instill.tech/Resource"}, - (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { - field_configuration: {path_param_name: "resource.resource_permalink"} - } - ]; -} - -// GetResourceResponse represents a response to fetch a resource's state -message GetResourceResponse { - // Retrieved resource state - Resource resource = 1; -} - -// UpdateResourceRequest represents a request to update a resource's state -message UpdateResourceRequest { - // Resource state - Resource resource = 1 [(google.api.field_behavior) = REQUIRED]; - // Resource longrunnning workflow id - optional string workflow_id = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// UpdateResourceResponse represents a response to update a resource's state -message UpdateResourceResponse { - // Updated resource state - Resource resource = 1; -} - -// DeleteResourceRequest represents a request to delete a resource's state -message DeleteResourceRequest { - // Permalink of a resouce. For example: - // "resources/{resource_uuid}/types/{type}" - string resource_permalink = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = {type: "api.instill.tech/Resource"}, - (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { - field_configuration: {path_param_name: "resource.resource_permalink"} - } - ]; -} - -// DeleteResourceResponse represents an empty response -message DeleteResourceResponse {} diff --git a/vdp/controller/v1beta/controller_service.proto b/vdp/controller/v1beta/controller_service.proto deleted file mode 100644 index 8ec0a698..00000000 --- a/vdp/controller/v1beta/controller_service.proto +++ /dev/null @@ -1,55 +0,0 @@ -syntax = "proto3"; - -package vdp.controller.v1beta; - -// Google API -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/visibility.proto"; -import "vdp/controller/v1beta/controller.proto"; - -// Controller service responds to incoming controller requests -service ControllerPrivateService { - // Liveness method receives a LivenessRequest message and returns a - // LivenessResponse message. - // See https://github.com/grpc/grpc/blob/master/doc/health-checking.md - rpc Liveness(LivenessRequest) returns (LivenessResponse) { - option (google.api.http) = { - get: "/v1beta/__liveness" - additional_bindings: [ - {get: "/v1beta/health/controller"}] - }; - } - - // Readiness method receives a ReadinessRequest message and returns a - // ReadinessResponse message. - // See https://github.com/grpc/grpc/blob/master/doc/health-checking.md - rpc Readiness(ReadinessRequest) returns (ReadinessResponse) { - option (google.api.http) = {get: "/v1beta/__readiness"}; - } - - // GetResource method receives a GetResourceRequest message - // and returns a GetResourceResponse - rpc GetResource(GetResourceRequest) returns (GetResourceResponse) { - option (google.api.http) = {get: "/v1beta/{resource_permalink=resources/*/types/*}"}; - option (google.api.method_signature) = "resource_permalink"; - } - - // UpdateResource method receives a UpdateResourceRequest message - // and returns a UpdateResourceResponse - rpc UpdateResource(UpdateResourceRequest) returns (UpdateResourceResponse) { - option (google.api.http) = { - patch: "/v1beta/{resource.resource_permalink=resources/*/types/*}" - body: "resource" - }; - } - - // DeleteResource method receives a DeleteResourceRequest message - // and returns a DeleteResourceResponse - rpc DeleteResource(DeleteResourceRequest) returns (DeleteResourceResponse) { - option (google.api.http) = {delete: "/v1beta/{resource_permalink=resources/*/types/*}"}; - option (google.api.method_signature) = "resource_permalink"; - } - - option (google.api.api_visibility).restriction = "INTERNAL"; -}