Files
8b04c2f960 enhance: add CommitImport/AbortImport SDK wrappers for import 2PC (#50177)
## Summary

Adds Go SDK RESTful wrappers for the Import 2PC commit/abort endpoints
introduced server-side in #48524, mirroring the existing
`GetImportProgress` wrapper in `client/bulkwriter/bulk_import.go`:

- `CommitImport` → `POST /v2/vectordb/jobs/import/commit`
- `AbortImport` → `POST /v2/vectordb/jobs/import/abort`

Both take a `jobId` (plus optional `clusterId`/`apiKey`) and delegate
status handling to the existing `ResponseBase.CheckStatus` helper. The
2PC opt-in (`auto_commit=false`) continues to flow through the existing
import-create `options` map, so no create-path change is needed.

issue: #48525

### Changes

**Modified:**
- `client/bulkwriter/bulk_import.go`: add
`CommitImportOption`/`AbortImportOption` (+ constructors, `WithAPIKey`,
`GetRequest`), `CommitImportResponse`/`AbortImportResponse`, and the
`CommitImport`/`AbortImport` functions.
- `client/bulkwriter/bulk_import_test.go`: add
`TestCommitImport`/`TestAbortImport` (normal / status-error /
server-closed cases).

### Test Plan

- [x] `go test ./bulkwriter/` — `TestBulkImportAPIs` suite passes (incl.
new `TestCommitImport`/`TestAbortImport`).
- [x] `gofumpt` clean; imports unchanged.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-08 11:28:19 +08:00
..