Get started with the Data API
Mission Control lets you view Data API connection details in the UI to interact with the databases in your datacenter. On the Connect page, you can learn how to connect to the Data API and view the API documentation.
You can use the Data API to programmatically interact with your databases. You can interact with the Data API through clients or HTTP.
The Data API is available with HCD and DSE 6.9+. Apache Cassandra® databases are not supported. |
Connect with the Data API
You can view and manage the API gateways for your datacenter in the Mission Control UI.
-
In the Mission Control UI navigation menu, select your project, and then select your database cluster.
-
Click Connect.
-
Click APIs to open the Active API gateways page.
-
Create an API gateway for your datacenter:
-
Click Add Gateway, and then select the datacenter you want to expose using the Data API.
-
Under Replicas, enter the number of replicas. DataStax recommends a single replica for development and testing purposes and at least two replicas for production environments.
-
Select a Service Type from the list: nodePort or clusterIP.
-
nodePort service
-
clusterIP service
A
nodePort
service exposes the gateway outside Kubernetes on all nodes in the cluster through the specified port. For anodePort
service, you can reach the Data API from all configured VMs/worker nodes in the Mission Control cluster:http://DNS_NAME_OR_IP_ADDRESS_OF_CLUSTER_NODE:CONFIGURED_PORT
Replace the following:
-
DNS_NAME_OR_IP_ADDRESS_OF_CLUSTER_NODE
: DNS name or IP address of a node in the Mission Control cluster -
CONFIGURED_PORT
: Port number configured for the Data API service
The port must be in the 30000-32767 range.
A
clusterIP
service exposes the gateway inside the Kubernetes cluster only. For aclusterIP
service, use the following address to connect to the Data API from within the cluster:http://CLUSTER_NAME-DC_NAME-data-api-cip.PROJECT_SLUG.svc:CONFIGURED_PORT
Replace the following:
-
CLUSTER_NAME
: Name of the Mission Control cluster -
*DC_NAME:
: Name of the datacenter -
PROJECT_SLUG
: Name of the project -
CONFIGURED_PORT
: Port number configured for the Data API service
The generated service name is:
<GATEWAY_NAME>-data-api-cip
. -
-
Enter a Port Number, and then click Add Gateway. The port must be in the 30000-32767 range.
-
Use the Data API
Once you have connected with the Data API, refer to the HCD or DSE documentation to use the Data API: