Skip to main content Link Menu Expand (external link) Document Search Copy Copied

Datastores

Datastores define a destination for data loaded into a workspace by pipelines. The default datastore for a workspace is its own PostgreSQL database hosted by Matatika, but this can be changed at any time to another datastore with your own credentials (see our supported dataplugins of type LOADER).


Objects

Datastore

Path Type Format Description
id String Version 4 UUID The datastore ID
created String ISO 8601 timestamp The instant at which the datastore was created
lastModified String ISO 8601 timestamp The instant at which the datastore was last modified
name String   The datastore name
dataPlugin String   Create / update with dataplugin fullyQualifiedName
workspace String Version 4 UUID The datastore workspace id
jdbcUrl String JDBC URL The datastore JDBC URL
properties Properties   The datastore properties

Properties

For each setting s in the dataplugin settings:

Path Type Description
s.name s.kind Refer to s.description

Requests


View all datastores in a workspace

GET

/api/workspaces/{workspace-id}/datastores

Returns the datastores in the workspace {workspace-id}.

Prerequisites

  • Workspace {workspace-id} must exist

Request

Example Snippets

cURL

curl -H "Authorization: Bearer $ACCESS_TOKEN" 'https://catalog.matatika.com:443/api/workspaces/d4bec6ee-4f2e-4bc3-81c8-5a0d45605cd3/datastores' -i -X GET \
    -H 'Accept: application/json, application/javascript, text/javascript, text/json' \
    -H 'Content-Type: application/json'

Python (requests)

import requests

url = "https://catalog.matatika.com:443/api/workspaces/d4bec6ee-4f2e-4bc3-81c8-5a0d45605cd3/datastores"

headers = {
  'Authorization': ACCESS_TOKEN
}

response = requests.request("GET", url, headers=headers)

print(response.text.encode('utf8'))

Response

200 OK

Datastore collection with HAL links.

{
  "_embedded" : {
    "datastores" : [ {
      "id" : "90ea8a77-1976-41bd-b9e4-7b30b8299bcb",
      "created" : "2024-04-10T14:07:57.131725",
      "lastModified" : "2024-04-10T14:07:57.131726",
      "name" : "Warehouse",
      "properties" : {
        "password" : "BcH0Ku9P_stSiDV79_6j1GlCq3",
        "dbname" : "vvvcube",
        "default_target_schema" : "analytics",
        "port" : "5432",
        "host" : "sharp-banana.postgres.database.azure.com",
        "user" : "vvvcube"
      },
      "commands" : { },
      "dataPlugin" : "loaders/target-postgres--matatika",
      "logoUrl" : "/assets/logos/loaders/postgres.png",
      "workspace" : "d4bec6ee-4f2e-4bc3-81c8-5a0d45605cd3",
      "jdbcUrl" : "jdbc:postgresql://sharp-banana.postgres.database.azure.com:5432/vvvcube",
      "sqlAlchemyUrl" : "postgresql://vvvcube:BcH0Ku9P_stSiDV79_6j1GlCq3@sharp-banana.postgres.database.azure.com:5432/vvvcube?options=-csearch_path%3Dpublic",
      "draft" : false,
      "managed" : true,
      "_links" : {
        "self" : {
          "href" : "https://catalog.matatika.com/api/datastores/90ea8a77-1976-41bd-b9e4-7b30b8299bcb"
        },
        "dataplugin" : {
          "href" : "https://catalog.matatika.com/api/dataplugins/e52731c2-01f1-48f9-a576-864262fe0d98"
        }
      }
    } ]
  },
  "_links" : {
    "self" : {
      "href" : "https://catalog.matatika.com/api/workspaces/d4bec6ee-4f2e-4bc3-81c8-5a0d45605cd3/datastores?page=0&size=20"
    }
  },
  "page" : {
    "size" : 20,
    "totalElements" : 1,
    "totalPages" : 1,
    "number" : 0
  }
}

View a datastore

GET

/api/datastores/{datastore-id}

Returns the datastore {datastore-id}.

Prerequisites

  • Datastore {datastore-id} must exist

Request

Example Snippets

cURL

curl -H "Authorization: Bearer $ACCESS_TOKEN" 'https://catalog.matatika.com:443/api/datastores/cd6d22f9-7d92-4d9d-ae3e-0510afd33b85' -i -X GET \
    -H 'Accept: application/json, application/javascript, text/javascript, text/json' \
    -H 'Content-Type: application/json'

Python (requests)

import requests

url = "https://catalog.matatika.com:443/api/datastores/cd6d22f9-7d92-4d9d-ae3e-0510afd33b85"

headers = {
  'Authorization': ACCESS_TOKEN
}

response = requests.request("GET", url, headers=headers)

print(response.text.encode('utf8'))

Response

200 OK

Datastore with HAL links.

