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/d4ce46d0-d9e2-4228-9aa6-9f8f6d08dee4/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/d4ce46d0-d9e2-4228-9aa6-9f8f6d08dee4/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" : "bfb35fa1-458c-461d-adf1-6a95d10cda78",
"created" : "2024-12-09T14:10:10.849729",
"lastModified" : "2024-12-09T14:10:10.84973",
"name" : "Warehouse",
"properties" : {
"password" : "ATMry0p3_0xHtUm0F_CcsBW77W",
"dbname" : "wtvspql",
"default_target_schema" : "analytics",
"port" : "5432",
"host" : "sharp-banana.postgres.database.azure.com",
"user" : "wtvspql"
},
"commands" : { },
"dataPlugin" : "loaders/target-postgres--matatika",
"logoUrl" : "/assets/logos/loaders/postgres.png",
"workspace" : "d4ce46d0-d9e2-4228-9aa6-9f8f6d08dee4",
"jdbcUrl" : "jdbc:postgresql://sharp-banana.postgres.database.azure.com:5432/wtvspql",
"sqlAlchemyUrl" : "postgresql://wtvspql:ATMry0p3_0xHtUm0F_CcsBW77W@sharp-banana.postgres.database.azure.com:5432/wtvspql?options=-csearch_path%3Dpublic",
"draft" : false,
"managed" : true,
"_links" : {
"self" : {
"href" : "https://app.matatika.com/api/datastores/bfb35fa1-458c-461d-adf1-6a95d10cda78"
},
"dataplugin" : {
"href" : "https://app.matatika.com/api/dataplugins/cd523e01-481b-452c-8f03-b997df97e294"
}
}
} ]
},
"_links" : {
"self" : {
"href" : "https://app.matatika.com/api/workspaces/d4ce46d0-d9e2-4228-9aa6-9f8f6d08dee4/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/3a864a5a-41ef-49f8-9402-283d0e5c7317' -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/3a864a5a-41ef-49f8-9402-283d0e5c7317"
headers = {
'Authorization': ACCESS_TOKEN
}
response = requests.request("GET", url, headers=headers)
print(response.text.encode('utf8'))
Response
200 OK
Datastore with HAL links.
{
"id" : "3a864a5a-41ef-49f8-9402-283d0e5c7317",
"created" : "2024-12-09T14:10:17.128966",
"lastModified" : "2024-12-09T14:10:18.863158",
"name" : "Test datastore (updated)",
"properties" : {
"password" : "ATMry0p3_0xHtUm0F_CcsBW77W",
"default_target_schema" : "analytics",
"dbname" : "wtvspql",
"host" : "sharp-banana.postgres.database.azure.com",
"user" : "wtvspql"
},
"commands" : { },
"dataPlugin" : "loaders/target-postgres--matatika",
"logoUrl" : "/assets/logos/loaders/postgres.png",
"workspace" : "d4ce46d0-d9e2-4228-9aa6-9f8f6d08dee4",
"jdbcUrl" : "jdbc:postgresql://sharp-banana.postgres.database.azure.com:5432/wtvspql",
"sqlAlchemyUrl" : "postgresql://wtvspql:ATMry0p3_0xHtUm0F_CcsBW77W@sharp-banana.postgres.database.azure.com:5432/wtvspql?options=-csearch_path%3Dpublic",
"draft" : false,
"managed" : false,
"_links" : {
"self" : {
"href" : "https://app.matatika.com/api/datastores/3a864a5a-41ef-49f8-9402-283d0e5c7317"
},
"update datastore" : {
"href" : "https://app.matatika.com/api/datastores/3a864a5a-41ef-49f8-9402-283d0e5c7317"
},
"delete datastore" : {
"href" : "https://app.matatika.com/api/datastores/3a864a5a-41ef-49f8-9402-283d0e5c7317"
},
"make-default" : {
"href" : "https://app.matatika.com/api/datastores/3a864a5a-41ef-49f8-9402-283d0e5c7317/default"
},
"dataplugin" : {
"href" : "https://app.matatika.com/api/dataplugins/cd523e01-481b-452c-8f03-b997df97e294"
}
}
}
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/3a864a5a-41ef-49f8-9402-283d0e5c7317/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/3a864a5a-41ef-49f8-9402-283d0e5c7317/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/d4ce46d0-d9e2-4228-9aa6-9f8f6d08dee4/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/d4ce46d0-d9e2-4228-9aa6-9f8f6d08dee4/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" : "3a864a5a-41ef-49f8-9402-283d0e5c7317",
"created" : "2024-12-09T14:10:16.887787431",
"lastModified" : "2024-12-09T14:10:16.887787731",
"properties" : { },
"commands" : { },
"workspace" : "d4ce46d0-d9e2-4228-9aa6-9f8f6d08dee4",
"draft" : false,
"managed" : false,
"_links" : {
"self" : {
"href" : "https://app.matatika.com/api/datastores/3a864a5a-41ef-49f8-9402-283d0e5c7317"
},
"create datastore" : {
"href" : "https://app.matatika.com/api/workspaces/d4ce46d0-d9e2-4228-9aa6-9f8f6d08dee4/datastores/3a864a5a-41ef-49f8-9402-283d0e5c7317"
}
}
}
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" : {
"default_target_schema" : "analytics",
"dbname" : "wtvspql",
"password" : "ATMry0p3_0xHtUm0F_CcsBW77W",
"host" : "sharp-banana.postgres.database.azure.com",
"user" : "wtvspql"
}
}
Example Snippets
cURL
curl -H "Authorization: Bearer $ACCESS_TOKEN" 'https://app.matatika.com/api/workspaces/d4ce46d0-d9e2-4228-9aa6-9f8f6d08dee4/datastores/3a864a5a-41ef-49f8-9402-283d0e5c7317' -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" : {
"default_target_schema" : "analytics",
"dbname" : "wtvspql",
"password" : "ATMry0p3_0xHtUm0F_CcsBW77W",
"host" : "sharp-banana.postgres.database.azure.com",
"user" : "wtvspql"
}
}'
Python (requests
)
import requests
url = "https://app.matatika.com/api/workspaces/d4ce46d0-d9e2-4228-9aa6-9f8f6d08dee4/datastores/3a864a5a-41ef-49f8-9402-283d0e5c7317"
data = {
"name" : "Test datastore",
"dataPlugin" : "loaders/target-postgres",
"properties" : {
"default_target_schema" : "analytics",
"dbname" : "wtvspql",
"password" : "ATMry0p3_0xHtUm0F_CcsBW77W",
"host" : "sharp-banana.postgres.database.azure.com",
"user" : "wtvspql"
}
}
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" : "3a864a5a-41ef-49f8-9402-283d0e5c7317",
"created" : "2024-12-09T14:10:17.12896624",
"lastModified" : "2024-12-09T14:10:17.12896704",
"name" : "Test datastore",
"properties" : {
"default_target_schema" : "analytics",
"dbname" : "wtvspql",
"password" : "ATMry0p3_0xHtUm0F_CcsBW77W",
"host" : "sharp-banana.postgres.database.azure.com",
"user" : "wtvspql"
},
"commands" : { },
"dataPlugin" : "loaders/target-postgres--matatika",
"logoUrl" : "/assets/logos/loaders/postgres.png",
"workspace" : "d4ce46d0-d9e2-4228-9aa6-9f8f6d08dee4",
"jdbcUrl" : "jdbc:postgresql://sharp-banana.postgres.database.azure.com:5432/wtvspql",
"sqlAlchemyUrl" : "postgresql://wtvspql:ATMry0p3_0xHtUm0F_CcsBW77W@sharp-banana.postgres.database.azure.com:5432/wtvspql?options=-csearch_path%3Dpublic",
"draft" : false,
"managed" : false,
"_links" : {
"self" : {
"href" : "https://app.matatika.com/api/datastores/3a864a5a-41ef-49f8-9402-283d0e5c7317"
},
"update datastore" : {
"href" : "https://app.matatika.com/api/datastores/3a864a5a-41ef-49f8-9402-283d0e5c7317"
},
"delete datastore" : {
"href" : "https://app.matatika.com/api/datastores/3a864a5a-41ef-49f8-9402-283d0e5c7317"
},
"make-default" : {
"href" : "https://app.matatika.com/api/datastores/3a864a5a-41ef-49f8-9402-283d0e5c7317/default"
},
"dataplugin" : {
"href" : "https://app.matatika.com/api/dataplugins/cd523e01-481b-452c-8f03-b997df97e294"
}
}
}
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/3a864a5a-41ef-49f8-9402-283d0e5c7317' -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/3a864a5a-41ef-49f8-9402-283d0e5c7317"
headers = {
'Authorization': ACCESS_TOKEN
}
response = requests.request("DELETE", url, headers=headers)
print(response.text.encode('utf8'))
Response
204 No Content
No response body provided.