Skip to main content

Import

Imports data from files stored in a specified object storage bucket. Note that the bucket should be in the same cloud as the target cluster of the import.


POST
https://controller.api.{cloud-region}.zillizcloud.com/v1/vector/collections/import

Example

Notes
  • This API requires an API Key as the authentication token.
curl --request POST \
--url "https://controller.api.${CLOUD_REGION}.zillizcloud.com/v1/vector/collections/import" \
--header "Authorization: Bearer ${API_KEY}" \
--header "accept: application/json" \
--header "content-type: application/json" \
-d '{
"clusterId": "in03-***************",
"collectionName": "medium_articles",
"partitionName": "_default",
"objectUrl": "gs://publicdataset-zillizcloud-com/medium_articles_2020.json",
"accessKey": "your-access-key",
"secretKey": "your-secret-key"
}'

Your access key and secret key should have necessary permissions to access the object URL.

  • For AWS S3, the following permissions are required:

    • s3:GetObject
    • s3:ListBucket
    • s3:GetBucketLocation
  • For Google Cloud Storage, the following permissions are required:

    • storage.objects.get
    • storage.objects.list

Request

Parameters

  • No query parameters required

  • No path parameters required

Request Body

{
"clusterId": "string",
"collectionName": "string",
"partitionName": "string",
"objectUrl": "string",
"accessKey": "string",
"secretKey": "string"
}
ParameterDescription
clusterIdstring
The ID of a cluster to which this operation applies.
collectionNamestring
The name of the collection to which this operation applies.
partitionNamestring
The name of the partition to which this operation applies.
objectUrlstring
The URL of the object that stores the data to be imported.
accessKeystring
The access key used to access the specified object.
secretKeystring
The access secret key used to access the specified object.

Response

Returns a import task job ID.

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
dataobject
data.jobIdstring
The ID of the import task that has been submitted
messagestring
Indicates the possible reason for the reported error.

Possible Errors

CodeError Message
10003Invalid s3 ObjectUrl. [xxx]
40003Action not available given the current status of the cluster.
40021The cluster ID does not exist.
40022No access to this cluster. Please request access from your admin.
47005The specified cluster collection not exists.
47005The specified cluster collection not exists.
47035The specified object size exceeds limit.
47036The number of objects not equal to the number of collection fields.
47039The specified cluster do not support multiple imports at the same time.
47053Failed to checkFiles {xxx}.
47055The current cluster is currently importing data (xxx). To ensure more stable service of your Milvus cluster
80020Cluster not exist or you don't have permission.
80020Cluster not exist or you don't have permission.
80020Cluster not exist or you don't have permission.
83001Failed to getObjectMeta {xxx}.
83001Failed to getObjectMeta {xxx}.
83004Importing files across clouds is not currently supported
90011Invalid CollectionName. Reason: Name contains only alphanumeric letters and underscores
90011Invalid CollectionName. Reason: Name contains only alphanumeric letters and underscores
90102The cluster does not exist in current region.
90102The cluster does not exist in current region.
90103The clusterId parameter is empty in the request path.
90104The clusterId parameter is empty in the request parameter.
90117Invalid domain name used
90142No import content provided.
90145No ObjectUrl key field.