diff --git a/.github/workflows/buf-push.yaml b/.github/workflows/buf-push.yaml new file mode 100644 index 000000000..b08540981 --- /dev/null +++ b/.github/workflows/buf-push.yaml @@ -0,0 +1,33 @@ +name: buf-push + +on: + push: + branches: + - main + paths: + - 'proto/**' + +jobs: + push: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + # This step sets up the variable steps.buf-version.outputs.v + # to contain the version of Buf (e.g. v1.36.0) from go.mod. + - name: Get Buf version + id: buf-version + run: | + BUF_VERSION=$( go list -m -f '{{.Version}}' github.com/bufbuild/buf ) + # remove the leading 'v' in front of the version + BUF_VERSION=${BUF_VERSION#v} + echo "v=$BUF_VERSION" >> "$GITHUB_OUTPUT" + - uses: bufbuild/buf-action@v1 + with: + version: ${{ steps.buf-version.outputs.v }} + token: ${{ secrets.BUF_TOKEN }} + input: 'proto' + # The repository should already exist. + # If it can be automatically created, that's a sign that it was deleted, + # which is likely a major issue, which we want to be aware of. + push_disable_create: true diff --git a/.github/workflows/buf-validate.yaml b/.github/workflows/buf-validate.yaml new file mode 100644 index 000000000..56b336122 --- /dev/null +++ b/.github/workflows/buf-validate.yaml @@ -0,0 +1,33 @@ +name: buf-validate + +on: + pull_request: + # 'labeled' and 'unlabeled' are included so we can use the 'Buf Skip Breaking' label + # and skip a breaking change if that's required. + # See: https://github.com/bufbuild/buf-action?tab=readme-ov-file#skip-the-breaking-change-detection-step + types: [opened, synchronize, reopened, labeled, unlabeled] + paths: + - 'proto/**' + +jobs: + validate: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + # This step sets up the variable steps.buf-version.outputs.v + # to contain the version of Buf (e.g. v1.36.0) from go.mod. + - name: Get Buf version + id: buf-version + run: | + BUF_VERSION=$( go list -m -f '{{.Version}}' github.com/bufbuild/buf ) + # remove the leading 'v' in front of the version + BUF_VERSION=${BUF_VERSION#v} + echo "v=$BUF_VERSION" >> "$GITHUB_OUTPUT" + - uses: bufbuild/buf-action@v1 + with: + version: ${{ steps.buf-version.outputs.v }} + token: ${{ secrets.BUF_TOKEN }} + input: 'proto' + push: false + breaking_against: '${{ github.event.repository.clone_url }}#branch=main,subdir=proto' diff --git a/.github/workflows/buf.yml b/.github/workflows/buf.yml deleted file mode 100644 index 80657da57..000000000 --- a/.github/workflows/buf.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: buf - -on: - push: - branches: - - main - paths: - - 'proto/**' - pull_request: - paths: - - 'proto/**' - -jobs: - validate: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: bufbuild/buf-setup-action@v1 - - uses: bufbuild/buf-lint-action@v1 - with: - input: 'proto' - - # We need to fetch main so we can compare breaking changes against whatever is in main right now. - - name: Fetch origin/main - run: git fetch --no-tags --prune --depth=1 origin +refs/heads/main:refs/remotes/origin/main - - - uses: bufbuild/buf-breaking-action@v1 - with: - input: 'proto' - against: '.git#branch=origin/main,subdir=proto' - - # Push buf module to the buf schema registry, but only if the validate action succeeded and if the action is running - # on branch main. - push: - runs-on: ubuntu-latest - needs: validate - if: ${{ github.ref == 'refs/heads/main' }} - steps: - - uses: actions/checkout@v4 - - uses: bufbuild/buf-setup-action@v1 - - uses: bufbuild/buf-push-action@v1 - with: - input: 'proto' - buf_token: ${{ secrets.BUF_TOKEN }} - diff --git a/.github/workflows/validate-generated-files.yml b/.github/workflows/validate-generated-files.yml index 623ae6058..3f8a0967e 100644 --- a/.github/workflows/validate-generated-files.yml +++ b/.github/workflows/validate-generated-files.yml @@ -17,6 +17,8 @@ jobs: go-version-file: 'go.mod' - name: Check generated files + env: + BUF_TOKEN: ${{ secrets.BUF_TOKEN }} run: | export PATH=$PATH:$(go env GOPATH)/bin make install-tools generate proto-generate diff --git a/proto/README.md b/proto/README.md index 288a8cd26..0cf6342dc 100644 --- a/proto/README.md +++ b/proto/README.md @@ -6,8 +6,12 @@ the [grpc-gateway](https://github.com/grpc-ecosystem/grpc-gateway). ## Client code -The client code for Conduit's API is available as a [Buf remote package](https://docs.buf.build/bsr/remote-packages/go). -Proto files are pushed to the Buf Schema Registry via a GitHub workflow defined [here](/.github/workflows/buf.yml). +The client code for Conduit's API is available as +a [Buf remote package](https://docs.buf.build/bsr/remote-packages/go). Proto +files are validates through the GitHub workflow defined +in [buf-validate.yaml](/.github/workflows/buf-validate.yaml) and pushed to the +Buf Schema Registry via the workflow defined +in [buf-push](/.github/workflows/buf-push.yaml). To use the client code, firstly run: diff --git a/proto/api/v1/api.pb.go b/proto/api/v1/api.pb.go index 8c892a9e2..dbc703b57 100644 --- a/proto/api/v1/api.pb.go +++ b/proto/api/v1/api.pb.go @@ -4416,19 +4416,19 @@ var File_api_v1_api_proto protoreflect.FileDescriptor var file_api_v1_api_proto_rawDesc = []byte{ 0x0a, 0x10, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x12, 0x06, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x1a, 0x18, 0x6f, 0x70, 0x65, 0x6e, - 0x63, 0x64, 0x63, 0x2f, 0x76, 0x31, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x64, 0x63, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x76, 0x31, 0x2f, - 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, - 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x66, 0x69, 0x65, 0x6c, - 0x64, 0x5f, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, - 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x61, - 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, 0x6e, 0x6e, - 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, - 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, + 0x74, 0x6f, 0x12, 0x06, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x1a, 0x19, 0x63, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, + 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, + 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x18, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x64, 0x63, 0x2f, 0x76, + 0x31, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x64, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f, 0x70, 0x65, 0x6e, + 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, 0x6e, + 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa9, 0x06, 0x0a, 0x08, 0x50, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x13, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x2c, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, diff --git a/proto/api/v1/api.proto b/proto/api/v1/api.proto index b1a9c003a..e62ca597c 100644 --- a/proto/api/v1/api.proto +++ b/proto/api/v1/api.proto @@ -2,12 +2,41 @@ syntax = "proto3"; package api.v1; -import "opencdc/v1/opencdc.proto"; import "config/v1/parameter.proto"; -import "google/api/field_behavior.proto"; import "google/api/annotations.proto"; -import "protoc-gen-openapiv2/options/annotations.proto"; +import "google/api/field_behavior.proto"; import "google/protobuf/timestamp.proto"; +import "opencdc/v1/opencdc.proto"; +import "protoc-gen-openapiv2/options/annotations.proto"; + +option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { + info: { + title: "Conduit REST API" + version: "v0.1.0" + contact: { + name: "Conduit project" + url: "https://github.com/conduitio/conduit" + email: "" + } + license: { + name: "Apache License Version 2.0" + url: "https://github.com/ConduitIO/conduit/blob/main/LICENSE.md" + } + } + + responses: { + key: "500" + value: { + schema: { + json_schema: {ref: ".google.rpc.Status"} + } + examples: { + key: "application/json" + value: '{ "code": 13, "message": "server error", "details": [] }' + } + } + } +}; message Pipeline { // Status describes the pipeline status. @@ -124,8 +153,10 @@ message Processor { } string id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - reserved 2; reserved "state"; // message does not track state - reserved 4; reserved "type"; + reserved 2; + reserved "state"; // message does not track state + reserved 4; + reserved "type"; Config config = 3; // Condition is a goTemplate formatted string, the value provided to the template is a sdk.Record, it should evaluate // to a boolean value, indicating a condition to run the processor for a specific record or not. (template functions @@ -142,7 +173,7 @@ message Processor { } // ConnectorPluginSpecifications describes the specifications of a connector plugin. -message ConnectorPluginSpecifications{ +message ConnectorPluginSpecifications { // Name is the name of the plugin. string name = 1; // Summary is a brief description of the plugin and what it does, @@ -166,7 +197,7 @@ message ConnectorPluginSpecifications{ } // ProcessorPluginSpecifications describes the specifications of a processor plugin. -message ProcessorPluginSpecifications{ +message ProcessorPluginSpecifications { // Name is the name of the plugin. string name = 1; // Summary is a brief description of the plugin and what it does, @@ -187,7 +218,7 @@ message ProcessorPluginSpecifications{ } // Deprecated: use ConnectorPluginSpecifications instead. -message PluginSpecifications{ +message PluginSpecifications { option deprecated = true; // Deprecated: use config.v1.Parameter instead. @@ -195,7 +226,7 @@ message PluginSpecifications{ option deprecated = true; // Deprecated: use config.v1.Validation instead. - message Validation{ + message Validation { option deprecated = true; // Deprecated: use config.v1.Validation.Type instead. @@ -269,7 +300,7 @@ service PipelineService { get: "/v1/pipelines" response_body: "pipelines" }; - }; + } rpc CreatePipeline(CreatePipelineRequest) returns (CreatePipelineResponse) { option (google.api.http) = { @@ -279,35 +310,31 @@ service PipelineService { }; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { responses: { - key: "400"; + key: "400" value: { schema: { - json_schema: { - ref: ".google.rpc.Status"; - } + json_schema: {ref: ".google.rpc.Status"} } examples: { key: "application/json" - value: '{ "code": 3, "message": "invalid arguments error", "details": [] }'; + value: '{ "code": 3, "message": "invalid arguments error", "details": [] }' } } } responses: { - key: "409"; + key: "409" value: { schema: { - json_schema: { - ref: ".google.rpc.Status"; - } + json_schema: {ref: ".google.rpc.Status"} } examples: { key: "application/json" - value: '{ "code": 6, "message": "already exists error", "details": [] }'; + value: '{ "code": 6, "message": "already exists error", "details": [] }' } } } }; - }; + } rpc GetPipeline(GetPipelineRequest) returns (GetPipelineResponse) { option (google.api.http) = { @@ -316,21 +343,19 @@ service PipelineService { }; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { responses: { - key: "404"; + key: "404" value: { schema: { - json_schema: { - ref: ".google.rpc.Status"; - } + json_schema: {ref: ".google.rpc.Status"} } examples: { key: "application/json" - value: '{ "code": 5, "message": "resource not found error", "details": [] }'; + value: '{ "code": 5, "message": "resource not found error", "details": [] }' } } } }; - }; + } rpc UpdatePipeline(UpdatePipelineRequest) returns (UpdatePipelineResponse) { option (google.api.http) = { @@ -340,121 +365,103 @@ service PipelineService { }; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { responses: { - key: "404"; + key: "404" value: { schema: { - json_schema: { - ref: ".google.rpc.Status"; - } + json_schema: {ref: ".google.rpc.Status"} } examples: { key: "application/json" - value: '{ "code": 5, "message": "resource not found error", "details": [] }'; + value: '{ "code": 5, "message": "resource not found error", "details": [] }' } } } responses: { - key: "400"; + key: "400" value: { schema: { - json_schema: { - ref: ".google.rpc.Status"; - } + json_schema: {ref: ".google.rpc.Status"} } examples: { key: "application/json" - value: '{ "code": 3, "message": "invalid arguments error", "details": [] }'; + value: '{ "code": 3, "message": "invalid arguments error", "details": [] }' } } } responses: { - key: "409"; + key: "409" value: { schema: { - json_schema: { - ref: ".google.rpc.Status"; - } + json_schema: {ref: ".google.rpc.Status"} } examples: { key: "application/json" - value: '{ "code": 6, "message": "already exists error", "details": [] }'; + value: '{ "code": 6, "message": "already exists error", "details": [] }' } } } }; - }; + } rpc DeletePipeline(DeletePipelineRequest) returns (DeletePipelineResponse) { - option (google.api.http) = { - delete: "/v1/pipelines/{id}" - }; + option (google.api.http) = {delete: "/v1/pipelines/{id}"}; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { responses: { - key: "404"; + key: "404" value: { schema: { - json_schema: { - ref: ".google.rpc.Status"; - } + json_schema: {ref: ".google.rpc.Status"} } examples: { key: "application/json" - value: '{ "code": 5, "message": "resource not found error", "details": [] }'; + value: '{ "code": 5, "message": "resource not found error", "details": [] }' } } } responses: { - key: "400"; + key: "400" value: { schema: { - json_schema: { - ref: ".google.rpc.Status"; - } + json_schema: {ref: ".google.rpc.Status"} } examples: { key: "application/json" - value: '{ "code": 9, "message": "failed precondition error", "details": [] }'; + value: '{ "code": 9, "message": "failed precondition error", "details": [] }' } } } }; - }; + } rpc StartPipeline(StartPipelineRequest) returns (StartPipelineResponse) { - option (google.api.http) = { - post: "/v1/pipelines/{id}/start" - }; + option (google.api.http) = {post: "/v1/pipelines/{id}/start"}; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { responses: { - key: "404"; + key: "404" value: { schema: { - json_schema: { - ref: ".google.rpc.Status"; - } + json_schema: {ref: ".google.rpc.Status"} } examples: { key: "application/json" - value: '{ "code": 5, "message": "resource not found error", "details": [] }'; + value: '{ "code": 5, "message": "resource not found error", "details": [] }' } } } responses: { - key: "400"; + key: "400" value: { schema: { - json_schema: { - ref: ".google.rpc.Status"; - } + json_schema: {ref: ".google.rpc.Status"} } examples: { key: "application/json" - value: '{ "code": 9, "message": "failed precondition error", "details": [] }'; + value: '{ "code": 9, "message": "failed precondition error", "details": [] }' } } } }; - }; + } rpc StopPipeline(StopPipelineRequest) returns (StopPipelineResponse) { option (google.api.http) = { @@ -463,42 +470,38 @@ service PipelineService { }; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { responses: { - key: "404"; + key: "404" value: { schema: { - json_schema: { - ref: ".google.rpc.Status"; - } + json_schema: {ref: ".google.rpc.Status"} } examples: { key: "application/json" - value: '{ "code": 5, "message": "resource not found error", "details": [] }'; + value: '{ "code": 5, "message": "resource not found error", "details": [] }' } } } responses: { - key: "400"; + key: "400" value: { schema: { - json_schema: { - ref: ".google.rpc.Status"; - } + json_schema: {ref: ".google.rpc.Status"} } examples: { key: "application/json" - value: '{ "code": 9, "message": "failed precondition error", "details": [] }'; + value: '{ "code": 9, "message": "failed precondition error", "details": [] }' } } } }; - }; + } rpc GetDLQ(GetDLQRequest) returns (GetDLQResponse) { option (google.api.http) = { get: "/v1/pipelines/{id}/dead-letter-queue" response_body: "dlq" }; - }; + } rpc UpdateDLQ(UpdateDLQRequest) returns (UpdateDLQResponse) { option (google.api.http) = { @@ -506,14 +509,14 @@ service PipelineService { body: "dlq" response_body: "dlq" }; - }; + } rpc ExportPipeline(ExportPipelineRequest) returns (ExportPipelineResponse) { option (google.api.http) = { post: "/v1/pipelines/{id}/export" response_body: "pipeline" }; - }; + } rpc ImportPipeline(ImportPipelineRequest) returns (ImportPipelineResponse) { option (google.api.http) = { @@ -521,7 +524,7 @@ service PipelineService { body: "pipeline" response_body: "pipeline" }; - }; + } } message ListPipelinesRequest { @@ -604,7 +607,7 @@ service ConnectorService { get: "/v1/connectors" response_body: "connectors" }; - }; + } rpc InspectConnector(InspectConnectorRequest) returns (stream InspectConnectorResponse) { option (google.api.http) = { @@ -620,21 +623,19 @@ service ConnectorService { }; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { responses: { - key: "404"; + key: "404" value: { schema: { - json_schema: { - ref: ".google.rpc.Status"; - } + json_schema: {ref: ".google.rpc.Status"} } examples: { key: "application/json" - value: '{ "code": 5, "message": "resource not found error", "details": [] }'; + value: '{ "code": 5, "message": "resource not found error", "details": [] }' } } } }; - }; + } rpc CreateConnector(CreateConnectorRequest) returns (CreateConnectorResponse) { option (google.api.http) = { @@ -644,21 +645,19 @@ service ConnectorService { }; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { responses: { - key: "400"; + key: "400" value: { schema: { - json_schema: { - ref: ".google.rpc.Status"; - } + json_schema: {ref: ".google.rpc.Status"} } examples: { key: "application/json" - value: '{ "code": 3, "message": "invalid arguments error", "details": [] }'; + value: '{ "code": 3, "message": "invalid arguments error", "details": [] }' } } } }; - }; + } rpc ValidateConnector(ValidateConnectorRequest) returns (ValidateConnectorResponse) { option (google.api.http) = { post: "/v1/connectors/validate" @@ -666,30 +665,26 @@ service ConnectorService { }; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { responses: { - key: "500"; + key: "500" value: { schema: { - json_schema: { - ref: ".google.rpc.Status"; - } + json_schema: {ref: ".google.rpc.Status"} } examples: { key: "application/json" - value: '{ "code": 13, "message": "could not dispense destination", "details": [] }'; + value: '{ "code": 13, "message": "could not dispense destination", "details": [] }' } } } responses: { - key: "400"; + key: "400" value: { schema: { - json_schema: { - ref: ".google.rpc.Status"; - } + json_schema: {ref: ".google.rpc.Status"} } examples: { key: "application/json" - value: '{ "code": 9, "message": "validation error: `aws.accessKeyId` config value must be set", "details": [] }'; + value: '{ "code": 9, "message": "validation error: `aws.accessKeyId` config value must be set", "details": [] }' } } } @@ -704,78 +699,68 @@ service ConnectorService { }; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { responses: { - key: "404"; + key: "404" value: { schema: { - json_schema: { - ref: ".google.rpc.Status"; - } + json_schema: {ref: ".google.rpc.Status"} } examples: { key: "application/json" - value: '{ "code": 5, "message": "resource not found error", "details": [] }'; + value: '{ "code": 5, "message": "resource not found error", "details": [] }' } } } responses: { - key: "400"; + key: "400" value: { schema: { - json_schema: { - ref: ".google.rpc.Status"; - } + json_schema: {ref: ".google.rpc.Status"} } examples: { key: "application/json" - value: '{ "code": 3, "message": "invalid arguments error", "details": [] }'; + value: '{ "code": 3, "message": "invalid arguments error", "details": [] }' } } } }; - }; + } rpc DeleteConnector(DeleteConnectorRequest) returns (DeleteConnectorResponse) { - option (google.api.http) = { - delete: "/v1/connectors/{id}" - }; + option (google.api.http) = {delete: "/v1/connectors/{id}"}; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { responses: { - key: "404"; + key: "404" value: { schema: { - json_schema: { - ref: ".google.rpc.Status"; - } + json_schema: {ref: ".google.rpc.Status"} } examples: { key: "application/json" - value: '{ "code": 5, "message": "resource not found error", "details": [] }'; + value: '{ "code": 5, "message": "resource not found error", "details": [] }' } } } responses: { - key: "400"; + key: "400" value: { schema: { - json_schema: { - ref: ".google.rpc.Status"; - } + json_schema: {ref: ".google.rpc.Status"} } examples: { key: "application/json" - value: '{ "code": 9, "message": "failed precondition error", "details": [] }'; + value: '{ "code": 9, "message": "failed precondition error", "details": [] }' } } } }; - }; + } rpc ListConnectorPlugins(ListConnectorPluginsRequest) returns (ListConnectorPluginsResponse) { option (google.api.http) = { get: "/v1/connectors/plugins" response_body: "plugins" }; - }; + } } message CreateConnectorRequest { @@ -804,8 +789,7 @@ message ValidateConnectorRequest { Connector.Config config = 4; } -message ValidateConnectorResponse { -} +message ValidateConnectorResponse {} message ListConnectorsRequest { string pipeline_id = 1; @@ -847,7 +831,7 @@ message ListConnectorPluginsRequest { string name = 1; } -message ListConnectorPluginsResponse{ +message ListConnectorPluginsResponse { repeated ConnectorPluginSpecifications plugins = 1; } @@ -858,7 +842,7 @@ service ProcessorService { get: "/v1/processors" response_body: "processors" }; - }; + } // InspectProcessorIn streams records coming into the specified processor rpc InspectProcessorIn(InspectProcessorInRequest) returns (stream InspectProcessorInResponse) { @@ -883,21 +867,19 @@ service ProcessorService { }; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { responses: { - key: "404"; + key: "404" value: { schema: { - json_schema: { - ref: ".google.rpc.Status"; - } + json_schema: {ref: ".google.rpc.Status"} } examples: { key: "application/json" - value: '{ "code": 5, "message": "resource not found error", "details": [] }'; + value: '{ "code": 5, "message": "resource not found error", "details": [] }' } } } }; - }; + } rpc CreateProcessor(CreateProcessorRequest) returns (CreateProcessorResponse) { option (google.api.http) = { @@ -907,21 +889,19 @@ service ProcessorService { }; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { responses: { - key: "400"; + key: "400" value: { schema: { - json_schema: { - ref: ".google.rpc.Status"; - } + json_schema: {ref: ".google.rpc.Status"} } examples: { key: "application/json" - value: '{ "code": 3, "message": "invalid arguments error", "details": [] }'; + value: '{ "code": 3, "message": "invalid arguments error", "details": [] }' } } } }; - }; + } rpc UpdateProcessor(UpdateProcessorRequest) returns (UpdateProcessorResponse) { option (google.api.http) = { @@ -931,78 +911,68 @@ service ProcessorService { }; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { responses: { - key: "404"; + key: "404" value: { schema: { - json_schema: { - ref: ".google.rpc.Status"; - } + json_schema: {ref: ".google.rpc.Status"} } examples: { key: "application/json" - value: '{ "code": 5, "message": "resource not found error", "details": [] }'; + value: '{ "code": 5, "message": "resource not found error", "details": [] }' } } } responses: { - key: "400"; + key: "400" value: { schema: { - json_schema: { - ref: ".google.rpc.Status"; - } + json_schema: {ref: ".google.rpc.Status"} } examples: { key: "application/json" - value: '{ "code": 3, "message": "invalid arguments error", "details": [] }'; + value: '{ "code": 3, "message": "invalid arguments error", "details": [] }' } } } }; - }; + } rpc DeleteProcessor(DeleteProcessorRequest) returns (DeleteProcessorResponse) { - option (google.api.http) = { - delete: "/v1/processors/{id}" - }; + option (google.api.http) = {delete: "/v1/processors/{id}"}; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { responses: { - key: "404"; + key: "404" value: { schema: { - json_schema: { - ref: ".google.rpc.Status"; - } + json_schema: {ref: ".google.rpc.Status"} } examples: { key: "application/json" - value: '{ "code": 5, "message": "resource not found error", "details": [] }'; + value: '{ "code": 5, "message": "resource not found error", "details": [] }' } } } responses: { - key: "400"; + key: "400" value: { schema: { - json_schema: { - ref: ".google.rpc.Status"; - } + json_schema: {ref: ".google.rpc.Status"} } examples: { key: "application/json" - value: '{ "code": 9, "message": "failed precondition error", "details": [] }'; + value: '{ "code": 9, "message": "failed precondition error", "details": [] }' } } } }; - }; + } rpc ListProcessorPlugins(ListProcessorPluginsRequest) returns (ListProcessorPluginsResponse) { option (google.api.http) = { get: "/v1/processors/plugins" response_body: "plugins" }; - }; + } } message ListProcessorsRequest { @@ -1026,7 +996,6 @@ message InspectProcessorOutResponse { opencdc.v1.Record record = 1; } - message CreateProcessorRequest { string type = 1 [deprecated = true]; Processor.Parent parent = 3; @@ -1063,17 +1032,17 @@ message ListProcessorPluginsRequest { string name = 1; } -message ListProcessorPluginsResponse{ +message ListProcessorPluginsResponse { repeated ProcessorPluginSpecifications plugins = 1; } service InformationService { - rpc GetInfo (GetInfoRequest) returns (GetInfoResponse) { + rpc GetInfo(GetInfoRequest) returns (GetInfoResponse) { option (google.api.http) = { get: "/info" response_body: "info" }; - }; + } } message GetInfoRequest {} @@ -1088,37 +1057,6 @@ message Info { string arch = 3; } -option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { - info: { - title: "Conduit REST API"; - version: "v0.1.0"; - contact: { - name: "Conduit project"; - url: "https://github.com/conduitio/conduit"; - email: ""; - } - license: { - name: "Apache License Version 2.0"; - url: "https://github.com/ConduitIO/conduit/blob/main/LICENSE.md"; - } - } - - responses: { - key: "500"; - value: { - schema: { - json_schema: { - ref: ".google.rpc.Status"; - } - } - examples: { - key: "application/json" - value: '{ "code": 13, "message": "server error", "details": [] }'; - } - } - } -}; - // Deprecated: use ConnectorService and ProcessorService instead. service PluginService { // Deprecated: use ConnectorService.ListConnectorPlugins instead. @@ -1128,7 +1066,7 @@ service PluginService { get: "/v1/plugins" response_body: "plugins" }; - }; + } } // Deprecated: use ConnectorService.ListConnectorPlugins instead. @@ -1139,7 +1077,7 @@ message ListPluginsRequest { } // Deprecated: use ConnectorService.ListConnectorPlugins instead. -message ListPluginsResponse{ +message ListPluginsResponse { option deprecated = true; repeated PluginSpecifications plugins = 1; } diff --git a/proto/buf.lock b/proto/buf.lock index 64f11225a..4acfdb0e9 100644 --- a/proto/buf.lock +++ b/proto/buf.lock @@ -4,13 +4,13 @@ deps: - remote: buf.build owner: conduitio repository: conduit-commons - commit: e990b17e93ed46918d583f3a86ae2ce6 - digest: shake256:c04156587387580d084096e8fdc6d75c2382ff79f456677b7d40ddf216aa8f09898e9f1a5e442e23c55c7dccb3347666e5095fe299d0d54802d1144b7a111e67 + commit: 11464f8c698f416da0641fdaff2cd45c + digest: shake256:9dd5ce71529da7ae268ef521b0252aad49712d6214e383c0d8da039ad2103b0e44c6ac597f5b83d93808a32c65926317999f9c4be39765688737ce3fe804eb21 - remote: buf.build owner: googleapis repository: googleapis - commit: f0e53af8f2fc4556b94f482688b57223 - digest: shake256:de26a277fc28b8b411ecf58729d78d32fcf15090ffd998a4469225b17889bfb51442eaab04bb7a8d88d203ecdf0a9febd4ffd52c18ed1c2229160c7bd353ca95 + commit: 8bc2c51e08c447cd8886cdea48a73e14 + digest: shake256:a969155953a5cedc5b2df5b42c368f2bc66ff8ce1804bc96e0f14ff2ee8a893687963058909df844d1643cdbc98ff099d2daa6bc9f9f5b8886c49afdc60e19af - remote: buf.build owner: grpc-ecosystem repository: grpc-gateway