Skip to main content

AbortImportResponse

An AbortImportResponse instance is the response returned by the AbortImport() package function. It embeds ResponseBase for the common Status and Message fields. Use the embedded CheckStatus() method to verify the call succeeded.

go
type AbortImportResponse struct {
ResponseBase
}

FIELDS:

  • Status (int) -

    Inherited from ResponseBase. A value of 0 indicates success; any other value indicates an error.

  • Message (string) -

    Inherited from ResponseBase. Human-readable error description when Status is non-zero.

BUILDER METHODS:

  • CheckStatus()

    This validates the response status. Returns nil when Status == 0; otherwise returns a formatted error containing Status and Message.

Example​

Demonstrates AbortImportResponse usage.

go
import (
"context"

"github.com/milvus-io/milvus/client/v3/milvusclient"
)

ctx, cancel := context.WithCancel(context.Background())
defer cancel()

cli, err := milvusclient.New(ctx, &milvusclient.ClientConfig{
Address: "YOUR_CLUSTER_ENDPOINT",
})
if err != nil {
// handle error
}
defer cli.Close(ctx)

resp, err := milvusclient.AbortImport(ctx, milvusclient.NewAbortImportOption("<jobId>"))
if err != nil {
// handle error
}
if err := resp.CheckStatus(); err != nil {
// handle non-zero status
}
Minimum SDK versionv3.0.x
Was this page helpful?