Hubs - Sources

Sources are data sources that can be used to fetch, update, create, or delete data. Sources are paired with Queries and encapsulated as a single object within nokori. This allows platform functionality to be utilized across all sources and 100% of supported data sources in exactly the same way.

Source Types

For a list of currently supported data sources, see the Supported Sources page.


POST/v1/sources

Create a Source

This endpoint allows you to create a hub.

Request Body Parameters

  • Name
    hubId
    Type
    string
    required
    Description

    The hubId of the hub that the source will be created in.

  • Name
    label
    Type
    string
    required
    Description

    The name of the source (for humans).

  • Name
    engine
    Type
    enum
    required
    Description

    See the Supported Sources page for a list of currently supported data sources.

    Examples mariadb, mysql, postgres, etc.

  • Name
    connectionSettings.host
    Type
    string
    required
    Description

    URL of the database host.

  • Name
    connectionSettings.port
    Type
    number
    required
    Description

    Port number of the database host endpoint.

  • Name
    connectionSettings.database
    Type
    string
    required
    Description

    The database/schema name queries will execute against by default.

  • Name
    connectionSettings.user
    Type
    string
    required
    Description

    Username of the user for the connection.

  • Name
    connectionSettings.password
    Type
    string
    required
    Description

    Password of the user for the connection.

Request

POST
/v1/sources
curl https://api.nokori.com/v1/sources \
  -X POST
  -H 'x-nokori-api-key: {{apiKey}}' \
  -H 'Content-Type: application/json'
  -d '{
  "hubId" : "lola.hub.hsnwg921TBQbNKeNMjS",
  "label" : "MySQL Production",
  "engine" : "mysql",
  "connectionSettings": {
      "host" : "cosmicdb-001.sector-four.nokori.com",
      "port" : "3306",
      "database" : "shop_db",
      "user" : "db_admin",
      "password" : "phasers_to_stun",
    }
  }'

Response

{
  "hubId":"lola.hub.hsnwg921TBQbNKeNMjS",
  "label":"MySQL Production",
  "engine":"mysql",
  "sourceId":"lola.src.ydPccAMDQKfCwKN-b2M",
  "nodeId":"lola.src.ydPccAMDQKfCwKN-b2M",
  "nodeType":"source",
  "parentNodeId":"lola.hrt.F6huKxiahYR6nyUZBMO"
}  

GET/v1/sources

List Sources

Query Parameters

  • Name
    hubId
    Type
    string
    required
    Description

    The ID of the hub to list sources for.

This endpoint allows you to list available sources within a hub.

Request

GET
/v1/sources?hubId=:hubId
curl -G https://api.nokori.com/v1/sources?hubId=:hubId \
  -H 'x-nokori-api-key: {{apiKey}}' \
  -H 'Content-Type: application/json'

Response

[
  {
    "sourceId": "lola.src.ydPccAMDQKfCwKN-b2M",
    "accountId": "lola.acct.SlW4s3ZNWdDiBMVANJy",
    "hubId": "lola.hub.hsnwg921TBQbNKeNMjS",
    "label": "MySQL Production",
    "engine": "mysql",
    "driver": null,
    "createdAt": "2023-02-20T16:37:15.000Z",
    "updatedAt": null,
    "connectionSettings": {
        "host": "cosmicdb-001.sector-four.nokori.com",
        "port": 3306,
        "database": "shop_db",
        "user": "db_*****",
        "password": "pha************"
    }
  }
]

GET/v1/sources/:sourceId

Get A Source

Query Parameters

  • Name
    sourceId
    Type
    string
    required
    Description

    The ID of the source to get.

This endpoint allows you to get a source by ID.

Request

GET
/v1/sources/:sourceId
curl -G https://api.nokori.com/v1/sources/:sourceId \
  -H 'x-nokori-api-key: {{apiKey}}' \
  -H 'Content-Type: application/json'

Response

{
  "sourceId": "lola.src.ydPccAMDQKfCwKN-b2M",
  "hubId": "lola.hub.hsnwg921TBQbNKeNMjS",
  "label": "MySQL Production",
  "engine": "mysql",
  "connectionSettings": {
    "host": "cosmicdb-001.sector-four.nokori.com",
    "port": 3306,
    "database": "shop_db",
    "user": "db_*****",
    "password": "pha************"
  },
  "createdAt": "2023-02-20T16:37:15.000Z",
  "updatedAt": null,
  "nodeType": "source"
}

PUT/v1/sources/:sourceId

Update a Source

This endpoint allows you to update a source.

Note: this endpoint supports partial updates. You can update only the properties you want to change.

Query Parameters

  • Name
    sourceId
    Type
    string
    optional
    Description

    The source ID of the source to update.

Request

PUT
/v1/sources/:sourceId
curl https://api.nokori.com/v1/sources/:sourceId \
  -X PUT
  -H 'x-nokori-api-key: {{apiKey}}' \
  -H 'Content-Type: application/json'
  -d '{
    "label": "MySQL Production Update"
    }'

Response

200 OK
{
  "sourceId": "lola.src.ydPccAMDQKfCwKN-b2M",
  "hubId": "lola.hub.hsnwg921TBQbNKeNMjS",
  "label": "MySQL Production Update",
  "engine": "mysql",
  "connectionSettings": {
    "host": "cosmicdb-001.sector-four.nokori.com",
    "port": 3306,
    "database": "shop_db",
    "user": "db_*****",
    "password": "pha************"
  },
  "createdAt": "2023-02-20T16:37:15.000Z",
  "updatedAt": null,
  "nodeType": "source"
}

DELETE/v1/sources/:sourceId

Delete a Source

This endpoint allows you to delete a source.

Query Parameters

  • Name
    sourceId
    Type
    string
    required
    Description

    The ID of the source to delete

Request

DELETE
/v1/sources/:sourceId
curl https://api.nokori.com/v1/sources/:sourceId \
  -X DELETE \
  -H 'x-nokori-api-key: {{apiKey}}' \
  -H 'Content-Type: application/json'

Response

200 OK
{}