### Insert Example Data into ScyllaDB Table Source: https://cloud.docs.scylladb.com/stable/vector-search/vector-search-quick-start This code provides multiple examples of inserting data into the 'myapp.comments' table. Each insertion includes a unique record_id, id, commenter, comment text, and a corresponding 'comment_vector' represented as an array of floats. This data is crucial for populating the table before performing vector searches. ```cql INSERT INTO myapp.comments (record_id, id, commenter, comment, comment_vector, created_at) VALUES (now(), uuid(), 'Alice', 'I like vector search in ScyllaDB.', [0.12,0.34,0.56,0.78,0.91,0.15,0.62,0.48,0.22,0.31,0.40,0.67,0.53,0.84,0.19,0.72,0.63,0.54,0.26,0.33,0.11,0.09,0.27,0.41,0.69,0.82,0.57,0.38,0.71,0.46,0.55,0.64,0.17,0.81,0.23,0.95,0.66,0.35,0.44,0.59,0.02,0.75,0.28,0.16,0.92,0.88,0.47,0.13,0.99,0.21,0.32,0.83,0.45,0.04,0.86,0.25,0.36,0.73,0.07,0.61,0.52,0.14,0.68,0.05], toTimestamp(now())); INSERT INTO myapp.comments (record_id, id, commenter, comment, comment_vector, created_at) VALUES (now(), uuid(), 'Bob', 'I like ScyllaDB!', [0.11,0.35,0.55,0.77,0.92,0.14,0.61,0.47,0.23,0.32,0.41,0.66,0.52,0.83,0.18,0.73,0.64,0.53,0.27,0.34,0.12,0.10,0.26,0.42,0.70,0.81,0.56,0.39,0.70,0.47,0.54,0.65,0.16,0.80,0.22,0.94,0.67,0.34,0.43,0.58,0.03,0.74,0.29,0.17,0.91,0.87,0.46,0.12,0.98,0.20,0.31,0.84,0.44,0.05,0.85,0.24,0.35,0.72,0.06,0.60,0.51,0.13,0.67,0.06], toTimestamp(now())); INSERT INTO myapp.comments (record_id, id, commenter, comment, comment_vector, created_at) VALUES (now(), uuid(), 'Charlie', 'Can somebody recommend a good restaurant in Paris?', [0.55,0.08,0.44,0.19,0.77,0.25,0.39,0.10,0.50,0.62,0.07,0.14,0.97,0.23,0.36,0.92,0.31,0.81,0.06,0.42,0.70,0.28,0.59,0.21,0.85,0.63,0.15,0.30,0.38,0.27,0.11,0.79,0.52,0.99,0.33,0.40,0.12,0.73,0.24,0.47,0.65,0.20,0.57,0.87,0.13,0.48,0.74,0.04,0.60,0.29,0.18,0.64,0.71,0.16,0.53,0.45,0.95,0.02,0.37,0.26,0.05,0.82,0.35,0.32], toTimestamp(now())); INSERT INTO myapp.comments (record_id, id, commenter, comment, comment_vector, created_at) VALUES (now(), uuid(), 'Diana', 'Vector databases are the future', [0.12,0.33,0.57,0.79,0.90,0.16,0.63,0.49,0.21,0.30,0.39,0.68,0.54,0.85,0.20,0.71,0.62,0.55,0.25,0.32,0.10,0.08,0.28,0.40,0.68,0.83,0.58,0.37,0.72,0.45,0.56,0.63,0.18,0.82,0.24,0.96,0.65,0.36,0.45,0.60,0.01,0.76,0.27,0.15,0.93,0.89,0.48,0.14,1.00,0.22,0.33,0.82,0.46,0.03,0.87,0.26,0.37,0.74,0.08,0.62,0.53,0.13,0.69,0.04], toTimestamp(now())); INSERT INTO myapp.comments (record_id, id, commenter, comment, comment_vector, created_at) VALUES (now(), uuid(), 'Eve', 'Testing similarity search queries in ScyllaDB', [0.13,0.36,0.59,0.76,0.88,0.17,0.60,0.50,0.25,0.34,0.38,0.65,0.50,0.82,0.23,0.70,0.66,0.51,0.28,0.31,0.09,0.07,0.30,0.43,0.71,0.80,0.60,0.36,0.74,0.48,0.53,0.62,0.19,0.83,0.26,0.93,0.64,0.33,0.46,0.61,0.00,0.73,0.31,0.13,0.90,0.85,0.49,0.11,0.97,0.19,0.35,0.81,0.42,0.06,0.89,0.29,0.34,0.75,0.10,0.63,0.52,0.12,0.67,0.02], toTimestamp(now())); INSERT INTO myapp.comments (record_id, id, commenter, comment, comment_vector, created_at) VALUES (now(), uuid(), 'Frank', 'Deep learning meets databases', [0.10,0.31,0.53,0.81,0.93,0.13,0.59,0.45,0.26,0.33,0.42,0.64,0.49,0.80,0.22,0.74,0.61,0.57,0.24,0.35,0.15,0.11,0.29,0.39,0.66,0.84,0.55,0.40,0.73,0.50,0.51,0.60,0.14,0.79,0.20,0.92,0.68,0.37,0.41,0.56,0.04,0.77,0.30,0.18,0.91,0.86,0.47,0.10,0.96,0.23,0.36,0.80,0.43,0.02,0.88,0.27,0.38,0.70,0.06,0.65,0.54,0.08,0.71,0.07], toTimestamp(now())); INSERT INTO myapp.comments (record_id, id, commenter, comment, comment_vector, created_at) VALUES (now(), uuid(), 'Grace', 'ScyllaDB is highly performant', [0.11,0.84,0.29,0.71,0.17,0.94,0.62,0.53,0.43,0.25,0.96,0.38,0.18,0.82,0.45,0.01,0.75,0.19,0.30,0.58,0.12,0.68,0.92,0.15,0.26,0.20,0.44,0.32,0.89,0.16,0.64,0.54,0.79,0.27,0.36,0.21,0.09,0.50,0.23,0.88,0.39,0.33,0.06,0.70,0.31,0.07,0.80,0.13,0.24,0.52,0.46,0.85,0.60,0.08,0.48,0.22,0.14,0.42,0.10,0.34,0.28,0.02,0.41,0.63], toTimestamp(now())); INSERT INTO myapp.comments (record_id, id, commenter, comment, comment_vector, created_at) VALUES (now(), uuid(), 'Heidi', 'Anyone here using ScyllaDB for AI applications?', [0.08,0.37,0.52,0.82,0.94,0.19,0.57,0.43,0.27,0.36,0.44,0.62,0.48,0.79,0.26,0.76,0.59,0.50,0.30,0.29,0.14,0.05,0.32,0.37,0.65,0.86,0.61,0.42,0.75,0.51,0.49,0.59,0.12,0.77,0.25,0.90,0.70,0.39,0.40,0.54,0.06,0.71,0.33,0.21,0.89,0.84,0.45,0.09,0.93,0.16,0.37,0.78,0.41,0.00,0.86,0.22,0.40,0.69,0.11,0.64,0.56,0.10,0.73,0.09], toTimestamp(now())); ``` -------------------------------- ### Example: List Cloud Providers using ScyllaDB Cloud API with cURL Source: https://cloud.docs.scylladb.com/stable/api-docs/create-api-token This example demonstrates how to list all available cloud providers using the ScyllaDB Cloud API via a cURL command. It shows the correct way to include the 'Authorization' header with your personal access token for the request. ```bash curl --request GET \ --url https://api.cloud.scylladb.com/deployment/cloud-providers \ --header 'Authorization: Bearer ' ``` -------------------------------- ### Get VPC Connection List (GET) Source: https://cloud.docs.scylladb.com/stable/api Retrieves a list of all VPC connections for a given account and cluster. Supports filtering by connection type and datacenter ID. Requires account ID and cluster ID. ```Shell curl --request GET \ --url 'https://api.cloud.scylladb.com/account/{accountId}/cluster/{clusterId}/network/vpc/connection?type=SOME_STRING_VALUE&dc=SOME_INTEGER_VALUE' \ --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' ``` -------------------------------- ### Get all Scylla Cloud versions Source: https://cloud.docs.scylladb.com/stable/api List all available ScyllaDB Cloud service versions. ```APIDOC ## GET /deployment/scylla-versions ### Description List all available ScyllaDB Cloud service versions. ### Method GET ### Endpoint https://api.cloud.scylladb.com/deployment/scylla-versions ### Parameters #### Query Parameters - **defaults** (boolean) - Optional - If true, should include default values. Defaults to false. #### Request Body None ### Request Example ```bash curl --request GET \ --url 'https://api.cloud.scylladb.com/deployment/scylla-versions?defaults=SOME_BOOLEAN_VALUE' \ --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' ``` ### Response #### Success Response (200) OK #### Response Example (Response structure not provided in the input text) ``` -------------------------------- ### Get list of supported cloud providers Source: https://cloud.docs.scylladb.com/stable/api Lists details about all cloud providers currently supported in Scylla-Cloud. ```APIDOC ## GET /deployment/cloud-providers ### Description Lists details about all cloud providers currently supported in Scylla-Cloud. ### Method GET ### Endpoint https://api.cloud.scylladb.com/deployment/cloud-providers ### Parameters #### Query Parameters None #### Request Body None ### Request Example ```bash curl --request GET \ --url https://api.cloud.scylladb.com/deployment/cloud-providers \ --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' ``` ### Response #### Success Response (200) - **cloudProviders** (array) - A list of supported cloud providers. - **id** (integer) - The unique identifier for the cloud provider. - **name** (string) - The name of the cloud provider (e.g., "AWS"). - **rootAccountId** (string) - The root account ID for the cloud provider. #### Response Example ```json { "error": "040101", "data": { "cloudProviders": [ { "id": 1, "name": "AWS", "rootAccountId": "123456789012" } ] } } ``` ``` -------------------------------- ### Create ScyllaDB Vector Index (CQL) Source: https://cloud.docs.scylladb.com/stable/vector-search/reference-vector-search Illustrates the CQL syntax and an example for creating a vector index on a table in ScyllaDB. This enables efficient similarity searches. ```cql CREATE CUSTOM INDEX [ IF NOT EXISTS ] `index_name` ON `table_name` (`vector_column_name`) USING 'vector_index' [WITH OPTIONS = ]; CREATE CUSTOM INDEX vectorIndex ON pictures (picture_vector) USING 'vector_index' WITH OPTIONS = {'similarity_function': 'COSINE', 'maximum_node_connections': '16'}; ``` -------------------------------- ### GET /account/{accountId}/notifications/email Source: https://cloud.docs.scylladb.com/stable/api Gets the contact email addresses used for cluster notifications. This endpoint allows you to retrieve the current list of email addresses configured for receiving cluster notifications. ```APIDOC ## GET /account/{accountId}/notifications/email ### Description Gets the contact email addresses used for cluster notifications. This endpoint allows you to retrieve the current list of email addresses configured for receiving cluster notifications. ### Method GET ### Endpoint /account/{accountId}/notifications/email ### Parameters #### Path Parameters - **accountId** (integer) - Required - The ID of the account. #### Header Parameters - **Authorization** (string) - Required - Bearer token for authentication. ### Response #### Success Response (200) - **error** (string) - Description of any error that occurred. - **data** (object) - Notification email information: - **email** (string) - The primary email address (may be deprecated or unused). - **emails** (array of strings) - The list of notification email addresses. #### Response Example (200) ```json { "error": null, "data": { "email": "notifications@achme.com", "emails": [ "notifications@achme.com", "other@mail.com" ] } } ``` #### Error Responses - **400** - Bad Request - **404** - Not Found - **500** - Internal Server Error ``` -------------------------------- ### Create ScyllaDB Keyspace Source: https://cloud.docs.scylladb.com/stable/vector-search/vector-search-quick-start This code snippet creates a new keyspace named 'myapp' with a NetworkTopologyStrategy and a replication factor of 3. This is the first step in organizing data for ScyllaDB. ```cql CREATE KEYSPACE myapp WITH replication = { 'class': 'NetworkTopologyStrategy', 'replication_factor': 3 }; ``` -------------------------------- ### Create ScyllaDB Keyspace with Tablets Enabled (CQL) Source: https://cloud.docs.scylladb.com/stable/vector-search/work-with-vector-search Demonstrates how to create a ScyllaDB keyspace with tablets enabled, which is a requirement for tables containing vector-typed columns. Includes syntax for both new and older ScyllaDB versions. ```cql CREATE KEYSPACE myapp WITH replication = { 'class': 'NetworkTopologyStrategy', 'replication_factor': 3 }; ``` ```cql CREATE KEYSPACE myapp WITH replication = { 'class': 'NetworkTopologyStrategy', 'replication_factor': 3 } AND tablets = { 'enabled': true }; ``` -------------------------------- ### Get ScyllaDB Cloud Account ID via API Source: https://cloud.docs.scylladb.com/stable/vector-search/vector-search-clusters Retrieves the account ID from ScyllaDB Cloud by making a GET request to the account endpoint. Requires an API token for authentication. The response contains the accountId, name, and userId. ```bash curl -X GET "https://api.cloud.scylladb.com/account/default" \ -H "Authorization: Bearer YOUR_API_TOKEN" ``` -------------------------------- ### Initialize, Plan, and Apply Terraform Configuration for GCP Source: https://cloud.docs.scylladb.com/stable/cloud-setup/byoa-gcp These Terraform commands are used to set up the necessary cloud resources for integrating your GCP account with ScyllaDB Cloud. 'terraform init' initializes the working directory, 'terraform plan' creates an execution plan, and 'terraform apply' applies the changes to your GCP account. You will be prompted to enter a Cloud Resource Template Secret during initialization and planning. ```bash terraform init ``` ```bash terraform plan ``` ```bash terraform apply ``` -------------------------------- ### Get Your Cluster ID Source: https://cloud.docs.scylladb.com/stable/vector-search/reference-vector-search Retrieves a list of clusters associated with your account. ```APIDOC ## GET /account/{ACCOUNT_ID}/clusters ### Description Get your cluster ID. ### Method GET ### Endpoint https://api.cloud.scylladb.com/account/{ACCOUNT_ID}/clusters ### Parameters #### Path Parameters - **ACCOUNT_ID** (string) - Required - The ID of the account. #### Query Parameters None #### Request Body None ### Request Example ```bash curl -X GET "https://api.cloud.scylladb.com/account/{ACCOUNT_ID}/clusters" \ -H "Authorization: Bearer YOUR_API_TOKEN" ``` ### Response #### Success Response (200) (Response structure not provided in the source text.) ``` -------------------------------- ### Navigate to ScyllaDB Monitoring Repository Source: https://cloud.docs.scylladb.com/stable/monitoring/cloud-prom-proxy This command navigates the user into the scylla-monitoring directory. It's a prerequisite for further configuration steps. ```bash cd scylla-monitoring ``` -------------------------------- ### Get Your Account ID Source: https://cloud.docs.scylladb.com/stable/vector-search/reference-vector-search Retrieves the account ID for the authenticated user. ```APIDOC ## GET /account/default ### Description Get your account ID. ### Method GET ### Endpoint https://api.cloud.scylladb.com/account/default ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```bash curl -X GET "https://api.cloud.scylladb.com/account/default" \ -H "Authorization: Bearer YOUR_API_TOKEN" ``` ### Response #### Success Response (200) - **error** (string) - An empty string if successful. - **data** (object) - Contains account information. - **accountId** (integer) - The ID of the account. - **name** (string) - The name of the account. - **userId** (string) - The ID of the user associated with the account. #### Response Example ```json { "error": "", "data": { "accountId": 12345, "name": "my-account", "userId": "12345" } } ``` ``` -------------------------------- ### Run ScyllaDB Vector Similarity Search (CQL) Source: https://cloud.docs.scylladb.com/stable/vector-search/reference-vector-search Shows the CQL syntax and an example for performing a similarity search on vector data in ScyllaDB using the ANN operator. ```cql SELECT `column1`, `column2`, ... FROM `keyspace.table` ORDER BY `vector_column_name` ANN OF `vector` LIMIT `integer`; SELECT pictureid FROM mykeyspace.pictures ORDER BY picture_vector ANN OF [ 0.12,0.34,0.56,0.78,0.91,0.15,0.62,0.48,0.22,0.31, 0.40,0.67,0.53,0.84,0.19,0.72,0.63,0.54,0.26,0.33, 0.11,0.09,0.27,0.41,0.69,0.82,0.57,0.38,0.71,0.46, 0.55,0.64,0.17,0.81,0.23,0.95,0.66,0.35,0.44,0.59, 0.02,0.75,0.28,0.16,0.92,0.88,0.47,0.13,0.99,0.21, 0.32,0.83,0.45,0.04,0.86,0.25,0.36,0.73,0.07,0.61, 0.52,0.14,0.68,0.05 ] LIMIT 3; ``` -------------------------------- ### Get Instances for a Region (Shell + Curl) Source: https://cloud.docs.scylladb.com/stable/api Lists instances available in a given region for a specific cloud provider. Requires cloudProviderId, regionId, and an authorization token. Supports optional 'defaults' and 'target' query parameters. ```shell curl --request GET \ --url 'https://api.cloud.scylladb.com/deployment/cloud-provider/{cloudProviderId}/region/{regionId}?defaults=SOME_BOOLEAN_VALUE&target=SOME_STRING_VALUE' \ --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' ``` -------------------------------- ### Get Your DC ID Source: https://cloud.docs.scylladb.com/stable/vector-search/reference-vector-search Retrieves a list of datacenters (DCs) for a given cluster. ```APIDOC ## GET /account/{ACCOUNT_ID}/cluster/{CLUSTER_ID}/dcs ### Description Get your DC ID. ### Method GET ### Endpoint https://api.cloud.scylladb.com/account/{ACCOUNT_ID}/cluster/{CLUSTER_ID}/dcs ### Parameters #### Path Parameters - **ACCOUNT_ID** (string) - Required - The ID of the account. - **CLUSTER_ID** (string) - Required - The ID of the cluster. #### Query Parameters None #### Request Body None ### Request Example ```bash curl -X GET "https://api.cloud.scylladb.com/account/{ACCOUNT_ID}/cluster/{CLUSTER_ID}/dcs" \ -H "Authorization: Bearer YOUR_API_TOKEN" ``` ### Response #### Success Response (200) (Response structure not provided in the source text.) ``` -------------------------------- ### List Datacenters Source: https://cloud.docs.scylladb.com/stable/vector-search/vector-search-clusters Lists datacenters for a given cluster. ```APIDOC ## GET /account/{ACCOUNT_ID}/cluster/{CLUSTER_ID}/dcs ### Description Lists datacenters for a specified cluster within an account. ### Method GET ### Endpoint /account/{ACCOUNT_ID}/cluster/{CLUSTER_ID}/dcs ### Parameters #### Path Parameters - **ACCOUNT_ID** (integer) - Required - The ID of the account. - **CLUSTER_ID** (integer) - Required - The ID of the cluster. #### Headers - **Authorization** (string) - Required - Bearer token for authentication. ### Request Example ```bash curl -X GET "https://api.cloud.scylladb.com/account/12345/cluster/6789/dcs" \ -H "Authorization: Bearer YOUR_API_TOKEN" ``` ### Response #### Success Response (200) - **data.dataCenters** (array) - A list of datacenter objects. - **id** (integer) - The datacenter ID. - **name** (string) - The name of the datacenter. - **status** (string) - The status of the datacenter. #### Response Example ```json { "data": { "dataCenters": [ { "id": 222, "name": "us-east-1a", "status": "ACTIVE" } ] } } ``` ``` -------------------------------- ### Get Account ID Source: https://cloud.docs.scylladb.com/stable/vector-search/vector-search-clusters Retrieves the account ID associated with the provided API token. ```APIDOC ## GET /account/default ### Description Retrieves the account ID for the authenticated user. ### Method GET ### Endpoint /account/default ### Parameters #### Headers - **Authorization** (string) - Required - Bearer token for authentication. ### Request Example ```bash curl -X GET "https://api.cloud.scylladb.com/account/default" \ -H "Authorization: Bearer YOUR_API_TOKEN" ``` ### Response #### Success Response (200) - **data.accountId** (integer) - The account ID. #### Response Example ```json { "error": "", "data": { "accountId": 12345, "name": "my-account", "userId": "12345" } } ``` ``` -------------------------------- ### Create Cluster Request Sample (Async) Source: https://cloud.docs.scylladb.com/stable/api This snippet shows a partial JSON payload for creating a new ScyllaDB cluster asynchronously. It includes essential parameters like cluster name, region, instance type, and number of nodes. ```json { "accountCredentialId": 0, "alternatorWriteIsolation": "forbid", "broadcastType": "PRIVATE", "cidrBlock": "string", "cloudProviderId": 0, "instanceId": 0, "regionId": 0, "enableDnsAssociation": true, "allowedIPs": [ { "cidr": "string" } ], "freeTier": true, "clusterName": "string", "numberOfNodes": 0, "promProxy": true, "replicationFactor": 0, "scyllaVersion": "string", "userApiInterface": "CQL", "maintenanceWindows": [ { "dayOfWeek": 0, "startTime": "string", "durationHours": 0 } ], "provisioning": "dedicated-vm", "pu": 1, "expiration": "string", "encryptionAtRest": { "kmsKeyId": "string", "kmsRegion": "string" }, "scaling": { "minNodes": 0, "maxNodes": 0, "minPerDc": 0, "maxPerDc": 0 }, "tablets": "enforced", "vectorSearch": { "enabled": true, "dimension": 0, "metric": "cosine" } } ```