Skip to main content

JSON Data Source

A JSON data source opens a data endpoint for writing json data.

Configure through the Strya DAS UI

The following section configures <das-id>.styra.com to access a data source stored in HTTPS using the Styra DAS UI.

Create a Styra DAS System

  1. Go to <das-id>.styra.com.
  2. To add a new system, click the ( ⨁ ) plus icon next to SYSTEMS on the left side of the navigation panel.
  3. Fill in the following fields:
  • System type (required): Select any system type from the drop down list. For example, Custom.
  • System name (required): A user-friendly name so that you can distinguish between the different systems.
  • Description (optional): More details about this system.
  • Leave the Show errors switch ON to display the errors.
  1. Click Add system button.

The Styra DAS System is created under the SYSTEMS on the left side of the navigation panel.

Add a Data Source

After you create your System, click the kebab icon () next to it and select Add Data Source to start configuring the data source.

Figure 1 - Add Data SourceFigure 1 - Add Data Source

The Custom System >> Add Data Source dialog appears.

Figure 2 - Add Data Source WindowFigure 2 - Add Data Source Window

Complete the following steps in your Custom System >> Add Data Source dialog box.

  1. Type: An editable data source that you fill in with JSON data and publish. Click the down arrow to select the data source type. For example, select JSON to a specific endpoint for direct write to the DAS. This refreshes regularly.

    Figure 3 - Data Source TypeFigure 3 - Data Source Type

  2. Path: Enter a new or existing path separated by /. For example, datasourcetypes.

  3. Data source name (required): Enter a name for the data source type. For example, json.

  4. Description: This field is optional.

  5. Click the Add button to add a data source.

Configure using curl

The following comment will open the /v1/data/json endpoint for direct writes.

curl -H 'Authorization: bearer XXX' \
-H 'Content-Type: application/json' \
-XPUT 'https://TENANT.styra.com/v1/datasources/json' -d'
{
"category": "rest"
}'

Manually send any JSON data to opened endpoint.

curl -H 'Authorization: bearer XXX' \
-H 'Content-Type: application/json' \
-XPUT 'https://TENANT.styra.com/v1/data/json' -d'
{
"foo": "bar"
}'