Create Workspace
Every one of your projects in GoodData will require the creation of at least one workspace for you to work in. The workspace is an environment where you create and store all of your analytics.
For larger projects where you may need to use multiple workspaces, you can start making use of features such as workspace hierarchies and data filters. See Set Up Multiple Tenants to get started.
- On the home page switch to Workspaces.
- Click the Create workspace button
- Name your workspace and click Create.
- Your workspace is going to be listed on the Workspaces page. Open the workspace to connect it to your data source, create a logical data model and start creating analytics.
You can create a new workspace with few lines of python code:
from gooddata_sdk import GoodDataSdk, CatalogWorkspace
host = "<GOODDATA_URI>"
token = "<API_TOKEN>"
sdk = GoodDataSdk.create(host, token)
# Create new workspace entity locally
my_workspace_object = CatalogWorkspace("some_workspace_id", name="Workspace Name")
# Create workspace
sdk.catalog_workspace.create_or_update(my_workspace_object)
You can also get list of workspaces to confirm that the workspace has been created:
from gooddata_sdk import GoodDataSdk, CatalogWorkspace
host = "<GOODDATA_URI>"
token = "<API_TOKEN>"
sdk = GoodDataSdk.create(host, token)
# List workspaces
workspaces = sdk.catalog_workspace.list_workspaces()
print(workspaces)
# [
# CatalogWorkspace(id=some_workspace_id, name='Workspace Name'),
# ]
To create a workspace called Workspace Name
with the identifier of some_workspace_id
, submit a POST
request to /api/v1/entities/workspaces
:
curl $HOST_URL/api/v1/entities/workspaces \
-H "Content-Type: application/vnd.gooddata.api+json" \
-H "Accept: application/vnd.gooddata.api+json" \
-H "Authorization: Bearer <API_TOKEN>" \
-X POST \
-d '{
"data": {
"attributes": {
"description": "My first workspace created using the API.",
"name": "Workspace Name"
},
"id": "some_workspace_id",
"type": "workspace"
}
}' | jq .
To confirm that the workspace has been created, the server returns the following response:
{
"data": {
"id": "some_workspace_id",
"type": "workspace",
"attributes": {
"description": "My first workspace created using the API.",
"name": "Workspace Name"
}
},
"links": {
"self": "$HOST_URL/api/v1/entities/workspaces/some_workspace_id"
}
}
Workspace API
The web UI supports basic administrative actions when it comes to workspaces, such as their creation or deletion. For more advanced use cases, such as cloning, creating backups, and manipulating with the content within a workspace, you need to use the API or Python SDK.
There are two types of interfaces available, the main difference between entity and declarative interface is their attitude to objects:
- Metadata Entity Interface allows accessing and managing objects one by one and can be retrieved in particular batches.
- Workspace Declarative Interface works with a model specified in an all-in-one document only.
Metadata API interfaces come in two categories:
- Components of logical data model can be:
- retrieved individually via Metadata Entity Interface
- managed all together via the Workspace Declarative Interface
- Components of analytical model can be:
- managed individually via Metadata Entity Interface
- managed all together via Workspace Declarative Interface