{"id":27370216,"url":"https://github.com/datastaxdevs/conference-2021-apachecon-stargate","last_synced_at":"2026-01-22T11:32:31.240Z","repository":{"id":104795673,"uuid":"409148179","full_name":"datastaxdevs/conference-2021-apachecon-stargate","owner":"datastaxdevs","description":"Materials for the conference Apachecon2021","archived":false,"fork":false,"pushed_at":"2021-09-24T13:26:53.000Z","size":12301,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-13T08:57:11.945Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/datastaxdevs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-09-22T09:50:41.000Z","updated_at":"2021-09-30T07:04:49.000Z","dependencies_parsed_at":"2023-05-29T22:45:20.676Z","dependency_job_id":null,"html_url":"https://github.com/datastaxdevs/conference-2021-apachecon-stargate","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/datastaxdevs/conference-2021-apachecon-stargate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datastaxdevs%2Fconference-2021-apachecon-stargate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datastaxdevs%2Fconference-2021-apachecon-stargate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datastaxdevs%2Fconference-2021-apachecon-stargate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datastaxdevs%2Fconference-2021-apachecon-stargate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/datastaxdevs","download_url":"https://codeload.github.com/datastaxdevs/conference-2021-apachecon-stargate/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datastaxdevs%2Fconference-2021-apachecon-stargate/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28662111,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-22T01:17:37.254Z","status":"online","status_checked_at":"2026-01-22T02:00:07.137Z","response_time":144,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-04-13T08:48:20.106Z","updated_at":"2026-01-22T11:32:31.226Z","avatar_url":"https://github.com/datastaxdevs.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"## 🎓🔥 An OSS Api Layer for your Cassandra  🔥🎓\n\n[![License Apache2](https://img.shields.io/hexpm/l/plug.svg)](http://www.apache.org/licenses/LICENSE-2.0)\n[![Discord](https://img.shields.io/discord/685554030159593522)](https://discord.com/widget?id=685554030159593522\u0026theme=dark)\n\n![image](pics/splash.png?raw=true)\n\n## Table of content\n\n1. [Prerequisites](#1-prerequisite-install-docker-and-docker-compose)\n2. [Start the Demo](#2-start-the-demo)\n3. [Use CQL API](#3-use-cql-api)\n4. [Use REST API](#4-use-rest-api)\n5. [Use Document API](#5-use-document-api-swagger)\n6. [Use GraphQL API](#6-use-graphql-api-portal)\n7. [Create an Astra Instance](#7-create-your-astra-instance)\n\n## 1. Prerequisite, Install docker and docker-compose ##\n\nTo run the demo you need `docker` and `docker-compose`. Skip this steps if you have them available already\n\n### 1.1 Install Docker\n\nDocker is an open-source project that automates the deployment of software applications inside containers by providing an additional layer of abstraction and automation of OS-level virtualization on Linux.\n\n![Windows](https://github.com/DataStax-Academy/kubernetes-workshop-online/blob/master/4-materials/images/windows32.png?raw=true) : To install on **windows** please use the following installer [Docker Desktop for Windows Installer](https://download.docker.com/win/stable/Docker%20Desktop%20Installer.exe)\n\n![osx](https://github.com/DataStax-Academy/kubernetes-workshop-online/blob/master/4-materials/images/mac32.png?raw=true) : To install on **MAC OS**  use [Docker Desktop for MAC Installer](https://download.docker.com/mac/stable/Docker.dmg) or [homebrew](https://docs.brew.sh/Installation) with following commands:\n```bash\n# Fetch latest version of homebrew and formula.\nbrew update              \n# Tap the Caskroom/Cask repository from Github using HTTPS.\nbrew tap caskroom/cask                \n# Searches all known Casks for a partial or exact match.\nbrew search docker                    \n# Displays information about the given Cask\nbrew cask info docker\n# Install the given cask.\nbrew cask install docker              \n# Remove any older versions from the cellar.\nbrew cleanup\n# Validate installation\ndocker -v\n```\n\n![linux](https://github.com/DataStax-Academy/kubernetes-workshop-online/blob/master/4-materials/images/linux32.png?raw=true) : To install on linux (centOS) you can use the following commands\n```bash\n# Remove if already install\nsudo yum remove docker \\\n                  docker-client \\\n                  docker-client-latest \\\n                  docker-common \\\n                  docker-latest \\\n                  docker-latest-logrotate \\\n                  docker-logrotate \\\n                  docker-engine\n# Utils\nsudo yum install -y yum-utils\n\n# Add docker-ce repo\nsudo dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo\n# Install\nsudo dnf -y  install docker-ce --nobest\n# Enable service\nsudo systemctl enable --now docker\n# Get Status\nsystemctl status  docker\n\n# Logout....Lougin\nexit\n# Create user\nsudo usermod -aG docker $USER\nnewgrp docker\n\n# Validation\ndocker images\ndocker run hello-world\ndocker -v\n```\n[🏠 Back to Table of Contents](#Table-Of-content)\n\n### 1.2 Install Docker Compose\n\nDocker Compose is a tool for defining and running multi-container Docker applications. It uses YAML files to configure the application's services and performs the creation and start-up process of all the containers with a single command. The `docker-compose` CLI utility allows users to run commands on multiple containers at once, for example, building images, scaling containers, running containers that were stopped, and more. Please refer to [Reference Documentation](https://docs.docker.com/compose/install/) if you have for more detailed instructions.\n\n![Windows](https://github.com/DataStax-Academy/kubernetes-workshop-online/blob/master/4-materials/images/windows32.png?raw=true) : Already **included** in the previous package *Docker for Windows*\n\n![osx](https://github.com/DataStax-Academy/kubernetes-workshop-online/blob/master/4-materials/images/mac32.png?raw=true) : Already **included** in the previous package *Docker for Mac*\n\n![linux](https://github.com/DataStax-Academy/kubernetes-workshop-online/blob/master/4-materials/images/linux32.png?raw=true) : To install on linux (centOS) you can use the following commands\n\n```bash\n# Download deliverable and move to target location\nsudo curl -L \"https://github.com/docker/compose/releases/download/1.23.2/docker-compose-$(uname -s)-$(uname -m)\" -o /usr/local/bin/docker-compose\n\n# Allow execution\nsudo chmod +x /usr/local/bin/docker-compose\n```\n\n### 1.3 Install curl\n\n[Reference Article](https://help.ubidots.com/en/articles/2165289-learn-how-to-install-run-curl-on-windows-macosx-linux)\n\n![Windows](https://github.com/DataStax-Academy/kubernetes-workshop-online/blob/master/4-materials/images/windows32.png?raw=true) : Already **included** as stated [here](https://www.thewindowsclub.com/how-to-install-curl-on-windows-10)\n\n![osx](https://github.com/DataStax-Academy/kubernetes-workshop-online/blob/master/4-materials/images/mac32.png?raw=true) : Use brew\n\n```\nbrew install curl\n```\n\n![linux](https://github.com/DataStax-Academy/kubernetes-workshop-online/blob/master/4-materials/images/linux32.png?raw=true) :Use your package installer like `yum` or apt-get\n\n```\nsudo apt-get install curl\n```\n\n[🏠 Back to Table of Contents](#table-of-content)\n\n\n## 2. Start the demo\n\n#### ✅ 2a. Clone the repository \n\nDownload the repository as a zip [here](https://github.com/datastaxdevs/conference-2021-apachecon-stargate/archive/refs/heads/main.zip) or clone with the following git command\n\n```bash\ngit clone https://github.com/datastaxdevs/conference-2021-apachecon-stargate.git\n``` \n\n#### ✅ 2b. Start `backend-1`\n\nWe provide a `docker-compose.yaml` file ready to go with a `Cassandra 3.11.8` backend and stargate in version `1.0.34`\n\n```bash\nexport CASSTAG=3.11.8\nexport SGTAG=v1.0.34\ndocker-compose up -d backend-1\n```\n\n#### ✅ 2c. When the bootstrap is completed, Start node2 with `docker-compose`\n\n```bash\ndocker-compose up -d backend-2\n```\n\n#### ✅ 2d. When the bootstrap is completed, Start node3 with `docker-compose`\n\n```bash\ndocker-compose up -d backend-3\n````\n\n#### ✅ 2e. Check status of your nodes with `nodetool`\n\n```bash\ndocker exec -it `docker ps | grep backend-1 | cut -b 1-12` nodetool status\n```\n\n#### ✅ 2f. Extract IP of `backend-1` as variable `backend1ip`\n\n- Extract variable\n```bash\nexport backend1ip=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' `docker ps | grep backend-1 | cut -b 1-12`)\n```\n\n- Check that we are OK\n```bash\necho $backend1ip\n```\n\n#### ✅ 2g. Connect as `CQLSH` using the new created var\n\n```bash\ndocker exec -it `docker ps | grep backend-1 | cut -b 1-12` cqlsh $backend1ip -u cassandra -p cassandra\n```\n\n#### ✅ 2h. Create Keyspace `data_endpoint_auth`\n\nThe stargate node executes query with `LOCAL_QUORUM`, the table handling the token `data_endpoint_auth` must have a replication factory of 3.\nThe datacenter used everywhere is `datacenter1`\nAlso here we create an sample keyspace `ks1` for tests.\n\n- Create keyspace\n\n```sql\nDROP KEYSPACE IF EXISTS data_endpoint_auth;\nCREATE KEYSPACE data_endpoint_auth WITH replication = {'class': 'NetworkTopologyStrategy', 'datacenter1': '3'}  AND durable_writes = true;\n```\n\n- Exit CQLSH\n```\nexit\n```\n\n#### ✅ 2i. Start Stargate Node\n\n- Start the node\n```\ndocker-compose up -d stargate\n```\n\n- Wait for the node to be up\n```\necho \"Waiting for stargate to start up...\"\nwhile [[ \"$(curl -s -o /dev/null -w ''%{http_code}'' http://localhost:8082/health)\" != \"200\" ]]; do\n    printf '.'\n    sleep 5\ndone\n```\n\n#### ✅ 2j. Wait for the node to bootstrap and get IP\n\n- Extract variable\n```\nexport stargateip=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' `docker ps | grep stargateio | cut -b 1-12`)\n```\n\n- check we are OK\n```\necho $stargateip\n```\n\n#### ✅ 2k. Check we are all GOOD\n\n```\necho \"Check Status....\"\necho \"Backend-1 IP: $backend1ip\"\necho \"Stargate IP: $stargateip\"\ndocker ps\ndocker exec -it `docker ps | grep backend-1 | cut -b 1-12` nodetool status\n```\n\n**👁️ Expected output**\n\n```bash\nCheck Status....\nBackend-1 IP: 172.19.0.2\nStargate IP: 172.19.0.5\n\nPROMPT\u003e docker ps\nCONTAINER ID   IMAGE                              COMMAND                  CREATED       STATUS       PORTS                                                                                                                                                 NAMES\n2200f5c86bfd   stargateio/stargate-3_11:v1.0.34   \"./starctl\"              3 hours ago   Up 3 hours   0.0.0.0:8080-8082-\u003e8080-8082/tcp, :::8080-8082-\u003e8080-8082/tcp, 0.0.0.0:8084-\u003e8084/tcp, :::8084-\u003e8084/tcp, 0.0.0.0:9045-\u003e9042/tcp, :::9045-\u003e9042/tcp   cassandra-3_stargate_1\n16cb48746e72   cassandra:3.11.8                   \"docker-entrypoint.s…\"   3 hours ago   Up 3 hours   7000-7001/tcp, 7199/tcp, 9042/tcp, 9160/tcp                                                                                                           cassandra-3_backend-3_1\n31bd64f67237   cassandra:3.11.8                   \"docker-entrypoint.s…\"   3 hours ago   Up 3 hours   7000-7001/tcp, 7199/tcp, 9042/tcp, 9160/tcp                                                                                                           cassandra-3_backend-2_1\n835408a3d2d0   cassandra:3.11.8                   \"docker-entrypoint.s…\"   3 hours ago   Up 3 hours   7000-7001/tcp, 7199/tcp, 9160/tcp, 0.0.0.0:9044-\u003e9042/tcp, :::9044-\u003e9042/tcp                                                                          cassandra-3_backend-1_1\n\nPROMPT\u003e  docker exec -it `docker ps | grep backend-1 | cut -b 1-12` nodetool status\n\nDatacenter: datacenter1\n=======================\nStatus=Up/Down\n|/ State=Normal/Leaving/Joining/Moving\n--  Address     Load       Tokens       Owns (effective)  Host ID                               Rack\nUN  172.19.0.3  355.37 KiB  256          100.0%            75b42435-3197-42ed-bdd8-fdb00294865b  rack1\nUN  172.19.0.2  331.99 KiB  256          100.0%            45a33f3a-9115-4878-a1c2-54d00b4c3ff0  rack1\nUN  172.19.0.4  320.44 KiB  256          100.0%            9cb00b9d-3bc6-44bb-95a8-e0152d9db9f8  rack1\n\n```\n\n- You should be able to access the GRAPHQL Playground on [http://localhost:8080/playground](http://localhost:8080/playground)\n\n**👁️ Expected output**\n![image](pics/playground-home.png?raw=true)\n\n- You should be able to access the Swagger UI on [http://localhost:8082/swagger-ui/#/](http://localhost:8082/swagger-ui/#/)\n\n**👁️ Expected output**\n![image](pics/swagger-home.png?raw=true)\n\n- You should be able to access the Metrics UI [http://localhost:8084/metrics](http://localhost:8084/metrics)\n\n**👁️ Expected output**\n![image](pics/metrics.png?raw=true)\n\n[🏠 Back to Table of Contents](#table-of-content)\n\n## 3. Use CQL API\n\n#### ✅ 3a. Start CQLSH\n\n- Use this IP to connect with a cqlsh. *Note that the stargate image itself does not provide it we use the cqlsh from backend-1 as a sample client.*\n\n```bash\ndocker exec -it `docker ps | grep backend-1 | cut -b 1-12` cqlsh $stargateip -u cassandra -p cassandra\n```\n\n#### ✅ 3b. Create your schema\n\n```sql\nCREATE KEYSPACE ks1 WITH replication = {'class': 'NetworkTopologyStrategy', 'datacenter1': '3'}  AND durable_writes = true;\n\nuse ks1;\n\nCREATE TYPE IF NOT EXISTS video_format (\n  width   int,\n  height  int\n);\n\nCREATE TABLE IF NOT EXISTS videos (\n videoid   uuid,\n title     text,\n upload    timestamp,\n email     text,\n url       text,\n tags      set \u003ctext\u003e,\n frames    list\u003cint\u003e,\n formats   map \u003ctext,frozen\u003cvideo_format\u003e\u003e,\n PRIMARY KEY (videoid)\n);\n\ndescribe ks1\n```\n\n#### ✅ 3c. Populate some data\n\n- Insert value using plain CQL\n\n```sql\nINSERT INTO videos(videoid, email, title, upload, url, tags, frames, formats)\nVALUES(uuid(), 'clu@sample.com', 'sample video', \n     toTimeStamp(now()), 'http://google.fr',\n     { 'cassandra','accelerate','2020'},\n     [ 1, 2, 3, 4], \n     { 'mp4':{width:1,height:1},'ogg':{width:1,height:1}});\n```\n\n- Insert Value using JSON\n\n```sql\nINSERT INTO videos JSON '{\n   \"videoid\":\"e466f561-4ea4-4eb7-8dcc-126e0fbfd573\",\n     \"email\":\"clunven@sample.com\",\n     \"title\":\"A Second videos\",\n     \"upload\":\"2020-02-26 15:09:22 +00:00\",\n     \"url\": \"http://google.fr\",\n     \"frames\": [1,2,3,4],\n     \"tags\":   [ \"cassandra\",\"accelerate\", \"2020\"],\n     \"formats\": { \n        \"mp4\": {\"width\":1,\"height\":1},\n        \"ogg\": {\"width\":1,\"height\":1}\n     }\n}';\n```\n\n- Read values\n\n```sql\nselect * from videos;\n```\n\n- Read by id\n```sql\nselect * from videos where videoid=e466f561-4ea4-4eb7-8dcc-126e0fbfd573;\n```\n\n- Quit `cqlsh`\n\n```sql\nexit\n```\n\n[🏠 Back to Table of Contents](#table-of-content)\n\n## 4. Use REST API\n\nThis walkthrough has been realized using the [REST API Quick Start](https://stargate.io/docs/stargate/0.1/quickstart/quick_start-rest.html). Here we will the the [DATA](http://localhost:8082/swagger-ui/#/data) or SwaggerUI\n\n![image](pics/swagger-general.png?raw=true)\n\n#### ✅ 4a. Generate an auth token\n\n```bash\ncurl -L -X POST 'http://localhost:8081/v1/auth' \\\n  -H 'Content-Type: application/json' \\\n  --data-raw '{\n    \"username\": \"cassandra\",\n    \"password\": \"cassandra\"\n}'\n```\n\nCopy the token value (here `74be42ef-3431-4193-b1c1-cd8bd9f48132`) in your clipboard.\n\n**👁️ Expected output**\n```\n{\"authToken\":\"74be42ef-3431-4193-b1c1-cd8bd9f48132\"}\n```\n\n#### ✅ 4b. List keyspaces\n\n- [`GET: /v2/schemas/keyspaces`](http://localhost:8082/swagger-ui/#/schemas/getAllKeyspaces)\n \n![image](pics/swagger-list-keyspace.png?raw=true)\n\n- Click `Try it out`\n- Provide your token in the field `X-Cassandra-Token`\n- Click on `Execute`\n\n\n#### ✅ 4c. List Tables\n\n- [GET /v2/schemas/keyspaces/{keyspaceName}/tables](http://localhost:8082/swagger-ui/#/schemas/getAllTables)\n\n![image](pics/swagger-list-tables.png?raw=true)\n\n- Click `Try it out`\n- Provide your token in the field `X-Cassandra-Token`\n- keyspace: `ks1`\n- Click on `Execute`\n\n\n#### ✅ 4d. List Types\n\n- [GET /v2/schemas/keyspaces/{keyspaceName}/types](http://localhost:8082/swagger-ui/#/schemas/findAll)\n\n![image](pics/swagger-list-types.png?raw=true)\n\n- Click `Try it out`\n- X-Cassandra-Token: `\u003cyour_token\u003e`\n- keyspace: `ks1`\n- Click on `Execute`\n\n#### ✅ 4e Create a Table\n\n- [POST /v2/schemas/keyspaces/{keyspaceName}/tables](http://localhost:8082/swagger-ui/#/schemas/createTable)\n\n![image](pics/swagger-create-table.png?raw=true)\n\n- Click `Try it out`\n- X-Cassandra-Token: `\u003cyour_token\u003e`\n- keyspace: `ks1`\n- Data\n```json\n{\n  \"name\": \"users\",\n  \"columnDefinitions\":\n    [\n        {\n        \"name\": \"firstname\",\n        \"typeDefinition\": \"text\"\n      },\n        {\n        \"name\": \"lastname\",\n        \"typeDefinition\": \"text\"\n      },\n      {\n        \"name\": \"email\",\n        \"typeDefinition\": \"text\"\n      },\n        {\n        \"name\": \"color\",\n        \"typeDefinition\": \"text\"\n      }\n    ],\n  \"primaryKey\":\n    {\n      \"partitionKey\": [\"firstname\"],\n      \"clusteringKey\": [\"lastname\"]\n    },\n  \"tableOptions\":\n    {\n      \"defaultTimeToLive\": 0,\n      \"clusteringExpression\":\n        [{ \"column\": \"lastname\", \"order\": \"ASC\" }]\n    }\n}\n```\n\n**👁️ Expected output**\n\n```json\n{\n  \"name\": \"users\"\n}\n```\n\n#### ✅ 4f. Insert Rows\n\n*Notice than for the DML you move to `DATA`. Make sure you are using url with `V2`, `V1` would also work but this is NOT the same payload.* \n\n- [POST /v2/keyspaces/{keyspaceName}/{tableName}](http://localhost:8082/swagger-ui/#/data/createRow)\n\n![image](pics/swagger-addrows.png?raw=true)\n\n- X-Cassandra-Token: `\u003cyour_token\u003e`\n- keyspaceName: `ks1`\n- tableName: `users`\n- Data\n```json\n{   \n    \"firstname\": \"Cedrick\",\n    \"lastname\": \"Lunven\",\n    \"email\": \"c.lunven@gmail.com\",\n    \"color\": \"blue\"\n}\n```\n\nYou can note that the output code is `201` and return your primary key `{ \"firstname\": \"Cedrick\",\"lastname\": \"Lunven\" }\n\n- You can add a second record changing only the payload\n```json\n{\n    \"firstname\": \"David\",\n    \"lastname\": \"Gilardi\",\n    \"email\": \"d.gilardi@gmail.com\",\n    \"color\": \"blue\"\n}\n```\n\n- Add a third\n```json\n{\n    \"firstname\": \"Kirsten\",\n    \"lastname\": \"Hunter\",\n    \"email\": \"k.hunter@gmail.com\",\n    \"color\": \"pink\"\n}\n```\n\n#### ✅ 4g. Read multiple rows\n\n- [GET /v2/keyspaces/{keyspaceName}/{tableName}/rows](http://localhost:8082/swagger-ui/#/data/getAllRows_1)\n![image](pics/swagger-listrows.png?raw=true)\n\n- X-Cassandra-Token: `\u003cyour_token\u003e`\n- keyspaceName: `ks1`\n- tableName: `users`\n- Click Execute\n\n- Notice how now you can only limited return fields\n\n- fields: `firstname, lastname`\n\n#### ✅ 4h. Read a single partition\n\n- [GET /v2/keyspaces/{keyspaceName}/{tableName}/{primaryKey}](http://localhost:8082/swagger-ui/#/data/getRows_1)\n\n![image](pics/swagger-readrows.png?raw=true)\n\n- X-Cassandra-Token: `\u003cyour_token\u003e`\n- keyspaceName: `ks1`\n- tableName: `users`\n- primaryKey; 'Cedrick`\n- Click Execute\n\n```diff\n- Important: The Swagger user interface is limited as of now and you cannot test a composite key (here adding Lunven). This is a bug in the UI not the API.\n```\n\n#### ✅ 4i. Delete a row\n\n- [DELETE /v2/keyspaces/{keyspaceName}/{tableName}/{primaryKey}](http://localhost:8082/swagger-ui/#/data/deleteRows)\n\n![image](pics/swagger-deleterows.png?raw=true)\n\n- X-Cassandra-Token: `\u003cyour_token\u003e`\n- keyspaceName: `ks1`\n- tableName: `users`\n- primaryKey; 'Cedrick`\n- Click Execute\n\n#### ✅ 4j. Searches\n\n- [GET /v2/keyspaces/{keyspaceName}/{tableName}](http://localhost:8082/swagger-ui/#/data/getRowWithWhere)\n\n![image](pics/swagger-searchrows.png?raw=true)\n\n\n- X-Cassandra-Token: `\u003cyour_token\u003e`\n- keyspaceName: `ks1`\n- tableName: `users`\n- whereClause; '{\"firstname\": {\"$eq\":\"David\"}}`\n- Click Execute\n\nI let you try with `{\"lastname\": {\"$eq\":\"Gilardi\"}}`.. expected right ?\n\n\n[🏠 Back to Table of Contents](#table-of-content)\n\n## 5. Use Document API (swagger+curl)\n\nThis walkthrough has been realized using the [Quick Start](https://stargate.io/docs/stargate/0.1/quickstart/quick_start-document.html)\n\n\n\n**✅ 5a. List Namespaces** :\n\n![image](pics/swagger-doc-listnamespaces.png?raw=true)\n\n\n**✅ 5b. Create a document** :\n\n*Note: operations requiring providing `namespace` and `collections` on the swagger UI seems not functional. We are switching to CURL the API is working, this is a documentation bug that has been notified to the development team.*\n\n![image](pics/swagger-doc-create.png?raw=true)\n\n\n```json\n{\n   \"videoid\":\"e466f561-4ea4-4eb7-8dcc-126e0fbfd573\",\n     \"email\":\"clunven@sample.com\",\n     \"title\":\"A Second videos\",\n     \"upload\":\"2020-02-26 15:09:22 +00:00\",\n     \"url\": \"http://google.fr\",\n     \"frames\": [1,2,3,4],\n     \"tags\":   [ \"cassandra\",\"accelerate\", \"2020\"],\n     \"formats\": { \n        \"mp4\": {\"width\":1,\"height\":1},\n        \"ogg\": {\"width\":1,\"height\":1}\n     }\n}\n```\n\n**✅ 5c. Retrieve documents** :\n\n![image](pics/swagger-doc-search.png?raw=true)\n\n\n\n**✅ 5d. Retrieve 1 document** :\n\n![image](pics/swagger-doc-get.png?raw=true)\n\n\n**✅ 5e. Search for document by properties** :\n\n\n![image](pics/swagger-doc-search.png?raw=true)\n\n- WhereClause\n\n```json\n{\"email\": {\"$eq\": \"clunven@sample.com\"}}\n```\n\n[🏠 Back to Table of Contents](#table-of-content)\n\n## 6. Use GraphQL API (portal)\n\nThis walkthrough has been realized using the [GraphQL Quick Start](https://stargate.io/docs/stargate/0.1/quickstart/quick_start-graphql.html)\n\nSame as Rest API generate a `auth token` \n\n**✅ 6a Generate Auth token** :\n```bash\ncurl -L -X POST 'http://localhost:8081/v1/auth' \\\n  -H 'Content-Type: application/json' \\\n  --data-raw '{\n    \"username\": \"cassandra\",\n    \"password\": \"cassandra\"\n}'\n```\n\nSave output as an environment variable\n```\nexport AUTH_TOKEN=7c37bda5-7360-4d39-96bc-9765db5773bc\n```\n\n**✅ 6b. Open GraphQL Playground** :\n\n- You should be able to access the GRAPH QL PORTAL on [http://localhost:8080/playground](http://localhost:8080/playground)\n\nYou can check on the right of the playground that you have access to documentation and schema which is the neat part about graphQL\n\n**👁️ Expected output**\n![image](pics/playground-home.png?raw=true)\n\n**✅ 6c. Creating a Table** :\n\n- Use this query\n```\nmutation {\n  books: createTable(\n    keyspaceName:\"library\",\n    tableName:\"books\",\n    partitionKeys: [ # The keys required to access your data\n      { name: \"title\", type: {basic: TEXT} }\n    ]\n    values: [ # The values associated with the keys\n      { name: \"author\", type: {basic: TEXT} }\n    ]\n  )\n  authors: createTable(\n    keyspaceName:\"library\",\n    tableName:\"authors\",\n    partitionKeys: [\n      { name: \"name\", type: {basic: TEXT} }\n    ]\n    clusteringKeys: [ # Secondary key used to access values within the partition\n      { name: \"title\", type: {basic: TEXT}, order: \"ASC\" }\n    ]\n  )\n}\n```\n\n**👁️ Expected output**\n![image](pics/graphql-createtables.png?raw=true)\n\n**✅ 6d. Populating Table** :\n\nAny of the created APIs can be used to interact with the GraphQL data, to write or read data.\n\nFirst, let’s navigate to your new keyspace `library` inside the playground. Change tab to `graphql` and pick url `/graphql/library`.\n\n- Use this query\n```\nmutation {\n  moby: insertBooks(value: {title:\"Moby Dick\", author:\"Herman Melville\"}) {\n    value {\n      title\n    }\n  }\n  catch22: insertBooks(value: {title:\"Catch-22\", author:\"Joseph Heller\"}) {\n    value {\n      title\n    }\n  }\n}\n```\n\n- Don't forget to update the header again\n```\n{\n  \"x-cassandra-token\":\"7c37bda5-7360-4d39-96bc-9765db5773bc\"\n}\n```\n**👁️ Expected output**\n![image](pics/graphql-insertdata.png?raw=true)\n\n\n**✅ 6e. Read data** :\n\nStay on the same screen and sinmply update the query with \n```\nquery oneBook {\n    books (value: {title:\"Moby Dick\"}) {\n      values {\n        title\n        author\n      }\n    }\n}\n```\n\n**👁️ Expected output**\n![image](pics/graphql-readdata.png?raw=true)\n\n\n[🏠 Back to Table of Contents](#table-of-content)\n\n## 7. Create your ASTRA Instance\n\n**✅ Create an free-forever Cassandra database with DataStax Astra**: [click here to get started](https://astra.datastax.com/register?utm_source=github\u0026utm_medium=referral\u0026utm_campaign=spring-petclinic-reactive) 🚀\n\n\n![Astra Registration Screen](pics/db-auth.png?raw=true)\n\n\n**✅ Use the form to create new database**\n\nOn the Astra home page locate the **Add Database** button\n\n![Astra Database Creation Form](pics/db-creation-1.png?raw=true)\n\nSelect the **free tier** plan, this is a true free tier, free forever and no payment method asked 🎉 🎉\n\n![Astra Database Creation Form](pics/db-creation-2.png?raw=true)\n\nSelect the proper region and click the `configure` button. The number of regions and cloud providers are limited in the free tier but please notice you can run the DB on any cloud with any VPC Peering.\n\n![Astra Database Creation Form](pics/db-creation-3.png?raw=true)\n\nFill the `database name`, `keyspace name`, `username` and `password`. *Please remember your password as you will be asked to provide it when application start the first time.*\n\n![Astra Database Creation Form](pics/db-creation-4.png?raw=true)\n\n**✅ View your Database and connect**\n\nView your database. It may take 2-3 minutes for your database to spin up. You will receive an email at that point.\n\n**👁️ Expected output**\n\n*Initializing*\n\n![my-pic](https://github.com/datastaxdevs/shared-assets/blob/master/astra/dashboard-pending-1000.png?raw=true)\n\nOnce the database is ready, notice how the status changes from `pending` to `Active` and Astra enables the **connect** button.\n\n![my-pic](https://github.com/datastaxdevs/shared-assets/blob/master/astra/dashboard-withdb-1000.png?raw=true)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatastaxdevs%2Fconference-2021-apachecon-stargate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdatastaxdevs%2Fconference-2021-apachecon-stargate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatastaxdevs%2Fconference-2021-apachecon-stargate/lists"}