{
  "id" : "cd6d22f9-7d92-4d9d-ae3e-0510afd33b85",
  "created" : "2024-04-10T14:07:58.152257",
  "lastModified" : "2024-04-10T14:07:59.271061",
  "name" : "Test datastore (updated)",
  "properties" : {
    "password" : "BcH0Ku9P_stSiDV79_6j1GlCq3",
    "default_target_schema" : "analytics",
    "dbname" : "vvvcube",
    "host" : "sharp-banana.postgres.database.azure.com",
    "user" : "vvvcube"
  },
  "commands" : { },
  "dataPlugin" : "loaders/target-postgres--matatika",
  "logoUrl" : "/assets/logos/loaders/postgres.png",
  "workspace" : "d4bec6ee-4f2e-4bc3-81c8-5a0d45605cd3",
  "jdbcUrl" : "jdbc:postgresql://sharp-banana.postgres.database.azure.com:5432/vvvcube",
  "sqlAlchemyUrl" : "postgresql://vvvcube:BcH0Ku9P_stSiDV79_6j1GlCq3@sharp-banana.postgres.database.azure.com:5432/vvvcube?options=-csearch_path%3Dpublic",
  "draft" : false,
  "managed" : false,
  "_links" : {
    "self" : {
      "href" : "https://catalog.matatika.com/api/datastores/cd6d22f9-7d92-4d9d-ae3e-0510afd33b85"
    },
    "update datastore" : {
      "href" : "https://catalog.matatika.com/api/datastores/cd6d22f9-7d92-4d9d-ae3e-0510afd33b85"
    },
    "delete datastore" : {
      "href" : "https://catalog.matatika.com/api/datastores/cd6d22f9-7d92-4d9d-ae3e-0510afd33b85"
    },
    "make-default" : {
      "href" : "https://catalog.matatika.com/api/datastores/cd6d22f9-7d92-4d9d-ae3e-0510afd33b85/default"
    },
    "dataplugin" : {
      "href" : "https://catalog.matatika.com/api/dataplugins/e52731c2-01f1-48f9-a576-864262fe0d98"
    }
  }
}

Set a datastore as the workspace default

PUT

/api/datastores/{datastore-id}/default

Sets the datastore {datastore-id} as the workspace default.

Prerequisites

  • Datastore {datastore-id} must exist

Request

Example Snippets

cURL

curl -H "Authorization: Bearer $ACCESS_TOKEN" 'https://catalog.matatika.com:443/api/datastores/cd6d22f9-7d92-4d9d-ae3e-0510afd33b85/default' -i -X PUT \
    -H 'Accept: application/json, application/javascript, text/javascript, text/json' \
    -H 'Content-Type: application/json'

Python (requests)

import requests

url = "https://catalog.matatika.com:443/api/datastores/cd6d22f9-7d92-4d9d-ae3e-0510afd33b85/default"

headers = {
  'Authorization': ACCESS_TOKEN
}

response = requests.request("PUT", url, headers=headers)

print(response.text.encode('utf8'))

Response

200 OK

No response body provided.


Initialise a new datastore in a workspace

POST

/api/workspaces/{workspace-id}/datastores

Initialises a new datastore in the workspace {workspace-id}.

Prerequisites

  • Workspace {workspace-id} must exist

Request

Example Snippets

cURL

curl -H "Authorization: Bearer $ACCESS_TOKEN" 'https://catalog.matatika.com:443/api/workspaces/d4bec6ee-4f2e-4bc3-81c8-5a0d45605cd3/datastores' -i -X POST \
    -H 'Accept: application/json, application/javascript, text/javascript, text/json' \
    -H 'Content-Type: application/json'

Python (requests)

import requests

url = "https://catalog.matatika.com:443/api/workspaces/d4bec6ee-4f2e-4bc3-81c8-5a0d45605cd3/datastores"

headers = {
  'Authorization': ACCESS_TOKEN
}

response = requests.request("POST", url, headers=headers)

print(response.text.encode('utf8'))

Response

200 OK

Datastore with HAL links.

{
  "id" : "cd6d22f9-7d92-4d9d-ae3e-0510afd33b85",
  "created" : "2024-04-10T14:07:57.932209449",
  "lastModified" : "2024-04-10T14:07:57.932209749",
  "properties" : { },
  "commands" : { },
  "workspace" : "d4bec6ee-4f2e-4bc3-81c8-5a0d45605cd3",
  "draft" : false,
  "managed" : false,
  "_links" : {
    "self" : {
      "href" : "https://catalog.matatika.com/api/datastores/cd6d22f9-7d92-4d9d-ae3e-0510afd33b85"
    },
    "create datastore" : {
      "href" : "https://catalog.matatika.com/api/workspaces/d4bec6ee-4f2e-4bc3-81c8-5a0d45605cd3/datastores/cd6d22f9-7d92-4d9d-ae3e-0510afd33b85"
    }
  }
}

Create or update a datastore in a workspace

PUT

/api/workspaces/{workspace-id}/datastores/{datastore-id}

Creates or updates the datastore {datastore-id} in the workspace {workspace-id}.

Prerequisites

  • Workspace {workspace-id} must exist

Request

Body

Datastore resource.

