Add ProjectID to VectorDBCreateRequest#1022
Conversation
| Size string `json:"size,omitempty"` | ||
| Tags []string `json:"tags,omitempty"` | ||
| ProjectID string `json:"project_id,omitempty"` | ||
| } |
There was a problem hiding this comment.
Hi, had a doubt here, while we are passing the request to the create request, the vector db response struct does not have project id field.
Can you please share cURL examples of create and get vector db endpoints so i can understand?
There was a problem hiding this comment.
Good question — project_id is only a create-time parameter. The API doesn't return it in the response body. The response returns the standard VectorDB object without project_id. This matches how other DO resources handle project assignment. Here are the curl examples:
Create:
curl -X POST
-H "Authorization: Bearer $TOKEN"
-H "Content-Type: application/json"
-d '{"name":"nilay-test-vdb","region":"s2r1","size":"small","project_id":"6b8aae37-b989-44b2-85fc-a00bce46bec3"}'
"https://api.s2r1.internal.digitalocean.com/v2/vector-databases"
Response:
{"vector_db":{"id":"51e6f20c-0c9b-46ba-9d02-a0a5ed2b3358","name":"nilay-test-vdb","region":"s2r1","status":"pending","size":"small","config":{"default_quantization":"rq","enable_auto_schema":true,"weaviate_version":"1.37.4"}}}
Get:
curl -X GET
-H "Authorization: Bearer $TOKEN"
"https://api.s2r1.internal.digitalocean.com/v2/vector-databases/51e6f20c-0c9b-46ba-9d02-a0a5ed2b3358"
Response:
{"vector_db":{"id":"51e6f20c-0c9b-46ba-9d02-a0a5ed2b3358","name":"nilay-test-vdb","region":"s2r1","status":"active","size":"small","endpoints":{"http":"https://nilay-test-vdb-s2r1-fdf7a2de.weaviate-staging.ondigitalocean.com","grpc":"nilay-test-vdb-s2r1-fdf7a2de-grpc.weaviate-staging.ondigitalocean.com:443"},"config":{"default_quantization":"rq","enable_auto_schema":true,"weaviate_version":"1.37.4"}}}
No project_id in either response.
| Size: "small", | ||
| Tags: []string{"production", "ml"}, | ||
| ProjectID: "49c369ee-c6a7-4c13-b8b4-ba0ac8d4180b", | ||
| } |
There was a problem hiding this comment.
As we dont have integration tests present in godo, I think the description is referring to unit tests.
Please run the create and list vector db apis with modified create struct as well and check the output.
Asking you to check as I am not added in the flipper.
There was a problem hiding this comment.
Tested both against stage2. Create with project_id works returns the new VectorDB in pending state. List returns it after it's active. Full test output is in the PR description. Happy to share more detailed output if needed.
Summary
Adds ProjectID field to VectorDBCreateRequest. The vector database API requires project_id on create requests, but it was missing from the original implementation.
Changes
vector_databases.go — added ProjectID string \json:"project_id,omitempty"
toVectorDBCreateRequestTesting
Built a comprehensive integration test against stage2 (https://api.s2r1.internal.digitalocean.com) that exercises all 11 VectorDB operations end-to-end:
=== CREATE ===
Created: 51e6f20c-0c9b-46ba-9d02-a0a5ed2b3358 nilay-test-vdb pending
(waited ~3 min for active)
=== LIST === ✅ total=1 count=1
=== GET === ✅ returned endpoints, config, status
=== UPDATE === ✅ auto_schema=true
=== UPDATE TAGS === ✅ tags=[test nilay]
=== GET CREDENTIALS === ✅ UserID=do-admin, Token returned
=== LIST BACKUPS === ✅
=== RESIZE (small → medium) === ✅ completed after ~3 min
=== DELETE === ✅ deleted successfully
Notes
project_id is confirmed required by the API. This field also needs to be added to the Swagger spec in Cthulhu
Related
Original PR: #1015 (merged, released as v1.193.0)
Ticket: KBAAS-265