Exercise: Test State
This example describes activation of CRUD endpoints for a new state manager using existing train_crud event runner.
Last updated
This example describes activation of CRUD endpoints for a new state manager using existing train_crud event runner.
Last updated
Open the Runner screen from your Devops app. Unless you've modified your implementation, this screen is located at https://[YOUR_ADMIN_UI_DOMAIN]/app/devops/common/runner.
From the runner list on left hand side, filter and select Train CRUD runner.
From the stencil, drag and drop a new State element (with table icon) onto the runner diagram. Select the newly added element and click on edit action displayed on it (with pencil icon).
On the displayed screen, select 'Generic Master' element as shown above. This element can be used to add generic state managers for creating & accessing collections on MongoDB master database.
Enter 'test' as the 'alias' for your state, which will be used as the CRUD url path and also used as the collection name on the database. This is the simplest configuration for a CRUD endpoint, full list of configuration options can be viewed in the Devops section.
The CRUD runner for training examples has a rebuild configuration of 30 seconds, meaning any changes done on the runner, such as adding a new state like this example will be automatically applied within 30 seconds. You can start using full list of CRUD endpoints found here afterwards.
As an example, you can make a call to https://[YOUR_ADMIN_API_DOMAIN]/api/request/train_crud/test endpoint.
You should receive a response with "200 OK" status and {list: []} in its body for your GET request, as the MongoDB collection will be initially empty.