Giter Site home page Giter Site logo

thuytran-gooddata / gooddata-public-demos Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gooddata/gooddata-public-demos

0.0 0.0 0.0 39.06 MB

Repository for GoodData Demos and Packages

License: BSD 3-Clause "New" or "Revised" License

JavaScript 100.00%

gooddata-public-demos's Introduction

gooddata-public-demos

Public Repository for GoodData Demos and Packages

How to deploy sample data for a new demo workspace

This is an example of using gooddemo sample data

Notice

If you are using GoodData.CN version 2.5.0 or older, use ldm_v2.5.0.json. For newer versions, use ldm.json.

Before you start

  1. There is an existing user in adminGroup
  2. Prepare the data source for demo
    1. Connect to your snowflake data source, run the snowflake.ddl to create your demo data source
    2. Loading sample data in .csv files into your snowflake data source if this is created in 2.1
  • You can ignore this step if you just want to use the existing sample data source of gooddata (already defined in gooddemo sample data)
  1. Setting the environment variables (replace the API_TOKEN and ENDPOINT value by yours) by command
    1. You can generate API token according to the instructions in our documentation: Use an API Token for Authentication
    2. For endpoint please use the full host name of your organization, e.g.: https://trial-demo-data.cloud.gooddata.com
API_TOKEN="<TOKEN>"
ENDPOINT="<endpoint url>"

Step 1: Create data source

We will create a data source the same as the existing GoodDemo data source
Using content body in this file, just replace the password value (, you can change the name and the id of your data source if required)
You can also change the url, username and password if you have an existing one or you created it in Step 2 of ## Before you start
For example:

curl --request POST \
  --header "Authorization: Bearer $API_TOKEN" \
  --header 'Content-Type: application/vnd.gooddata.api+json' \
  --data '{
      "data": {
        "attributes": {
          "name": "GDC Good Demo Data source",
          "url": "jdbc:snowflake://gooddata.snowflakecomputing.com?warehouse=GOODDATA_DEMO_WAREHOUSE&db=GOODDATA_DEMO_DATABASE",
          "schema": "GOODDATA_DEMO_SCHEMA",
          "type": "SNOWFLAKE",
          "username": "gooddata_demo",
          "password": "<your password>"
        },
        "id": "gdc_ds_gooddemo",
        "type": "dataSource"
      }
}' $ENDPOINT/api/v1/entities/dataSources

Step 2: Create physical data model

We will create a data source the same as the existing GoodDemo physical data model
Using content body in this file, just replace the by id in Step 1, in this example, it is: gdc_ds_gooddemo
For example:

curl --request PUT \
  --header "Authorization: Bearer $API_TOKEN" \
  --header 'Content-Type: application/json' \
  --data '@./gooddemo/dataSource/pdm.json' $ENDPOINT/api/v1/layout/dataSources/<dataSourceId>/physicalModel

Step 3: Create workspace

We will create a data source the same as the existing GoodDemo / demo workspace
Using content body in this file, you can change the name and the id of your workspace if required
For example:

curl --request POST \
  --header "Authorization: Bearer $API_TOKEN" \
  --header 'Content-Type: application/vnd.gooddata.api+json' \
  --data '{
  "data": {
    "attributes": {
      "name": "Demo analytics"
    },
    "id": "demo",
    "type": "workspace"
  }
}' $ENDPOINT/api/v1/entities/workspaces

Step 4: Create analytics and logical data model for new workspace

Copy the content data of demo workspace logical data model and analytics into one model
Replace the by id in Step 3, in this example, it is: demo And then perform the API call as below (replace model of ldm and analytics by the appropriate content from above files)

curl --request PUT \
  --header "Authorization: Bearer $API_TOKEN" \
  --header 'Content-Type: application/json' \
  --data '{
        "ldm": {...},
        "analytics": {...}
}' $ENDPOINT/api/v1/layout/workspaces/<workspaceId>

Additional options

Create logical data model only

We will create a workspace logical data model the same as the existing demo workspace logical data model
Using content body in this file, just replace the by id in Step 3, in this example, it is: demo
For example:

curl --request PUT \
  --header "Authorization: Bearer $API_TOKEN" \
  --header 'Content-Type: application/json' \
  --data '@./gooddemo/workspaces/demo/ldm.json' $ENDPOINT/api/v1/layout/workspaces/<workspaceId>

License

Copyright (c) 2022, GoodData Corporation

This project is not intended for production usage. It’s meant to provide users exploring GoodData products with initial data and analytical objects for their evaluation or learning.

That being said, the usage of the project is not restricted beyond the requirements of the BSD 3-Clause License; please see the LICENSE for more information.

gooddata-public-demos's People

Contributors

gdgate avatar huavannis avatar phong-nguyen-duy avatar thuytran-gooddata avatar josefzila avatar tvthuan210 avatar lamho-gooddata avatar jakub-sterba avatar patrikbraborec avatar helobinvn avatar leosflodr avatar jeskepetr avatar danh-ung avatar kandl avatar macekond avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.