Connecting with the Milvus SDK
VBase’s data plane is Milvus 2.6, so you connect with the standard Milvus SDK — no Dodil-specific client. Once a database is allocated and RUNNING, three values are all you need.
The connection contract
| Value | Where it comes from | Notes |
|---|---|---|
uri | the database’s endpoint + port from GetServiceAccess (or dodil vbase db use) | always TLS — https://<endpoint>:443 |
token | your IAM access token (see Auth and Access) | your IAM token is your Milvus token |
db_name | the allocated database name from GetServiceAccess | scopes the connection to your database |
Python (pymilvus)
Exchange your IAM service-account credentials for an access token, then connect:
import os, requests
from pymilvus import MilvusClient
# 1. get an IAM access token (client-credentials flow)
TOKEN_URL = "https://id.dev.dodil.io/realms/dodil/protocol/openid-connect/token"
token = requests.post(TOKEN_URL, data={
"grant_type": "client_credentials",
"client_id": os.environ["DODIL_SERVICE_ACCOUNT_ID"],
"client_secret": os.environ["DODIL_SERVICE_ACCOUNT_SECRET"],
}).json()["access_token"]
# 2. connect Milvus with that token
client = MilvusClient(
uri="https://<endpoint>:443", # from GetServiceAccess / `dodil vbase db use`
token=token, # your IAM token is your Milvus token
db_name="<db_name>",
)
# from here, it's standard Milvus 2.6
client.list_collections()Need the token in another language, or want the full flow? See Get an Access Token — curl, Python, Node.js, and Go. The same three values work with any Milvus client.
The same three values work with any Milvus client. For example, the Go and Java SDKs take the address, the token (as the API key / authorization), and a database name; the Node SDK takes address, token, and dbName. See the Milvus SDK reference for each language.
What you can do
The full native Milvus 2.6 surface: create collections and schemas, build indexes (HNSW, IVF_FLAT, IVF_SQ8, FLAT) with L2/IP/COSINE metrics, insert/upsert/delete, load/release, and run vector, filtered, and hybrid + BM25 search. The Recipes walk through the common ones; milvus.io/docs is the complete reference.
What’s managed for you
Milvus user and role administration is owned by VBase — you authenticate with your IAM token and VBase maps it to the right per-database Milvus credentials. So the Milvus RBAC/user-management calls (create user, grant role, etc.) are not available to clients; everything else in the SDK is.
Getting the endpoint and database name
- CLI:
dodil vbase db use <service-id>resolves and stores them. - API:
GetServiceAccessreturnsendpoint,port, anddb_name. Allocate first withAllocateDatabaseand wait until the database isRUNNING.
See also
- Recipes — semantic search, hybrid search, bulk ingest with the SDK
- Auth and Access — getting and using an IAM token
- API Reference — Databases · Quickstart
- Milvus documentation