Skip to main content

Quickstart: Service Invocation

This quickstart showcases how to enable the request-reply pattern using the Service Invocation API.

invoke qs

1

Prerequisites

Before you proceed, ensure you have the following prereqs installed.

2

Log in to Catalyst

Authenticate to Diagrid Catalyst using the following command:

diagrid login

Confirm your organization and user details are correct:

diagrid whoami
3

Clone Quickstart Code

Clone the quickstart code from the Diagrid Labs GitHub repository and navigate to the appropriate directory:

diagrid dev quickstart --type invoke --language python
4

Install Dependencies and Run

The diagrid dev run command creates your Catalyst project (if needed), provisions resources (App IDs, Components), configures environment variables, and launches your application using the dapr multi-app run file.

Install .NET dependencies:

dotnet restore ./client && dotnet restore ./server

Run the application:

diagrid dev run -f dev-python-invocation.yaml --project dev-python-invocation
tip

Ensure the log Connected App ID "server" to localhost:5002 appears before proceeding to the next section.

5

Interact with Service Invocation API

With the quickstart running, test the Service Invocation API using curl or the REST Client extension with the test.rest file.

Open a new terminal and execute the following curl command:

curl -i -X POST http://localhost:5001/order -H "Content-Type: application/json" -d '{"orderId":1}'

Upon successful execution, the server app should indicate the request was successfully received and the client app logs should output the invocation was successful.

logs

To stop the local applications and disconnect the local app connection for the server App ID, run:

diagrid dev stop
6

Clean Up ResourcesOptional

If you are not going to continue to use this application, delete the app IDs:

diagrid appid delete client
diagrid appid delete server

To delete the entire Catalyst project, including the managed infrastructure resources:

diagrid project delete dev-python-invocation  # or dev-csharp-invocation, dev-js-invocation, dev-java-invocation