Skip to content

Instantly share code, notes, and snippets.

version: "3.9"
services:
postgres:
container_name: iot-online-shop-postgres
image: postgres:latest
ports:
- "5432:5432"
volumes:
- /var/lib/postgresql/data
env_file:
create table users
(
id serial not null,
first_name varchar,
last_name varchar,
city varchar,
age numeric,
gender varchar,
primary key (id)
);
$ curl http://localhost:3000/api/entities/dataSources \
-H "Content-Type: application/vnd.gooddata.api+json" \
-H "Accept: application/vnd.gooddata.api+json" \
-H "Authorization: Bearer YWRtaW46Ym9vdHN0cmFwOmFkbWluMTIz" \
-X POST \
-d '{
"data": {
"attributes": {
"name":"iot-online-shop-postgres",
"url": "jdbc:postgresql://postgres:5432/iot-online-shop-production",
import React from "react";
import { InsightView } from "@gooddata/sdk-ui-ext";
import Page from "../components/Page";
import { Insights } from "../md/full";
const Home = () => {
return (
<Page>
<h1>Short term analysis</h1>
df.loc[1, 'Age'] = 24
import gooddata_sdk
from gooddata_sdk.catalog.workspace.entity_model.workspace import CatalogWorkspace
import os
host = os.getenv('GOODDATA_HOST')
token = os.getenv('GOODDATA_API_TOKEN')
staging_workspace_id = os.getenv('GOODDATA_STAGING_WORKSPACE_ID')
production_workspace_id = os.getenv('GOODDATA_PRODUCTION_WORKSPACE_ID')
sdk = gooddata_sdk.GoodDataSdk.create(host, token)
curl --location --request POST \ 'https://cicd.anywhere.gooddata.com/api/entities/workspaces' \
--header 'Authorization: <Bearer API Token>' \
--header 'Content-Type: application/vnd.gooddata.api+json' \
--data-raw '{
"data": {
"attributes": {
"name": "staging"
},
"id": "staging",
"type": "workspace"
package pipeline
import (
"dagger.io/dagger"
"universe.dagger.io/docker"
)
#StagingToProductionDeploy: docker.#Dockerfile & {
dockerfile: contents: """
FROM python:3.9
import gooddata_sdk
from gooddata_sdk.catalog.workspace.entity_model.workspace import CatalogWorkspace
host = <GOODDATA_HOST>
token = <GOODDATA_API_TOKEN>
workspace = "new_workspace"
sdk = gooddata_sdk.GoodDataSdk.create(host, token)
sdk.catalog_workspace.create_or_update(CatalogWorkspace(workspace, workspace))
def get_pages(self, org: str, repo: str, table: Table):
endpoint = self.get_endpoint(org, repo, table)
self.logger.info(f'get_pages endpoint={endpoint}')
page = 1
params = self.get_params(page, table)
result = []
batch = self.rest_api.get(endpoint, params=params).json()
result.extend(batch)
while batch:
self.logger.info(f'get_pages endpoint={endpoint} done={len(result)}')