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
- View a datastore
- Set a datastore as the workspace default
- Initialise a new datastore in a workspace
- Create or update a datastore in a workspace
- Delete a datastore
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://app.matatika.com/api/workspaces/df4ae73f-ee57-435b-b2d7-56fdae6514d6/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://app.matatika.com/api/workspaces/df4ae73f-ee57-435b-b2d7-56fdae6514d6/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" : "5d7963ca-d95c-49be-8b98-8d40339b3e63",
"created" : "2024-12-16T09:59:32.769924",
"lastModified" : "2024-12-16T09:59:32.769925",
"name" : "Warehouse",
"properties" : {
"password" : "Far752AE_UV60aeZO_9A9Wobvx",
"dbname" : "vumogxj",
"default_target_schema" : "analytics",
"port" : "5432",
"host" : "sharp-banana.postgres.database.azure.com",
"user" : "vumogxj"
},
"commands" : { },
"dataPlugin" : "loaders/target-postgres--matatika",
"logoUrl" : "/assets/logos/loaders/postgres.png",
"workspace" : "df4ae73f-ee57-435b-b2d7-56fdae6514d6",
"jdbcUrl" : "jdbc:postgresql://sharp-banana.postgres.database.azure.com:5432/vumogxj",
"sqlAlchemyUrl" : "postgresql://vumogxj:Far752AE_UV60aeZO_9A9Wobvx@sharp-banana.postgres.database.azure.com:5432/vumogxj?options=-csearch_path%3Dpublic",
"managed" : true,
"draft" : false,
"_links" : {
"self" : {
"href" : "https://app.matatika.com/api/datastores/5d7963ca-d95c-49be-8b98-8d40339b3e63"
},
"dataplugin" : {
"href" : "https://app.matatika.com/api/dataplugins/7ef8f87e-b232-4e27-a900-2ef4ce577332"
}
}
} ]
},
"_links" : {
"self" : {
"href" : "https://app.matatika.com/api/workspaces/df4ae73f-ee57-435b-b2d7-56fdae6514d6/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://app.matatika.com/api/datastores/eab55a83-890f-4743-8117-93902a0be826' -i -X GET \
-H 'Accept: application/json, application/javascript, text/javascript, text/json' \
-H 'Content-Type: application/json'
Python (requests
)
import requests
url = "https://app.matatika.com/api/datastores/eab55a83-890f-4743-8117-93902a0be826"
headers = {
'Authorization': ACCESS_TOKEN
}
response = requests.request("GET", url, headers=headers)
print(response.text.encode('utf8'))
Response
200 OK
Datastore with HAL links.
{
"id" : "eab55a83-890f-4743-8117-93902a0be826",
"created" : "2024-12-16T09:59:33.820731",
"lastModified" : "2024-12-16T09:59:35.153795",
"name" : "Test datastore (updated)",
"properties" : {
"password" : "Far752AE_UV60aeZO_9A9Wobvx",
"default_target_schema" : "analytics",
"dbname" : "vumogxj",
"host" : "sharp-banana.postgres.database.azure.com",
"user" : "vumogxj"
},
"commands" : { },
"dataPlugin" : "loaders/target-postgres--matatika",
"logoUrl" : "/assets/logos/loaders/postgres.png",
"workspace" : "df4ae73f-ee57-435b-b2d7-56fdae6514d6",
"jdbcUrl" : "jdbc:postgresql://sharp-banana.postgres.database.azure.com:5432/vumogxj",
"sqlAlchemyUrl" : "postgresql://vumogxj:Far752AE_UV60aeZO_9A9Wobvx@sharp-banana.postgres.database.azure.com:5432/vumogxj?options=-csearch_path%3Dpublic",
"managed" : false,
"draft" : false,
"_links" : {
"self" : {
"href" : "https://app.matatika.com/api/datastores/eab55a83-890f-4743-8117-93902a0be826"
},
"update datastore" : {
"href" : "https://app.matatika.com/api/datastores/eab55a83-890f-4743-8117-93902a0be826"
},
"delete datastore" : {
"href" : "https://app.matatika.com/api/datastores/eab55a83-890f-4743-8117-93902a0be826"
},
"make-default" : {
"href" : "https://app.matatika.com/api/datastores/eab55a83-890f-4743-8117-93902a0be826/default"
},
"dataplugin" : {
"href" : "https://app.matatika.com/api/dataplugins/7ef8f87e-b232-4e27-a900-2ef4ce577332"
}
}
}
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://app.matatika.com/api/datastores/eab55a83-890f-4743-8117-93902a0be826/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://app.matatika.com/api/datastores/eab55a83-890f-4743-8117-93902a0be826/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://app.matatika.com/api/workspaces/df4ae73f-ee57-435b-b2d7-56fdae6514d6/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://app.matatika.com/api/workspaces/df4ae73f-ee57-435b-b2d7-56fdae6514d6/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" : "eab55a83-890f-4743-8117-93902a0be826",
"created" : "2024-12-16T09:59:33.584968426",
"lastModified" : "2024-12-16T09:59:33.584968626",
"properties" : { },
"commands" : { },
"workspace" : "df4ae73f-ee57-435b-b2d7-56fdae6514d6",
"managed" : false,
"draft" : false,
"_links" : {
"self" : {
"href" : "https://app.matatika.com/api/datastores/eab55a83-890f-4743-8117-93902a0be826"
},
"create datastore" : {
"href" : "https://app.matatika.com/api/workspaces/df4ae73f-ee57-435b-b2d7-56fdae6514d6/datastores/eab55a83-890f-4743-8117-93902a0be826"
}
}
}
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" : "Far752AE_UV60aeZO_9A9Wobvx",
"host" : "sharp-banana.postgres.database.azure.com",
"user" : "vumogxj",
"default_target_schema" : "analytics",
"dbname" : "vumogxj"
}
}
Example Snippets
cURL
curl -H "Authorization: Bearer $ACCESS_TOKEN" 'https://app.matatika.com/api/workspaces/df4ae73f-ee57-435b-b2d7-56fdae6514d6/datastores/eab55a83-890f-4743-8117-93902a0be826' -i -X PUT \
-H 'Accept: application/json, application/javascript, text/javascript, text/json' \
-H 'Content-Type: application/json' \
-d '{
"name" : "Test datastore",
"dataPlugin" : "loaders/target-postgres",
"properties" : {
"password" : "Far752AE_UV60aeZO_9A9Wobvx",
"host" : "sharp-banana.postgres.database.azure.com",
"user" : "vumogxj",
"default_target_schema" : "analytics",
"dbname" : "vumogxj"
}
}'
Python (requests
)
import requests
url = "https://app.matatika.com/api/workspaces/df4ae73f-ee57-435b-b2d7-56fdae6514d6/datastores/eab55a83-890f-4743-8117-93902a0be826"
data = {
"name" : "Test datastore",
"dataPlugin" : "loaders/target-postgres",
"properties" : {
"password" : "Far752AE_UV60aeZO_9A9Wobvx",
"host" : "sharp-banana.postgres.database.azure.com",
"user" : "vumogxj",
"default_target_schema" : "analytics",
"dbname" : "vumogxj"
}
}
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" : "eab55a83-890f-4743-8117-93902a0be826",
"created" : "2024-12-16T09:59:33.820731482",
"lastModified" : "2024-12-16T09:59:33.820732882",
"name" : "Test datastore",
"properties" : {
"password" : "Far752AE_UV60aeZO_9A9Wobvx",
"host" : "sharp-banana.postgres.database.azure.com",
"user" : "vumogxj",
"default_target_schema" : "analytics",
"dbname" : "vumogxj"
},
"commands" : { },
"dataPlugin" : "loaders/target-postgres--matatika",
"logoUrl" : "/assets/logos/loaders/postgres.png",
"workspace" : "df4ae73f-ee57-435b-b2d7-56fdae6514d6",
"jdbcUrl" : "jdbc:postgresql://sharp-banana.postgres.database.azure.com:5432/vumogxj",
"sqlAlchemyUrl" : "postgresql://vumogxj:Far752AE_UV60aeZO_9A9Wobvx@sharp-banana.postgres.database.azure.com:5432/vumogxj?options=-csearch_path%3Dpublic",
"managed" : false,
"draft" : false,
"_links" : {
"self" : {
"href" : "https://app.matatika.com/api/datastores/eab55a83-890f-4743-8117-93902a0be826"
},
"update datastore" : {
"href" : "https://app.matatika.com/api/datastores/eab55a83-890f-4743-8117-93902a0be826"
},
"delete datastore" : {
"href" : "https://app.matatika.com/api/datastores/eab55a83-890f-4743-8117-93902a0be826"
},
"make-default" : {
"href" : "https://app.matatika.com/api/datastores/eab55a83-890f-4743-8117-93902a0be826/default"
},
"dataplugin" : {
"href" : "https://app.matatika.com/api/dataplugins/7ef8f87e-b232-4e27-a900-2ef4ce577332"
}
}
}
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://app.matatika.com/api/datastores/eab55a83-890f-4743-8117-93902a0be826' -i -X DELETE \
-H 'Accept: application/json, application/javascript, text/javascript, text/json' \
-H 'Content-Type: application/json'
Python (requests
)
import requests
url = "https://app.matatika.com/api/datastores/eab55a83-890f-4743-8117-93902a0be826"
headers = {
'Authorization': ACCESS_TOKEN
}
response = requests.request("DELETE", url, headers=headers)
print(response.text.encode('utf8'))
Response
204 No Content
No response body provided.