To-do List Gateway
To provide public access to your new deployment, you need to configure one of the existing API gateways or deploy a new one.
Last updated
To provide public access to your new deployment, you need to configure one of the existing API gateways or deploy a new one.
Last updated
Open the Gateway > System screen from your Devops app. Unless you've modified your implementation, this screen is located at https://[YOUR_ADMIN_UI_DOMAIN]/app/devops/common/gateway_system.
Next, you will create a new Gateway System, which will allow your API gateways to communicate with your new deployment.
Click on "CREATE NEW" button on top of the menu lister of Gateway System screen. This will clear the contents of Gateway System design page, and allow you to create a new Gateway System from scratch.
Provide a unique identifier to your new element from top left corner marked with "ID: " tag and a pencil icon. For this example, we are using "example-admin" as the id.
Enter the following details and save:
System Name: Example (Admin)
System Status: ACTIVE
Description: System mapping for example deployment
Applicable Gateways: admin-prod
Executor Class: com.rierino.api.gateway.executor.CRUDExecutor
Parameters:
Key: server.baseUrl, Value: http://runner-example-0001-service.admin-backend.svc.cluster.local:1235
These settings will mean that access to this system will be enabled only on predefined "admin-prod" gateway, and all received requests will be sent to the automatically generated service for the "example-0001" deployment using CRUDExecutor (handling standard CRUD requests).
Open the Gateway > Channel screen from your Devops app. Unless you've modified your implementation, this screen is located at https://[YOUR_ADMIN_UI_DOMAIN]/app/devops/common/gateway_channel.
Next, you will create a new API channel on this new Gateway System to assign a specific URL path to your deployment.
Click on "CREATE NEW" button, assign "todo_crud" as the id, enter the following details and save:
DEFINITION
Channel Name: Todo
Channel Status: ACTIVE
Description: CRUD path to todo list runner
Applicable Gateways: admin-prod
System: example-admin
Target: /api/todo
AUTHENTICATION
Path Authentications: { "*": { "isPublic": true } }
These settings will map "todo_crud" endpoint on "admin-prod" gateway to "/api/todo" endpoint of your "example-0001" deployment. The authentication settings provide public access to all paths on this endpoint.
Why do you need a Channel?
Separation of channels from systems follow similar principle as having runners separate from deployments. You can think of systems as gateway mappings of deployments, with assigned servers and addresses, and channels as gateway mappings of runners, with assigned URL paths on such servers.
After saving the new channel, your settings will be automatically applied to your gateway (after a few seconds as defined in configuration). You can also refresh gateway settings manually, by making calls to the following endpoints using your favorite API client:
Now, you can access your todo list APIs publicly through your gateway. Test your access by listing the record you've created in last section by:
Please note that you only need to create new gateway mappings when you create microservices that should be directly accessible by end users. Typically, you should prefer using a Saga runner which can coordinate or delegate requests to different runners instead of creating new gateway endpoints.