├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md └── workflows │ ├── publish.yml │ └── validate.yml ├── .gitignore ├── LICENSE ├── README.md ├── buf.lock ├── buf.yaml ├── docs └── assets │ ├── raccoon-reqres.svg │ └── usage.svg └── raystack ├── assets ├── v1beta1 │ ├── bucket.proto │ ├── dashboard.proto │ ├── event.proto │ ├── group.proto │ ├── job.proto │ ├── lineage.proto │ ├── ownership.proto │ ├── preview.proto │ ├── properties.proto │ ├── resource.proto │ ├── schema.proto │ ├── table.proto │ ├── timestamp.proto │ ├── topic.proto │ └── user.proto └── v1beta2 │ ├── application.proto │ ├── asset.proto │ ├── bucket.proto │ ├── common.proto │ ├── dashboard.proto │ ├── experiment.proto │ ├── feature_table.proto │ ├── group.proto │ ├── job.proto │ ├── metric.proto │ ├── model.proto │ ├── table.proto │ ├── topic.proto │ └── user.proto ├── common └── v1 │ └── service.proto ├── compass └── v1beta1 │ └── service.proto ├── entropy └── v1beta1 │ ├── module.proto │ └── resource.proto ├── frontier └── v1beta1 │ ├── admin.proto │ ├── frontier.proto │ └── models.proto ├── guardian └── v1beta1 │ └── guardian.proto ├── optimus ├── core │ └── v1beta1 │ │ ├── backup.proto │ │ ├── job_run.proto │ │ ├── job_spec.proto │ │ ├── namespace.proto │ │ ├── project.proto │ │ ├── replay.proto │ │ ├── resource.proto │ │ ├── runtime.proto │ │ ├── secret.proto │ │ └── status.proto ├── integration │ └── v1beta1 │ │ └── event.proto └── plugins │ └── v1beta1 │ └── dependency_resolver.proto ├── predator └── v1beta1 │ ├── metrics_log.proto │ └── result_log.proto ├── raccoon ├── readme.md └── v1beta1 │ └── raccoon.proto ├── siren └── v1beta1 │ └── siren.proto └── stencil └── v1beta1 └── stencil.proto /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Desktop (please complete the following information):** 27 | - OS: [e.g. iOS] 28 | - Browser [e.g. chrome, safari] 29 | - Version [e.g. 22] 30 | 31 | **Smartphone (please complete the following information):** 32 | - Device: [e.g. iPhone6] 33 | - OS: [e.g. iOS8.1] 34 | - Browser [e.g. stock browser, safari] 35 | - Version [e.g. 22] 36 | 37 | **Additional context** 38 | Add any other context about the problem here. 39 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.github/workflows/publish.yml: -------------------------------------------------------------------------------- 1 | name: Publish 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | 8 | jobs: 9 | validate: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - uses: actions/checkout@v2 13 | - uses: bufbuild/buf-setup-action@v1.5.0 14 | with: 15 | version: 1.5.0 16 | - uses: bufbuild/buf-breaking-action@v1 17 | with: 18 | against: 'https://github.com/$GITHUB_REPOSITORY.git#branch=main' 19 | push_to_bsr: 20 | runs-on: ubuntu-latest 21 | needs: validate 22 | steps: 23 | - uses: actions/checkout@v2 24 | - uses: bufbuild/buf-setup-action@v1.5.0 25 | with: 26 | version: 1.5.0 27 | - uses: bufbuild/buf-push-action@v1 28 | with: 29 | buf_token: ${{ secrets.BUF_TOKEN }} 30 | -------------------------------------------------------------------------------- /.github/workflows/validate.yml: -------------------------------------------------------------------------------- 1 | name: Validate 2 | 3 | on: 4 | - push 5 | - pull_request 6 | 7 | jobs: 8 | validate: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - uses: actions/checkout@v2 12 | - uses: bufbuild/buf-setup-action@v1.5.0 13 | with: 14 | version: 1.5.0 15 | - uses: bufbuild/buf-lint-action@v1 16 | continue-on-error: true 17 | - uses: bufbuild/buf-breaking-action@v1 18 | with: 19 | against: "https://github.com/$GITHUB_REPOSITORY.git#branch=main" 20 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Binaries for programs and plugins 2 | *.exe 3 | *.exe~ 4 | *.dll 5 | *.so 6 | *.dylib 7 | *.class 8 | 9 | # Test binary, built with `go test -c` 10 | *.test 11 | 12 | # Output of the go coverage tool, specifically when used with LiteIDE 13 | *.out 14 | 15 | # Dependency directories (remove the comment below to include it) 16 | # vendor/ 17 | 18 | .gradle/ 19 | .idea/ 20 | .project/ 21 | .settings/ 22 | build/ 23 | generated-protos/ 24 | 25 | .DS_Store 26 | .vscode/ 27 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Proton 2 | 3 | This repository contains the original interface definitions of Raystack APIs that support both REST and gRPC protocols. Reading the original interface definitions can provide a better understanding of Raystack APIs and help you to utilize them more efficiently. You can also use these definitions with open source tools to generate client libraries, documentation, and other artifacts. 4 | 5 | ## Overview 6 | 7 | Raystack APIs are typically deployed as API services that are hosted under different DNS names. One API service may implement multiple APIs and multiple versions of the same API. 8 | 9 | Raystack APIs use [Protocol Buffers](https://github.com/google/protobuf) version 3 (proto3) as their Interface Definition Language (IDL) to define the API interface and the structure of the payload messages. The same interface definition is used for both REST and RPC versions of the API, which can be accessed over different wire protocols. 10 | 11 | There are several ways of accessing Raystack APIs: 12 | 13 | 1. JSON over HTTP: You can access all Raystack APIs directly using JSON over HTTP, using any API client libraries. 14 | 2. Protocol Buffers over gRPC: You can access Raystack APIs published in this repository through [GRPC](https://github.com/grpc), which is a high-performance binary RPC protocol over HTTP/2. It offers many useful features, including request/response multiplex and full-duplex streaming. 15 | 16 | ## Structure 17 | 18 | This repository uses a directory hierarchy that reflects the Raystack API product structure. In general, every API has its own root directory, and each major version of the API has its own subdirectory. 19 | 20 | The proto package names exactly match the directory: this makes it easy to locate the proto definitions and ensures that the generated client libraries have idiomatic namespaces in most programming languages. 21 | 22 | ## Usage 23 | 24 | Proton does not provide compiled language specific proto files or the descriptor sets for the respective protos. It is upto the users to pull these protos and use `protoc` or `buf` for language specific compiled files and have dependencies/imports in their code. 25 | 26 | To generate gRPC source code for Protobuf APIs in this repository, you first need to install buf on your local machine. For next step, add `buf.gen.yaml` at the root of your project. 27 | 28 | ```yaml 29 | version: v1 30 | plugins: 31 | - name: go 32 | out: api 33 | opt: paths=source_relative 34 | ``` 35 | 36 | Run below command to generate your proto to `/api` folder. 37 | 38 | ``` 39 | buf generate 40 | ``` 41 | 42 | Use below command if you just want to target specific package/folder 43 | 44 | ``` 45 | buf generate --path raystack/assets 46 | ``` 47 | 48 | Check out Compass [implementation](https://github.com/raystack/compass) for reference. 49 | 50 | ## Contribute 51 | 52 |
53 | Prerequisites: 54 | 55 | - [Buf](https://docs.buf.build/installation) 56 | - [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) 57 | 58 |
59 | 60 | You can run following command for linting protobuf files 61 | 62 | ```sh 63 | buf lint 64 | ``` 65 | 66 | Run following command to format protobuf files 67 | 68 | ```sh 69 | buf format -w 70 | ``` 71 | 72 | You can run following command for formatting protobuf files 73 | 74 | ```sh 75 | $ buf format -w 76 | ``` 77 | 78 | You can add proto files when you need to introduce proto for Raystack projects. If you need to modify proto files, you need to ensure backward compatibility. To ensure the backward compatibility of your changes, you can run 79 | 80 | ```sh 81 | buf breaking --against '.git#branch=master' 82 | ``` 83 | 84 | ## License 85 | 86 | Proton is [Apache 2.0](LICENSE) licensed. 87 | -------------------------------------------------------------------------------- /buf.lock: -------------------------------------------------------------------------------- 1 | # Generated by buf. DO NOT EDIT. 2 | version: v1 3 | deps: 4 | - remote: buf.build 5 | owner: envoyproxy 6 | repository: protoc-gen-validate 7 | commit: 6607b10f00ed4a3d98f906807131c44a 8 | digest: shake256:acc7b2ededb2f88d296862943a003b157bdb68ec93ed13dcd8566b2d06e47993ea6daf12013b9655658aaf6bbdb141cf65bfe400ce2870f4654b0a5b45e57c09 9 | - remote: buf.build 10 | owner: googleapis 11 | repository: googleapis 12 | commit: cc916c31859748a68fd229a3c8d7a2e8 13 | digest: shake256:469b049d0eb04203d5272062636c078decefc96fec69739159c25d85349c50c34c7706918a8b216c5c27f76939df48452148cff8c5c3ae77fa6ba5c25c1b8bf8 14 | - remote: buf.build 15 | owner: grpc-ecosystem 16 | repository: grpc-gateway 17 | commit: a1ecdc58eccd49aa8bea2a7a9022dc27 18 | digest: shake256:efdd86fbdc42e8b7259fe461a49656827a03fb7cba0b3b9eb622ca10654ec6beccb9a051229c1553ccd89ed3e95d69ad4d7c799f1da3f3f1bd447b7947a4893e 19 | -------------------------------------------------------------------------------- /buf.yaml: -------------------------------------------------------------------------------- 1 | version: v1 2 | name: buf.build/raystack/proton 3 | deps: 4 | - buf.build/googleapis/googleapis 5 | - buf.build/grpc-ecosystem/grpc-gateway 6 | - buf.build/envoyproxy/protoc-gen-validate 7 | breaking: 8 | use: 9 | - WIRE 10 | except: 11 | - RESERVED_MESSAGE_NO_DELETE 12 | lint: 13 | allow_comment_ignores: true 14 | -------------------------------------------------------------------------------- /docs/assets/usage.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 |
Local dependency
Local dependency
Other compilation methods
Other compilation methods
GOGO Compile on CI
GOGO Compile on CI
Pull proto files
Pull proto files
PROTON
PROTON
Your GO repository
Your GO repository
Local machine
Local machine
Other projects
Other projects
Viewer does not support full SVG 1.1
-------------------------------------------------------------------------------- /raystack/assets/v1beta1/bucket.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package raystack.assets.v1beta1; 4 | 5 | import "google/protobuf/timestamp.proto"; 6 | import "raystack/assets/v1beta1/event.proto"; 7 | import "raystack/assets/v1beta1/ownership.proto"; 8 | import "raystack/assets/v1beta1/properties.proto"; 9 | import "raystack/assets/v1beta1/resource.proto"; 10 | import "raystack/assets/v1beta1/timestamp.proto"; 11 | 12 | option go_package = "github.com/raystack/proton/assets/v1beta1;assetsv1beta1"; 13 | option java_outer_classname = "BucketProto"; 14 | option java_package = "io.raystack.assets"; 15 | 16 | message Bucket { 17 | // Representation of the resource 18 | raystack.assets.v1beta1.Resource resource = 1; 19 | 20 | // The description of the bucket. 21 | // Example: `This bucket was created by the product team.` 22 | string description = 4; 23 | 24 | // The location of the bucket. Can differ based on cloud storage used. (e.g. GCS, S3, etc) 25 | // Example: `ASIA` 26 | string location = 5; 27 | 28 | // The type of the storage. Can differ based on cloud storage used. (e.g. GCS, S3, etc) 29 | // Example: `STANDARD` 30 | string storage_type = 6; 31 | 32 | // List of blobs in the bucket. 33 | repeated Blob blobs = 7; 34 | 35 | // The ownership of the bucket. 36 | // For an example check out ownership. 37 | raystack.assets.v1beta1.Ownership ownership = 31; 38 | 39 | // List of the user's custom properties. 40 | // Properties facet can be used to set custom properties, tags and labels for a user. 41 | raystack.assets.v1beta1.Properties properties = 32; 42 | 43 | // The timestamp of the bucket's creation. 44 | // Timstamp facet can be used to set the creation and updation timestamp of a bucket. 45 | raystack.assets.v1beta1.Timestamp timestamps = 33; 46 | 47 | // The timestamp of the generated event. 48 | // Event schemas is defined in the common event schema. 49 | raystack.assets.v1beta1.Event event = 100; 50 | } 51 | 52 | message Blob { 53 | // The URN of the blob. 54 | // Example: `location/bucket-name/file-name`. 55 | string urn = 1; 56 | 57 | // The name of the blob. 58 | // Example: `file-name`. 59 | string name = 2; 60 | 61 | // The source of the blob. 62 | // Example: `gcs`. 63 | string source = 3; 64 | 65 | // The length of the object content. 66 | // Example: `300` 67 | int64 size = 4; 68 | 69 | // Delete time of the blob object. 70 | google.protobuf.Timestamp delete_time = 5; 71 | 72 | // Expire time of the blob object. 73 | google.protobuf.Timestamp expire_time = 6; 74 | 75 | // The ownership of the blob. 76 | // For an example check out ownership. 77 | raystack.assets.v1beta1.Ownership ownership = 31; 78 | 79 | // List of the user's custom properties. 80 | // Properties facet can be used to set custom properties, tags and labels for a user. 81 | raystack.assets.v1beta1.Properties properties = 32; 82 | 83 | // The timestamp of the blob's creation. 84 | // Timstamp facet can be used to set the creation and updation timestamp of a blob. 85 | raystack.assets.v1beta1.Timestamp timestamps = 33; 86 | } 87 | -------------------------------------------------------------------------------- /raystack/assets/v1beta1/dashboard.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package raystack.assets.v1beta1; 4 | 5 | import "raystack/assets/v1beta1/event.proto"; 6 | import "raystack/assets/v1beta1/lineage.proto"; 7 | import "raystack/assets/v1beta1/ownership.proto"; 8 | import "raystack/assets/v1beta1/properties.proto"; 9 | import "raystack/assets/v1beta1/resource.proto"; 10 | import "raystack/assets/v1beta1/timestamp.proto"; 11 | 12 | option go_package = "github.com/raystack/proton/assets/v1beta1;assetsv1beta1"; 13 | option java_outer_classname = "DashboardProto"; 14 | option java_package = "io.raystack.assets"; 15 | 16 | // Dashboard is a resource that represents a dashboard. 17 | message Dashboard { 18 | // Representation of the resource 19 | raystack.assets.v1beta1.Resource resource = 1; 20 | 21 | // The list of the charts in the dashboard. 22 | // For an example, check the schema of the chart. 23 | repeated Chart charts = 21; 24 | 25 | // The ownership of the dashboard. 26 | // For an example check out ownership. 27 | raystack.assets.v1beta1.Ownership ownership = 31; 28 | 29 | // List of the user's custom properties. 30 | // Properties facet can be used to set custom properties, tags and labels for a user. 31 | raystack.assets.v1beta1.Properties properties = 32; 32 | 33 | // The timestamp of the user's creation. 34 | // Timstamp facet can be used to set the creation and updation timestamp of a user. 35 | raystack.assets.v1beta1.Timestamp timestamps = 33; 36 | 37 | // The lineage of the dashboard. 38 | // For an example check out lineage schema. 39 | raystack.assets.v1beta1.Lineage lineage = 34; 40 | 41 | // The timestamp of the generated event. 42 | // Event schemas is defined in the common event schema. 43 | raystack.assets.v1beta1.Event event = 100; 44 | } 45 | 46 | message Chart { 47 | // The URN of the chart. 48 | // Example: `chart:1`. 49 | string urn = 1; 50 | 51 | // The name of the chart. 52 | // Example: `My Chart`. 53 | string name = 2; 54 | 55 | // The type of the chart. 56 | // Example: `line`. 57 | string type = 3; 58 | 59 | // The source of the chart. 60 | // Example: `metabase`. 61 | string source = 4; 62 | 63 | // The description of the chart. 64 | // Example: `This is a chart for my dashboard.` 65 | string description = 5; 66 | 67 | // The url of the chart. 68 | // Example: `http://metabase.com/charts/mychart`. 69 | string url = 6; 70 | 71 | // The raw query of the chart. 72 | // Example: `SELECT * FROM my_table`. 73 | string raw_query = 7; 74 | 75 | // The source of the data. 76 | // Example: `bigquery,graphite`. 77 | string data_source = 8; 78 | 79 | // The dashboard ur of the chart. 80 | // Example: `dashboard:1`. 81 | string dashboard_urn = 9; 82 | 83 | // The source of the dashboard of the chart. 84 | // Example: `metabase`. 85 | string dashboard_source = 10; 86 | 87 | // The ownership of the dashboard. 88 | // For an example check out ownership. 89 | raystack.assets.v1beta1.Ownership ownership = 31; 90 | 91 | // The lineage of the chart. 92 | // For an example check out lineage schema. 93 | raystack.assets.v1beta1.Lineage lineage = 32; 94 | 95 | // List of the user's custom properties. 96 | // Properties facet can be used to set custom properties, tags and labels for a dashboard. 97 | raystack.assets.v1beta1.Properties properties = 33; 98 | 99 | // The timestamp of the user's creation. 100 | // Timstamp facet can be used to set the creation and updation timestamp of a dashboard. 101 | raystack.assets.v1beta1.Timestamp timestamps = 34; 102 | 103 | // The timestamp of the generated event. 104 | // Event schemas is defined in the common event schema. 105 | raystack.assets.v1beta1.Event event = 100; 106 | } 107 | -------------------------------------------------------------------------------- /raystack/assets/v1beta1/event.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package raystack.assets.v1beta1; 4 | 5 | import "google/protobuf/timestamp.proto"; 6 | 7 | option go_package = "github.com/raystack/proton/assets/v1beta1;assetsv1beta1"; 8 | option java_outer_classname = "EventProto"; 9 | option java_package = "io.raystack.assets"; 10 | 11 | // Event represents an event in the system. 12 | // Event is majorly used to represent the state of the system in the form of events. 13 | // It can be used in any schema which intend to produce events to message bus. 14 | message Event { 15 | // The timestamp of the event. 16 | // Example: `2018-01-01T00:00:00Z`. 17 | google.protobuf.Timestamp timestamp = 1; 18 | 19 | // The activity that created the event. 20 | // Example: `create`, `update`. 21 | string action = 2; 22 | 23 | // The description of the event. 24 | // Example: `user is created from signup form`. 25 | string description = 3; 26 | } 27 | -------------------------------------------------------------------------------- /raystack/assets/v1beta1/group.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package raystack.assets.v1beta1; 4 | 5 | import "raystack/assets/v1beta1/event.proto"; 6 | import "raystack/assets/v1beta1/properties.proto"; 7 | import "raystack/assets/v1beta1/resource.proto"; 8 | import "raystack/assets/v1beta1/timestamp.proto"; 9 | 10 | option go_package = "github.com/raystack/proton/assets/v1beta1;assetsv1beta1"; 11 | option java_outer_classname = "GroupProto"; 12 | option java_package = "io.raystack.assets"; 13 | 14 | // Group represents a group of users and resources. 15 | message Group { 16 | // Representation of the resource 17 | raystack.assets.v1beta1.Resource resource = 1; 18 | 19 | // The email of the group. 20 | // Example: `xyz@xyz.com` 21 | string email = 2; 22 | 23 | // The members of the group. 24 | // For example look at schema of the member. 25 | repeated Member members = 21; 26 | 27 | // List of the user's custom properties. 28 | // Properties facet can be used to set custom properties, tags and labels for a user. 29 | raystack.assets.v1beta1.Properties properties = 31; 30 | 31 | // The timestamp of the user's creation. 32 | // Timstamp facet can be used to set the creation and updation timestamp of a user. 33 | raystack.assets.v1beta1.Timestamp timestamps = 32; 34 | 35 | // The timestamp of the generated event. 36 | // Event schemas is defined in the common event schema. 37 | raystack.assets.v1beta1.Event event = 100; 38 | } 39 | 40 | // Member represents a user. 41 | message Member { 42 | // The unique identifier for the user. 43 | // Example: `user:example`. 44 | string urn = 1; 45 | // The role of the user. 46 | // Example: `owner`. 47 | string role = 2; 48 | } 49 | -------------------------------------------------------------------------------- /raystack/assets/v1beta1/job.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package raystack.assets.v1beta1; 4 | 5 | import "raystack/assets/v1beta1/event.proto"; 6 | import "raystack/assets/v1beta1/lineage.proto"; 7 | import "raystack/assets/v1beta1/ownership.proto"; 8 | import "raystack/assets/v1beta1/properties.proto"; 9 | import "raystack/assets/v1beta1/resource.proto"; 10 | import "raystack/assets/v1beta1/timestamp.proto"; 11 | 12 | option go_package = "github.com/raystack/proton/assets/v1beta1;assetsv1beta1"; 13 | option java_outer_classname = "JobProto"; 14 | option java_package = "io.raystack.assets"; 15 | 16 | // Job is a resource that represents a job. 17 | message Job { 18 | // Representation of the resource 19 | raystack.assets.v1beta1.Resource resource = 1; 20 | 21 | // The ownership of the job. 22 | // For an example check out ownership. 23 | raystack.assets.v1beta1.Ownership ownership = 31; 24 | 25 | // The lineage of the job. 26 | // For an example check out lineage schema. 27 | raystack.assets.v1beta1.Lineage lineage = 32; 28 | 29 | // List of the user's custom properties. 30 | // Properties facet can be used to set custom properties, tags and labels for a user. 31 | raystack.assets.v1beta1.Properties properties = 33; 32 | 33 | // The timestamp of the user's creation. 34 | // Timstamp facet can be used to set the creation and updation timestamp of a user. 35 | raystack.assets.v1beta1.Timestamp timestamps = 34; 36 | 37 | // The timestamp of the generated event. 38 | // Event schemas is defined in the common event schema. 39 | raystack.assets.v1beta1.Event event = 100; 40 | } 41 | -------------------------------------------------------------------------------- /raystack/assets/v1beta1/lineage.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package raystack.assets.v1beta1; 4 | 5 | import "raystack/assets/v1beta1/resource.proto"; 6 | 7 | option go_package = "github.com/raystack/proton/assets/v1beta1;assetsv1beta1"; 8 | option java_outer_classname = "LineageProto"; 9 | option java_package = "io.raystack.assets"; 10 | 11 | // Linage reprsents the relationship of resource to other resources. 12 | // Relation is way of describing the relationship between two resources. 13 | message Lineage { 14 | // The resource that is the source of the relationship. 15 | // Example: a resource that is the parent of another resource. 16 | repeated raystack.assets.v1beta1.Resource upstreams = 1; 17 | 18 | // The resource that is the destination of the relationship. 19 | // Example: a resource that is the child of another resource. 20 | repeated raystack.assets.v1beta1.Resource downstreams = 2; 21 | } 22 | -------------------------------------------------------------------------------- /raystack/assets/v1beta1/ownership.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package raystack.assets.v1beta1; 4 | 5 | option go_package = "github.com/raystack/proton/assets/v1beta1;assetsv1beta1"; 6 | option java_outer_classname = "OwnershipProto"; 7 | option java_package = "io.raystack.assets"; 8 | 9 | // Ownership is a facet that describes the ownership of a resource. 10 | message Ownership { 11 | // Required: The list of owners of the resource. 12 | // For an example check the owner schema. 13 | repeated Owner owners = 7; 14 | } 15 | 16 | // Owner is a facet that describes the owner of a resource. 17 | message Owner { 18 | // The name of the owner. 19 | // Example: `user:johndoe`. 20 | 21 | string urn = 1; 22 | // The name of the owner. 23 | // Example: `John Doe`. 24 | string name = 2; 25 | 26 | // The role of the owner. 27 | // Example: `admin`, `steward`. 28 | string role = 3; 29 | 30 | // The email of the owner. 31 | // Example: `abc@email.com` 32 | string email = 4; 33 | } 34 | -------------------------------------------------------------------------------- /raystack/assets/v1beta1/preview.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package raystack.assets.v1beta1; 4 | 5 | import "google/protobuf/struct.proto"; 6 | 7 | option go_package = "github.com/raystack/proton/assets/v1beta1;assetsv1beta1"; 8 | option java_outer_classname = "PreviewProto"; 9 | option java_package = "io.raystack.assets"; 10 | 11 | // Preview contains samples of the metadata. 12 | message Preview { 13 | // fields is a list of fields. 14 | repeated string fields = 1; 15 | 16 | // rows is a multidimensional array containing 17 | // Optional: List of properties the user has. 18 | google.protobuf.ListValue rows = 2; 19 | } 20 | -------------------------------------------------------------------------------- /raystack/assets/v1beta1/properties.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package raystack.assets.v1beta1; 4 | 5 | import "google/protobuf/struct.proto"; 6 | 7 | option go_package = "github.com/raystack/proton/assets/v1beta1;assetsv1beta1"; 8 | option java_outer_classname = "PropertiesProto"; 9 | option java_package = "io.raystack.assets"; 10 | 11 | message Properties { 12 | // Optional: List of tags the user has. 13 | repeated string tags = 1; 14 | 15 | //Optional. List of labels the user has. 16 | map labels = 2; 17 | 18 | // Optional: List of properties the user has. 19 | google.protobuf.Struct attributes = 3; 20 | } 21 | -------------------------------------------------------------------------------- /raystack/assets/v1beta1/resource.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package raystack.assets.v1beta1; 4 | 5 | option go_package = "github.com/raystack/proton/assets/v1beta1;assetsv1beta1"; 6 | option java_outer_classname = "ResourceProto"; 7 | option java_package = "io.raystack.assets"; 8 | 9 | // Resource is a generic resource that represents a file or other resource. 10 | // It can be a table, job, user or group. 11 | message Resource { 12 | // The unique identifier of the resource. 13 | // Example: `user:jdoe` or `group:accounting`. 14 | string urn = 1; 15 | 16 | // The name of the resource. 17 | // Example: `John Doe` or `Accounting`. 18 | string name = 2; 19 | 20 | // The source of the resource. 21 | // Example: `github` or `bigquery`. 22 | string service = 3; 23 | 24 | // The type of the asset. 25 | // Example: `user` or `group`. 26 | string type = 4; 27 | 28 | // The REST URL for accessing the resource. URL returns the resource itself. 29 | // Example: `https://xyz.com/v1/users/user-123` 30 | string url = 5; 31 | 32 | // The description of the resource. 33 | // Example: `This resource is being used for storing important number` 34 | string description = 6; 35 | } 36 | -------------------------------------------------------------------------------- /raystack/assets/v1beta1/schema.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package raystack.assets.v1beta1; 4 | 5 | import "raystack/assets/v1beta1/properties.proto"; 6 | 7 | option go_package = "github.com/raystack/proton/assets/v1beta1;assetsv1beta1"; 8 | option java_outer_classname = "SchemaProto"; 9 | option java_package = "io.raystack.assets"; 10 | 11 | // Columns represents a list of columns. 12 | // It is facet used to specify the schema of a table or a file. 13 | message Columns { 14 | // The list of columns. 15 | repeated Column columns = 1; 16 | } 17 | 18 | // Column represents a column in a table or a file. 19 | message Column { 20 | // The name of the column. 21 | // Example: `customer_id`. 22 | string name = 1; 23 | 24 | // The description of the column. 25 | // Example: `The unique id of the customer` 26 | string description = 2; 27 | 28 | // The data type of the column. 29 | // Example: `INT64`. 30 | 31 | string data_type = 3; 32 | // The format of the column. 33 | // Example: `true`. 34 | bool is_nullable = 4; 35 | 36 | // The length of the column. 37 | // Example: `10`. 38 | int64 length = 5; 39 | 40 | // The profile of the column. 41 | ColumnProfile profile = 6; 42 | 43 | // Representation of the column properties. 44 | // Properties facet can be used to set custom properties, tags and labels for a column. 45 | raystack.assets.v1beta1.Properties properties = 31; 46 | } 47 | 48 | message ColumnProfile { 49 | string min = 1; 50 | string max = 2; 51 | double avg = 3; 52 | double med = 4; 53 | int64 unique = 5; 54 | int64 count = 6; 55 | string top = 7; 56 | } 57 | 58 | // TopicSchema represents a schema for message bus. 59 | // It is facet used to specify the schema of a message bus. 60 | message TopicSchema { 61 | string schema_url = 1; 62 | string format = 2; 63 | } 64 | -------------------------------------------------------------------------------- /raystack/assets/v1beta1/table.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package raystack.assets.v1beta1; 4 | 5 | import "raystack/assets/v1beta1/event.proto"; 6 | import "raystack/assets/v1beta1/lineage.proto"; 7 | import "raystack/assets/v1beta1/ownership.proto"; 8 | import "raystack/assets/v1beta1/preview.proto"; 9 | import "raystack/assets/v1beta1/properties.proto"; 10 | import "raystack/assets/v1beta1/resource.proto"; 11 | import "raystack/assets/v1beta1/schema.proto"; 12 | import "raystack/assets/v1beta1/timestamp.proto"; 13 | 14 | option go_package = "github.com/raystack/proton/assets/v1beta1;assetsv1beta1"; 15 | option java_outer_classname = "TableProto"; 16 | option java_package = "io.raystack.assets"; 17 | 18 | // Table is a table in a database. 19 | // It can be a file, a table, a view, a materialized view, a temporary table, or a virtual table. 20 | message Table { 21 | // Representation of the resource 22 | raystack.assets.v1beta1.Resource resource = 1; 23 | 24 | // The metrics about the table. 25 | // For example check the profile schem. 26 | TableProfile profile = 21; 27 | 28 | // The columns of the table. 29 | // Example: 'id', `name`, `age'. 30 | raystack.assets.v1beta1.Columns schema = 22; 31 | 32 | // Previews of the table. 33 | // For an example check out preview facet. 34 | raystack.assets.v1beta1.Preview preview = 23; 35 | 36 | // The ownership of the table. 37 | // For an example check out ownership. 38 | raystack.assets.v1beta1.Ownership ownership = 31; 39 | 40 | // The lineage of the table. 41 | // For an example check out lineage. 42 | raystack.assets.v1beta1.Lineage lineage = 32; 43 | 44 | // List of the user's custom properties. 45 | // Properties facet can be used to set custom properties, tags and labels for a user. 46 | raystack.assets.v1beta1.Properties properties = 33; 47 | 48 | // The timestamp of the user's creation. 49 | // Timstamp facet can be used to set the creation and updation timestamp of a user. 50 | raystack.assets.v1beta1.Timestamp timestamps = 34; 51 | 52 | // The timestamp of the generated event. 53 | // Event schemas is defined in the common event schema. 54 | raystack.assets.v1beta1.Event event = 100; 55 | } 56 | 57 | // TableProfile is the metrics about the table. 58 | message TableProfile { 59 | // The number of rows in the table. 60 | // Example: `100`. 61 | int64 total_rows = 1; 62 | 63 | // The number of rows in the table that are not deleted. 64 | // Example: `event_timestamp`. 65 | string partition_key = 2; 66 | 67 | string partition_value = 3; 68 | 69 | // The number of how many times table is being used 70 | int64 usage_count = 4; 71 | 72 | // The information of `join` applied to the table 73 | repeated Join joins = 5; 74 | 75 | // The information of `filter` applied to the table 76 | repeated string filters = 6; 77 | } 78 | 79 | // Join is the metric of which are other tables that are joined with this table 80 | message Join { 81 | string urn = 1; 82 | 83 | // The number of how many times table is being joined with a certain table urn 84 | int64 count = 2; 85 | 86 | // The information of `join conditions` applied to the table 87 | repeated string conditions = 3; 88 | } 89 | -------------------------------------------------------------------------------- /raystack/assets/v1beta1/timestamp.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package raystack.assets.v1beta1; 4 | 5 | import "google/protobuf/timestamp.proto"; 6 | 7 | option go_package = "github.com/raystack/proton/assets/v1beta1;assetsv1beta1"; 8 | option java_outer_classname = "TimestampProto"; 9 | option java_package = "io.raystack.assets"; 10 | 11 | // Timestamp represents created and modified timestamps. 12 | message Timestamp { 13 | // The timestamp when the object was created. 14 | google.protobuf.Timestamp create_time = 1; 15 | 16 | // The timestamp when the object was last modified. 17 | google.protobuf.Timestamp update_time = 2; 18 | } 19 | 20 | // A time window specified by its `start_time` and `end_time`. 21 | message TimeWindow { 22 | // Start time of the time window (exclusive). 23 | google.protobuf.Timestamp start_time = 1; 24 | 25 | // End time of the time window (inclusive). If not specified, the current 26 | // timestamp is used instead. 27 | google.protobuf.Timestamp end_time = 2; 28 | } 29 | -------------------------------------------------------------------------------- /raystack/assets/v1beta1/topic.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package raystack.assets.v1beta1; 4 | 5 | import "raystack/assets/v1beta1/event.proto"; 6 | import "raystack/assets/v1beta1/lineage.proto"; 7 | import "raystack/assets/v1beta1/ownership.proto"; 8 | import "raystack/assets/v1beta1/properties.proto"; 9 | import "raystack/assets/v1beta1/resource.proto"; 10 | import "raystack/assets/v1beta1/schema.proto"; 11 | import "raystack/assets/v1beta1/timestamp.proto"; 12 | 13 | option go_package = "github.com/raystack/proton/assets/v1beta1;assetsv1beta1"; 14 | option java_outer_classname = "TopicProto"; 15 | option java_package = "io.raystack.assets"; 16 | 17 | // Topic is resource that represents a logical group of messages 18 | // in message bus like kafka, pubsub, pulsar etc. 19 | message Topic { 20 | // Representation of the resource 21 | raystack.assets.v1beta1.Resource resource = 1; 22 | 23 | // The metrics of the topic. 24 | // For an example check out topic profile schema. 25 | TopicProfile profile = 21; 26 | 27 | // The schama of the topic. 28 | // For an example check out topic schema. 29 | raystack.assets.v1beta1.TopicSchema schema = 31; 30 | 31 | // The ownership of the topic. 32 | // For an example check out ownership. 33 | raystack.assets.v1beta1.Ownership ownership = 32; 34 | 35 | // The lineage of the topic. 36 | // For an example check out lineage schema. 37 | raystack.assets.v1beta1.Lineage lineage = 33; 38 | 39 | // List of the user's custom properties. 40 | // Properties facet can be used to set custom properties, tags and labels for a user. 41 | raystack.assets.v1beta1.Properties properties = 34; 42 | 43 | // The timestamp of the user's creation. 44 | // Timstamp facet can be used to set the creation and updation timestamp of a user. 45 | raystack.assets.v1beta1.Timestamp timestamps = 35; 46 | 47 | // The timestamp of the generated event. 48 | // Event schemas is defined in the common event schema. 49 | raystack.assets.v1beta1.Event event = 100; 50 | } 51 | 52 | // TopicProfile is the profile of the topic. 53 | message TopicProfile { 54 | // The thrroughput of the topic. 55 | // Example: `1m/minute`. 56 | string throughput = 1; 57 | 58 | // The number of partitions in the topic. 59 | // Example: `12`. 60 | int64 number_of_partitions = 2; 61 | } 62 | -------------------------------------------------------------------------------- /raystack/assets/v1beta1/user.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package raystack.assets.v1beta1; 4 | 5 | import "raystack/assets/v1beta1/event.proto"; 6 | import "raystack/assets/v1beta1/properties.proto"; 7 | import "raystack/assets/v1beta1/resource.proto"; 8 | import "raystack/assets/v1beta1/timestamp.proto"; 9 | 10 | option go_package = "github.com/raystack/proton/assets/v1beta1;assetsv1beta1"; 11 | option java_outer_classname = "UserProto"; 12 | option java_package = "io.raystack.assets"; 13 | 14 | // User is a person who uses or operates something. 15 | // It can be a user of the system, or a user of a device. 16 | // User is a resource that represents a user. 17 | message User { 18 | // Representation of the resource 19 | raystack.assets.v1beta1.Resource resource = 1; 20 | 21 | // The emai address of the user. 22 | // Example: `job.deo@gmail.com` 23 | string email = 3; 24 | 25 | // The username of the user. 26 | // Example: `johndoe` 27 | string username = 4; 28 | 29 | // The first name of the user. 30 | // Example: `john` 31 | string first_name = 5; 32 | 33 | // The last name of the user. 34 | // Example: `doe` 35 | string last_name = 6; 36 | 37 | // The full name of the user. 38 | // Example: `john mayer doe` 39 | string full_name = 7; 40 | 41 | // The display name of the user. 42 | // Example: `John M. Doe` 43 | string display_name = 8; 44 | 45 | // The job title of the user, 46 | // Example: `data engineer` 47 | string title = 9; 48 | 49 | // The status of the user. 50 | // Example: `active` 51 | string status = 10; 52 | 53 | // The email of the manger of the user. 54 | // Example: `rambo.ryan@gmail.com` 55 | string manager_email = 11; 56 | 57 | // List of the user social media accounts. 58 | // For an example check out the profile schema. 59 | repeated Profile profiles = 21; 60 | 61 | // List of the groups user belongs to. 62 | // A user can be part of multiple groups and have a different role in every group. 63 | repeated Membership memberships = 22; 64 | 65 | // Representation of custom properties of user. 66 | // Properties facet can be used to set custom properties, tags and labels for a user. 67 | raystack.assets.v1beta1.Properties properties = 31; 68 | 69 | // The timestamp of the user's creation. 70 | // Timstamp facet can be used to set the creation and updation timestamp of a user. 71 | raystack.assets.v1beta1.Timestamp timestamps = 32; 72 | 73 | // The timestamp of the generated event. 74 | // Event schemas is defined in the common event schema. 75 | raystack.assets.v1beta1.Event event = 100; 76 | } 77 | 78 | // Membership is a relationship between a user and a group. 79 | message Membership { 80 | // The unique identifier of the group. 81 | // Example: `group:mygroup` 82 | string group_urn = 1; 83 | 84 | // The role user has in the group. 85 | // Example: "owner" 86 | repeated string role = 2; 87 | } 88 | 89 | // Profile is a social media account of the user. 90 | message Profile { 91 | // The unique identifier of the profile. 92 | // Example: `profile:jdoe` 93 | string id = 1; 94 | 95 | // The type of the profile. 96 | // Example: `github` 97 | string platform = 2; 98 | 99 | // The url of the profile. 100 | // Example: `http://github.com/jdoe` 101 | string url = 3; 102 | } 103 | -------------------------------------------------------------------------------- /raystack/assets/v1beta2/application.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package raystack.assets.v1beta2; 4 | 5 | import "google/protobuf/struct.proto"; 6 | import "google/protobuf/timestamp.proto"; 7 | 8 | option go_package = "github.com/raystack/proton/assets/v1beta2;assetsv1beta2"; 9 | option java_outer_classname = "ApplicationProto"; 10 | option java_package = "io.raystack.assets"; 11 | 12 | message Application { 13 | // The service/application's ID 14 | string id = 1; 15 | 16 | // Optional: The version of the service. 17 | string version = 2; 18 | 19 | // List of attributes the model has. 20 | google.protobuf.Struct attributes = 3; 21 | 22 | // The timestamp of the service's creation. 23 | google.protobuf.Timestamp create_time = 101; 24 | 25 | // The timestamp when the service was last modified. 26 | google.protobuf.Timestamp update_time = 102; 27 | } 28 | -------------------------------------------------------------------------------- /raystack/assets/v1beta2/asset.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package raystack.assets.v1beta2; 4 | 5 | import "google/protobuf/any.proto"; 6 | import "google/protobuf/timestamp.proto"; 7 | import "raystack/assets/v1beta2/common.proto"; 8 | 9 | option go_package = "github.com/raystack/proton/assets/v1beta2;assetsv1beta2"; 10 | option java_outer_classname = "AssetsProto"; 11 | option java_package = "io.raystack.assets"; 12 | 13 | // Asset is a resource that represents any type of asset. 14 | message Asset { 15 | // The unique identifier of the asset. 16 | // Example: `user:jdoe` or `group:accounting`. 17 | string urn = 1; 18 | 19 | // The name of the asset. 20 | // Example: `John Doe` or `Accounting`. 21 | string name = 2; 22 | 23 | // The source of the asset. 24 | // Example: `github` or `bigquery`. 25 | string service = 3; 26 | 27 | // The type of the asset. 28 | // Example: `user` or `group`. 29 | string type = 4; 30 | 31 | // The REST URL for accessing the resource. URL returns the resource itself. 32 | // Example: `https://xyz.com/v1/users/user-123` 33 | string url = 5; 34 | 35 | // The description of the resource. 36 | // Example: `This resource is being used for storing important number` 37 | string description = 6; 38 | 39 | // Represents Data in asset, can be of type bucket, dashboard, group ... user 40 | google.protobuf.Any data = 7; 41 | 42 | // The ownership of the job. 43 | // For an example check out Owner. 44 | repeated raystack.assets.v1beta2.Owner owners = 31; 45 | 46 | // The lineage of the job. 47 | // For an example check out lineage schema. 48 | raystack.assets.v1beta2.Lineage lineage = 32; 49 | 50 | //Optional. List of labels the user has. 51 | map labels = 33; 52 | 53 | // The timestamp of the generated event. 54 | // Event schemas is defined in the common event schema. 55 | raystack.assets.v1beta2.Event event = 100; 56 | 57 | // The timestamp when the asset was created. 58 | // This information is expected to be maintained by the system. 59 | google.protobuf.Timestamp create_time = 101; 60 | 61 | // The timestamp when the asset was last modified. 62 | // This information is expected to be maintained by the system. 63 | google.protobuf.Timestamp update_time = 102; 64 | } 65 | -------------------------------------------------------------------------------- /raystack/assets/v1beta2/bucket.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package raystack.assets.v1beta2; 4 | 5 | import "google/protobuf/struct.proto"; 6 | import "google/protobuf/timestamp.proto"; 7 | import "raystack/assets/v1beta2/common.proto"; 8 | 9 | option go_package = "github.com/raystack/proton/assets/v1beta2;assetsv1beta2"; 10 | option java_outer_classname = "BucketProto"; 11 | option java_package = "io.raystack.assets"; 12 | 13 | message Bucket { 14 | // The description of the bucket. 15 | // Example: `This bucket was created by the product team.` 16 | string description = 1; 17 | 18 | // The location of the bucket. Can differ based on cloud storage used. (e.g. GCS, S3, etc) 19 | // Example: `ASIA` 20 | string location = 2; 21 | 22 | // The type of the storage. Can differ based on cloud storage used. (e.g. GCS, S3, etc) 23 | // Example: `STANDARD` 24 | string storage_type = 3; 25 | 26 | // List of blobs in the bucket. 27 | repeated Blob blobs = 4; 28 | 29 | // List of attributes the model has. 30 | google.protobuf.Struct attributes = 10; 31 | 32 | // The timestamp of the bucket's creation. 33 | google.protobuf.Timestamp create_time = 101; 34 | 35 | // The timestamp when the bucket was last modified. 36 | google.protobuf.Timestamp update_time = 102; 37 | } 38 | 39 | message Blob { 40 | // The URN of the blob. 41 | // Example: `location/bucket-name/file-name`. 42 | string urn = 1; 43 | 44 | // The name of the blob. 45 | // Example: `file-name`. 46 | string name = 2; 47 | 48 | // The source of the blob. 49 | // Example: `gcs`. 50 | string source = 3; 51 | 52 | // The length of the object content. 53 | // Example: `300` 54 | int64 size = 4; 55 | 56 | // Delete time of the blob object. 57 | google.protobuf.Timestamp delete_time = 5; 58 | 59 | // Expire time of the blob object. 60 | google.protobuf.Timestamp expire_time = 6; 61 | 62 | // List of attributes the model has. 63 | google.protobuf.Struct attributes = 7; 64 | 65 | // The ownership of the blob. 66 | // For an example check out ownership. 67 | repeated raystack.assets.v1beta2.Owner ownership = 31; 68 | 69 | // The timestamp of the blob's creation. 70 | google.protobuf.Timestamp create_time = 101; 71 | 72 | // The timestamp when the blob was last modified. 73 | google.protobuf.Timestamp update_time = 102; 74 | } 75 | -------------------------------------------------------------------------------- /raystack/assets/v1beta2/common.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package raystack.assets.v1beta2; 4 | 5 | import "google/protobuf/timestamp.proto"; 6 | 7 | option go_package = "github.com/raystack/proton/assets/v1beta2;assetsv1beta2"; 8 | option java_outer_classname = "CommonProto"; 9 | option java_package = "io.raystack.assets"; 10 | 11 | // Event represents an event in the system. 12 | // Event is majorly used to represent the state of the system in the form of events. 13 | // It can be used in any schema which intend to produce events to message bus. 14 | message Event { 15 | // The timestamp of the event. 16 | // Example: `2018-01-01T00:00:00Z`. 17 | google.protobuf.Timestamp timestamp = 1; 18 | 19 | // The activity that created the event. 20 | // Example: `create`, `update`. 21 | string action = 2; 22 | 23 | // The description of the event. 24 | // Example: `user is created from signup form`. 25 | string description = 3; 26 | } 27 | 28 | // Linage represents the relationship of resource to other resources. 29 | // Relation is way of describing the relationship between two resources. 30 | message Lineage { 31 | // The resource that is the source of the relationship. 32 | // Example: a resource that is the parent of another resource. 33 | repeated Resource upstreams = 1; 34 | 35 | // The resource that is the destination of the relationship. 36 | // Example: a resource that is the child of another resource. 37 | repeated Resource downstreams = 2; 38 | } 39 | 40 | message Resource { 41 | // The unique identifier of the resource. 42 | // Example: `user:jdoe` or `group:accounting`. 43 | string urn = 1; 44 | 45 | // The name of the resource. 46 | // Example: `John Doe` or `Accounting`. 47 | string name = 2; 48 | 49 | // The source of the resource. 50 | // Example: `github` or `bigquery`. 51 | string service = 3; 52 | 53 | // The type of the asset. 54 | // Example: `user` or `group`. 55 | string type = 4; 56 | } 57 | 58 | // Owner is a facet that describes the owner of a resource. 59 | message Owner { 60 | // The name of the owner. 61 | // Example: `user:johndoe`. 62 | 63 | string urn = 1; 64 | // The name of the owner. 65 | // Example: `John Doe`. 66 | string name = 2; 67 | 68 | // The role of the owner. 69 | // Example: `admin`, `steward`. 70 | string role = 3; 71 | 72 | // The email of the owner. 73 | // Example: `abc@email.com` 74 | string email = 4; 75 | } 76 | -------------------------------------------------------------------------------- /raystack/assets/v1beta2/dashboard.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package raystack.assets.v1beta2; 4 | 5 | import "google/protobuf/struct.proto"; 6 | import "google/protobuf/timestamp.proto"; 7 | import "raystack/assets/v1beta2/common.proto"; 8 | 9 | option go_package = "github.com/raystack/proton/assets/v1beta2;assetsv1beta2"; 10 | option java_outer_classname = "DashboardProto"; 11 | option java_package = "io.raystack.assets"; 12 | 13 | // Dashboard is a resource that represents a dashboard. 14 | message Dashboard { 15 | // The list of the charts in the dashboard. 16 | // For an example, check the schema of the chart. 17 | repeated Chart charts = 1; 18 | 19 | // List of attributes the model has. 20 | google.protobuf.Struct attributes = 8; 21 | 22 | // The timestamp of the dashboard's creation. 23 | google.protobuf.Timestamp create_time = 101; 24 | 25 | // The timestamp when the dashboard was last modified. 26 | google.protobuf.Timestamp update_time = 102; 27 | } 28 | 29 | message Chart { 30 | // The URN of the chart. 31 | // Example: `chart:1`. 32 | string urn = 1; 33 | 34 | // The name of the chart. 35 | // Example: `My Chart`. 36 | string name = 2; 37 | 38 | // The type of the chart. 39 | // Example: `line`. 40 | string type = 3; 41 | 42 | // The source of the chart. 43 | // Example: `metabase`. 44 | string source = 4; 45 | 46 | // The description of the chart. 47 | // Example: `This is a chart for my dashboard.` 48 | string description = 5; 49 | 50 | // The url of the chart. 51 | // Example: `http://metabase.com/charts/mychart`. 52 | string url = 6; 53 | 54 | // The raw query of the chart. 55 | // Example: `SELECT * FROM my_table`. 56 | string raw_query = 7; 57 | 58 | // The source of the data. 59 | // Example: `bigquery,graphite`. 60 | string data_source = 8; 61 | 62 | // The dashboard ur of the chart. 63 | // Example: `dashboard:1`. 64 | string dashboard_urn = 9; 65 | 66 | // The source of the dashboard of the chart. 67 | // Example: `metabase`. 68 | string dashboard_source = 10; 69 | 70 | // The ownership of the dashboard. 71 | // For an example check out ownership. 72 | repeated raystack.assets.v1beta2.Owner owners = 31; 73 | 74 | // List of properties the model has. 75 | google.protobuf.Struct attributes = 32; 76 | 77 | // The lineage of the chart. 78 | // For an example check out lineage schema. 79 | raystack.assets.v1beta2.Lineage lineage = 33; 80 | 81 | // The timestamp when the object was created. 82 | google.protobuf.Timestamp create_time = 34; 83 | 84 | // The timestamp when the object was last modified. 85 | google.protobuf.Timestamp update_time = 35; 86 | 87 | // The timestamp of the generated event. 88 | // Event schemas is defined in the common event schema. 89 | raystack.assets.v1beta2.Event event = 100; 90 | } 91 | -------------------------------------------------------------------------------- /raystack/assets/v1beta2/experiment.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package raystack.assets.v1beta2; 4 | 5 | import "google/protobuf/struct.proto"; 6 | import "google/protobuf/timestamp.proto"; 7 | 8 | option go_package = "github.com/raystack/proton/assets/v1beta2;assetsv1beta2"; 9 | option java_outer_classname = "ExperimentProto"; 10 | option java_package = "io.raystack.assets"; 11 | 12 | // An experiment is the set of configurations and filters that allow for 13 | // systematically varying some independent variables to impact some other 14 | // dependent variables. 15 | message Experiment { 16 | // Instance of configurations to be compared in the experiment. 17 | message Variant { 18 | // Name of the experiment variant. 19 | string name = 1; 20 | 21 | // Traffic percent enabled for the variant. 22 | float traffic_percent = 2; 23 | 24 | // Indicated whether the variant is the control for the experiment. 25 | bool is_control = 3; 26 | 27 | // List of properties the entity has. 28 | google.protobuf.Struct attributes = 4; 29 | 30 | // Whether the variant has been promoted to all users. 31 | bool is_promoted = 5; 32 | } 33 | 34 | // Optional: Type of the entity being experimented over. ex: customer, session, 35 | // device, driver etc. 36 | string entity = 1; 37 | 38 | // Optional: Percentage of the traffic that the experiment is enabled for. 39 | float traffic_percent = 2; 40 | 41 | // The variants of the experiment possibly including the control group. 42 | repeated Variant variants = 3; 43 | 44 | // Optional: List of attributes the experiment has. This could include the 45 | // following: 46 | // - client_id[string]: The ID if the client running the experiment. 47 | // - client_name[string]: The name of the client running the experiment. 48 | // - primary_metric[string]: Used to determine a statistically significant 49 | // winning or losing variant. 50 | // - guardrail_metric[string]: Business metric designed to indirectly measure 51 | // business value and track any potentially misleading or erroneous results 52 | // and analysis. 53 | // - variant_sample_size[double]: Sample size per variant. 54 | // - filter_rules[repeated string]: Textual representation of rules required 55 | // to be satisfied for experiment to be shown to the user. 56 | // - start_time[RFC 3339 string]: The timestamp at which the 57 | // experiment would start. 58 | // - end_time[RFC 3339 string]: The timestamp at which the 59 | // experiment would end. 60 | google.protobuf.Struct attributes = 5; 61 | 62 | // The timestamp of the experiment's creation. 63 | google.protobuf.Timestamp create_time = 101; 64 | 65 | // The timestamp when the experiment was last modified. 66 | google.protobuf.Timestamp update_time = 102; 67 | } 68 | -------------------------------------------------------------------------------- /raystack/assets/v1beta2/feature_table.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package raystack.assets.v1beta2; 4 | 5 | import "google/protobuf/struct.proto"; 6 | import "google/protobuf/timestamp.proto"; 7 | 8 | option go_package = "github.com/raystack/proton/assets/v1beta2;assetsv1beta2"; 9 | option java_outer_classname = "FeatureProto"; 10 | option java_package = "io.raystack.assets"; 11 | 12 | // Feature is a Machine Learning(ML) feature. In machine learning, a feature 13 | // is an individual measurable property, typically represented by a column, 14 | // that serves as an input for Machine Learning (ML) algorithms. 15 | message Feature { 16 | // The name of the field. 17 | string name = 1; 18 | 19 | // The data type associated with an individual ML Feature. 20 | string data_type = 2; 21 | 22 | // Optional: Name of the algorithm used to compute the feature, e.g., PCA, 23 | // bucketing etc. 24 | string algorithm = 3; 25 | 26 | // Optional: Name of the entity instance. 27 | string entity_name = 4; 28 | } 29 | 30 | // FeatureTable is a Machine Learning(ML) feature table or view that 31 | // represents a logical group of time-series feature data as it is found in a 32 | // data source. 33 | message FeatureTable { 34 | // An entity is a collection of semantically related features. Users define 35 | // entities to map to the domain of their use case. For example, a 36 | // ride-hailing service could have customers and drivers as their entities, 37 | // which group related features that correspond to these customers and drivers. 38 | message Entity { 39 | // The unique name of the entity. 40 | string name = 1; 41 | 42 | // A property that uniquely identifies different entities within the 43 | // collection. The join_key property is typically used for joining entities 44 | // with their associated features. 45 | repeated string join_keys = 2; 46 | 47 | // Optional: Arbitrary metadata. 48 | map labels = 3; 49 | 50 | // Optional: Description of the entity. 51 | string description = 4; 52 | 53 | // Optional: Data type of the entity. 54 | string type = 5; 55 | } 56 | 57 | // Optional: Feature store's namespace or project. 58 | string namespace = 1; 59 | 60 | // Optional: The list of entities that this feature view is associated with. 61 | repeated Entity entities = 2; 62 | 63 | // Features that are part of the table, akin to columns in a table. 64 | repeated Feature features = 3; 65 | 66 | // List of attributes the model has. 67 | google.protobuf.Struct attributes = 4; 68 | 69 | // The timestamp when the feature table was created. 70 | google.protobuf.Timestamp create_time = 101; 71 | 72 | // The timestamp when the feature table was last modified. 73 | google.protobuf.Timestamp update_time = 102; 74 | } 75 | -------------------------------------------------------------------------------- /raystack/assets/v1beta2/group.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package raystack.assets.v1beta2; 4 | 5 | import "google/protobuf/struct.proto"; 6 | 7 | option go_package = "github.com/raystack/proton/assets/v1beta2;assetsv1beta2"; 8 | option java_outer_classname = "GroupProto"; 9 | option java_package = "io.raystack.assets"; 10 | 11 | // Group represents a group of users and resources. 12 | message Group { 13 | // The email of the group. 14 | // Example: `xyz@xyz.com` 15 | string email = 1; 16 | 17 | // The members of the group. 18 | // For example look at schema of the member. 19 | repeated Member members = 2; 20 | 21 | // List of attributes the model has. 22 | google.protobuf.Struct attributes = 10; 23 | } 24 | 25 | // Member represents a user. 26 | message Member { 27 | // The unique identifier for the user. 28 | // Example: `user:example`. 29 | string urn = 1; 30 | // The role of the user. 31 | // Example: `owner`. 32 | string role = 2; 33 | } 34 | -------------------------------------------------------------------------------- /raystack/assets/v1beta2/job.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package raystack.assets.v1beta2; 4 | 5 | import "google/protobuf/struct.proto"; 6 | import "google/protobuf/timestamp.proto"; 7 | 8 | option go_package = "github.com/raystack/proton/assets/v1beta2;assetsv1beta2"; 9 | option java_outer_classname = "JobProto"; 10 | option java_package = "io.raystack.assets"; 11 | 12 | // Job is a resource that represents a job. 13 | message Job { 14 | // List of attributes the model has. 15 | google.protobuf.Struct attributes = 10; 16 | 17 | // The timestamp of the job's creation. 18 | google.protobuf.Timestamp create_time = 101; 19 | 20 | // The timestamp when the job was last modified. 21 | google.protobuf.Timestamp update_time = 102; 22 | } 23 | -------------------------------------------------------------------------------- /raystack/assets/v1beta2/metric.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package raystack.assets.v1beta2; 4 | 5 | import "google/protobuf/struct.proto"; 6 | import "google/protobuf/timestamp.proto"; 7 | 8 | option go_package = "github.com/raystack/proton/assets/v1beta2;assetsv1beta2"; 9 | option java_outer_classname = "MetricProto"; 10 | option java_package = "io.raystack.assets"; 11 | 12 | // A metric is a timeseries aggregation over a table that supports zero or more dimensions. 13 | message Metric { 14 | // Namespace of the metric. Something like `{project}-{model}` for dbt and 15 | // `schema` for Cube. 16 | string namespace = 1; 17 | 18 | // The field being used to calculate a metric. 19 | string field_name = 2; 20 | 21 | // Type of the evaluated metric. ex: count_distinct, average etc. 22 | string measure_type = 3; 23 | 24 | // Optional: The query, possibly in SQL representation, with filters and aggregations. 25 | string query = 4; 26 | 27 | // Optional: List of attributes the metric has. This could include the 28 | // following: 29 | // - time_grains[repeated string]: One or more "grains" at which the metric 30 | // can be evaluated. Ex: [day, week, month]. 31 | // - dimensions[repeated string]: A list of dimensions to group or filter the 32 | // metric by. Ex: [plan, country]. 33 | // - filters[repeated map]: Predicates for the metric. Ex: 34 | // [{"field": "is_paying", "operator": "is", "value": "true"}]. 35 | google.protobuf.Struct attributes = 5; 36 | 37 | // The timestamp of the metric's creation. 38 | google.protobuf.Timestamp create_time = 101; 39 | 40 | // The timestamp when the metric was last modified. 41 | google.protobuf.Timestamp update_time = 102; 42 | } 43 | -------------------------------------------------------------------------------- /raystack/assets/v1beta2/model.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package raystack.assets.v1beta2; 4 | 5 | import "google/protobuf/struct.proto"; 6 | import "google/protobuf/timestamp.proto"; 7 | 8 | option go_package = "github.com/raystack/proton/assets/v1beta2;assetsv1beta2"; 9 | option java_outer_classname = "ModelProto"; 10 | option java_package = "io.raystack.assets"; 11 | 12 | // Schema of the model's inputs and outputs. Strongly inspired by 13 | // https://mlflow.org/docs/latest/python_api/mlflow.models.html#mlflow.models.ModelSignature. 14 | message ModelSignature { 15 | // Specification of name and type of a single column in a dataset. 16 | message Parameter { 17 | // Optional: Name of the input or output parameter. 18 | string name = 1; 19 | 20 | // Data type of the parameter. Ex: boolean, double, numpy's dtypes etc. 21 | string data_type = 2; 22 | 23 | // Optional: The tensor shape. 24 | repeated int64 shape = 3; 25 | } 26 | 27 | repeated Parameter inputs = 1; 28 | repeated Parameter outputs = 2; 29 | } 30 | 31 | message ModelVersion { 32 | // The schema of a model version’s inputs and outputs. 33 | ModelSignature signature = 1; 34 | 35 | // Status of the model version. ex: pending/ready/serving/terminated etc. 36 | string status = 2; 37 | 38 | // Version of the model 39 | string version = 3; 40 | 41 | // List of attributes the model version has. This could include the following: 42 | // - mlflow_run_id[string]: MLFlow expriment run ID associated with the model 43 | // version. Relevant for Merlin models. 44 | // - mlflow_run_url[string]: URL of MLFlow experiment run associated with 45 | // the model. Relevant for Merlin models. 46 | // - endpoint_url[string]: Endpoint that the model is serving requests on. 47 | // Ex: http://-... 48 | // - version_endpoint_url[string]: Endpoint that the model is serving 49 | // requests on for the specific version. Ex: 50 | // http://-... 51 | // - traffic[double]: Percentage of traffic being served by this version of 52 | // the model. 53 | // - weight[double]: Weightage for the model version endpoint. 54 | // - params[map]: Parameters for the Model's run. 55 | // - metrics[map]: Metrics for the model's run. 56 | google.protobuf.Struct attributes = 4; 57 | 58 | // Optional. List of labels the model version has. 59 | map labels = 5; 60 | 61 | // The timestamp of the model's creation. 62 | google.protobuf.Timestamp create_time = 101; 63 | 64 | // The timestamp when the model was last modified. 65 | google.protobuf.Timestamp update_time = 102; 66 | } 67 | 68 | // Model represents a Data Science Model commonly used for Machine Learning 69 | // (ML). Models are algorithms trained on data to find patterns or make 70 | // predictions. Models typically consume ML features to generate a meaningful 71 | // output. The inputs can also include contextual information that is made 72 | // available in realtime as part of the request to the model server. 73 | message Model { 74 | // Optional: Model's namespace or project. 75 | string namespace = 1; 76 | 77 | // Flavor of the ML Model. ex: pytorch, tensorflow etc. 78 | string flavor = 2; 79 | 80 | // Optional: Algorithm used to train the ML Model. 81 | string algorithm = 3; 82 | 83 | // Status of the model. ex: active/deleted etc. 84 | string status = 4; 85 | 86 | // Versions of the model, similar to experiment runs in MLFlow and model 87 | // version in Merlin. 88 | repeated ModelVersion versions = 5; 89 | 90 | // List of attributes the model version has. This could include the following: 91 | // - project_id[double]: ID of project the model is present in. 92 | // - project_name[string]: Name of project the model is present in. 93 | // - mlflow_experiment_id[double]: MLFlow experiment ID associated with the 94 | // model. Relevant for Merlin models. 95 | // - mlflow_experiment_url[string]: URL of MLFlow experiment associated with 96 | // the model. Relevant for Merlin models. 97 | // - endpoint_urls[repeated string]: List of URLs associated with endpoints 98 | // that are serving requests for the model. Relevant for Merlin models. 99 | google.protobuf.Struct attributes = 6; 100 | 101 | // The timestamp of the model's creation. 102 | google.protobuf.Timestamp create_time = 101; 103 | 104 | // The timestamp when the model was last modified. 105 | google.protobuf.Timestamp update_time = 102; 106 | } 107 | -------------------------------------------------------------------------------- /raystack/assets/v1beta2/table.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package raystack.assets.v1beta2; 4 | 5 | import "google/protobuf/struct.proto"; 6 | import "google/protobuf/timestamp.proto"; 7 | 8 | option go_package = "github.com/raystack/proton/assets/v1beta2;assetsv1beta2"; 9 | option java_outer_classname = "TableProto"; 10 | option java_package = "io.raystack.assets"; 11 | 12 | // Table is a table in a database. 13 | // It can be a file, a table, a view, a materialized view, a temporary table, or a virtual table. 14 | message Table { 15 | // The metrics about the table. 16 | // For example check the profile schem. 17 | TableProfile profile = 1; 18 | 19 | // The columns of the table. 20 | // Example: 'id', `name`, `age'. 21 | repeated Column columns = 2; 22 | 23 | // preview_fields of the table. 24 | repeated string preview_fields = 3; 25 | 26 | // preview_rows is a multidimensional array containing preview of table 27 | google.protobuf.ListValue preview_rows = 4; 28 | 29 | // List of attributes the model has. 30 | google.protobuf.Struct attributes = 10; 31 | 32 | // The timestamp of the table's creation. 33 | google.protobuf.Timestamp create_time = 101; 34 | 35 | // The timestamp when the table was last modified. 36 | google.protobuf.Timestamp update_time = 102; 37 | } 38 | 39 | // TableProfile is the metrics about the table. 40 | message TableProfile { 41 | // The number of rows in the table. 42 | // Example: `100`. 43 | int64 total_rows = 1; 44 | 45 | // The number of rows in the table that are not deleted. 46 | // Example: `event_timestamp`. 47 | string partition_key = 2; 48 | 49 | string partition_value = 3; 50 | 51 | // The number of how many times table is being used 52 | int64 usage_count = 4; 53 | 54 | // The information of `join` applied to the table 55 | repeated TableCommonJoin common_joins = 5; 56 | 57 | // The information of `filter` applied to the table 58 | repeated string filters = 6; 59 | } 60 | 61 | // Join is the metric of which are other tables that are joined with this table 62 | message TableCommonJoin { 63 | string urn = 1; 64 | 65 | // The number of how many times table is being joined with a certain table urn 66 | int64 count = 2; 67 | 68 | // The information of `join conditions` applied to the table 69 | repeated string conditions = 3; 70 | } 71 | 72 | // Column represents a column in a table or a file. 73 | message Column { 74 | // The name of the column. 75 | // Example: `customer_id`. 76 | string name = 1; 77 | 78 | // The description of the column. 79 | // Example: `The unique id of the customer` 80 | string description = 2; 81 | 82 | // The data type of the column. 83 | // Example: `INT64`. 84 | 85 | string data_type = 3; 86 | // The format of the column. 87 | // Example: `true`. 88 | bool is_nullable = 4; 89 | 90 | // The length of the column. 91 | // Example: `10`. 92 | int64 length = 5; 93 | 94 | // The profile of the column. 95 | ColumnProfile profile = 6; 96 | 97 | // To capture nested columns. 98 | repeated Column columns = 7; 99 | 100 | // Representation of the column properties. 101 | // Properties facet can be used to set custom properties, tags and labels for a column. 102 | google.protobuf.Struct attributes = 31; 103 | } 104 | 105 | message ColumnProfile { 106 | string min = 1; 107 | string max = 2; 108 | double avg = 3; 109 | double med = 4; 110 | int64 unique = 5; 111 | int64 count = 6; 112 | string top = 7; 113 | } 114 | -------------------------------------------------------------------------------- /raystack/assets/v1beta2/topic.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package raystack.assets.v1beta2; 4 | 5 | import "google/protobuf/struct.proto"; 6 | import "google/protobuf/timestamp.proto"; 7 | 8 | option go_package = "github.com/raystack/proton/assets/v1beta2;assetsv1beta2"; 9 | option java_outer_classname = "TopicProto"; 10 | option java_package = "io.raystack.assets"; 11 | 12 | // Topic is resource that represents a logical group of messages 13 | // in message bus like kafka, pubsub, pulsar etc. 14 | message Topic { 15 | // The metrics of the topic. 16 | // For an example check out topic profile schema. 17 | TopicProfile profile = 1; 18 | 19 | // The schema of the topic. 20 | // For an example check out topic schema. 21 | TopicSchema schema = 2; 22 | 23 | // List of attributes the model has. 24 | google.protobuf.Struct attributes = 10; 25 | 26 | // The timestamp of the topic's creation. 27 | google.protobuf.Timestamp create_time = 101; 28 | 29 | // The timestamp when the topic was last modified. 30 | google.protobuf.Timestamp update_time = 102; 31 | } 32 | 33 | // TopicProfile is the profile of the topic. 34 | message TopicProfile { 35 | // The throughput of the topic. 36 | // Example: `1m/minute`. 37 | string throughput = 1; 38 | 39 | // The number of partitions in the topic. 40 | // Example: `12`. 41 | int64 number_of_partitions = 2; 42 | } 43 | 44 | // TopicSchema represents a schema for message bus. 45 | // It is facet used to specify the schema of a message bus. 46 | message TopicSchema { 47 | string schema_url = 1; 48 | string format = 2; 49 | } 50 | -------------------------------------------------------------------------------- /raystack/assets/v1beta2/user.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package raystack.assets.v1beta2; 4 | 5 | import "google/protobuf/struct.proto"; 6 | import "google/protobuf/timestamp.proto"; 7 | 8 | option go_package = "github.com/raystack/proton/assets/v1beta2;assetsv1beta2"; 9 | option java_outer_classname = "UserProto"; 10 | option java_package = "io.raystack.assets"; 11 | 12 | // User is a person who uses or operates something. 13 | // It can be a user of the system, or a user of a device. 14 | // User is a resource that represents a user. 15 | message User { 16 | // The email address of the user. 17 | // Example: `job.deo@gmail.com` 18 | string email = 3; 19 | 20 | // The username of the user. 21 | // Example: `johndoe` 22 | string username = 4; 23 | 24 | // The first name of the user. 25 | // Example: `john` 26 | string first_name = 5; 27 | 28 | // The last name of the user. 29 | // Example: `doe` 30 | string last_name = 6; 31 | 32 | // The full name of the user. 33 | // Example: `john mayer doe` 34 | string full_name = 7; 35 | 36 | // The display name of the user. 37 | // Example: `John M. Doe` 38 | string display_name = 8; 39 | 40 | // The job title of the user. 41 | // Example: `data engineer` 42 | string title = 9; 43 | 44 | // The status of the user. 45 | // Example: `active` 46 | string status = 10; 47 | 48 | // The email of the manger of the user. 49 | // Example: `rambo.ryan@gmail.com` 50 | string manager_email = 11; 51 | 52 | // List of the user social media accounts. 53 | // For an example check out the profile schema. 54 | repeated Profile profiles = 21; 55 | 56 | // List of the groups user belongs to. 57 | // A user can be part of multiple groups and have a different role in every group. 58 | repeated Membership memberships = 22; 59 | 60 | // List of attributes the model has. 61 | google.protobuf.Struct attributes = 30; 62 | 63 | // The timestamp of the user's account creation. 64 | google.protobuf.Timestamp create_time = 101; 65 | 66 | // The timestamp when the user's account details were last modified. 67 | google.protobuf.Timestamp update_time = 102; 68 | } 69 | 70 | // Membership is a relationship between a user and a group. 71 | message Membership { 72 | // The unique identifier of the group. 73 | // Example: `group:mygroup` 74 | string group_urn = 1; 75 | 76 | // The role user has in the group. 77 | // Example: "owner" 78 | repeated string role = 2; 79 | } 80 | 81 | // Profile is a social media account of the user. 82 | message Profile { 83 | // The unique identifier of the profile. 84 | // Example: `profile:jdoe` 85 | string id = 1; 86 | 87 | // The type of the profile. 88 | // Example: `github` 89 | string platform = 2; 90 | 91 | // The url of the profile. 92 | // Example: `http://github.com/jdoe` 93 | string url = 3; 94 | } 95 | -------------------------------------------------------------------------------- /raystack/common/v1/service.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package raystack.common.v1; 4 | 5 | import "google/api/annotations.proto"; 6 | import "google/protobuf/timestamp.proto"; 7 | import "protoc-gen-openapiv2/options/annotations.proto"; 8 | 9 | option go_package = "github.com/raystack/proton/common/v1"; 10 | option java_multiple_files = true; 11 | option java_outer_classname = "CommonServiceProto"; 12 | option java_package = "io.raystack.proton.common"; 13 | option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { 14 | info: {version: "0.1.0"}; 15 | external_docs: {description: "Common endpoints for all services"} 16 | schemes: HTTP; 17 | }; 18 | 19 | service CommonService { 20 | rpc GetVersion(GetVersionRequest) returns (GetVersionResponse) { 21 | option (google.api.http) = { 22 | post: "/v1/version" 23 | body: "*" 24 | }; 25 | } 26 | } 27 | 28 | message GetVersionRequest { 29 | Version client = 1; 30 | } 31 | 32 | message GetVersionResponse { 33 | Version server = 1; 34 | } 35 | 36 | message Version { 37 | string version = 1; 38 | string commit = 2; 39 | google.protobuf.Timestamp build_time = 3; 40 | string lang_version = 4; 41 | string os = 5; 42 | string architecture = 6; 43 | } 44 | -------------------------------------------------------------------------------- /raystack/entropy/v1beta1/module.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package raystack.entropy.v1beta1; 4 | 5 | import "google/api/annotations.proto"; 6 | import "google/protobuf/struct.proto"; 7 | import "google/protobuf/timestamp.proto"; 8 | 9 | option go_package = "github.com/raystack/proton/entropy/v1beta1;entropyv1beta1"; 10 | option java_multiple_files = true; 11 | option java_outer_classname = "ModuleServiceProto"; 12 | option java_package = "io.raystack.proton.entropy.v1beta1"; 13 | 14 | service ModuleService { 15 | rpc ListModules(ListModulesRequest) returns (ListModulesResponse) { 16 | option (google.api.http) = {get: "/v1beta1/modules"}; 17 | } 18 | 19 | rpc GetModule(GetModuleRequest) returns (GetModuleResponse) { 20 | option (google.api.http) = {get: "/v1beta1/modules/{urn}"}; 21 | } 22 | 23 | rpc CreateModule(CreateModuleRequest) returns (CreateModuleResponse) { 24 | option (google.api.http) = { 25 | post: "/v1beta1/modules" 26 | body: "module" 27 | }; 28 | } 29 | 30 | rpc UpdateModule(UpdateModuleRequest) returns (UpdateModuleResponse) { 31 | option (google.api.http) = { 32 | patch: "/v1beta1/modules/{urn}" 33 | body: "*" 34 | }; 35 | } 36 | 37 | rpc DeleteModule(DeleteModuleRequest) returns (DeleteModuleResponse) { 38 | option (google.api.http) = {delete: "/v1beta1/modules/{urn}"}; 39 | } 40 | } 41 | 42 | message Module { 43 | string urn = 1; 44 | string name = 2; 45 | string project = 3; 46 | google.protobuf.Timestamp created_at = 4; 47 | google.protobuf.Timestamp updated_at = 5; 48 | reserved 6; // removed the ModuleSpec field. 49 | google.protobuf.Value configs = 7; 50 | } 51 | 52 | message ListModulesRequest { 53 | string project = 1; 54 | } 55 | 56 | message ListModulesResponse { 57 | repeated Module modules = 1; 58 | } 59 | 60 | message GetModuleRequest { 61 | string urn = 1; 62 | } 63 | 64 | message GetModuleResponse { 65 | Module module = 1; 66 | } 67 | 68 | message CreateModuleRequest { 69 | Module module = 1; 70 | } 71 | 72 | message CreateModuleResponse { 73 | Module module = 1; 74 | } 75 | 76 | message UpdateModuleRequest { 77 | string urn = 1; 78 | reserved 2; // removed the ModuleSpec field. 79 | google.protobuf.Value configs = 3; 80 | } 81 | 82 | message UpdateModuleResponse { 83 | Module module = 1; 84 | } 85 | 86 | message DeleteModuleRequest { 87 | string urn = 1; 88 | } 89 | 90 | message DeleteModuleResponse {} 91 | -------------------------------------------------------------------------------- /raystack/entropy/v1beta1/resource.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package raystack.entropy.v1beta1; 4 | 5 | import "google/api/annotations.proto"; 6 | import "google/protobuf/struct.proto"; 7 | import "google/protobuf/timestamp.proto"; 8 | 9 | option go_package = "github.com/raystack/proton/entropy/v1beta1;entropyv1beta1"; 10 | option java_multiple_files = true; 11 | option java_outer_classname = "ResourceServiceProto"; 12 | option java_package = "io.raystack.proton.entropy.v1beta1"; 13 | 14 | service ResourceService { 15 | rpc ListResources(ListResourcesRequest) returns (ListResourcesResponse) { 16 | option (google.api.http) = {get: "/v1beta1/resources"}; 17 | } 18 | 19 | rpc GetResource(GetResourceRequest) returns (GetResourceResponse) { 20 | option (google.api.http) = {get: "/v1beta1/resources/{urn}"}; 21 | } 22 | 23 | rpc CreateResource(CreateResourceRequest) returns (CreateResourceResponse) { 24 | option (google.api.http) = { 25 | post: "/v1beta1/resources" 26 | body: "resource" 27 | }; 28 | } 29 | 30 | rpc UpdateResource(UpdateResourceRequest) returns (UpdateResourceResponse) { 31 | option (google.api.http) = { 32 | patch: "/v1beta1/resources/{urn}" 33 | body: "*" 34 | }; 35 | } 36 | 37 | rpc DeleteResource(DeleteResourceRequest) returns (DeleteResourceResponse) { 38 | option (google.api.http) = {delete: "/v1beta1/resources/{urn}"}; 39 | } 40 | 41 | rpc ApplyAction(ApplyActionRequest) returns (ApplyActionResponse) { 42 | option (google.api.http) = { 43 | post: "/v1beta1/resources/{urn}/actions/{action}" 44 | body: "params" 45 | }; 46 | } 47 | 48 | rpc GetLog(GetLogRequest) returns (stream GetLogResponse) { 49 | option (google.api.http) = {get: "/v1beta1/resources/{urn}/logs"}; 50 | } 51 | 52 | rpc GetResourceRevisions(GetResourceRevisionsRequest) returns (GetResourceRevisionsResponse) { 53 | option (google.api.http) = {get: "/v1beta1/resources/{urn}/revisions"}; 54 | } 55 | } 56 | 57 | message ResourceDependency { 58 | // Key should be as defined by the module being used for 59 | // the resource. 60 | string key = 1; 61 | 62 | // Value should refer to an existing resource via URN. 63 | string value = 2; 64 | } 65 | 66 | message ResourceSpec { 67 | google.protobuf.Value configs = 1; 68 | 69 | // dependencies can be used to refer to other existing resources 70 | // as dependency of this resource. 71 | repeated ResourceDependency dependencies = 2; 72 | } 73 | 74 | message ListString { 75 | repeated string values = 1; 76 | } 77 | 78 | message LogOptions { 79 | map filters = 1; 80 | } 81 | 82 | message ResourceState { 83 | enum Status { 84 | STATUS_UNSPECIFIED = 0; 85 | STATUS_PENDING = 1; 86 | STATUS_ERROR = 2; 87 | STATUS_DELETED = 3; 88 | STATUS_COMPLETED = 4; 89 | } 90 | 91 | Status status = 1; 92 | google.protobuf.Value output = 2; 93 | bytes module_data = 3; 94 | LogOptions log_options = 4; 95 | } 96 | 97 | message Resource { 98 | string urn = 1; 99 | string kind = 2; 100 | string name = 3; 101 | string project = 4; 102 | map labels = 5; 103 | google.protobuf.Timestamp created_at = 6; 104 | google.protobuf.Timestamp updated_at = 7; 105 | 106 | ResourceSpec spec = 8; 107 | ResourceState state = 9; 108 | } 109 | 110 | message ListResourcesRequest { 111 | string project = 1; 112 | string kind = 2; 113 | } 114 | 115 | message ListResourcesResponse { 116 | repeated Resource resources = 1; 117 | } 118 | 119 | message GetResourceRequest { 120 | string urn = 1; 121 | } 122 | 123 | message GetResourceResponse { 124 | Resource resource = 1; 125 | } 126 | 127 | message CreateResourceRequest { 128 | Resource resource = 1; 129 | } 130 | 131 | message CreateResourceResponse { 132 | Resource resource = 1; 133 | } 134 | 135 | message UpdateResourceRequest { 136 | string urn = 1; 137 | ResourceSpec new_spec = 2; 138 | map labels = 3; 139 | } 140 | 141 | message UpdateResourceResponse { 142 | Resource resource = 1; 143 | } 144 | 145 | message DeleteResourceRequest { 146 | string urn = 1; 147 | } 148 | 149 | message DeleteResourceResponse {} 150 | 151 | message ApplyActionRequest { 152 | string urn = 1; 153 | string action = 2; 154 | google.protobuf.Value params = 3; 155 | map labels = 4; 156 | } 157 | 158 | message ApplyActionResponse { 159 | Resource resource = 1; 160 | } 161 | 162 | message LogChunk { 163 | bytes data = 1; 164 | map labels = 2; 165 | } 166 | 167 | message GetLogRequest { 168 | string urn = 1; 169 | map filter = 6; 170 | } 171 | 172 | message GetLogResponse { 173 | LogChunk chunk = 1; 174 | } 175 | 176 | message ResourceRevision { 177 | string id = 1; 178 | string urn = 2; 179 | map labels = 3; 180 | google.protobuf.Timestamp created_at = 4; 181 | 182 | ResourceSpec spec = 5; 183 | string reason = 6; 184 | } 185 | 186 | message GetResourceRevisionsRequest { 187 | string urn = 1; 188 | } 189 | 190 | message GetResourceRevisionsResponse { 191 | repeated ResourceRevision revisions = 1; 192 | } 193 | -------------------------------------------------------------------------------- /raystack/optimus/core/v1beta1/backup.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package raystack.optimus.core.v1beta1; 4 | 5 | import "google/api/annotations.proto"; 6 | import "google/protobuf/timestamp.proto"; 7 | import "protoc-gen-openapiv2/options/annotations.proto"; 8 | 9 | option go_package = "github.com/raystack/proton/optimus"; 10 | option java_multiple_files = true; 11 | option java_outer_classname = "BackupServiceManager"; 12 | option java_package = "org.raystack.proton.optimus"; 13 | // These annotations are used when generating the OpenAPI file. 14 | option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { 15 | info: {version: "0.1"}; 16 | external_docs: {description: "Optimus Backup Service"} 17 | schemes: HTTP; 18 | host: "127.0.0.1:9100"; 19 | base_path: "/api"; 20 | }; 21 | 22 | service BackupService { 23 | rpc CreateBackup(CreateBackupRequest) returns (CreateBackupResponse) { 24 | option (google.api.http) = { 25 | post: "/v1beta1/project/{project_name}/namespace/{namespace_name}/datastore/{datastore_name}/backup" 26 | body: "*" 27 | }; 28 | } 29 | rpc ListBackups(ListBackupsRequest) returns (ListBackupsResponse) { 30 | option (google.api.http) = {get: "/v1beta1/project/{project_name}/namespace/{namespace_name}/datastore/{datastore_name}/backup"}; 31 | } 32 | rpc GetBackup(GetBackupRequest) returns (GetBackupResponse) { 33 | option (google.api.http) = {get: "/v1/project/{project_name}/namespace/{namespace_name}/datastore/{datastore_name}/backup/{id}"}; 34 | } 35 | } 36 | 37 | message IgnoredResource { 38 | string name = 1; 39 | string reason = 2; 40 | } 41 | 42 | message CreateBackupRequest { 43 | reserved 3, 6, 8; 44 | 45 | string project_name = 1; 46 | string datastore_name = 2; 47 | string namespace_name = 4; 48 | string description = 5; 49 | map config = 7; 50 | 51 | repeated string resource_names = 9; 52 | } 53 | 54 | message CreateBackupResponse { 55 | reserved 2; 56 | 57 | repeated string resource_names = 1; 58 | repeated IgnoredResource ignored_resources = 3; 59 | string backup_id = 4; 60 | } 61 | 62 | message ListBackupsRequest { 63 | string project_name = 1; 64 | string datastore_name = 2; 65 | string namespace_name = 3; 66 | } 67 | 68 | message ListBackupsResponse { 69 | repeated BackupSpec backups = 1; 70 | } 71 | 72 | message BackupSpec { 73 | reserved 2; 74 | 75 | string id = 1; 76 | google.protobuf.Timestamp created_at = 3; 77 | string description = 4; 78 | map config = 5; 79 | repeated string resource_names = 6; 80 | } 81 | 82 | message GetBackupRequest { 83 | string project_name = 1; 84 | string datastore_name = 2; 85 | string namespace_name = 3; 86 | string id = 4; 87 | } 88 | 89 | message GetBackupResponse { 90 | reserved 2; 91 | 92 | BackupSpec spec = 1; 93 | } 94 | -------------------------------------------------------------------------------- /raystack/optimus/core/v1beta1/job_run.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package raystack.optimus.core.v1beta1; 4 | 5 | import "google/api/annotations.proto"; 6 | import "google/protobuf/duration.proto"; 7 | import "google/protobuf/timestamp.proto"; 8 | import "protoc-gen-openapiv2/options/annotations.proto"; 9 | import "raystack/optimus/core/v1beta1/job_spec.proto"; 10 | 11 | option go_package = "github.com/raystack/proton/optimus"; 12 | option java_multiple_files = true; 13 | option java_outer_classname = "JobRunManager"; 14 | option java_package = "org.raystack.proton.optimus"; 15 | // These annotations are used when generating the OpenAPI file. 16 | option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { 17 | info: {version: "0.1"}; 18 | external_docs: {description: "Optimus Job Run Service"} 19 | schemes: HTTP; 20 | host: "127.0.0.1:9100"; 21 | base_path: "/api"; 22 | }; 23 | 24 | // todo: should this not be called, scheduler service, as this will also, manage the runtime functions , like airflow events 25 | service JobRunService { 26 | // JobRunInput is used to fetch task/hook compiled configuration and assets. 27 | rpc JobRunInput(JobRunInputRequest) returns (JobRunInputResponse) { 28 | option (google.api.http) = { 29 | post: "/v1beta1/project/{project_name}/job/{job_name}/run_input" 30 | body: "*" 31 | }; 32 | } 33 | // JobRun returns the current and past run status of jobs on a given range 34 | rpc JobRun(JobRunRequest) returns (JobRunResponse) { 35 | option (google.api.http) = {get: "/v1beta1/project/{project_name}/job/{job_name}/run"}; 36 | } 37 | // RegisterJobEvent notifies optimus service about an event related to job 38 | rpc RegisterJobEvent(RegisterJobEventRequest) returns (RegisterJobEventResponse) { 39 | option (google.api.http) = { 40 | post: "/v1beta1/project/{project_name}/namespace/{namespace_name}/job/{job_name}/event" 41 | body: "*" 42 | }; 43 | } 44 | // UploadToScheduler comiles jobSpec from database into DAGs and uploads the generated DAGs to scheduler 45 | rpc UploadToScheduler(UploadToSchedulerRequest) returns (UploadToSchedulerResponse) { 46 | option (google.api.http) = { 47 | put: "/v1beta1/project/{project_name}/upload" 48 | body: "*" 49 | }; 50 | } 51 | } 52 | 53 | message UploadToSchedulerRequest { 54 | string project_name = 1; 55 | optional string namespace_name = 2; 56 | } 57 | 58 | message UploadToSchedulerResponse { 59 | bool status = 1; 60 | string error_message = 2; 61 | } 62 | 63 | message RegisterJobEventRequest { 64 | string project_name = 1; 65 | string job_name = 2; 66 | string namespace_name = 3; 67 | 68 | JobEvent event = 4; 69 | } 70 | 71 | message RegisterJobEventResponse {} 72 | 73 | message JobRunInputRequest { 74 | reserved 3; 75 | 76 | string project_name = 1; 77 | string job_name = 2; 78 | google.protobuf.Timestamp scheduled_at = 4; 79 | 80 | string instance_name = 5; 81 | InstanceSpec.Type instance_type = 6; 82 | 83 | // either set job_name if this is a scheduled execution 84 | // or set jobrun_id if this is a manual triggered execution 85 | // and not really registered as a valid job 86 | string jobrun_id = 7; 87 | } 88 | 89 | message JobRunRequest { 90 | string project_name = 1; 91 | string job_name = 2; 92 | google.protobuf.Timestamp start_date = 3; 93 | google.protobuf.Timestamp end_date = 4; 94 | repeated string filter = 5; 95 | } 96 | 97 | message JobRunResponse { 98 | repeated JobRun job_runs = 1; 99 | } 100 | 101 | message InstanceSpec { 102 | reserved 2, 4; 103 | 104 | string state = 1; 105 | 106 | // deprecated 107 | // google.protobuf.Timestamp scheduled_at = 2; 108 | // deprecated 109 | // string job_name = 4; 110 | 111 | repeated InstanceSpecData data = 3; 112 | google.protobuf.Timestamp executed_at = 5; 113 | 114 | enum Type { 115 | TYPE_UNSPECIFIED = 0; 116 | TYPE_TASK = 1; 117 | TYPE_HOOK = 2; 118 | } 119 | string name = 6; 120 | Type type = 7; 121 | } 122 | 123 | message InstanceSpecData { 124 | reserved 3, 4; 125 | 126 | string name = 1; 127 | string value = 2; 128 | 129 | // type of data, could be an env var or file 130 | enum Type { 131 | TYPE_UNSPECIFIED = 0; 132 | TYPE_ENV = 1; 133 | TYPE_FILE = 2; 134 | } 135 | Type type = 5; 136 | } 137 | 138 | message JobRunInputResponse { 139 | map envs = 1; 140 | map files = 2; 141 | map secrets = 3; 142 | } 143 | 144 | message TaskWindow { 145 | google.protobuf.Duration size = 1; 146 | google.protobuf.Duration offset = 2; 147 | string truncate_to = 3; 148 | } 149 | -------------------------------------------------------------------------------- /raystack/optimus/core/v1beta1/job_spec.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package raystack.optimus.core.v1beta1; 4 | 5 | import "google/api/annotations.proto"; 6 | import "google/protobuf/duration.proto"; 7 | import "google/protobuf/struct.proto"; 8 | import "google/protobuf/timestamp.proto"; 9 | import "protoc-gen-openapiv2/options/annotations.proto"; 10 | import "raystack/optimus/core/v1beta1/status.proto"; 11 | 12 | option go_package = "github.com/raystack/proton/optimus"; 13 | option java_multiple_files = true; 14 | option java_outer_classname = "JobSpecificationServiceManager"; 15 | option java_package = "org.raystack.proton.optimus"; 16 | // These annotations are used when generating the OpenAPI file. 17 | option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { 18 | info: {version: "0.1"}; 19 | external_docs: {description: "Optimus Job Specification Service"} 20 | schemes: HTTP; 21 | host: "127.0.0.1:9100"; 22 | base_path: "/api"; 23 | }; 24 | 25 | service JobSpecificationService { 26 | // DeployJobSpecification schedules jobs for execution 27 | // returns a stream of messages which can be used to track the progress 28 | // of deployments. Message containing ack are status events other are progress 29 | // events 30 | // State of the world request 31 | rpc DeployJobSpecification(stream DeployJobSpecificationRequest) returns (stream DeployJobSpecificationResponse) {} 32 | 33 | // JobInspect return a new jobSpec for a namespace which belongs to a project 34 | rpc JobInspect(JobInspectRequest) returns (JobInspectResponse) { 35 | option (google.api.http) = { 36 | post: "/v1beta1/project/{project_name}/namespace/{namespace_name}/job/inspect" 37 | body: "*" 38 | }; 39 | } 40 | 41 | // CreateJobSpecification registers a new job for a namespace which belongs to a project 42 | rpc CreateJobSpecification(CreateJobSpecificationRequest) returns (CreateJobSpecificationResponse) { 43 | option (google.api.http) = { 44 | post: "/v1beta1/project/{project_name}/namespace/{namespace_name}/job" 45 | body: "*" 46 | }; 47 | } 48 | 49 | // AddJobSpecification registers new jobs for a namespace which belongs to the given project 50 | rpc AddJobSpecifications(AddJobSpecificationsRequest) returns (AddJobSpecificationsResponse) { 51 | option (google.api.http) = { 52 | post: "/v1beta1/project/{project_name}/namespace/{namespace_name}/jobs" 53 | body: "*" 54 | }; 55 | } 56 | 57 | // UpdateJobSpecifications modify jobs for a namespace which belongs to the given project 58 | rpc UpdateJobSpecifications(UpdateJobSpecificationsRequest) returns (UpdateJobSpecificationsResponse) { 59 | option (google.api.http) = { 60 | put: "/v1beta1/project/{project_name}/namespace/{namespace_name}/jobs" 61 | body: "*" 62 | }; 63 | } 64 | 65 | // GetJobSpecification reads a provided job spec of a namespace 66 | rpc GetJobSpecification(GetJobSpecificationRequest) returns (GetJobSpecificationResponse) { 67 | option (google.api.http) = {get: "/v1beta1/project/{project_name}/namespace/{namespace_name}/job/{job_name}"}; 68 | } 69 | 70 | // GetJobSpecifications read a job spec for provided filters 71 | rpc GetJobSpecifications(GetJobSpecificationsRequest) returns (GetJobSpecificationsResponse) { 72 | option (google.api.http) = {get: "/v1beta1/jobs"}; 73 | } 74 | 75 | // DeleteJobSpecification deletes a job spec of a namespace 76 | rpc DeleteJobSpecification(DeleteJobSpecificationRequest) returns (DeleteJobSpecificationResponse) { 77 | option (google.api.http) = {delete: "/v1beta1/project/{project_name}/namespace/{namespace_name}/job/{job_name}"}; 78 | } 79 | 80 | // ChangeJobNamespace move a job spec from one namespace to another 81 | rpc ChangeJobNamespace(ChangeJobNamespaceRequest) returns (ChangeJobNamespaceResponse) { 82 | option (google.api.http) = { 83 | post: "/v1beta1/project/{project_name}/change-job-namespace" 84 | body: "*" 85 | }; 86 | } 87 | 88 | // ListJobSpecification returns list of jobs created in a project 89 | rpc ListJobSpecification(ListJobSpecificationRequest) returns (ListJobSpecificationResponse) { 90 | option (google.api.http) = {get: "/v1beta1/project/{project_name}/namespace/{namespace_name}/job"}; 91 | } 92 | 93 | // CheckJobSpecification checks if a job specification is valid 94 | rpc CheckJobSpecification(CheckJobSpecificationRequest) returns (CheckJobSpecificationResponse) { 95 | option (google.api.http) = {post: "/v1beta1/project/{project_name}/job/check"}; 96 | } 97 | // CheckJobSpecifications checks if the job specifications are valid 98 | rpc CheckJobSpecifications(CheckJobSpecificationsRequest) returns (stream CheckJobSpecificationsResponse) {} 99 | 100 | // RefreshJobs do redeployment using the current persisted state. 101 | // It will returns a stream of messages which can be used to track the progress. 102 | rpc RefreshJobs(RefreshJobsRequest) returns (stream RefreshJobsResponse) {} 103 | 104 | // GetDeployJobsStatus check status of job deployment. 105 | // It will returns status of the job deployment and the failure details. 106 | rpc GetDeployJobsStatus(GetDeployJobsStatusRequest) returns (GetDeployJobsStatusResponse) {} 107 | 108 | // ReplaceAllJobSpecifications replaces all jobs in server for a given tenant 109 | rpc ReplaceAllJobSpecifications(stream ReplaceAllJobSpecificationsRequest) returns (stream ReplaceAllJobSpecificationsResponse) {} 110 | 111 | // GetJobTask provides task details specific to plugin used in a job 112 | rpc GetJobTask(GetJobTaskRequest) returns (GetJobTaskResponse) { 113 | option (google.api.http) = {get: "/v1beta1/project/{project_name}/namespace/{namespace_name}/job/{job_name}/task"}; 114 | } 115 | 116 | // GetWindow provides the start and end dates provided a scheduled date 117 | // of the execution window 118 | rpc GetWindow(GetWindowRequest) returns (GetWindowResponse) { 119 | option (google.api.http) = {get: "/v1beta1/window"}; 120 | } 121 | 122 | // UpdateJobState enable / disable job on scheuler 123 | rpc UpdateJobsState(UpdateJobsStateRequest) returns (UpdateJobsStateResponse) { 124 | option (google.api.http) = { 125 | patch: "/v1beta1/project/{project_name}/namespace/{namespace_name}/update-job-state" 126 | body: "*" 127 | }; 128 | } 129 | 130 | // SyncJobsState enable / disable job on scheuler 131 | rpc SyncJobsState(SyncJobsStateRequest) returns (SyncJobsStateResponse) { 132 | option (google.api.http) = { 133 | patch: "/v1beta1/project/{project_name}/namespace/{namespace_name}/sync-job-state" 134 | body: "*" 135 | }; 136 | } 137 | } 138 | 139 | message DeployJobSpecificationRequest { 140 | string project_name = 1; // unique project identifier 141 | repeated JobSpecification jobs = 2; 142 | string namespace_name = 4; 143 | } 144 | 145 | // DeployJobSpecificationResponse hold the value of DeploymentID 146 | // and the log messages 147 | message DeployJobSpecificationResponse { 148 | reserved 1 to 6; 149 | string deployment_id = 7; 150 | Log log_status = 8; 151 | } 152 | 153 | message AddJobSpecificationsRequest { 154 | string project_name = 1; 155 | string namespace_name = 2; 156 | repeated JobSpecification specs = 3; 157 | } 158 | message AddJobSpecificationsResponse { 159 | reserved 1; 160 | string log = 2; 161 | } 162 | 163 | message UpdateJobSpecificationsRequest { 164 | string project_name = 1; 165 | string namespace_name = 2; 166 | repeated JobSpecification specs = 3; 167 | } 168 | message UpdateJobSpecificationsResponse { 169 | string log = 1; 170 | } 171 | 172 | message JobInspectRequest { 173 | string project_name = 1; 174 | string namespace_name = 2; 175 | string job_name = 3; 176 | JobSpecification spec = 4; 177 | google.protobuf.Timestamp scheduled_at = 5; 178 | } 179 | message JobRun { 180 | string state = 1; 181 | google.protobuf.Timestamp scheduled_at = 2; 182 | } 183 | 184 | message JobInspectResponse { 185 | message BasicInfoSection { 186 | JobSpecification job = 1; 187 | repeated string source = 2; 188 | string destination = 3; 189 | repeated Log notice = 4; 190 | } 191 | BasicInfoSection basic_info = 1; 192 | 193 | message JobDependency { 194 | string name = 1; 195 | string host = 2; 196 | string project_name = 3; 197 | string namespace_name = 4; 198 | string task_name = 5; 199 | repeated JobRun runs = 6; 200 | } 201 | message UpstreamSection { 202 | repeated JobDependency external_dependency = 1; 203 | repeated JobDependency internal_dependency = 2; 204 | repeated HttpDependency http_dependency = 3; 205 | 206 | message UnknownDependencies { 207 | string job_name = 1; 208 | string project_name = 2; 209 | string resource_destination = 3; 210 | } 211 | repeated UnknownDependencies unknown_dependencies = 4; 212 | repeated Log notice = 5; 213 | } 214 | UpstreamSection upstreams = 2; 215 | 216 | message DownstreamSection { 217 | repeated JobDependency downstream_jobs = 1; 218 | repeated Log notice = 2; 219 | } 220 | DownstreamSection downstreams = 3; 221 | } 222 | 223 | message CreateJobSpecificationRequest { 224 | string project_name = 1; 225 | string namespace_name = 2; 226 | JobSpecification spec = 3; 227 | } 228 | 229 | message CreateJobSpecificationResponse { 230 | bool success = 1; 231 | string message = 2; 232 | } 233 | 234 | message GetJobSpecificationRequest { 235 | string project_name = 1; 236 | string namespace_name = 2; 237 | string job_name = 3; 238 | } 239 | 240 | message GetJobSpecificationResponse { 241 | JobSpecification spec = 1; 242 | } 243 | 244 | message DeleteJobSpecificationRequest { 245 | string project_name = 1; 246 | string namespace_name = 2; 247 | string job_name = 3; 248 | bool clean_history = 4; 249 | bool force = 5; 250 | } 251 | 252 | message DeleteJobSpecificationResponse { 253 | bool success = 1; 254 | string message = 2; 255 | } 256 | 257 | message ChangeJobNamespaceRequest { 258 | string project_name = 1; 259 | string namespace_name = 2; 260 | string job_name = 3; 261 | string new_namespace_name = 4; 262 | } 263 | 264 | message ChangeJobNamespaceResponse {} 265 | 266 | message ListJobSpecificationRequest { 267 | string project_name = 1; 268 | string namespace_name = 2; 269 | } 270 | 271 | message ListJobSpecificationResponse { 272 | repeated JobSpecification jobs = 1; 273 | } 274 | 275 | message CheckJobSpecificationRequest { 276 | string project_name = 1; 277 | JobSpecification job = 2; 278 | string namespace_name = 3; 279 | } 280 | 281 | message CheckJobSpecificationResponse { 282 | bool success = 1; 283 | } 284 | 285 | message CheckJobSpecificationsRequest { 286 | string project_name = 1; 287 | repeated JobSpecification jobs = 2; 288 | string namespace_name = 3; 289 | } 290 | 291 | message CheckJobSpecificationsResponse { 292 | reserved 1 to 4; 293 | Log log_status = 5; 294 | } 295 | 296 | message JobSpecification { 297 | int32 version = 1; 298 | string name = 2; 299 | string owner = 3; 300 | 301 | string start_date = 4; 302 | string end_date = 5; // optional 303 | string interval = 6; 304 | 305 | bool depends_on_past = 7; // should only execute today if yesterday was completed with success? 306 | bool catch_up = 8 [deprecated = true]; // should backfill till today? 307 | 308 | string task_name = 9; 309 | repeated JobConfigItem config = 10; 310 | 311 | string window_size = 11; 312 | string window_offset = 12; 313 | string window_truncate_to = 13; 314 | 315 | repeated JobDependency dependencies = 14; // static dependencies 316 | map assets = 15; 317 | 318 | repeated JobSpecHook hooks = 16; // optional 319 | 320 | string description = 17; // optional 321 | map labels = 18; 322 | 323 | message Behavior { 324 | // retry behaviour if job failed to execute for the first time 325 | message Retry { 326 | int32 count = 1; 327 | google.protobuf.Duration delay = 2; 328 | bool exponential_backoff = 3; 329 | } 330 | Retry retry = 1; 331 | 332 | // Notifiers are used to set custom alerting in case of job failure/sla_miss 333 | message Notifiers { 334 | JobEvent.Type on = 1; 335 | repeated string channels = 2; 336 | map config = 3; 337 | } 338 | repeated Notifiers notify = 2; 339 | } 340 | Behavior behavior = 19; 341 | 342 | JobMetadata metadata = 20; 343 | 344 | string destination = 21; 345 | repeated string sources = 22; 346 | } 347 | 348 | message JobDependency { 349 | string name = 1; 350 | string type = 2; // intra/inter/extra 351 | HttpDependency http_dependency = 3; // http sensor dependency 352 | } 353 | 354 | message HttpDependency { 355 | string name = 1; 356 | string url = 2; 357 | map headers = 3; 358 | map params = 4; 359 | } 360 | 361 | message JobSpecHook { 362 | string name = 1; 363 | repeated JobConfigItem config = 2; 364 | } 365 | 366 | message JobConfigItem { 367 | string name = 1; 368 | string value = 2; 369 | } 370 | 371 | message JobEvent { 372 | enum Type { 373 | TYPE_UNSPECIFIED = 0; 374 | 375 | TYPE_SLA_MISS = 1; 376 | reserved 2 to 5; 377 | TYPE_JOB_SUCCESS = 6; 378 | TYPE_FAILURE = 7; 379 | 380 | TYPE_TASK_RETRY = 8; 381 | TYPE_TASK_SUCCESS = 9; 382 | TYPE_TASK_START = 10; 383 | TYPE_TASK_FAIL = 11; 384 | 385 | TYPE_SENSOR_RETRY = 12; 386 | TYPE_SENSOR_SUCCESS = 13; 387 | TYPE_SENSOR_START = 14; 388 | TYPE_SENSOR_FAIL = 15; 389 | 390 | TYPE_HOOK_START = 16; 391 | TYPE_HOOK_RETRY = 17; 392 | TYPE_HOOK_FAIL = 18; 393 | TYPE_HOOK_SUCCESS = 19; 394 | } 395 | Type type = 1; 396 | google.protobuf.Struct value = 2; 397 | } 398 | 399 | message JobMetadata { 400 | JobSpecMetadataResource resource = 1; 401 | JobSpecMetadataAirflow airflow = 2; 402 | } 403 | 404 | message JobSpecMetadataResource { 405 | JobSpecMetadataResourceConfig request = 1; 406 | JobSpecMetadataResourceConfig limit = 2; 407 | } 408 | 409 | message JobSpecMetadataResourceConfig { 410 | string cpu = 1; 411 | string memory = 2; 412 | } 413 | 414 | message JobSpecMetadataAirflow { 415 | string pool = 1; 416 | string queue = 2; 417 | } 418 | 419 | message RefreshJobsRequest { 420 | string project_name = 1; 421 | repeated string namespace_names = 2; 422 | repeated string job_names = 3; 423 | } 424 | 425 | message RefreshJobsResponse { 426 | reserved 1 to 5; 427 | Log log_status = 6; 428 | } 429 | 430 | message GetDeployJobsStatusRequest { 431 | string deploy_id = 1; 432 | } 433 | 434 | message GetDeployJobsStatusResponse { 435 | string status = 1; 436 | 437 | repeated DeployJobFailure failures = 2; 438 | int32 success_count = 3; 439 | int32 failure_count = 4; 440 | map unknown_dependencies = 5; 441 | } 442 | 443 | message DeployJobFailure { 444 | string job_name = 1; 445 | string message = 2; 446 | } 447 | 448 | message GetJobSpecificationsRequest { 449 | string project_name = 1; 450 | string resource_destination = 2; 451 | string job_name = 3; 452 | string namespace_name = 4; 453 | } 454 | 455 | message GetJobSpecificationsResponse { 456 | repeated JobSpecification jobs = 1 [deprecated = true]; 457 | repeated JobSpecificationResponse job_specification_responses = 2; 458 | } 459 | 460 | message JobSpecificationResponse { 461 | string project_name = 1; 462 | string namespace_name = 2; 463 | JobSpecification job = 3; 464 | } 465 | 466 | message ReplaceAllJobSpecificationsRequest { 467 | string project_name = 1; 468 | string namespace_name = 2; 469 | repeated JobSpecification jobs = 3; 470 | } 471 | 472 | message ReplaceAllJobSpecificationsResponse { 473 | Log log_status = 1; 474 | } 475 | 476 | message GetJobTaskRequest { 477 | string project_name = 1; 478 | string namespace_name = 2; 479 | string job_name = 3; 480 | } 481 | 482 | message GetJobTaskResponse { 483 | JobTask task = 1; 484 | } 485 | 486 | // JobTask is part of a job that dictates main transformation 487 | // each job has exactly one task 488 | message JobTask { 489 | string name = 1; 490 | string description = 2; 491 | string image = 3; 492 | 493 | message Destination { 494 | string destination = 1; 495 | string type = 2; 496 | } 497 | Destination destination = 4; 498 | 499 | message Dependency { 500 | string dependency = 1; 501 | } 502 | repeated Dependency dependencies = 5; 503 | } 504 | 505 | message GetWindowRequest { 506 | google.protobuf.Timestamp scheduled_at = 1; 507 | string size = 2; 508 | string offset = 3; 509 | string truncate_to = 4; 510 | int32 version = 5; 511 | } 512 | 513 | message GetWindowResponse { 514 | google.protobuf.Timestamp start = 1; 515 | google.protobuf.Timestamp end = 2; 516 | } 517 | 518 | enum JobState { 519 | JOB_STATE_UNSPECIFIED = 0; 520 | JOB_STATE_ENABLED = 1; 521 | JOB_STATE_DISABLED = 2; 522 | } 523 | 524 | message UpdateJobsStateRequest { 525 | string project_name = 1; 526 | string namespace_name = 2; 527 | string remark = 3; 528 | JobState state = 4; 529 | repeated string job_names = 5; 530 | } 531 | 532 | message UpdateJobsStateResponse {} 533 | 534 | message SyncJobsStateRequest { 535 | string project_name = 1; 536 | string namespace_name = 2; 537 | message JobStatePair { 538 | string job_name = 1; 539 | JobState state = 2; 540 | } 541 | repeated JobStatePair job_states = 3; 542 | } 543 | 544 | message SyncJobsStateResponse {} 545 | -------------------------------------------------------------------------------- /raystack/optimus/core/v1beta1/namespace.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package raystack.optimus.core.v1beta1; 4 | 5 | import "google/api/annotations.proto"; 6 | import "protoc-gen-openapiv2/options/annotations.proto"; 7 | 8 | option go_package = "github.com/raystack/proton/optimus"; 9 | option java_multiple_files = true; 10 | option java_outer_classname = "NamespaceServiceManager"; 11 | option java_package = "org.raystack.proton.optimus"; 12 | // These annotations are used when generating the OpenAPI file. 13 | option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { 14 | info: {version: "0.1"}; 15 | external_docs: {description: "Optimus Namespace Service"} 16 | schemes: HTTP; 17 | host: "127.0.0.1:9100"; 18 | base_path: "/api"; 19 | }; 20 | 21 | service NamespaceService { 22 | // RegisterProjectNamespace creates a new namespace for a project 23 | rpc RegisterProjectNamespace(RegisterProjectNamespaceRequest) returns (RegisterProjectNamespaceResponse) { 24 | option (google.api.http) = { 25 | post: "/v1beta1/project/{project_name}/namespace" 26 | body: "*" 27 | }; 28 | } 29 | 30 | // ListProjectNamespaces returns list of namespaces of a project 31 | rpc ListProjectNamespaces(ListProjectNamespacesRequest) returns (ListProjectNamespacesResponse) { 32 | option (google.api.http) = {get: "/v1beta1/project/{project_name}/namespace"}; 33 | } 34 | 35 | // GetNamespace returns namespace details based on project_name and namespace_name 36 | rpc GetNamespace(GetNamespaceRequest) returns (GetNamespaceResponse) { 37 | option (google.api.http) = {get: "/v1beta1/project/{project_name}/namespace/{namespace_name}"}; 38 | } 39 | } 40 | 41 | message RegisterProjectNamespaceRequest { 42 | string project_name = 1; 43 | NamespaceSpecification namespace = 2; 44 | } 45 | 46 | message RegisterProjectNamespaceResponse { 47 | bool success = 1; 48 | string message = 2; 49 | } 50 | 51 | message ListProjectNamespacesRequest { 52 | string project_name = 1; 53 | } 54 | 55 | message ListProjectNamespacesResponse { 56 | repeated NamespaceSpecification namespaces = 1; 57 | } 58 | 59 | message GetNamespaceRequest { 60 | string project_name = 1; 61 | string namespace_name = 2; 62 | } 63 | 64 | message GetNamespaceResponse { 65 | NamespaceSpecification namespace = 1; 66 | } 67 | 68 | message NamespaceSpecification { 69 | string name = 1; 70 | map config = 2; 71 | } 72 | -------------------------------------------------------------------------------- /raystack/optimus/core/v1beta1/project.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package raystack.optimus.core.v1beta1; 4 | 5 | import "google/api/annotations.proto"; 6 | import "protoc-gen-openapiv2/options/annotations.proto"; 7 | 8 | option go_package = "github.com/raystack/proton/optimus"; 9 | option java_multiple_files = true; 10 | option java_outer_classname = "ProjectServiceManager"; 11 | option java_package = "org.raystack.proton.optimus"; 12 | // These annotations are used when generating the OpenAPI file. 13 | option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { 14 | info: {version: "0.1"}; 15 | external_docs: {description: "Optimus Project Service"} 16 | schemes: HTTP; 17 | host: "127.0.0.1:9100"; 18 | base_path: "/api"; 19 | }; 20 | 21 | service ProjectService { 22 | // RegisterProject creates a new optimus project 23 | rpc RegisterProject(RegisterProjectRequest) returns (RegisterProjectResponse) { 24 | option (google.api.http) = { 25 | post: "/v1beta1/project" 26 | body: "*" 27 | }; 28 | } 29 | // ListProjects returns list of registered projects and configurations 30 | rpc ListProjects(ListProjectsRequest) returns (ListProjectsResponse) { 31 | option (google.api.http) = {get: "/v1beta1/project"}; 32 | } 33 | // GetProject returns project details based on project_name 34 | rpc GetProject(GetProjectRequest) returns (GetProjectResponse) { 35 | option (google.api.http) = {get: "/v1beta1/project/{project_name}"}; 36 | } 37 | } 38 | 39 | message RegisterProjectRequest { 40 | reserved 2; 41 | ProjectSpecification project = 1; 42 | } 43 | 44 | message RegisterProjectResponse { 45 | bool success = 1; 46 | string message = 2; 47 | } 48 | 49 | message ListProjectsRequest {} 50 | 51 | message ListProjectsResponse { 52 | repeated ProjectSpecification projects = 1; 53 | } 54 | 55 | message GetProjectRequest { 56 | string project_name = 1; 57 | } 58 | 59 | message GetProjectResponse { 60 | ProjectSpecification project = 1; 61 | } 62 | 63 | message ProjectSpecification { 64 | string name = 1; 65 | map config = 2; 66 | 67 | message ProjectSecret { 68 | string name = 1; 69 | string value = 2; 70 | } 71 | repeated ProjectSecret secrets = 3; 72 | } 73 | -------------------------------------------------------------------------------- /raystack/optimus/core/v1beta1/replay.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package raystack.optimus.core.v1beta1; 4 | 5 | import "google/api/annotations.proto"; 6 | import "google/protobuf/timestamp.proto"; 7 | import "protoc-gen-openapiv2/options/annotations.proto"; 8 | 9 | option go_package = "github.com/raystack/proton/optimus"; 10 | option java_multiple_files = true; 11 | option java_outer_classname = "ReplayServiceManager"; 12 | option java_package = "org.raystack.proton.optimus"; 13 | // These annotations are used when generating the OpenAPI file. 14 | option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { 15 | info: {version: "0.1"}; 16 | external_docs: {description: "Optimus Replay Service"} 17 | schemes: HTTP; 18 | host: "127.0.0.1:9100"; 19 | base_path: "/api"; 20 | }; 21 | 22 | service ReplayService { 23 | rpc Replay(ReplayRequest) returns (ReplayResponse) { 24 | option (google.api.http) = { 25 | post: "/v1beta1/project/{project_name}/replay" 26 | body: "*" 27 | }; 28 | } 29 | rpc ReplayDryRun(ReplayDryRunRequest) returns (ReplayDryRunResponse) { 30 | option (google.api.http) = { 31 | post: "/v1beta1/project/{project_name}/replay-dry-run" 32 | body: "*" 33 | }; 34 | } 35 | rpc ListReplay(ListReplayRequest) returns (ListReplayResponse) { 36 | option (google.api.http) = {get: "/v1beta1/project/{project_name}/replay"}; 37 | } 38 | rpc GetReplay(GetReplayRequest) returns (GetReplayResponse) { 39 | option (google.api.http) = {get: "/v1beta1/project/{project_name}/replay/{replay_id}"}; 40 | } 41 | } 42 | 43 | message ListReplayRequest { 44 | string project_name = 1; 45 | } 46 | 47 | message ListReplayResponse { 48 | repeated GetReplayResponse replays = 1; 49 | } 50 | 51 | message GetReplayRequest { 52 | string replay_id = 1; 53 | string project_name = 2; 54 | } 55 | 56 | message GetReplayResponse { 57 | string id = 1; 58 | string job_name = 2; 59 | string status = 3; 60 | ReplayConfig replay_config = 4; 61 | repeated ReplayRun replay_runs = 5; 62 | } 63 | 64 | message ReplayConfig { 65 | google.protobuf.Timestamp start_time = 1; 66 | google.protobuf.Timestamp end_time = 2; 67 | bool parallel = 3; 68 | map job_config = 4; 69 | string description = 5; 70 | } 71 | 72 | message ReplayRun { 73 | google.protobuf.Timestamp scheduled_at = 1; 74 | string status = 2; 75 | } 76 | 77 | message ReplayDryRunResponse { 78 | repeated ReplayRun replay_runs = 1; 79 | } 80 | 81 | message ReplayRequest { 82 | string project_name = 1; 83 | string job_name = 2; 84 | string namespace_name = 3; 85 | google.protobuf.Timestamp start_time = 4; 86 | google.protobuf.Timestamp end_time = 5; 87 | bool parallel = 6; 88 | string description = 7; 89 | string job_config = 8; 90 | } 91 | 92 | message ReplayDryRunRequest { 93 | string project_name = 1; 94 | string job_name = 2; 95 | string namespace_name = 3; 96 | google.protobuf.Timestamp start_time = 4; 97 | google.protobuf.Timestamp end_time = 5; 98 | bool parallel = 6; 99 | string description = 7; 100 | string job_config = 8; 101 | } 102 | 103 | message ReplayResponse { 104 | string id = 1; 105 | } 106 | -------------------------------------------------------------------------------- /raystack/optimus/core/v1beta1/resource.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package raystack.optimus.core.v1beta1; 4 | 5 | import "google/api/annotations.proto"; 6 | import "google/protobuf/struct.proto"; 7 | import "protoc-gen-openapiv2/options/annotations.proto"; 8 | import "raystack/optimus/core/v1beta1/status.proto"; 9 | 10 | option go_package = "github.com/raystack/proton/optimus"; 11 | option java_multiple_files = true; 12 | option java_outer_classname = "ResourceServiceManager"; 13 | option java_package = "org.raystack.proton.optimus"; 14 | // These annotations are used when generating the OpenAPI file. 15 | option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { 16 | info: {version: "0.1"}; 17 | external_docs: {description: "Optimus Resource Management Service"} 18 | schemes: HTTP; 19 | host: "127.0.0.1:9100"; 20 | base_path: "/api"; 21 | }; 22 | 23 | service ResourceService { 24 | // DeployResourceSpecification migrate all resource specifications of a datastore in project 25 | // State of the world request 26 | rpc DeployResourceSpecification(stream DeployResourceSpecificationRequest) returns (stream DeployResourceSpecificationResponse) {} 27 | // ListResourceSpecification lists all resource specifications of a datastore in project 28 | rpc ListResourceSpecification(ListResourceSpecificationRequest) returns (ListResourceSpecificationResponse) { 29 | option (google.api.http) = {get: "/v1beta1/project/{project_name}/namespace/{namespace_name}/datastore/{datastore_name}/resource"}; 30 | } 31 | 32 | // Database CRUD 33 | // CreateResource registers a new resource of a namespace which belongs to a project 34 | rpc CreateResource(CreateResourceRequest) returns (CreateResourceResponse) { 35 | option (google.api.http) = { 36 | post: "/v1beta1/project/{project_name}/namespace/{namespace_name}/datastore/{datastore_name}/resource" 37 | body: "*" 38 | }; 39 | } 40 | // ReadResource reads a provided resource spec of a namespace 41 | rpc ReadResource(ReadResourceRequest) returns (ReadResourceResponse) { 42 | option (google.api.http) = {get: "/v1beta1/project/{project_name}/namespace/{namespace_name}/datastore/{datastore_name}/resource/{resource_name}"}; 43 | } 44 | // UpdateResource updates a resource specification of a datastore in project 45 | rpc UpdateResource(UpdateResourceRequest) returns (UpdateResourceResponse) { 46 | option (google.api.http) = { 47 | put: "/v1beta1/project/{project_name}/namespace/{namespace_name}/datastore/{datastore_name}/resource" 48 | body: "*" 49 | }; 50 | } 51 | 52 | // ChangeJobNamespace move a job spec from one namespace to another 53 | rpc ChangeResourceNamespace(ChangeResourceNamespaceRequest) returns (ChangeResourceNamespaceResponse) { 54 | option (google.api.http) = { 55 | post: "/v1beta1/project/{project_name}/change-resource-namespace" 56 | body: "*" 57 | }; 58 | } 59 | 60 | // apply a resource from optimus to datastore 61 | rpc ApplyResources(ApplyResourcesRequest) returns (ApplyResourcesResponse) { 62 | option (google.api.http) = { 63 | post: "/v1beta1/project/{project_name}/namespace/{namespace_name}/datastore/{datastore_name}/resources-apply" 64 | body: "*" 65 | }; 66 | } 67 | } 68 | 69 | message DeployResourceSpecificationRequest { 70 | string project_name = 1; 71 | string datastore_name = 2; 72 | repeated ResourceSpecification resources = 3; 73 | string namespace_name = 4; 74 | } 75 | 76 | message DeployResourceSpecificationResponse { 77 | reserved 1 to 4; 78 | Log log_status = 5; 79 | } 80 | 81 | // ListResourceSpecificationRequest lists all resource specifications of a datastore in project 82 | message ListResourceSpecificationRequest { 83 | string project_name = 1; 84 | string datastore_name = 2; 85 | string namespace_name = 3; 86 | } 87 | 88 | message ListResourceSpecificationResponse { 89 | repeated ResourceSpecification resources = 1; 90 | } 91 | 92 | message CreateResourceRequest { 93 | string project_name = 1; 94 | string datastore_name = 2; 95 | ResourceSpecification resource = 3; 96 | string namespace_name = 4; 97 | } 98 | 99 | message CreateResourceResponse { 100 | bool success = 1; 101 | string message = 2; 102 | } 103 | 104 | message ReadResourceRequest { 105 | string project_name = 1; 106 | string datastore_name = 2; 107 | string resource_name = 3; 108 | string namespace_name = 4; 109 | } 110 | 111 | message ReadResourceResponse { 112 | bool success = 1; 113 | string message = 2; 114 | ResourceSpecification resource = 3; 115 | } 116 | 117 | message UpdateResourceRequest { 118 | string project_name = 1; 119 | string datastore_name = 2; 120 | ResourceSpecification resource = 3; 121 | string namespace_name = 4; 122 | } 123 | 124 | message UpdateResourceResponse { 125 | bool success = 1; 126 | string message = 2; 127 | } 128 | 129 | // ResourceSpecification are datastore specification representation of a resource 130 | message ResourceSpecification { 131 | reserved 3; // depricated "datastore" 132 | 133 | int32 version = 1; 134 | string name = 2; 135 | string type = 4; 136 | 137 | google.protobuf.Struct spec = 5; 138 | map assets = 6; 139 | map labels = 7; 140 | } 141 | 142 | message ChangeResourceNamespaceRequest { 143 | string project_name = 1; 144 | string namespace_name = 2; 145 | string datastore_name = 3; 146 | string resource_name = 4; 147 | string new_namespace_name = 5; 148 | } 149 | 150 | message ChangeResourceNamespaceResponse {} 151 | 152 | message ApplyResourcesRequest { 153 | string project_name = 1; 154 | string namespace_name = 2; 155 | string datastore_name = 3; 156 | repeated string resource_names = 4; 157 | } 158 | 159 | message ApplyResourcesResponse { 160 | message ResourceStatus { 161 | string resource_name = 1; 162 | string status = 2; 163 | string reason = 3; 164 | } 165 | 166 | repeated ResourceStatus statuses = 1; 167 | } 168 | -------------------------------------------------------------------------------- /raystack/optimus/core/v1beta1/runtime.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package raystack.optimus.core.v1beta1; 4 | 5 | import "google/api/annotations.proto"; 6 | import "protoc-gen-openapiv2/options/annotations.proto"; 7 | 8 | option go_package = "github.com/raystack/proton/optimus"; 9 | option java_multiple_files = true; 10 | option java_outer_classname = "RuntimeServiceManager"; 11 | option java_package = "org.raystack.proton.optimus"; 12 | // These annotations are used when generating the OpenAPI file. 13 | option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { 14 | info: {version: "0.1"}; 15 | external_docs: {description: "Optimus Runtime Service"} 16 | schemes: HTTP; 17 | host: "127.0.0.1:9100"; 18 | base_path: "/api"; 19 | }; 20 | 21 | // WARNING: This is still in active development and can have breaking changes 22 | service RuntimeService { 23 | // server ping with version 24 | rpc Version(VersionRequest) returns (VersionResponse) { 25 | option (google.api.http) = { 26 | post: "/v1beta1/version" 27 | body: "*" 28 | }; 29 | } 30 | } 31 | 32 | message VersionRequest { 33 | string client = 1; 34 | } 35 | 36 | message VersionResponse { 37 | string server = 1; 38 | } 39 | -------------------------------------------------------------------------------- /raystack/optimus/core/v1beta1/secret.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package raystack.optimus.core.v1beta1; 4 | 5 | import "google/api/annotations.proto"; 6 | import "google/protobuf/timestamp.proto"; 7 | import "protoc-gen-openapiv2/options/annotations.proto"; 8 | 9 | option go_package = "github.com/raystack/proton/optimus"; 10 | option java_multiple_files = true; 11 | option java_outer_classname = "SecretServiceManager"; 12 | option java_package = "org.raystack.proton.optimus"; 13 | // These annotations are used when generating the OpenAPI file. 14 | option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { 15 | info: {version: "0.1"}; 16 | external_docs: {description: "Optimus Secret Management Service"} 17 | schemes: HTTP; 18 | host: "127.0.0.1:9100"; 19 | base_path: "/api"; 20 | }; 21 | 22 | service SecretService { 23 | // RegisterSecret creates a new secret of a project 24 | rpc RegisterSecret(RegisterSecretRequest) returns (RegisterSecretResponse) { 25 | option (google.api.http) = { 26 | post: "/v1beta1/project/{project_name}/secret/{secret_name}" 27 | body: "*" 28 | }; 29 | } 30 | 31 | // UpdateSecret updates secret at project level 32 | rpc UpdateSecret(UpdateSecretRequest) returns (UpdateSecretResponse) { 33 | option (google.api.http) = { 34 | put: "/v1beta1/project/{project_name}/secret/{secret_name}" 35 | body: "*" 36 | }; 37 | } 38 | 39 | // ListSecrets shows the secrets registered for a project 40 | rpc ListSecrets(ListSecretsRequest) returns (ListSecretsResponse) { 41 | option (google.api.http) = {get: "/v1beta1/project/{project_name}/secret"}; 42 | } 43 | 44 | // DeleteSecret deletes a secret for a project 45 | rpc DeleteSecret(DeleteSecretRequest) returns (DeleteSecretResponse) { 46 | option (google.api.http) = {delete: "/v1beta1/project/{project_name}/secret/{secret_name}"}; 47 | } 48 | } 49 | 50 | message RegisterSecretRequest { 51 | string project_name = 1; 52 | string secret_name = 2; 53 | string value = 3; // base64 encoded secret value 54 | string namespace_name = 4; 55 | } 56 | 57 | message RegisterSecretResponse {} 58 | 59 | message UpdateSecretRequest { 60 | string project_name = 1; 61 | string secret_name = 2; 62 | string value = 3; // base64 encoded secret value 63 | string namespace_name = 4; 64 | } 65 | 66 | message UpdateSecretResponse {} 67 | 68 | message ListSecretsRequest { 69 | string project_name = 1; 70 | } 71 | 72 | message ListSecretsResponse { 73 | message Secret { 74 | string name = 1; 75 | string digest = 2; 76 | string namespace = 3; 77 | google.protobuf.Timestamp updated_at = 4; 78 | } 79 | repeated Secret secrets = 1; 80 | } 81 | 82 | message DeleteSecretRequest { 83 | string project_name = 1; 84 | string secret_name = 2; 85 | string namespace_name = 3; 86 | } 87 | 88 | message DeleteSecretResponse {} 89 | -------------------------------------------------------------------------------- /raystack/optimus/core/v1beta1/status.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package raystack.optimus.core.v1beta1; 4 | 5 | option go_package = "github.com/raystack/proton/optimus"; 6 | option java_multiple_files = true; 7 | option java_outer_classname = "Status"; 8 | option java_package = "org.raystack.proton.optimus"; 9 | 10 | message Log { 11 | Level level = 1; 12 | string message = 2; 13 | } 14 | 15 | enum Level { 16 | LEVEL_UNSPECIFIED = 0; 17 | LEVEL_TRACE = 1; 18 | LEVEL_DEBUG = 2; 19 | LEVEL_INFO = 3; 20 | LEVEL_WARNING = 4; 21 | LEVEL_ERROR = 5; 22 | LEVEL_FATAL = 6; 23 | } 24 | -------------------------------------------------------------------------------- /raystack/optimus/integration/v1beta1/event.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package raystack.optimus.integration.v1beta1; 4 | 5 | import "google/protobuf/timestamp.proto"; 6 | import "raystack/optimus/core/v1beta1/job_spec.proto"; 7 | import "raystack/optimus/core/v1beta1/resource.proto"; 8 | 9 | option go_package = "github.com/raystack/proton/optimus"; 10 | option java_multiple_files = true; 11 | option java_outer_classname = "Event"; 12 | option java_package = "org.raystack.proton.optimus"; 13 | 14 | message ResourceChangePayload { 15 | string datastore_name = 1; 16 | raystack.optimus.core.v1beta1.ResourceSpecification resource = 2; 17 | } 18 | 19 | message JobChangePayload { 20 | string job_name = 1; 21 | raystack.optimus.core.v1beta1.JobSpecification job_spec = 2; 22 | } 23 | 24 | message JobRunPayload { 25 | string job_name = 1; 26 | google.protobuf.Timestamp scheduled_at = 2; 27 | string job_run_id = 3; 28 | google.protobuf.Timestamp start_time = 4; 29 | } 30 | 31 | message JobStateChangePayload { 32 | string job_name = 1; 33 | raystack.optimus.core.v1beta1.JobState state = 2; 34 | } 35 | 36 | message OptimusChangeEvent { 37 | enum EventType { 38 | EVENT_TYPE_TYPE_UNSPECIFIED = 0; 39 | 40 | EVENT_TYPE_RESOURCE_CREATE = 1; 41 | EVENT_TYPE_RESOURCE_UPDATE = 2; 42 | 43 | EVENT_TYPE_JOB_CREATE = 3; 44 | EVENT_TYPE_JOB_UPDATE = 4; 45 | EVENT_TYPE_JOB_DELETE = 5; 46 | 47 | EVENT_TYPE_JOB_WAIT_UPSTREAM = 6; 48 | EVENT_TYPE_JOB_IN_PROGRESS = 7; 49 | EVENT_TYPE_JOB_SUCCESS = 8; 50 | EVENT_TYPE_JOB_FAILURE = 9; 51 | 52 | EVENT_TYPE_JOB_STATE_CHANGE = 10; 53 | } 54 | 55 | string event_id = 1; 56 | google.protobuf.Timestamp occurred_at = 2; 57 | 58 | string project_name = 3; 59 | string namespace_name = 4; 60 | EventType event_type = 5; 61 | 62 | oneof payload { 63 | JobChangePayload job_change = 6; 64 | ResourceChangePayload resource_change = 7; 65 | JobRunPayload job_run = 8; 66 | JobStateChangePayload job_state_change = 9; 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /raystack/optimus/plugins/v1beta1/dependency_resolver.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package raystack.optimus.plugins.v1beta1; 4 | 5 | import "google/protobuf/timestamp.proto"; 6 | 7 | option go_package = "github.com/raystack/proton/optimus"; 8 | option java_multiple_files = true; 9 | option java_outer_classname = "DependencyResolverModProto"; 10 | option java_package = "org.raystack.proton.optimus.plugins"; 11 | 12 | // DependencyResolverModService must be implemented by all plugins want to support automatic 13 | // dependency resolution 14 | service DependencyResolverModService { 15 | // GetName returns name of the plugin 16 | rpc GetName(GetNameRequest) returns (GetNameResponse); 17 | 18 | // GenerateDestination derive destination from config and assets 19 | rpc GenerateDestination(GenerateDestinationRequest) returns (GenerateDestinationResponse); 20 | 21 | // GenerateDependencies return names of job destination on which this unit 22 | // is dependent on 23 | rpc GenerateDependencies(GenerateDependenciesRequest) returns (GenerateDependenciesResponse); 24 | 25 | // CompileAssets overrides the default asset compilation behaviour 26 | rpc CompileAssets(CompileAssetsRequest) returns (CompileAssetsResponse); 27 | } 28 | 29 | message GetNameRequest {} 30 | 31 | message GetNameResponse { 32 | string name = 1; 33 | } 34 | 35 | message GenerateDestinationRequest { 36 | reserved 3; 37 | Configs config = 1; 38 | Assets assets = 2; 39 | 40 | PluginOptions options = 40; 41 | } 42 | message GenerateDestinationResponse { 43 | string destination = 1; 44 | string destination_type = 2; 45 | } 46 | 47 | message GenerateDependenciesRequest { 48 | reserved 3; 49 | Configs config = 1; 50 | Assets assets = 2; 51 | 52 | PluginOptions options = 40; 53 | } 54 | message GenerateDependenciesResponse { 55 | repeated string dependencies = 1; 56 | } 57 | 58 | message Configs { 59 | message Config { 60 | string name = 1; 61 | string value = 2; 62 | } 63 | repeated Config configs = 1; 64 | } 65 | 66 | message Assets { 67 | message Asset { 68 | string name = 1; 69 | string value = 2; 70 | } 71 | repeated Asset assets = 1; 72 | } 73 | 74 | message InstanceData { 75 | string name = 1; 76 | string value = 2; 77 | string type = 3; 78 | } 79 | 80 | message CompileAssetsRequest { 81 | reserved 3, 4, 5; 82 | Configs configs = 1; 83 | Assets assets = 2; 84 | repeated InstanceData instance_data = 8; 85 | 86 | google.protobuf.Timestamp start_time = 6; 87 | google.protobuf.Timestamp end_time = 7; 88 | 89 | PluginOptions options = 40; 90 | } 91 | message CompileAssetsResponse { 92 | Assets assets = 1; 93 | } 94 | 95 | message PluginOptions { 96 | bool dry_run = 1; 97 | } 98 | -------------------------------------------------------------------------------- /raystack/predator/v1beta1/metrics_log.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package raystack.predator.v1beta1; 4 | 5 | import "google/protobuf/timestamp.proto"; 6 | 7 | option go_package = "github.com/raystack/proton/predator"; 8 | option java_multiple_files = true; 9 | option java_outer_classname = "MetricsLogProto"; 10 | option java_package = "io.raystack.proton.predator"; 11 | 12 | message MetricsLogKey { 13 | string id = 1; 14 | Group group = 2; 15 | google.protobuf.Timestamp event_timestamp = 99; 16 | } 17 | 18 | message MetricsLogMessage { 19 | string id = 1; 20 | string urn = 2; 21 | string filter = 3; 22 | Group group = 4; 23 | string mode = 5; 24 | repeated Metric table_metrics = 6; 25 | repeated ColumnMetric column_metrics = 7; 26 | google.protobuf.Timestamp event_timestamp = 99; 27 | } 28 | 29 | message Metric { 30 | string name = 1; 31 | double value = 2; 32 | string condition = 3; 33 | } 34 | 35 | message Group { 36 | string column = 1; 37 | string value = 2; 38 | } 39 | 40 | message ColumnMetric { 41 | string id = 1; 42 | string type = 2; 43 | repeated Metric metrics = 3; 44 | } 45 | -------------------------------------------------------------------------------- /raystack/predator/v1beta1/result_log.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package raystack.predator.v1beta1; 4 | 5 | import "google/protobuf/timestamp.proto"; 6 | import "raystack/predator/v1beta1/metrics_log.proto"; 7 | 8 | option go_package = "github.com/raystack/proton/predator"; 9 | option java_multiple_files = true; 10 | option java_outer_classname = "ResultLogProto"; 11 | option java_package = "io.raystack.proton.predator"; 12 | 13 | message ResultLogKey { 14 | string id = 1; 15 | Group group = 2; 16 | google.protobuf.Timestamp event_timestamp = 99; 17 | } 18 | 19 | message ResultLogMessage { 20 | string id = 1; 21 | string profile_id = 2; 22 | string urn = 3; 23 | Group group = 4; 24 | repeated Result results = 5; 25 | 26 | google.protobuf.Timestamp event_timestamp = 99; 27 | } 28 | 29 | message Result { 30 | string name = 1; 31 | string field_id = 2; 32 | double value = 3; 33 | repeated ToleranceRule rules = 4; 34 | bool pass_flag = 5; 35 | string condition = 6; 36 | } 37 | 38 | message ToleranceRule { 39 | string name = 1; 40 | double value = 2; 41 | } 42 | -------------------------------------------------------------------------------- /raystack/raccoon/readme.md: -------------------------------------------------------------------------------- 1 | This folder contains the contract between [Raccoon](https://github.com/raystack/raccoon) and the client. 2 | 3 | ### High level view 4 | 5 | The client sends the request in form of bytes serialized `EventRequest` proto. `EventRequest` contains repeated `Event` field. `Event` is where you put your bytes serialized event. Because the event is serialized as bytes, you can put any kind of event structured in any kind of schema as per your requirement. This makes Raccoon event-agnostic. You can send any form of events. After the request is sent, Raccoon will process it and give back the response in form of `EventResponse`. The client can handle the response such as retry the request in case of failure. See the illustration below for more clarity. 6 | 7 |

8 | 9 | For details of each field in each proto, you can open the proto files and read the comment. 10 | 11 | ### How to use 12 | 13 | Since proton only provides the proto files. You need to [compile](https://developers.google.com/protocol-buffers/docs/reference/overview) the proto files yourself according to your language of choice. Then, use the generated code to build the request or parse the response. 14 | 15 | #### Javascript Example 16 | 17 | There are [2 packaging options](https://developers.google.com/protocol-buffers/docs/reference/javascript-generated#invocation) provided by the [default protoc](https://github.com/protocolbuffers/protobuf) to compile the proto to javascript code. For this example we are using [commonjs](https://developers.google.com/protocol-buffers/docs/reference/javascript-generated#commonjs-imports). 18 | To compile the proto files you can go to `proton` root directory and enter: 19 | 20 | ``` 21 | protoc --proto_path=src --js_out=import_style=commonjs,binary:. raystack/raccoon/Event.proto raystack/raccoon/EventRequest.proto raystack/raccoon/EventResponse.proto 22 | ``` 23 | 24 | The command will generate the javascript package under `raystack/raccoon`. You'll see 3 files with `_pb.js` suffix. You can move those generated codes to your project and import them. 25 | 26 | Javascript generated code requires `google-protobuf` as dependency. Make sure to include it in your `package.json`. 27 | 28 | Now, you got Javascript generated code in your project. You only need to import it and build the request or parse the response. See example below: 29 | 30 | ``` 31 | const { Timestamp } = require('google-protobuf/google/protobuf/timestamp_pb.js'); 32 | const { EventRequest } = require('./EventRequest_pb'); 33 | const { Event } = require('./Event_pb'); 34 | const { MyClickEvent } = require('./MyClickEvent_pb'); 35 | 36 | const userClickEvent = new MyClickEvent(); 37 | userClickEvent.setUserId('user-12783'); 38 | userClickEvent.setEvent('order_clicked'); 39 | userClickEvent.setTimestamp(1617092381); 40 | 41 | const event = new Event(); 42 | event.setEventbytes(userClickEvent.serializeBinary()); 43 | event.setType('click_event'); 44 | 45 | const sentTime = new Timestamp(); 46 | sentTime.fromDate(new Date()); 47 | 48 | const request = new EventRequest(); 49 | request.setReqGuid('123123'); 50 | request.setSentTime(sentTime); 51 | request.setEventsList([event]); 52 | 53 | sendRequestToRaccoon(request.serializeBinary()); 54 | ``` 55 | 56 | You can use the same generated package to deserialize the response from Raccoon. 57 | 58 | ``` 59 | const { EventResponse } = require('./EventResponse_pb'); 60 | 61 | const binaryResponse = getResonseFromRaccoon(); 62 | const response = new EventResponse(); 63 | response.deserializeBinary(binaryResponse); 64 | ``` 65 | 66 | #### Raccoon Example 67 | 68 | We also compile the proto in GO for Raccoon. You can check how the code is generated by looking at the Makefile. In general, it does the following: 69 | 70 | 1. Pull the proto from `proton` 71 | 2. Generate the GO code and place it internal package 72 | 3. Packages that require the proto can import it from the internal package 73 | -------------------------------------------------------------------------------- /raystack/raccoon/v1beta1/raccoon.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package raystack.raccoon.v1beta1; 4 | 5 | import "google/protobuf/timestamp.proto"; 6 | 7 | option go_package = "github.com/raystack/proton/raccoon/v1;raccoonv1"; 8 | option java_multiple_files = true; 9 | option java_outer_classname = "EventProto"; 10 | option java_package = "io.raystack.proton.raccoon"; 11 | 12 | service EventService { 13 | rpc SendEvent(SendEventRequest) returns (SendEventResponse); 14 | } 15 | 16 | /* 17 | `EventRequest` defines the contract to push events to Raccoon 18 | 19 | An `EventRequest` allows you to push more than one events(batch). The events 20 | are wrapped inside `events` repeated field. All of the fields on `EventRequest` 21 | are required. 22 | */ 23 | message SendEventRequest { 24 | /* 25 | `req_guid` is unique identifier of the request the client is making. 26 | 27 | Raccoon uses the identifier to send response of the request. The client can handle the 28 | response accordingly. For example, the client can retry the request in case the response is 29 | giving `INTERNAL_ERROR` code with "publisher failed" reason. 30 | 31 | This identifier is necessary because on event-based protocols like WebSocket the response is 32 | returned asynchronously. If there is no identifier, no way the client can tell which response 33 | belongs to which request. 34 | 35 | Apart from sending response, `req_guid` is used to log some informations on 'debug' level. You can search the 36 | debug logs with `ReqGUID` keyword. 37 | */ 38 | string req_guid = 1; 39 | /* 40 | `sent_time` defines the time the request is sent. 41 | 42 | `sent_time` is used to calculate various metrics. The main metric uses `sent_time` is duration from the 43 | request is sent until the events are published. 44 | */ 45 | google.protobuf.Timestamp sent_time = 2; 46 | /* 47 | `events` is where the client put all the events wrapped in `Event`. 48 | 49 | As mentioned above, the request allows the client to push more than one event. Normally you want to batch 50 | the events to optimize the network call. 51 | */ 52 | repeated Event events = 3; 53 | } 54 | 55 | /* 56 | `Event` defines wrapper of the event you want to push to Raccoon 57 | 58 | The event populated here is in form of bytes. It means you can use any data format or schema 59 | you want for your event. You can structure your event on protobuf as you like. The data then 60 | needs to be serialized to bytes and populate it in `event_bytes` field. Single `Event` contains one event. 61 | */ 62 | 63 | message Event { 64 | /* 65 | `event_bytes` is where you put bytes serialized event. 66 | */ 67 | bytes event_bytes = 1; 68 | /* 69 | `type` denotes an event type that the producer of this proto message may set. 70 | 71 | It is currently used by raccoon to distribute events to respective Kafka topics. However the 72 | users of this proto can use this type to set strings which can be processed in their 73 | ingestion systems to distribute or perform other functions. 74 | */ 75 | string type = 2; 76 | } 77 | 78 | /* 79 | `EventResponse` defines the response contract from Raccoon 80 | 81 | Raccoon sends `EventResponse` for each `EventRequest` received. For WebSocket, 82 | `EventResponse` is also used to send the final message in case connection is failed to 83 | established. 84 | */ 85 | 86 | message SendEventResponse { 87 | /* 88 | `status` denotes status of the request. 89 | 90 | Only 3 values are valid. `SUCCESS` means the the request is processed 91 | successfully. `ERROR` means the request failed to be processed. `UNKNOWN_STATUS` 92 | means Raccoon unable to determine whether the request is success or not. 93 | */ 94 | Status status = 1; 95 | /* 96 | `code` gives more detail of what happened to the request. 97 | 98 | Details of available `code` can be seen below. 99 | */ 100 | Code code = 2; 101 | /* 102 | `sent_time` is UNIX timestamp populated by Raccoon by the time the response is sent. 103 | */ 104 | int64 sent_time = 3; 105 | /* 106 | `reason` is additional-human readable information to provide more context to `status` and `code`. 107 | 108 | There is no predefined structure for this. The value is arbitrary. 109 | */ 110 | string reason = 4; 111 | /* 112 | `data` is arbitrary extra metadata. 113 | 114 | Arbitrary key-value makes the field flexible for future changes. `req_guid` is also sent as part 115 | of `data`. The client may fetch req_guid as key to get the `req_guid` value. 116 | */ 117 | map data = 5; 118 | } 119 | 120 | enum Status { 121 | STATUS_UNSPECIFIED = 0; 122 | STATUS_SUCCESS = 1; 123 | STATUS_ERROR = 2; 124 | } 125 | 126 | enum Code { 127 | /* 128 | `CODE_UNSPECIFIED` indicates no appropriate/existing code can describe it. 129 | */ 130 | CODE_UNSPECIFIED = 0; 131 | /* 132 | `OK` indicates the request is processed successfully. 133 | */ 134 | CODE_OK = 1; 135 | /* 136 | `BAD_REQUEST` indicates there is something wrong with the request. 137 | */ 138 | CODE_BAD_REQUEST = 2; 139 | /* 140 | `INTERNAL_ERROR` indicates that Raccoon encountered an unexpected condition that prevented it from fulfilling the request. 141 | */ 142 | CODE_INTERNAL_ERROR = 3; 143 | /* 144 | `MAX_CONNECTION_LIMIT_REACHED` indicates that Raccoon is unable to accepts new connection due to max connection is reached. 145 | 146 | To prevent Raccoon from eating up resources, connection limit needs to be set. The limit is configurable on Raccoon by setting `SERVER_WEBSOCKET_MAX_CONN` 147 | */ 148 | CODE_MAX_CONNECTION_LIMIT_REACHED = 4; 149 | /* 150 | `MAX_USER_LIMIT_REACHED` indicates that existing connection with the same ID. 151 | 152 | Raccoon ensures unique connection using unique identifier passed from the header 153 | the first time Websocket connection is established. The header key that 154 | contains unique identifier is configurable on Raccoon by setting `SERVER_WEBSOCKET_CONN_UNIQ_ID_HEADER` 155 | */ 156 | CODE_MAX_USER_LIMIT_REACHED = 5; 157 | } 158 | -------------------------------------------------------------------------------- /raystack/siren/v1beta1/siren.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package raystack.siren.v1beta1; 4 | 5 | import "google/api/annotations.proto"; 6 | import "google/protobuf/descriptor.proto"; 7 | import "google/protobuf/struct.proto"; 8 | import "google/protobuf/timestamp.proto"; 9 | import "protoc-gen-openapiv2/options/annotations.proto"; 10 | import "validate/validate.proto"; 11 | 12 | option go_package = "github.com/raystack/proton/siren/v1beta1;sirenv1beta1"; 13 | option java_multiple_files = true; 14 | option java_outer_classname = "ServiceManager"; 15 | option java_package = "io.raystack.proton.siren"; 16 | // These annotations are used when generating the OpenAPI file. 17 | option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { 18 | info: { 19 | title: "Siren APIs"; 20 | description: "Documentation of our Siren API with gRPC and\ngRPC-Gateway."; 21 | version: "0.5"; 22 | }; 23 | schemes: HTTP; 24 | }; 25 | 26 | service SirenService { 27 | rpc ListProviders(ListProvidersRequest) returns (ListProvidersResponse) { 28 | option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { 29 | summary: "list providers"; 30 | tags: "Provider"; 31 | }; 32 | 33 | option (google.api.http) = {get: "/v1beta1/providers"}; 34 | } 35 | 36 | rpc CreateProvider(CreateProviderRequest) returns (CreateProviderResponse) { 37 | option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { 38 | summary: "create a provider"; 39 | tags: "Provider"; 40 | }; 41 | 42 | option (google.api.http) = { 43 | post: "/v1beta1/providers" 44 | body: "*" 45 | }; 46 | } 47 | 48 | rpc GetProvider(GetProviderRequest) returns (GetProviderResponse) { 49 | option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { 50 | summary: "get a provider"; 51 | tags: "Provider"; 52 | }; 53 | 54 | option (google.api.http) = {get: "/v1beta1/providers/{id}"}; 55 | } 56 | 57 | rpc UpdateProvider(UpdateProviderRequest) returns (UpdateProviderResponse) { 58 | option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { 59 | summary: "update a provider"; 60 | tags: "Provider"; 61 | }; 62 | 63 | option (google.api.http) = { 64 | put: "/v1beta1/providers/{id}", 65 | body: "*" 66 | }; 67 | } 68 | 69 | rpc DeleteProvider(DeleteProviderRequest) returns (DeleteProviderResponse) { 70 | option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { 71 | summary: "delete a provider"; 72 | tags: "Provider"; 73 | }; 74 | 75 | option (google.api.http) = {delete: "/v1beta1/providers/{id}"}; 76 | } 77 | 78 | rpc NotifyReceiver(NotifyReceiverRequest) returns (NotifyReceiverResponse) { 79 | option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { 80 | summary: "send notification to receiver"; 81 | tags: "Receiver"; 82 | }; 83 | 84 | option (google.api.http) = { 85 | post: "/v1beta1/receivers/{id}/send" 86 | body: "*" 87 | }; 88 | } 89 | 90 | rpc ListNamespaces(ListNamespacesRequest) returns (ListNamespacesResponse) { 91 | option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { 92 | summary: "list namespaces"; 93 | tags: "Namespace"; 94 | }; 95 | 96 | option (google.api.http) = {get: "/v1beta1/namespaces"}; 97 | } 98 | 99 | rpc CreateNamespace(CreateNamespaceRequest) returns (CreateNamespaceResponse) { 100 | option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { 101 | summary: "create a namespace"; 102 | tags: "Namespace"; 103 | }; 104 | 105 | option (google.api.http) = { 106 | post: "/v1beta1/namespaces" 107 | body: "*" 108 | }; 109 | } 110 | 111 | rpc GetNamespace(GetNamespaceRequest) returns (GetNamespaceResponse) { 112 | option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { 113 | summary: "get a namespace"; 114 | tags: "Namespace"; 115 | }; 116 | 117 | option (google.api.http) = {get: "/v1beta1/namespaces/{id}"}; 118 | } 119 | 120 | rpc UpdateNamespace(UpdateNamespaceRequest) returns (UpdateNamespaceResponse) { 121 | option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { 122 | summary: "update a namespace"; 123 | tags: "Namespace"; 124 | }; 125 | 126 | option (google.api.http) = { 127 | put: "/v1beta1/namespaces/{id}", 128 | body: "*" 129 | }; 130 | } 131 | 132 | rpc DeleteNamespace(DeleteNamespaceRequest) returns (DeleteNamespaceResponse) { 133 | option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { 134 | summary: "delete a namespace"; 135 | tags: "Namespace"; 136 | }; 137 | 138 | option (google.api.http) = {delete: "/v1beta1/namespaces/{id}"}; 139 | } 140 | 141 | rpc ListSubscriptions(ListSubscriptionsRequest) returns (ListSubscriptionsResponse) { 142 | option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { 143 | summary: "List subscriptions"; 144 | tags: "Subscription"; 145 | }; 146 | 147 | option (google.api.http) = {get: "/v1beta1/subscriptions"}; 148 | } 149 | 150 | rpc CreateSubscription(CreateSubscriptionRequest) returns (CreateSubscriptionResponse) { 151 | option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { 152 | summary: "Create a subscription"; 153 | tags: "Subscription"; 154 | }; 155 | 156 | option (google.api.http) = { 157 | post: "/v1beta1/subscriptions" 158 | body: "*" 159 | }; 160 | } 161 | 162 | rpc GetSubscription(GetSubscriptionRequest) returns (GetSubscriptionResponse) { 163 | option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { 164 | summary: "Get a subscription"; 165 | tags: "Subscription"; 166 | }; 167 | 168 | option (google.api.http) = {get: "/v1beta1/subscriptions/{id}"}; 169 | } 170 | 171 | rpc UpdateSubscription(UpdateSubscriptionRequest) returns (UpdateSubscriptionResponse) { 172 | option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { 173 | summary: "Update a subscription"; 174 | tags: "Subscription"; 175 | }; 176 | option (google.api.http) = { 177 | put: "/v1beta1/subscriptions/{id}", 178 | body: "*" 179 | }; 180 | } 181 | 182 | rpc DeleteSubscription(DeleteSubscriptionRequest) returns (DeleteSubscriptionResponse) { 183 | option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { 184 | summary: "Delete a subscription"; 185 | tags: "Subscription"; 186 | }; 187 | 188 | option (google.api.http) = {delete: "/v1beta1/subscriptions/{id}"}; 189 | } 190 | 191 | rpc ListReceivers(ListReceiversRequest) returns (ListReceiversResponse) { 192 | option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { 193 | summary: "list receivers"; 194 | tags: "Receiver"; 195 | }; 196 | 197 | option (google.api.http) = {get: "/v1beta1/receivers"}; 198 | } 199 | 200 | rpc CreateReceiver(CreateReceiverRequest) returns (CreateReceiverResponse) { 201 | option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { 202 | summary: "create a receiver"; 203 | tags: "Receiver"; 204 | }; 205 | 206 | option (google.api.http) = { 207 | post: "/v1beta1/receivers" 208 | body: "*" 209 | }; 210 | } 211 | 212 | rpc GetReceiver(GetReceiverRequest) returns (GetReceiverResponse) { 213 | option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { 214 | summary: "get a receiver"; 215 | tags: "Receiver"; 216 | }; 217 | 218 | option (google.api.http) = {get: "/v1beta1/receivers/{id}"}; 219 | } 220 | 221 | rpc UpdateReceiver(UpdateReceiverRequest) returns (UpdateReceiverResponse) { 222 | option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { 223 | summary: "update a receiver"; 224 | tags: "Receiver"; 225 | }; 226 | 227 | option (google.api.http) = { 228 | put: "/v1beta1/receivers/{id}", 229 | body: "*" 230 | }; 231 | } 232 | 233 | rpc DeleteReceiver(DeleteReceiverRequest) returns (DeleteReceiverResponse) { 234 | option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { 235 | summary: "delete a receiver"; 236 | tags: "Receiver"; 237 | }; 238 | 239 | option (google.api.http) = {delete: "/v1beta1/receivers/{id}"}; 240 | } 241 | 242 | rpc ListAlerts(ListAlertsRequest) returns (ListAlertsResponse) { 243 | option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { 244 | summary: "list alerts"; 245 | tags: "Alert"; 246 | }; 247 | 248 | option (google.api.http) = {get: "/v1beta1/alerts/{provider_type}/{provider_id}"}; 249 | } 250 | 251 | rpc CreateAlerts(CreateAlertsRequest) returns (CreateAlertsResponse) { 252 | option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { 253 | summary: "create alerts"; 254 | tags: "Alert"; 255 | }; 256 | 257 | option (google.api.http) = { 258 | post: "/v1beta1/alerts/{provider_type}/{provider_id}" 259 | body: "body" 260 | }; 261 | } 262 | 263 | rpc CreateAlertsWithNamespace(CreateAlertsWithNamespaceRequest) returns (CreateAlertsWithNamespaceResponse) { 264 | option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { 265 | summary: "create alerts with namespace"; 266 | tags: "Alert"; 267 | }; 268 | 269 | option (google.api.http) = { 270 | post: "/v1beta1/alerts/{provider_type}/{provider_id}/{namespace_id}" 271 | body: "body" 272 | }; 273 | } 274 | 275 | rpc ListRules(ListRulesRequest) returns (ListRulesResponse) { 276 | option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { 277 | summary: "list rules"; 278 | tags: "Rule"; 279 | }; 280 | 281 | option (google.api.http) = {get: "/v1beta1/rules"}; 282 | } 283 | 284 | rpc UpdateRule(UpdateRuleRequest) returns (UpdateRuleResponse) { 285 | option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { 286 | summary: "add/update a rule"; 287 | tags: "Rule"; 288 | }; 289 | 290 | option (google.api.http) = { 291 | put: "/v1beta1/rules" 292 | body: "*" 293 | }; 294 | } 295 | 296 | rpc ListTemplates(ListTemplatesRequest) returns (ListTemplatesResponse) { 297 | option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { 298 | summary: "list templates"; 299 | tags: "Template"; 300 | }; 301 | 302 | option (google.api.http) = {get: "/v1beta1/templates"}; 303 | } 304 | 305 | rpc GetTemplate(GetTemplateRequest) returns (GetTemplateResponse) { 306 | option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { 307 | summary: "get a template"; 308 | tags: "Template"; 309 | }; 310 | 311 | option (google.api.http) = {get: "/v1beta1/templates/{name}"}; 312 | } 313 | 314 | rpc UpsertTemplate(UpsertTemplateRequest) returns (UpsertTemplateResponse) { 315 | option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { 316 | summary: "add/update a template"; 317 | tags: "Template"; 318 | }; 319 | 320 | option (google.api.http) = { 321 | put: "/v1beta1/templates", 322 | body: "*" 323 | }; 324 | } 325 | 326 | rpc DeleteTemplate(DeleteTemplateRequest) returns (DeleteTemplateResponse) { 327 | option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { 328 | summary: "delete a template"; 329 | tags: "Template"; 330 | }; 331 | 332 | option (google.api.http) = {delete: "/v1beta1/templates/{name}"}; 333 | } 334 | 335 | rpc RenderTemplate(RenderTemplateRequest) returns (RenderTemplateResponse) { 336 | option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { 337 | summary: "render a template"; 338 | tags: "Template"; 339 | }; 340 | 341 | option (google.api.http) = { 342 | post: "/v1beta1/templates/{name}/render", 343 | body: "*" 344 | }; 345 | } 346 | 347 | rpc CreateSilence(CreateSilenceRequest) returns (CreateSilenceResponse) { 348 | option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { 349 | summary: "create a silence"; 350 | tags: "Silence"; 351 | }; 352 | 353 | option (google.api.http) = { 354 | post: "/v1beta1/silences", 355 | body: "*" 356 | }; 357 | } 358 | 359 | rpc ListSilences(ListSilencesRequest) returns (ListSilencesResponse) { 360 | option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { 361 | summary: "get all silences"; 362 | tags: "Silence"; 363 | }; 364 | 365 | option (google.api.http) = {get: "/v1beta1/silences"}; 366 | } 367 | 368 | rpc GetSilence(GetSilenceRequest) returns (GetSilenceResponse) { 369 | option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { 370 | summary: "get a silence"; 371 | tags: "Silence"; 372 | }; 373 | 374 | option (google.api.http) = {get: "/v1beta1/silences/{id}"}; 375 | } 376 | 377 | rpc ExpireSilence(ExpireSilenceRequest) returns (ExpireSilenceResponse) { 378 | option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { 379 | summary: "expire a silence"; 380 | tags: "Silence"; 381 | }; 382 | 383 | option (google.api.http) = {delete: "/v1beta1/silences/{id}"}; 384 | } 385 | } 386 | 387 | message Provider { 388 | uint64 id = 1; 389 | string host = 2; 390 | string urn = 3; 391 | string name = 4; 392 | string type = 5; 393 | google.protobuf.Struct credentials = 6; 394 | map labels = 7; 395 | google.protobuf.Timestamp created_at = 8; 396 | google.protobuf.Timestamp updated_at = 9; 397 | } 398 | 399 | message ListProvidersRequest { 400 | string urn = 1; 401 | string type = 2; 402 | } 403 | 404 | message ListProvidersResponse { 405 | repeated Provider providers = 1; 406 | } 407 | 408 | message CreateProviderRequest { 409 | string host = 1 [(validate.rules).string.uri = true]; 410 | string urn = 2 [(validate.rules).string.pattern = "^[A-Za-z0-9_-]+$"]; 411 | string name = 3 [(validate.rules).string.pattern = "^[A-Za-z0-9_-]+$"]; 412 | string type = 4; 413 | google.protobuf.Struct credentials = 5; 414 | map labels = 6; 415 | } 416 | 417 | message CreateProviderResponse { 418 | uint64 id = 1; 419 | } 420 | 421 | message GetProviderRequest { 422 | uint64 id = 1; 423 | } 424 | 425 | message GetProviderResponse { 426 | Provider provider = 1; 427 | } 428 | 429 | message UpdateProviderRequest { 430 | uint64 id = 1; 431 | string host = 2 [(validate.rules).string.uri = true]; 432 | string name = 3 [(validate.rules).string.pattern = "^[A-Za-z0-9_-]+$"]; 433 | string type = 4; 434 | google.protobuf.Struct credentials = 5; 435 | map labels = 6; 436 | } 437 | 438 | message UpdateProviderResponse { 439 | uint64 id = 1; 440 | } 441 | 442 | message DeleteProviderRequest { 443 | uint64 id = 1; 444 | } 445 | 446 | message DeleteProviderResponse {} 447 | 448 | message Namespace { 449 | uint64 id = 1; 450 | string urn = 2; 451 | string name = 3; 452 | uint64 provider = 4; 453 | google.protobuf.Struct credentials = 5; 454 | map labels = 6; 455 | google.protobuf.Timestamp created_at = 7; 456 | google.protobuf.Timestamp updated_at = 8; 457 | } 458 | 459 | message ListNamespacesRequest {} 460 | 461 | message ListNamespacesResponse { 462 | repeated Namespace namespaces = 1; 463 | } 464 | 465 | message CreateNamespaceRequest { 466 | string name = 1 [(validate.rules).string.pattern = "^[A-Za-z0-9_-]+$"]; 467 | string urn = 2 [(validate.rules).string.pattern = "^[A-Za-z0-9_-]+$"]; 468 | uint64 provider = 3; 469 | google.protobuf.Struct credentials = 4; 470 | map labels = 5; 471 | google.protobuf.Timestamp created_at = 6; 472 | google.protobuf.Timestamp updated_at = 7; 473 | } 474 | 475 | message CreateNamespaceResponse { 476 | uint64 id = 1; 477 | } 478 | 479 | message GetNamespaceRequest { 480 | uint64 id = 1; 481 | } 482 | 483 | message GetNamespaceResponse { 484 | Namespace namespace = 1; 485 | } 486 | 487 | message UpdateNamespaceRequest { 488 | uint64 id = 1; 489 | string name = 2 [(validate.rules).string.pattern = "^[A-Za-z0-9_-]+$"]; 490 | uint64 provider = 3; 491 | google.protobuf.Struct credentials = 4; 492 | map labels = 5; 493 | } 494 | 495 | message UpdateNamespaceResponse { 496 | uint64 id = 1; 497 | } 498 | 499 | message DeleteNamespaceRequest { 500 | uint64 id = 1; 501 | } 502 | 503 | message DeleteNamespaceResponse {} 504 | 505 | message ReceiverMetadata { 506 | uint64 id = 1; 507 | google.protobuf.Struct configuration = 4; 508 | } 509 | 510 | message Subscription { 511 | uint64 id = 1; 512 | string urn = 2 [(validate.rules).string.pattern = "^[A-Za-z0-9_-]+$"]; 513 | uint64 namespace = 3; 514 | repeated ReceiverMetadata receivers = 4; 515 | map match = 5; 516 | google.protobuf.Timestamp created_at = 6; 517 | google.protobuf.Timestamp updated_at = 7; 518 | } 519 | 520 | message ListSubscriptionsRequest { 521 | uint64 namespace_id = 1; 522 | map match = 2 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {description: "query result based on subscription label matchers. the match key is written as map. eg, \"match[key1]\""}]; 523 | map notification_match = 3 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {description: "query result based on applied notification label matchers. the notification_match key is written as map. eg, \"notification_match[key1]\""}]; 524 | string silence_id = 4; 525 | } 526 | 527 | message ListSubscriptionsResponse { 528 | repeated Subscription subscriptions = 1; 529 | } 530 | 531 | message CreateSubscriptionRequest { 532 | string urn = 1 [(validate.rules).string.pattern = "^[A-Za-z0-9_-]+$"]; 533 | uint64 namespace = 2; 534 | repeated ReceiverMetadata receivers = 3; 535 | map match = 4; 536 | } 537 | 538 | message CreateSubscriptionResponse { 539 | uint64 id = 1; 540 | } 541 | 542 | message GetSubscriptionRequest { 543 | uint64 id = 1; 544 | } 545 | 546 | message GetSubscriptionResponse { 547 | Subscription subscription = 1; 548 | } 549 | 550 | message UpdateSubscriptionRequest { 551 | uint64 id = 1; 552 | string urn = 2 [(validate.rules).string.pattern = "^[A-Za-z0-9_-]+$"]; 553 | uint64 namespace = 3; 554 | repeated ReceiverMetadata receivers = 4; 555 | map match = 5; 556 | } 557 | 558 | message UpdateSubscriptionResponse { 559 | uint64 id = 1; 560 | } 561 | 562 | message DeleteSubscriptionRequest { 563 | uint64 id = 1; 564 | } 565 | 566 | message DeleteSubscriptionResponse {} 567 | 568 | message Receiver { 569 | uint64 id = 1; 570 | string name = 2; 571 | string type = 3; 572 | map labels = 4; 573 | google.protobuf.Struct configurations = 5; 574 | google.protobuf.Struct data = 6; 575 | google.protobuf.Timestamp created_at = 7; 576 | google.protobuf.Timestamp updated_at = 8; 577 | } 578 | 579 | message ListReceiversRequest {} 580 | 581 | message ListReceiversResponse { 582 | repeated Receiver receivers = 1; 583 | } 584 | 585 | message CreateReceiverRequest { 586 | string name = 1 [(validate.rules).string.pattern = "^[A-Za-z0-9_.-]+$"]; 587 | string type = 2; 588 | map labels = 3; 589 | google.protobuf.Struct configurations = 4; 590 | } 591 | 592 | message CreateReceiverResponse { 593 | uint64 id = 1; 594 | } 595 | 596 | message GetReceiverRequest { 597 | uint64 id = 1; 598 | } 599 | 600 | message GetReceiverResponse { 601 | Receiver receiver = 1; 602 | } 603 | 604 | message UpdateReceiverRequest { 605 | uint64 id = 1; 606 | string name = 2 [(validate.rules).string.pattern = "^[A-Za-z0-9_.-]+$"]; 607 | map labels = 3; 608 | google.protobuf.Struct configurations = 4; 609 | } 610 | 611 | message UpdateReceiverResponse { 612 | uint64 id = 1; 613 | } 614 | 615 | message DeleteReceiverRequest { 616 | uint64 id = 1; 617 | } 618 | 619 | message DeleteReceiverResponse {} 620 | 621 | message NotifyReceiverRequest { 622 | uint64 id = 1; 623 | google.protobuf.Struct payload = 2; 624 | } 625 | 626 | message NotifyReceiverResponse {} 627 | 628 | message Alert { 629 | uint64 id = 1; 630 | uint64 provider_id = 2; 631 | string resource_name = 3; 632 | string metric_name = 4; 633 | string metric_value = 5; 634 | string severity = 6; 635 | string rule = 7; 636 | google.protobuf.Timestamp triggered_at = 8; 637 | uint64 namespace_id = 9; 638 | string silence_status = 10; 639 | } 640 | 641 | message ListAlertsRequest { 642 | string provider_type = 1; 643 | uint64 provider_id = 2; 644 | string resource_name = 3 [(validate.rules).string.pattern = "^[A-Za-z0-9_-]+$"]; 645 | uint64 start_time = 4; 646 | uint64 end_time = 5; 647 | uint64 namespace_id = 6; 648 | string silence_id = 7; 649 | } 650 | 651 | message ListAlertsResponse { 652 | repeated Alert alerts = 1; 653 | } 654 | 655 | message CreateAlertsRequest { 656 | string provider_type = 1; 657 | uint64 provider_id = 2; 658 | google.protobuf.Struct body = 3; 659 | } 660 | 661 | message CreateAlertsResponse { 662 | repeated Alert alerts = 1; 663 | } 664 | 665 | message CreateAlertsWithNamespaceRequest { 666 | string provider_type = 1; 667 | uint64 provider_id = 2; 668 | google.protobuf.Struct body = 3; 669 | uint64 namespace_id = 4; 670 | } 671 | 672 | message CreateAlertsWithNamespaceResponse { 673 | repeated Alert alerts = 1; 674 | } 675 | 676 | message Annotations { 677 | string metric_name = 1; 678 | string metric_value = 2; 679 | string resource = 3; 680 | string template = 4; 681 | } 682 | 683 | message Labels { 684 | string severity = 1; 685 | } 686 | 687 | message Rule { 688 | uint64 id = 1; 689 | string name = 2; 690 | bool enabled = 3; 691 | string group_name = 4; 692 | string namespace = 5; 693 | string template = 6; 694 | repeated Variables variables = 7; 695 | google.protobuf.Timestamp created_at = 8; 696 | google.protobuf.Timestamp updated_at = 9; 697 | uint64 provider_namespace = 10 [(validate.rules).uint64.gte = 0]; 698 | } 699 | 700 | message Variables { 701 | string name = 1 [(validate.rules).string.pattern = "^[A-Za-z0-9_-]+$"]; 702 | string value = 2; 703 | string type = 3; 704 | string description = 4; 705 | } 706 | 707 | message ListRulesRequest { 708 | string name = 1; 709 | string namespace = 2; 710 | string group_name = 3; 711 | string template = 4; 712 | uint64 provider_namespace = 5; 713 | } 714 | 715 | message ListRulesResponse { 716 | repeated Rule rules = 1; 717 | } 718 | 719 | message UpdateRuleRequest { 720 | bool enabled = 1; 721 | string group_name = 2 [(validate.rules).string.pattern = "^[A-Za-z0-9_-]+$"]; 722 | string namespace = 3 [(validate.rules).string.pattern = "^[A-Za-z0-9_-]+$"]; 723 | string template = 4 [(validate.rules).string.pattern = "^[A-Za-z0-9_-]+$"]; 724 | repeated Variables variables = 5; 725 | uint64 provider_namespace = 6; 726 | } 727 | 728 | message UpdateRuleResponse { 729 | Rule rule = 1; 730 | } 731 | 732 | message TemplateVariables { 733 | string name = 1 [(validate.rules).string.pattern = "^[A-Za-z0-9_-]+$"]; 734 | string type = 2 [(validate.rules).string.pattern = "^[A-Za-z0-9_-]+$"]; 735 | string default = 3; 736 | string description = 4; 737 | } 738 | 739 | message Template { 740 | uint64 id = 1; 741 | string name = 2 [(validate.rules).string.pattern = "^[A-Za-z0-9_-]+$"]; 742 | string body = 3 [(validate.rules).string.pattern = "^[A-Za-z0-9_-]+$"]; 743 | repeated string tags = 4 [(validate.rules).repeated.min_items = 1]; 744 | google.protobuf.Timestamp created_at = 5; 745 | google.protobuf.Timestamp updated_at = 6; 746 | repeated TemplateVariables variables = 7 [(validate.rules).repeated.min_items = 1]; 747 | } 748 | 749 | message ListTemplatesRequest { 750 | string tag = 1; 751 | } 752 | 753 | message ListTemplatesResponse { 754 | repeated Template templates = 1; 755 | } 756 | 757 | message UpsertTemplateRequest { 758 | uint64 id = 1; 759 | string name = 2 [(validate.rules).string.pattern = "^[A-Za-z0-9_-]+$"]; 760 | string body = 3; 761 | repeated string tags = 4 [(validate.rules).repeated.min_items = 1]; 762 | repeated TemplateVariables variables = 5 [(validate.rules).repeated.min_items = 1]; 763 | } 764 | 765 | message UpsertTemplateResponse { 766 | uint64 id = 1; 767 | } 768 | 769 | message GetTemplateRequest { 770 | string name = 1 [(validate.rules).string.pattern = "^[A-Za-z0-9_-]+$"]; 771 | } 772 | 773 | message GetTemplateResponse { 774 | Template template = 1; 775 | } 776 | 777 | message DeleteTemplateRequest { 778 | string name = 1; 779 | } 780 | 781 | message DeleteTemplateResponse {} 782 | 783 | message RenderTemplateRequest { 784 | string name = 1 [(validate.rules).string.pattern = "^[A-Za-z0-9_-]+$"]; 785 | map variables = 2; 786 | } 787 | 788 | message RenderTemplateResponse { 789 | string body = 1; 790 | } 791 | 792 | message Silence { 793 | string id = 1; 794 | uint64 namespace_id = 2; 795 | string type = 3; 796 | uint64 target_id = 4; 797 | google.protobuf.Struct target_expression = 5; 798 | google.protobuf.Timestamp created_at = 6; 799 | google.protobuf.Timestamp updated_at = 7; 800 | google.protobuf.Timestamp deleted_at = 8; 801 | } 802 | 803 | message CreateSilenceRequest { 804 | uint64 namespace_id = 1; 805 | string type = 2; 806 | uint64 target_id = 3; 807 | google.protobuf.Struct target_expression = 4; 808 | } 809 | 810 | message CreateSilenceResponse { 811 | string id = 1; 812 | } 813 | 814 | message ListSilencesRequest { 815 | uint64 subscription_id = 1; 816 | uint64 namespace_id = 2; 817 | map match = 3 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {description: "query result based on silences label matchers. the match key is written as map. eg, \"match[key1]\""}]; 818 | map subscription_match = 4 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {description: "query result based on applied subscription label matchers. the subscription_match key is written as map. eg, \"subscription_match[key1]\""}]; 819 | } 820 | 821 | message ListSilencesResponse { 822 | repeated Silence silences = 1; 823 | } 824 | 825 | message GetSilenceRequest { 826 | string id = 1; 827 | } 828 | 829 | message GetSilenceResponse { 830 | Silence silence = 1; 831 | } 832 | 833 | message ExpireSilenceRequest { 834 | string id = 1; 835 | } 836 | 837 | message ExpireSilenceResponse {} 838 | -------------------------------------------------------------------------------- /raystack/stencil/v1beta1/stencil.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package raystack.stencil.v1beta1; 4 | 5 | import "google/api/annotations.proto"; 6 | import "google/api/field_behavior.proto"; 7 | import "google/protobuf/descriptor.proto"; 8 | import "google/protobuf/timestamp.proto"; 9 | import "protoc-gen-openapiv2/options/annotations.proto"; 10 | 11 | option go_package = "github.com/raystack/proton/stencil/v1beta1;stencilv1beta1"; 12 | // These annotations are used when generating the OpenAPI file. 13 | option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { 14 | info: {version: "0.1.4"}; 15 | schemes: HTTP; 16 | }; 17 | 18 | service StencilService { 19 | rpc ListNamespaces(ListNamespacesRequest) returns (ListNamespacesResponse) { 20 | option (google.api.http) = {get: "/v1beta1/namespaces"}; 21 | option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { 22 | tags: "namespace"; 23 | summary: "List names of namespaces"; 24 | }; 25 | } 26 | rpc GetNamespace(GetNamespaceRequest) returns (GetNamespaceResponse) { 27 | option (google.api.http) = {get: "/v1beta1/namespaces/{id}"}; 28 | option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { 29 | tags: "namespace"; 30 | summary: "Get namespace by id"; 31 | }; 32 | } 33 | rpc CreateNamespace(CreateNamespaceRequest) returns (CreateNamespaceResponse) { 34 | option (google.api.http) = { 35 | post: "/v1beta1/namespaces", 36 | body: "*" 37 | }; 38 | option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { 39 | tags: "namespace"; 40 | summary: "Create namespace entry"; 41 | }; 42 | } 43 | rpc UpdateNamespace(UpdateNamespaceRequest) returns (UpdateNamespaceResponse) { 44 | option (google.api.http) = { 45 | put: "/v1beta1/namespaces/{id}", 46 | body: "*" 47 | }; 48 | option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { 49 | tags: "namespace"; 50 | summary: "Update namespace entity by id"; 51 | }; 52 | } 53 | rpc DeleteNamespace(DeleteNamespaceRequest) returns (DeleteNamespaceResponse) { 54 | option (google.api.http) = {delete: "/v1beta1/namespaces/{id}"}; 55 | option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { 56 | tags: "namespace"; 57 | summary: "Delete namespace by id"; 58 | description: "Ensure all schemas under this namespace is deleted, otherwise it will throw error"; 59 | }; 60 | } 61 | rpc ListSchemas(ListSchemasRequest) returns (ListSchemasResponse) { 62 | option (google.api.http) = {get: "/v1beta1/namespaces/{id}/schemas"}; 63 | option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { 64 | tags: "schema"; 65 | summary: "List schemas under the namespace"; 66 | }; 67 | } 68 | rpc CreateSchema(CreateSchemaRequest) returns (CreateSchemaResponse) {} 69 | rpc CheckCompatibility(CheckCompatibilityRequest) returns (CheckCompatibilityResponse) {} 70 | rpc GetSchemaMetadata(GetSchemaMetadataRequest) returns (GetSchemaMetadataResponse) { 71 | option (google.api.http) = {get: "/v1beta1/namespaces/{namespace_id}/schemas/{schema_id}/meta"}; 72 | option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { 73 | tags: "schema"; 74 | summary: "Create schema under the namespace. Returns version number, unique ID and location"; 75 | }; 76 | } 77 | rpc UpdateSchemaMetadata(UpdateSchemaMetadataRequest) returns (UpdateSchemaMetadataResponse) { 78 | option (google.api.http) = { 79 | patch: "/v1beta1/namespaces/{namespace_id}/schemas/{schema_id}" 80 | body: "*" 81 | }; 82 | option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { 83 | tags: "schema"; 84 | summary: "Update only schema metadata"; 85 | }; 86 | } 87 | rpc GetLatestSchema(GetLatestSchemaRequest) returns (GetLatestSchemaResponse) {} 88 | rpc DeleteSchema(DeleteSchemaRequest) returns (DeleteSchemaResponse) { 89 | option (google.api.http) = {delete: "/v1beta1/namespaces/{namespace_id}/schemas/{schema_id}"}; 90 | option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { 91 | tags: "schema"; 92 | summary: "Delete specified schema"; 93 | }; 94 | } 95 | rpc GetSchema(GetSchemaRequest) returns (GetSchemaResponse) {} 96 | rpc ListVersions(ListVersionsRequest) returns (ListVersionsResponse) { 97 | option (google.api.http) = {get: "/v1beta1/namespaces/{namespace_id}/schemas/{schema_id}/versions"}; 98 | option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { 99 | tags: "schema"; 100 | tags: "version"; 101 | summary: "List all version numbers for schema"; 102 | }; 103 | } 104 | rpc DeleteVersion(DeleteVersionRequest) returns (DeleteVersionResponse) { 105 | option (google.api.http) = {delete: "/v1beta1/namespaces/{namespace_id}/schemas/{schema_id}/versions/{version_id}"}; 106 | option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { 107 | tags: "schema"; 108 | tags: "version"; 109 | summary: "Delete specified version of the schema"; 110 | }; 111 | } 112 | 113 | rpc Search(SearchRequest) returns (SearchResponse) { 114 | option (google.api.http) = {get: "/v1beta1/search"}; 115 | option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { 116 | tags: "schema"; 117 | summary: "Global Search API"; 118 | }; 119 | } 120 | } 121 | 122 | message Namespace { 123 | string id = 1; 124 | Schema.Format format = 2; 125 | Schema.Compatibility compatibility = 3; 126 | string description = 4; 127 | google.protobuf.Timestamp created_at = 5; 128 | google.protobuf.Timestamp updated_at = 6; 129 | } 130 | 131 | message Schema { 132 | enum Format { 133 | FORMAT_UNSPECIFIED = 0; 134 | FORMAT_PROTOBUF = 1; 135 | FORMAT_AVRO = 2; 136 | FORMAT_JSON = 3; 137 | } 138 | enum Compatibility { 139 | COMPATIBILITY_UNSPECIFIED = 0; 140 | COMPATIBILITY_BACKWARD = 1; 141 | COMPATIBILITY_BACKWARD_TRANSITIVE = 2; 142 | COMPATIBILITY_FORWARD = 3; 143 | COMPATIBILITY_FORWARD_TRANSITIVE = 4; 144 | COMPATIBILITY_FULL = 5; 145 | COMPATIBILITY_FULL_TRANSITIVE = 6; 146 | } 147 | string name = 1; 148 | Format format = 2; 149 | string authority = 3; 150 | Compatibility compatibility = 4; 151 | google.protobuf.Timestamp created_at = 5; 152 | google.protobuf.Timestamp updated_at = 6; 153 | } 154 | 155 | message ListNamespacesRequest {} 156 | 157 | message ListNamespacesResponse { 158 | repeated Namespace namespaces = 1; 159 | } 160 | 161 | message GetNamespaceRequest { 162 | string id = 1; 163 | } 164 | 165 | message GetNamespaceResponse { 166 | Namespace namespace = 1; 167 | } 168 | 169 | message CreateNamespaceRequest { 170 | string id = 1 [(google.api.field_behavior) = REQUIRED]; 171 | Schema.Format format = 2 [(google.api.field_behavior) = REQUIRED]; 172 | Schema.Compatibility compatibility = 3 [(google.api.field_behavior) = REQUIRED]; 173 | string description = 4; 174 | } 175 | 176 | message CreateNamespaceResponse { 177 | Namespace namespace = 1; 178 | } 179 | 180 | message UpdateNamespaceRequest { 181 | string id = 1; 182 | Schema.Format format = 2 [(google.api.field_behavior) = REQUIRED]; 183 | Schema.Compatibility compatibility = 3 [(google.api.field_behavior) = REQUIRED]; 184 | string description = 4; 185 | } 186 | 187 | message UpdateNamespaceResponse { 188 | Namespace namespace = 1; 189 | } 190 | 191 | message DeleteNamespaceRequest { 192 | string id = 1; 193 | } 194 | message DeleteNamespaceResponse { 195 | string message = 1; 196 | } 197 | 198 | message ListSchemasRequest { 199 | string id = 1; 200 | } 201 | message ListSchemasResponse { 202 | repeated Schema schemas = 1; 203 | } 204 | 205 | message GetLatestSchemaRequest { 206 | string namespace_id = 1; 207 | string schema_id = 2; 208 | } 209 | 210 | message GetLatestSchemaResponse { 211 | bytes data = 3; 212 | } 213 | 214 | message CreateSchemaRequest { 215 | string namespace_id = 1; 216 | string schema_id = 2; 217 | bytes data = 3 [(google.api.field_behavior) = REQUIRED]; 218 | Schema.Format format = 4; 219 | Schema.Compatibility compatibility = 5; 220 | } 221 | 222 | message CreateSchemaResponse { 223 | int32 version = 1; 224 | string id = 2; 225 | string location = 3; 226 | } 227 | 228 | message CheckCompatibilityRequest { 229 | string namespace_id = 1; 230 | string schema_id = 2; 231 | bytes data = 3 [(google.api.field_behavior) = REQUIRED]; 232 | Schema.Compatibility compatibility = 4; 233 | } 234 | 235 | message CheckCompatibilityResponse {} 236 | 237 | message GetSchemaMetadataRequest { 238 | string namespace_id = 1; 239 | string schema_id = 2; 240 | } 241 | 242 | message GetSchemaMetadataResponse { 243 | Schema.Format format = 1; 244 | Schema.Compatibility compatibility = 2; 245 | string authority = 3; 246 | string name = 4; 247 | google.protobuf.Timestamp created_at = 5; 248 | google.protobuf.Timestamp updated_at = 6; 249 | } 250 | 251 | message UpdateSchemaMetadataRequest { 252 | string namespace_id = 1; 253 | string schema_id = 2; 254 | Schema.Compatibility compatibility = 3; 255 | } 256 | 257 | message UpdateSchemaMetadataResponse { 258 | Schema.Format format = 1; 259 | Schema.Compatibility compatibility = 2; 260 | string authority = 3; 261 | } 262 | 263 | message DeleteSchemaRequest { 264 | string namespace_id = 1; 265 | string schema_id = 2; 266 | } 267 | 268 | message DeleteSchemaResponse { 269 | string message = 1; 270 | } 271 | 272 | message ListVersionsRequest { 273 | string namespace_id = 1; 274 | string schema_id = 2; 275 | } 276 | 277 | message ListVersionsResponse { 278 | repeated int32 versions = 1; 279 | } 280 | 281 | message GetSchemaRequest { 282 | string namespace_id = 1; 283 | string schema_id = 2; 284 | int32 version_id = 3; 285 | } 286 | 287 | message GetSchemaResponse { 288 | bytes data = 1; 289 | } 290 | 291 | message DeleteVersionRequest { 292 | string namespace_id = 1; 293 | string schema_id = 2; 294 | int32 version_id = 3; 295 | } 296 | 297 | message DeleteVersionResponse { 298 | string message = 1; 299 | } 300 | 301 | message SearchRequest { 302 | string namespace_id = 1; 303 | string schema_id = 2; 304 | string query = 3 [(google.api.field_behavior) = REQUIRED]; 305 | 306 | oneof version { 307 | bool history = 4; 308 | int32 version_id = 5; 309 | } 310 | } 311 | 312 | message SearchResponse { 313 | repeated SearchHits hits = 1; 314 | SearchMeta meta = 2; 315 | } 316 | 317 | message SearchHits { 318 | string namespace_id = 1; 319 | string schema_id = 2; 320 | int32 version_id = 3; 321 | repeated string fields = 4; 322 | repeated string types = 5; 323 | string path = 6; 324 | } 325 | 326 | message SearchMeta { 327 | uint32 total = 1; 328 | } 329 | --------------------------------------------------------------------------------