{"id":19704701,"url":"https://github.com/datastax/cassandra-data-apis","last_synced_at":"2026-01-11T21:53:35.637Z","repository":{"id":46956725,"uuid":"245009457","full_name":"datastax/cassandra-data-apis","owner":"datastax","description":"Data APIs for Apache Cassandra","archived":false,"fork":false,"pushed_at":"2021-09-20T14:30:19.000Z","size":469,"stargazers_count":20,"open_issues_count":37,"forks_count":5,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-11-22T13:05:25.564Z","etag":null,"topics":["cassandra","datastax","docker","endpoint","graphql","http"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/datastax.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-03-04T21:39:35.000Z","updated_at":"2024-07-16T06:39:03.000Z","dependencies_parsed_at":"2022-09-10T18:00:47.075Z","dependency_job_id":null,"html_url":"https://github.com/datastax/cassandra-data-apis","commit_stats":null,"previous_names":["riptano/data-endpoints"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/datastax/cassandra-data-apis","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datastax%2Fcassandra-data-apis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datastax%2Fcassandra-data-apis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datastax%2Fcassandra-data-apis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datastax%2Fcassandra-data-apis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/datastax","download_url":"https://codeload.github.com/datastax/cassandra-data-apis/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datastax%2Fcassandra-data-apis/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28324397,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-11T18:42:50.174Z","status":"ssl_error","status_checked_at":"2026-01-11T18:39:13.842Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["cassandra","datastax","docker","endpoint","graphql","http"],"created_at":"2024-11-11T21:24:08.045Z","updated_at":"2026-01-11T21:53:35.603Z","avatar_url":"https://github.com/datastax.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Data APIs for Apache Cassandra (Deprecated)\n\n(Project has been moved to Stargate)\n\nEasy to use APIs for accessing data stored in Apache Cassandra. \n\nThese APIs can be used as a standalone server using either Docker or manually\nrunning a server. They can also be embedded in existing applications using HTTP\nroutes. \n\nCurrently, this project provides GraphQL APIs. Other API types are possible in\nthe future.\n\n## Getting Started\n\n### Installation\n\n```sh\ndocker pull datastaxlabs/cassandra-data-apis\ndocker run -p 8080:8080 -e DATA_API_HOSTS=\u003ccassandra_hosts_here\u003e datastaxlabs/cassandra-data-apis\n```\n\nYou can also manually build the docker image and/or the server using the\n[instructions](#building) below.\n\n#### Running in the background\n\nYou can start the container in detached mode by using `-d` and `--rm` flags.\n\n```sh\ndocker run --rm -d -p 8080:8080 -e DATA_API_HOSTS=\u003ccassandra_hosts_here\u003e datastaxlabs/cassandra-data-apis\n```\n\n#### Running on macOS or Windows for development purposes\n\nWhen using Docker for Desktop, if your Cassandra instance is listening on the loopback address `127.0.0.1`,\nyou can use `host.docker.internal` name which resolves to the internal IP address used by the host.\n\n```sh\ndocker run -p 8080:8080 -e DATA_API_HOSTS=host.docker.internal datastaxlabs/cassandra-data-apis\n```\n\n### Using GraphQL\n\nBy default, a GraphQL endpoint is started and will generate a GraphQL schema per keyspace. You need at least one\nuser-defined keyspace in your database to get started.  \n\nUse the [GraphQL documentation](/docs/graphql/README.md) for getting started.\n\n## Configuration\n\nConfiguration for Docker can be done using either environment variables, a\nmounted configuration file, or both.\n\nAdd additional configuration using environment variables by adding them to the\n`docker run` command.\n\n```\ndocker run -e DATA_API_HOSTS=127.0.0.1 -e DATA_API_KEYSPACE=example ...\n```\n\n### Using a configuration file\n\nTo use a configuration file, create a file with the following contents:\n\n```yaml\nhosts:\n  # Change to your cluster's hosts\n  - 127.0.0.1\n# keyspace: example\n# username: cassandra\n# password: cassandra\n\n# See the \"Settings\" section for additional configuration\n\n```\n\nThen start docker with:\n\n```sh\ndocker run -p 8080:8080 -v \"${PWD}/\u003cyour_config_file\u003e.yaml:/root/config.yaml\" datastaxlabs/cassandra-data-apis\n```\n\n### Settings\n\n| Name | Type | Env. Variable | Description |\n| --- | --- | --- | --- |\n| hosts                  | strings  | DATA_API_HOSTS                  | Hosts for connecting to the database |\n| keyspace               | string   | DATA_API_KEYSPACE               | Only allow access to a single keyspace |\n| excluded-keyspaces     | strings  | DATA_API_EXCLUDED_KEYSPACES     | Keyspaces to exclude from the endpoint |\n| username               | string   | DATA_API_USERNAME               | Connect with database user |\n| password               | string   | DATA_API_PASSWORD               | Database user's password |\n| operations             | strings  | DATA_API_OPERATIONS             | A list of supported schema management operations. See below. (default `\"TableCreate, KeyspaceCreate\"`) |\n| request-logging        | bool     | DATA_API_REQUEST_LOGGING        | Enable request logging |\n| schema-update-interval | duration | DATA_API_SCHEMA_UPDATE_INTERVAL | Interval in seconds used to update the graphql schema (default `10s`) |\n| ssl-enabled            | bool     | DATA_API_SSL_ENABLED            | Enable SSL (client-to-node encryption)? |\n| ssl-ca-cert-path       | string   | DATA_API_SSL_CA_CERT_PATH       | SSL CA certificate path |\n| ssl-client-cert-path   | string   | DATA_API_SSL_CLIENT_CERT_PATH   | SSL client certificate path |\n| ssl-client-key-path    | string   | DATA_API_SSL_CLIENT_KEY_PATH    | SSL client private key path |\n| ssl-host-verification  | string   | DATA_API_SSL_HOST_VERIFICATION  | Verify the peer certificate? It is highly insecure to disable host verification (default `true`) |\n| start-graphql          | bool     | DATA_API_START_GRAPHQL          | Start the GraphQL endpoint (default `true`) |\n| graphql-path           | string   | DATA_API_GRAPHQL_PATH           | GraphQL endpoint path (default `\"/graphql\"`) |\n| graphql-port           | int      | DATA_API_GRAPHQL_PORT           | GraphQL endpoint port (default `8080`) |\n| graphql-schema-path    | string   | DATA_API_GRAPHQL_SCHEMA_PATH    | GraphQL schema management path (default `\"/graphql-schema\"`) |\n\n#### Configuration Types\n\nThe `strings` type expects a comma-delimited list e.g. `127.0.0.1, 127.0.0.2,\n127.0.0.3` when using environment variables or a command flag, and it expects\nan array type when using a configuration file.\n\nYAML:\n\n```yaml\n--- \nhost: \n  - \"127.0.0.1\"\n  - \"127.0.0.2\"\n  - \"127.0.0.3\"\n\n```\n\nJSON:\n```json\n{\n  \"hosts\": [\"127.0.0.1\", \"127.0.0.2\", \"127.0.0.3\"]\n}\n```\n\n#### Schema Management Operations\n\n| Operation | Allows |\n| --- | --- |\n| `TableCreate`    | Creation of tables    |\n| `TableDrop`      | Removal of tables     |\n| `TableAlterAdd`  | Add new table columns |\n| `TableAlterDrop` | Remove table columns  |\n| `KeyspaceCreate` | Creation of keyspaces |\n| `KeyspaceDrop`   | Removal of keyspaces  |\n\n#### TLS/SSL\n\n##### HTTPS\n\nThe API endpoint does not currently support HTTPS natively, but it can be handled by a gateway or\nreverse proxy. More information about protecting the API endpoint can be found in this\n[documentation][protecting].\n\n##### Client-to-node Encryption\n\nBy default, traffic between the API endpoints and the database servers is not encrypted. To secure\nthis traffic you will need to generate SSL certificates and enable SSL on the database servers. More\ninformation about enabling SSL (client-to-node encryption) on the database servers can be found in\nthis [documentation][client-to-node]. After SSL is enabled on the database servers use the\n`ssl-enabled` option, along with `ssl-ca-cert-path` to enable secure connections. `ssl-ca-cert-path`\nis a path to the chain of certificates used to generate the database server's certificates. The\ncertificate chain is used by API endpoints to verify the database server's certificates.  The\n`ssl-client-cert-path` and `ssl-client-key-path` options are not required, but can be use to provide\nclient-side certificates that are used by the database servers to authenticate and verify the API\nservers, this is known as mutual authentication. \n\n## Building \n\nThis section is mostly for developers. Pre-built docker image recommended.\n\n### Building the Docker Image\n\n```bash\ncd \u003cpath_to_data-apis\u003e/cassandra-data-apis\ndocker build -t cassandra-data-apis .\n```\n\n### Run locally with single node, local Cassandra cluster\n\n```bash\ncd \u003cpath_to_data-apis\u003e/cassandra-data-apis\ndocker build -t cassandra-data-apis .\n\n# On Linux (with a cluster started on the docker bridge: 172.17.0.1)\ndocker run -p 8080:8080 -e \"DATA_API_HOSTS=172.17.0.1\" cassandra-data-apis\n\n# With a cluster bound to 0.0.0.0\ndocker run --network host -e \"DATA_API_HOSTS=127.0.0.1\" cassandra-data-apis\n\n# On macOS (with a cluster bound to 0.0.0.0)\ndocker run -p 8080:8080 -e \"DATA_API_HOSTS=host.docker.internal\" cassandra-data-apis\n```\n\nThese host values can also be used in the configuration file approach used in\nthe previous section.\n\n### Build and run as a standalone webserver\n\nIf you want to run this module as a standalone webserver, use:\n\n```bash\n# Define the keyspace you want to use\n# Start the webserver\ngo build run.exe \u0026\u0026 ./run.exe --hosts 127.0.0.1 --keyspace store\n```\n\nYour settings can be persisted using a configuration file:\n\n```yaml\nhosts:\n  - 127.0.0.1\nkeyspace: store\noperations:\n  - TableCreate\n  - KeyspaceCreate\nport: 8080\nschema-update-interval: 30s\n```\n\nTo start the server using a configuration file, use:\n\n```bash\n./run.exe --config \u003cyour_config_file\u003e.yaml\n```\n\nSettings can also be overridden using environment variables prefixed with\n`DATA_API_`:\n\n```bash\nDATA_API_HOSTS=127.0.0.1 DATA_API_KEYSPACE=store ./run.exe --config \u003cyour_config_file\u003e.yaml\n```\n\n### Plugin the routes within your HTTP request router\n\n#### Installation\n\n```\ngo get github.com/datastax/cassandra-data-apis\n```\n\n#### Using the API\n\nTo add the routes to your existing HTTP request router, use:\n\n```go\ncfg := endpoint.NewEndpointConfig(\"your.first.contact.point\", \"your.second.contact.point\")\n// Setup config here using your env variables\nendpoint, err := cfg.NewEndpoint()\nif err != nil {\n\tlog.Fatalf(\"unable create new endpoint: %s\", err)\n}\nkeyspace := \"store\"\nroutes, err = endpoint.RoutesKeyspaceGraphQL(\"/graphql\", keyspace)\n// Setup routes on your http router\n```\n\n## License\n\n© DataStax, Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with\nthe License. You may obtain a copy of the License at\n\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under the License is distributed on\nan \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the\nspecific language governing permissions and limitations under the License.\n\n[protecting]: /docs/protecting/README.md\n[client-to-node]: https://docs.datastax.com/en/cassandra-oss/3.x/cassandra/configuration/secureSSLClientToNode.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatastax%2Fcassandra-data-apis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdatastax%2Fcassandra-data-apis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatastax%2Fcassandra-data-apis/lists"}