From 3f9ae8b99484c05b70ad3b634a1dadc9687002ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Loren=20=F0=9F=A4=93?= Date: Fri, 23 Sep 2022 18:01:00 -0400 Subject: [PATCH 1/2] Add usage info to README --- README.md | 81 ++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 77 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 9bf3004f..6550e915 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,82 @@ -# Temporal proto files +# Temporal gRPC API -## How to use +Proto files describing our gRPC API. Implemented by [Temporal Server](https://github.com/temporalio/temporal) and used by the [SDKs](https://docs.temporal.io/temporal#temporal-sdk) (both Clients and Workers). -Install as git submodule to the project. +- [Use the API](#use-the-api) + - [With code](#with-code) + - [Generate client stubs](#generate-client-stubs) + - [Via REST](#via-rest) + - [Via GraphQL](#via-graphql) + - [Manually](#manually) + - [With command line](#with-command-line) + - [With a GUI](#with-a-gui) +- [License](#license) + +## Use the API + +### With code + +Usually you interact with the API via high-level SDK methods like `startWorkflow()`. However, Clients also expose the underlying gRPC services, like: + +- [`Client.connection.workflowService`](https://typescript.temporal.io/api/classes/client.connection/#workflowservice) +- [`Client.connection.healthService`](https://typescript.temporal.io/api/classes/client.connection/#healthservice) +- [`Client.connection.operatorService`](https://typescript.temporal.io/api/classes/client.connection/#operatorservice) + +#### Generate client stubs + +If you're not using an SDK Client (rare), you can generate gRPC client stubs by: + +- Adding this repo as a git submodule or subtree inside your repo +- Generating code in [your language](https://grpc.io/docs/languages/) + +### Via REST + +See [`temporalio/ui-server`](https://github.com/temporalio/ui-server) + +### Via GraphQL + +See [`temporalio/graphql`](https://github.com/temporalio/graphql) + +### Manually + +To query the API manually via command line or a GUI, first: + +- Run Temporal Server locally ([Temporalite or Docker Compose](https://docs.temporal.io/application-development/foundations#run-a-dev-cluster)) +- Clone this repo: + + ```sh + git clone https://github.com/temporalio/api.git + cd api + ``` + +#### With command line + +Install [`evans`](https://github.com/ktr0731/evans#installation). + +``` +cd /path/to/api +evans --proto temporal/api/workflowservice/v1/service.proto --port 7233 +``` + +#### With a GUI + +- Install [BloomRPC](https://github.com/bloomrpc/bloomrpc#installation). +- Open the app +- Select "Import Paths" button on the top-left and enter the path to the cloned repo: `/path/to/api` +- Select the "Import protos" + button and select this file: + + `/path/to/api/temporal/api/workflowservice/v1/service.proto` + +- A list of methods should appear in the sidebar. Select one. +- Edit the JSON in the left pane. +- Hit `Cmd-Enter` or click the play button to get a response from the server on the right. + +![ListWorkflowExecutions](https://www.dropbox.com/s/ahuqk09ypoy79vq/BloomRPC.png?raw=1) + +One downside compared to [command line](#with-command-line) is it doesn't show enum names, just numbers like `"task_queue_type": 1`. + +![DescribeTaskQueue](https://www.dropbox.com/s/2pi21trui7l678p/DescribeTaskQueue.png?raw=1) ## License -MIT License, please see [LICENSE](LICENSE) for details. +[MIT License](LICENSE) From f23a0f8781510e153c662e6e47b9838b858122e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Loren=20=E2=98=BA=EF=B8=8F?= <251288+lorensr@users.noreply.github.com> Date: Thu, 20 Apr 2023 00:27:42 -0400 Subject: [PATCH 2/2] Update README.md --- README.md | 5 ----- 1 file changed, 5 deletions(-) diff --git a/README.md b/README.md index 6550e915..4cedab07 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,6 @@ Proto files describing our gRPC API. Implemented by [Temporal Server](https://gi - [Use the API](#use-the-api) - [With code](#with-code) - [Generate client stubs](#generate-client-stubs) - - [Via REST](#via-rest) - [Via GraphQL](#via-graphql) - [Manually](#manually) - [With command line](#with-command-line) @@ -29,10 +28,6 @@ If you're not using an SDK Client (rare), you can generate gRPC client stubs by: - Adding this repo as a git submodule or subtree inside your repo - Generating code in [your language](https://grpc.io/docs/languages/) -### Via REST - -See [`temporalio/ui-server`](https://github.com/temporalio/ui-server) - ### Via GraphQL See [`temporalio/graphql`](https://github.com/temporalio/graphql)