addFileResource()

This operation registers a file resource with Milvus. Use it when server-side features need a named file resource.

await milvusClient.addFileResource(data)

Request Syntax

await milvusClient.addFileResource({
    name: string,
    path: string,
    timeout?: number
})

PARAMETERS:

  • name (string) -

    [REQUIRED]

    The unique name of the file resource.

  • path (string) -

    [REQUIRED]

    The server-visible file path of the resource.

  • timeout (number) -

    The timeout duration in milliseconds for this operation.

RETURNS:

Promise

EXCEPTIONS:

  • MilvusError

    This exception will be raised when any error occurs during this operation.

Example

import { MilvusClient } from '@zilliz/milvus2-sdk-node';

const milvusClient = new MilvusClient({
    address: 'localhost:19530',
    token: 'root:Milvus',
});

const resStatus = await milvusClient.addFileResource({
    name: 'embedding_model',
    path: '/models/embedding.bin',
});

Try Managed Milvus for Free

Zilliz Cloud is hassle-free, powered by Milvus and 10x faster.

Get Started
Feedback

Was this page helpful?