{
  "name" : "Test datastore",
  "dataPlugin" : "loaders/target-postgres",
  "properties" : {
    "password" : "BcH0Ku9P_stSiDV79_6j1GlCq3",
    "host" : "sharp-banana.postgres.database.azure.com",
    "user" : "vvvcube",
    "default_target_schema" : "analytics",
    "dbname" : "vvvcube"
  }
}

Example Snippets

cURL

curl -H "Authorization: Bearer $ACCESS_TOKEN" 'https://catalog.matatika.com:443/api/workspaces/d4bec6ee-4f2e-4bc3-81c8-5a0d45605cd3/datastores/cd6d22f9-7d92-4d9d-ae3e-0510afd33b85' -i -X PUT \
    -H 'Accept: application/json, application/javascript, text/javascript, text/json' \
    -H 'Content-Type: application/hal+json; charset=ISO-8859-1' \
    -d '{
  "name" : "Test datastore",
  "dataPlugin" : "loaders/target-postgres",
  "properties" : {
    "password" : "BcH0Ku9P_stSiDV79_6j1GlCq3",
    "host" : "sharp-banana.postgres.database.azure.com",
    "user" : "vvvcube",
    "default_target_schema" : "analytics",
    "dbname" : "vvvcube"
  }
}'

Python (requests)

import requests

url = "https://catalog.matatika.com:443/api/workspaces/d4bec6ee-4f2e-4bc3-81c8-5a0d45605cd3/datastores/cd6d22f9-7d92-4d9d-ae3e-0510afd33b85"

data = {
  "name" : "Test datastore",
  "dataPlugin" : "loaders/target-postgres",
  "properties" : {
    "password" : "BcH0Ku9P_stSiDV79_6j1GlCq3",
    "host" : "sharp-banana.postgres.database.azure.com",
    "user" : "vvvcube",
    "default_target_schema" : "analytics",
    "dbname" : "vvvcube"
  }
}
headers = {
  'Authorization': ACCESS_TOKEN
}

response = requests.request("PUT", url, headers=headers, data=data)

print(response.text.encode('utf8'))

Response

200 OK / 201 Created

Datastore with HAL links.

{
  "id" : "cd6d22f9-7d92-4d9d-ae3e-0510afd33b85",
  "created" : "2024-04-10T14:07:58.152257221",
  "lastModified" : "2024-04-10T14:07:58.152258121",
  "name" : "Test datastore",
  "properties" : {
    "password" : "BcH0Ku9P_stSiDV79_6j1GlCq3",
    "host" : "sharp-banana.postgres.database.azure.com",
    "user" : "vvvcube",
    "default_target_schema" : "analytics",
    "dbname" : "vvvcube"
  },
  "commands" : { },
  "dataPlugin" : "loaders/target-postgres--matatika",
  "logoUrl" : "/assets/logos/loaders/postgres.png",
  "workspace" : "d4bec6ee-4f2e-4bc3-81c8-5a0d45605cd3",
  "jdbcUrl" : "jdbc:postgresql://sharp-banana.postgres.database.azure.com:5432/vvvcube",
  "sqlAlchemyUrl" : "postgresql://vvvcube:BcH0Ku9P_stSiDV79_6j1GlCq3@sharp-banana.postgres.database.azure.com:5432/vvvcube?options=-csearch_path%3Dpublic",
  "draft" : false,
  "managed" : false,
  "_links" : {
    "self" : {
      "href" : "https://catalog.matatika.com/api/datastores/cd6d22f9-7d92-4d9d-ae3e-0510afd33b85"
    },
    "update datastore" : {
      "href" : "https://catalog.matatika.com/api/datastores/cd6d22f9-7d92-4d9d-ae3e-0510afd33b85"
    },
    "delete datastore" : {
      "href" : "https://catalog.matatika.com/api/datastores/cd6d22f9-7d92-4d9d-ae3e-0510afd33b85"
    },
    "make-default" : {
      "href" : "https://catalog.matatika.com/api/datastores/cd6d22f9-7d92-4d9d-ae3e-0510afd33b85/default"
    },
    "dataplugin" : {
      "href" : "https://catalog.matatika.com/api/dataplugins/e52731c2-01f1-48f9-a576-864262fe0d98"
    }
  }
}

Delete a datastore

DELETE

/api/datastores/{datastore-id}

Deletes the datastore {datastore-id}.

Prerequisites

  • Datastore {datastore-id} must exist

Request

Example Snippets

cURL

curl -H "Authorization: Bearer $ACCESS_TOKEN" 'https://catalog.matatika.com:443/api/datastores/cd6d22f9-7d92-4d9d-ae3e-0510afd33b85' -i -X DELETE \
    -H 'Accept: application/json, application/javascript, text/javascript, text/json' \
    -H 'Content-Type: application/json'

Python (requests)

import requests

url = "https://catalog.matatika.com:443/api/datastores/cd6d22f9-7d92-4d9d-ae3e-0510afd33b85"

headers = {
  'Authorization': ACCESS_TOKEN
}

response = requests.request("DELETE", url, headers=headers)

print(response.text.encode('utf8'))

Response

204 No Content

No response body provided.