milvus-logo
LFAI
< Docs
  • RESTful
    • v2
      • Import (v2)

Create import Jobs

POST
http://${MILVUS_URI}/v2/vectordb/jobs/import/create

This operation imports the prepared data files to a Milvus instance. To learn how to prepare your data files, read Prepare Data Import.

Example

export MILVUS_URI="localhost:19530"

curl --location --request POST "http://${MILVUS_URI}/v2/vectordb/jobs/import/create" \
--header "Content-Type: application/json" \
--data-raw '{
    "files": [
        [
            "/d1782fa1-6b65-4ff3-b05a-43a436342445/1.json"
        ],
        [
            "/2a12dea7-2eff-4b34-97b6-9554063fd791/1/id.npy",
            "/2a12dea7-2eff-4b34-97b6-9554063fd791/1/vector.npy",
            "/2a12dea7-2eff-4b34-97b6-9554063fd791/1/$meta.npy"
        ],
        [
            "/a6fb2d1c-7b1b-427c-a8a3-178944e3b66d/1.parquet"
        ]
    ],
    "collectionName": "quick_setup"
}'

Possible response is similar to the following

{
    "code": 0,
    "data": {
        "jobId": "448707763884413158"
    }
}

Request

Parameters

  • Header parameters

    ParameterDescription
    Request-Timeoutinteger
    The timeout duration for this operation.
    Setting this to None indicates that this operation timeouts when any response arrives or any error occurs.
    Authorizationstring
    The authentication token.
  • No query parameters required

  • No path parameters required

Request Body

{
    "collectionName": "string",
    "dbName": "string",
    "files": [],
    "options": {
        "timeout": "string"
    }
}
ParameterDescription
collectionName *string
The name of the target collection.
Setting this to a non-existing collection results in an error.
dbNamestring
The name of the database to which the collection belongs.
Setting this to a non-existing database results in an error.
filesarray
The files that contain the data to import. The files should reside within the Milvus bucket on the MinIO instance deployed along with your Milvus instance.
files[]array
A sub-list that contains a single JSON or Parquet file, or a set of NumPy files.
files[][]string
A list of file paths, relative to the root of your Milvus bucket on the MinIO instance shipped along with the Milvus instance.
optionsobject
Bulk-import options.
options.timeoutstring
The timeout duration of the created import jobs. The value should be a positive number suffixed by s (seconds), m (minutes), and h(hours). For example, 300s, 1.5h, and 1h45 are all valid values.

Response

The ID of the bulk-import job.

Response Bodies

  • Response body if we process your request successfully
{
    "code": "integer",
    "data": [
        {
            "jobID": "string"
        }
    ]
}
  • Response body if we failed to process your request
{
    "code": integer,
    "message": string
}

Properties

The properties in the returned response are listed in the following table.

PropertyDescription
codeinteger
Indicates whether the request succeeds.
  • 200: The request succeeds.
  • Others: Some error occurs.
messagestring
Indicates the possible reason for the reported error.
dataarray
data[]object
data[].jobIDstring
The ID of the current bulk-import job.