From 3f33b395eb806a6543a7399cac6abe0b825f4979 Mon Sep 17 00:00:00 2001 From: AnthonyTsu1984 <115786031+AnthonyTsu1984@users.noreply.github.com> Date: Wed, 22 Jan 2025 17:35:27 +0800 Subject: [PATCH] update docs Signed-off-by: AnthonyTsu1984 <115786031+AnthonyTsu1984@users.noreply.github.com> --- .../Authentication/Authentication.md | 5 + .../Authentication/add_privileges_to_group.md | 63 ++++++++++ .../Authentication/create_privilege_group.md | 57 +++++++++ .../Authentication/create_role.md | 16 --- .../Authentication/create_user.md | 10 -- .../Authentication/drop_privilege_group.md | 57 +++++++++ .../MilvusClient/Authentication/drop_role.md | 17 --- .../Authentication/grant_privilege_v2.md | 72 +++++++++++ .../Authentication/list_privilege_groups.md | 52 ++++++++ .../remove_privileges_from_group.md | 63 ++++++++++ .../Authentication/revoke_privilege_v2.md | 72 +++++++++++ .../v2.5.x/MilvusClient/Client/Client.md | 5 + .../MilvusClient/Collections/Collections.md | 5 + .../alter_collection_properties.md | 78 ++++++++++++ .../Collections/create_collection.md | 8 ++ .../Collections/drop_collection_properties.md | 72 +++++++++++ .../v2.5.x/MilvusClient/Database/Database.md | 5 + .../Database/alter_database_properties.md | 79 ++++++++++++ .../MilvusClient/Database/create_database.md | 82 ++++++++++++ .../Database/describe_database.md | 55 ++++++++ .../MilvusClient/Database/drop_database.md | 47 +++++++ .../Database/drop_database_properties.md | 79 ++++++++++++ .../MilvusClient/Database/list_databases.md | 48 +++++++ .../MilvusClient/Database/using_database.md | 42 +++++++ .../MilvusClient/Management/Management.md | 5 + .../Management/alter_index_properties.md | 76 +++++++++++ .../v2.5.x/MilvusClient/Management/compact.md | 62 +++++++++ .../Management/drop_index_properties.md | 71 +++++++++++ .../v2.5.x/MilvusClient/Management/flush.md | 57 +++++++++ .../Management/get_compact_state.md | 65 ++++++++++ .../MilvusClient/Partitions/Partitions.md | 5 + .../ResourceGroup/ResourceGroup.md | 5 + .../ResourceGroup/ResourceGroupConfig.md | 91 ++++++++++++++ .../ResourceGroup/create_resource_group.md | 74 +++++++++++ .../ResourceGroup/describe_resource_group.md | 118 ++++++++++++++++++ .../ResourceGroup/drop_resource_group.md | 82 ++++++++++++ .../ResourceGroup/list_resource_groups.md | 59 +++++++++ .../ResourceGroup/transfer_replica.md | 99 +++++++++++++++ .../ResourceGroup/update_resource_groups.md | 75 +++++++++++ 39 files changed, 1990 insertions(+), 43 deletions(-) create mode 100644 API_Reference/pymilvus/v2.5.x/MilvusClient/Authentication/Authentication.md create mode 100644 API_Reference/pymilvus/v2.5.x/MilvusClient/Authentication/add_privileges_to_group.md create mode 100644 API_Reference/pymilvus/v2.5.x/MilvusClient/Authentication/create_privilege_group.md create mode 100644 API_Reference/pymilvus/v2.5.x/MilvusClient/Authentication/drop_privilege_group.md create mode 100644 API_Reference/pymilvus/v2.5.x/MilvusClient/Authentication/grant_privilege_v2.md create mode 100644 API_Reference/pymilvus/v2.5.x/MilvusClient/Authentication/list_privilege_groups.md create mode 100644 API_Reference/pymilvus/v2.5.x/MilvusClient/Authentication/remove_privileges_from_group.md create mode 100644 API_Reference/pymilvus/v2.5.x/MilvusClient/Authentication/revoke_privilege_v2.md create mode 100644 API_Reference/pymilvus/v2.5.x/MilvusClient/Client/Client.md create mode 100644 API_Reference/pymilvus/v2.5.x/MilvusClient/Collections/Collections.md create mode 100644 API_Reference/pymilvus/v2.5.x/MilvusClient/Collections/alter_collection_properties.md create mode 100644 API_Reference/pymilvus/v2.5.x/MilvusClient/Collections/drop_collection_properties.md create mode 100644 API_Reference/pymilvus/v2.5.x/MilvusClient/Database/Database.md create mode 100644 API_Reference/pymilvus/v2.5.x/MilvusClient/Database/alter_database_properties.md create mode 100644 API_Reference/pymilvus/v2.5.x/MilvusClient/Database/create_database.md create mode 100644 API_Reference/pymilvus/v2.5.x/MilvusClient/Database/describe_database.md create mode 100644 API_Reference/pymilvus/v2.5.x/MilvusClient/Database/drop_database.md create mode 100644 API_Reference/pymilvus/v2.5.x/MilvusClient/Database/drop_database_properties.md create mode 100644 API_Reference/pymilvus/v2.5.x/MilvusClient/Database/list_databases.md create mode 100644 API_Reference/pymilvus/v2.5.x/MilvusClient/Database/using_database.md create mode 100644 API_Reference/pymilvus/v2.5.x/MilvusClient/Management/Management.md create mode 100644 API_Reference/pymilvus/v2.5.x/MilvusClient/Management/alter_index_properties.md create mode 100644 API_Reference/pymilvus/v2.5.x/MilvusClient/Management/compact.md create mode 100644 API_Reference/pymilvus/v2.5.x/MilvusClient/Management/drop_index_properties.md create mode 100644 API_Reference/pymilvus/v2.5.x/MilvusClient/Management/flush.md create mode 100644 API_Reference/pymilvus/v2.5.x/MilvusClient/Management/get_compact_state.md create mode 100644 API_Reference/pymilvus/v2.5.x/MilvusClient/Partitions/Partitions.md create mode 100644 API_Reference/pymilvus/v2.5.x/MilvusClient/ResourceGroup/ResourceGroup.md create mode 100644 API_Reference/pymilvus/v2.5.x/MilvusClient/ResourceGroup/ResourceGroupConfig.md create mode 100644 API_Reference/pymilvus/v2.5.x/MilvusClient/ResourceGroup/create_resource_group.md create mode 100644 API_Reference/pymilvus/v2.5.x/MilvusClient/ResourceGroup/describe_resource_group.md create mode 100644 API_Reference/pymilvus/v2.5.x/MilvusClient/ResourceGroup/drop_resource_group.md create mode 100644 API_Reference/pymilvus/v2.5.x/MilvusClient/ResourceGroup/list_resource_groups.md create mode 100644 API_Reference/pymilvus/v2.5.x/MilvusClient/ResourceGroup/transfer_replica.md create mode 100644 API_Reference/pymilvus/v2.5.x/MilvusClient/ResourceGroup/update_resource_groups.md diff --git a/API_Reference/pymilvus/v2.5.x/MilvusClient/Authentication/Authentication.md b/API_Reference/pymilvus/v2.5.x/MilvusClient/Authentication/Authentication.md new file mode 100644 index 000000000..c98028c2c --- /dev/null +++ b/API_Reference/pymilvus/v2.5.x/MilvusClient/Authentication/Authentication.md @@ -0,0 +1,5 @@ +# Authentication + +Methods related to implement role-based access control to your resources. + + diff --git a/API_Reference/pymilvus/v2.5.x/MilvusClient/Authentication/add_privileges_to_group.md b/API_Reference/pymilvus/v2.5.x/MilvusClient/Authentication/add_privileges_to_group.md new file mode 100644 index 000000000..00aaa2588 --- /dev/null +++ b/API_Reference/pymilvus/v2.5.x/MilvusClient/Authentication/add_privileges_to_group.md @@ -0,0 +1,63 @@ +# add_privileges_to_group() + +This operation adds privileges to the specified privilege group. + +## Request Syntax + +```python +add_privileges_to_group( + self, + group_name: str, + privileges: List[str], + timeout: Optional[float] = None, + **kwargs, +) +``` + +**PARAMETERS:** + +- **group_name** (*str*) - + + The name of the target privilege group. + +- **privileges** (*List[str]*) - + + The privilages to add in a list. + +- **timeout** (*Optional[float]*) - + + The timeout duration for this operation. + + Setting this to None indicates that this operation timeouts when any response arrives or any error occurs. + +**RETURN TYPE:** + +*NoneType* + +**RETURNS:** + +*None* + +**EXCEPTIONS:** + +- **MilvusException** + + This exception will be raised when any error occurs during this operation, especially when the specified alias does not exist. + +## Example + +```python +from pymilvus import MilvusClient + +# 1. Create a milvus client +client = MilvusClient( + uri="http://localhost:19530", + token="root:Milvus" +) + +client.add_privileges_to_group( + group_name="my_privilege_group", + privileges=["ListDatabases", "DescribeDatabase"] +) +``` + diff --git a/API_Reference/pymilvus/v2.5.x/MilvusClient/Authentication/create_privilege_group.md b/API_Reference/pymilvus/v2.5.x/MilvusClient/Authentication/create_privilege_group.md new file mode 100644 index 000000000..95634cce2 --- /dev/null +++ b/API_Reference/pymilvus/v2.5.x/MilvusClient/Authentication/create_privilege_group.md @@ -0,0 +1,57 @@ +# create_privilege_group() + +This operation creates a privilege group. + +## Request Syntax + +```python +create_privilege_group( + self, + group_name: str, + timeout: Optional[float] = None, + **kwargs, +) +``` + +**PARAMETERS:** + +- **group_name** (*str*) - + + The name of the target privilege group. + +- **timeout** (*Optional[float]*) - + + The timeout duration for this operation. + + Setting this to None indicates that this operation timeouts when any response arrives or any error occurs. + +**RETURN TYPE:** + +*NoneType* + +**RETURNS:** + +*None* + +**EXCEPTIONS:** + +- **MilvusException** + + This exception will be raised when any error occurs during this operation, especially when the specified alias does not exist. + +## Example + +```python +from pymilvus import MilvusClient + +# 1. Create a milvus client +client = MilvusClient( + uri="http://localhost:19530", + token="root:Milvus" +) + +client.create_privilege_group( + group_name="my_privilege_group" +) +``` + diff --git a/API_Reference/pymilvus/v2.5.x/MilvusClient/Authentication/create_role.md b/API_Reference/pymilvus/v2.5.x/MilvusClient/Authentication/create_role.md index b102a285c..510aed066 100644 --- a/API_Reference/pymilvus/v2.5.x/MilvusClient/Authentication/create_role.md +++ b/API_Reference/pymilvus/v2.5.x/MilvusClient/Authentication/create_role.md @@ -58,19 +58,3 @@ client = MilvusClient( client.create_role(role_name="read_only") ``` -## Related methods - -- [describe_role()](describe_role.md) - -- [drop_role()](drop_role.md) - -- [grant_privilege()](grant_privilege.md) - -- [grant_role()](grant_role.md) - -- [list_roles()](list_roles.md) - -- [revoke_privileges()](revoke_privileges.md) - -- [revoke_role()](revoke_role.md) - diff --git a/API_Reference/pymilvus/v2.5.x/MilvusClient/Authentication/create_user.md b/API_Reference/pymilvus/v2.5.x/MilvusClient/Authentication/create_user.md index 74879949b..e43f8819f 100644 --- a/API_Reference/pymilvus/v2.5.x/MilvusClient/Authentication/create_user.md +++ b/API_Reference/pymilvus/v2.5.x/MilvusClient/Authentication/create_user.md @@ -65,13 +65,3 @@ client = MilvusClient( client.create_user(user_name="user_1", password="P@ssw0rd") ``` -## Related methods - -- [describe_user()](describe_user.md) - -- [drop_user()](drop_user.md) - -- [list_users()](list_users.md) - -- [update_password()](update_password.md) - diff --git a/API_Reference/pymilvus/v2.5.x/MilvusClient/Authentication/drop_privilege_group.md b/API_Reference/pymilvus/v2.5.x/MilvusClient/Authentication/drop_privilege_group.md new file mode 100644 index 000000000..05eb7f125 --- /dev/null +++ b/API_Reference/pymilvus/v2.5.x/MilvusClient/Authentication/drop_privilege_group.md @@ -0,0 +1,57 @@ +# drop_privilege_group() + +This operation drops the specified privilege group. + +## Request Syntax + +```python +drop_privilege_group( + self, + group_name: str, + timeout: Optional[float] = None, + **kwargs, +) +``` + +**PARAMETERS:** + +- **group_name** (*str*) - + + The name of the target privilege group. + +- **timeout** (*Optional[float]*) - + + The timeout duration for this operation. + + Setting this to None indicates that this operation timeouts when any response arrives or any error occurs. + +**RETURN TYPE:** + +*NoneType* + +**RETURNS:** + +*None* + +**EXCEPTIONS:** + +- **MilvusException** + + This exception will be raised when any error occurs during this operation, especially when the specified alias does not exist. + +## Example + +```python +from pymilvus import MilvusClient + +# 1. Create a milvus client +client = MilvusClient( + uri="http://localhost:19530", + token="root:Milvus" +) + +client.drop_privilege_group( + group_name="my_privilege_group" +) +``` + diff --git a/API_Reference/pymilvus/v2.5.x/MilvusClient/Authentication/drop_role.md b/API_Reference/pymilvus/v2.5.x/MilvusClient/Authentication/drop_role.md index 6976e1eed..0a000efe3 100644 --- a/API_Reference/pymilvus/v2.5.x/MilvusClient/Authentication/drop_role.md +++ b/API_Reference/pymilvus/v2.5.x/MilvusClient/Authentication/drop_role.md @@ -60,20 +60,3 @@ client.create_role(role_name="read_only") # 3. Drop a role client.drop_role(role_name="read_only") ``` - -## Related methods - -- [create_role()](create_role.md) - -- [describe_role()](describe_role.md) - -- [grant_privilege()](grant_privilege.md) - -- [grant_role()](grant_role.md) - -- [list_roles()](list_roles.md) - -- [revoke_privileges()](revoke_privileges.md) - -- [revoke_role()](revoke_role.md) - diff --git a/API_Reference/pymilvus/v2.5.x/MilvusClient/Authentication/grant_privilege_v2.md b/API_Reference/pymilvus/v2.5.x/MilvusClient/Authentication/grant_privilege_v2.md new file mode 100644 index 000000000..ae27032df --- /dev/null +++ b/API_Reference/pymilvus/v2.5.x/MilvusClient/Authentication/grant_privilege_v2.md @@ -0,0 +1,72 @@ +# grant_privilege_v2() + +This operation grants the specified privilege or privilege group to the specified role. + +## Request Syntax + +```python +grant_privilege_v2( + self, + role_name: str, + privilege: str, + collection_name: str, + db_name: Optional[str] = None, + timeout: Optional[float] = None, + **kwargs, +) +``` + +**PARAMETERS:** + +- **role_name** (*str*) - + + **[REQUIRED]** + + The name of the role to assign privileges to. + +- **privilege** (*str*) - + + **[REQUIRED]** + + The name of the privilege to assign. + + For details, refer to the **Privilege name** column in the table on page [Users and Roles](https://milvus.io/docs/users_and_roles.md). + +- **collection_name** (*str*) - + + **[REQUIRED]** + + The name of a collection. To grant privileges regarding all collections in the current database, set this parameter to `*`. + +- **db_name** (*str*) - + + The name of a database. + + This parameter is optional. Setting this parameter restricts the privilege assignment within the specified database. + +- **timeout** (*float* | *None*) + + The timeout duration for this operation. + + Setting this to **None** indicates that this operation timeouts when any response arrives or any error occurs. + +**RETURN TYPE:** + +*NoneType* + +**RETURNS:** + +None + +**EXCEPTIONS:** + +- **MilvusException** + + This exception will be raised when any error occurs during this operation. + +- **BaseException** + + This exception will be raised when this operation fails. + +## Example + diff --git a/API_Reference/pymilvus/v2.5.x/MilvusClient/Authentication/list_privilege_groups.md b/API_Reference/pymilvus/v2.5.x/MilvusClient/Authentication/list_privilege_groups.md new file mode 100644 index 000000000..9026880fc --- /dev/null +++ b/API_Reference/pymilvus/v2.5.x/MilvusClient/Authentication/list_privilege_groups.md @@ -0,0 +1,52 @@ +# list_privilege_groups() + +This operation lists all existing privilege groups. + +## Request Syntax + +```python +list_privilege_groups( + self, + timeout: Optional[float] = None, + **kwargs, +) -> List[Dict[str, str]] +``` + +**PARAMETERS:** + +- **timeout** (*Optional[float]*) - + + The timeout duration for this operation. + + Setting this to None indicates that this operation timeouts when any response arrives or any error occurs. + +**RETURN TYPE:** + +*List[Dict[str, str]]* + +**RETURNS:** + +A list of privilege group names. + +**EXCEPTIONS:** + +- **MilvusException** + + This exception will be raised when any error occurs during this operation, especially when the specified alias does not exist. + +## Example + +```python +from pymilvus import MilvusClient + +# 1. Create a milvus client +client = MilvusClient( + uri="http://localhost:19530", + token="root:Milvus" +) + +res = client.list_privilege_groups() + +# ['my_privilege_group'] +``` + diff --git a/API_Reference/pymilvus/v2.5.x/MilvusClient/Authentication/remove_privileges_from_group.md b/API_Reference/pymilvus/v2.5.x/MilvusClient/Authentication/remove_privileges_from_group.md new file mode 100644 index 000000000..36c18d345 --- /dev/null +++ b/API_Reference/pymilvus/v2.5.x/MilvusClient/Authentication/remove_privileges_from_group.md @@ -0,0 +1,63 @@ +# remove_privileges_from_group() + +This operation removes the specified privileges from a group. + +## Request Syntax + +```python +remove_privileges_from_group( + self, + group_name: str, + privileges: List[str], + timeout: Optional[float] = None, + **kwargs, +) +``` + +**PARAMETERS:** + +- **group_name** (*str*) - + + The name of the target privilege group. + +- **privileges** (*List[str]*) - + + The privilages to remove in a list. + +- **timeout** (*Optional[float]*) - + + The timeout duration for this operation. + + Setting this to None indicates that this operation timeouts when any response arrives or any error occurs. + +**RETURN TYPE:** + +*NoneType* + +**RETURNS:** + +*None* + +**EXCEPTIONS:** + +- **MilvusException** + + This exception will be raised when any error occurs during this operation, especially when the specified alias does not exist. + +## Example + +```python +from pymilvus import MilvusClient + +# 1. Create a milvus client +client = MilvusClient( + uri="http://localhost:19530", + token="root:Milvus" +) + +client.remove_privileges_to_group( + group_name="my_privilege_group", + privileges=["ListDatabases", "DescribeDatabase"] +) +``` + diff --git a/API_Reference/pymilvus/v2.5.x/MilvusClient/Authentication/revoke_privilege_v2.md b/API_Reference/pymilvus/v2.5.x/MilvusClient/Authentication/revoke_privilege_v2.md new file mode 100644 index 000000000..f4ea16772 --- /dev/null +++ b/API_Reference/pymilvus/v2.5.x/MilvusClient/Authentication/revoke_privilege_v2.md @@ -0,0 +1,72 @@ +# revoke_privilege_v2() + +This operation revokes the specified privilege or privilege group from the specified role. + +## Request Syntax + +```python +revoke_privilege_v2( + self, + role_name: str, + privilege: str, + collection_name: str, + db_name: Optional[str] = None, + timeout: Optional[float] = None, + **kwargs, +) +``` + +**PARAMETERS:** + +- **role_name** (*str*) - + + **[REQUIRED]** + + The name of the role to revoke privileges from. + +- **privilege** (*str*) - + + **[REQUIRED]** + + The name of the privilege to revoke. + + For details, refer to the **Privilege name** column in the table on page [Users and Roles](https://milvus.io/docs/users_and_roles.md). + +- **collection_name** (*str*) - + + **[REQUIRED]** + + The name of a collection. To revoke privileges regarding all collections in the current database, set this parameter to `*`. + +- **db_name** (*str*) - + + The name of a database. + + This parameter is optional. Setting this parameter restricts the privilege assignment within the specified database. + +- **timeout** (*float* | *None*) + + The timeout duration for this operation. + + Setting this to **None** indicates that this operation timeouts when any response arrives or any error occurs. + +**RETURN TYPE:** + +*NoneType* + +**RETURNS:** + +None + +**EXCEPTIONS:** + +- **MilvusException** + + This exception will be raised when any error occurs during this operation. + +- **BaseException** + + This exception will be raised when this operation fails. + +## Example + diff --git a/API_Reference/pymilvus/v2.5.x/MilvusClient/Client/Client.md b/API_Reference/pymilvus/v2.5.x/MilvusClient/Client/Client.md new file mode 100644 index 000000000..17c6505da --- /dev/null +++ b/API_Reference/pymilvus/v2.5.x/MilvusClient/Client/Client.md @@ -0,0 +1,5 @@ +# Client + +Classes and methods for you to manage the MilvusClient instances. + + diff --git a/API_Reference/pymilvus/v2.5.x/MilvusClient/Collections/Collections.md b/API_Reference/pymilvus/v2.5.x/MilvusClient/Collections/Collections.md new file mode 100644 index 000000000..6b911b5d9 --- /dev/null +++ b/API_Reference/pymilvus/v2.5.x/MilvusClient/Collections/Collections.md @@ -0,0 +1,5 @@ +# Collections + +Methods for you to manage collections. + + diff --git a/API_Reference/pymilvus/v2.5.x/MilvusClient/Collections/alter_collection_properties.md b/API_Reference/pymilvus/v2.5.x/MilvusClient/Collections/alter_collection_properties.md new file mode 100644 index 000000000..758a1e6d1 --- /dev/null +++ b/API_Reference/pymilvus/v2.5.x/MilvusClient/Collections/alter_collection_properties.md @@ -0,0 +1,78 @@ +# alter_collection_properties() + +This operation alters the specified collection properties. + +## Request Syntax + +```python +alter_collection_properties( + self, + collection_name: str, + properties: dict, + timeout: Optional[float] = None, + **kwargs +) +``` + +**PARAMETERS:** + +- **collection_name** (*str*) - + + The name of the target collection. + +- **properties** (*dict*) - + + The properties and their new values in a dictionary. Possible dictionary keys are as follows: + + - **collection.ttl.seconds** (*int*) - + + The time-to-live (TTL) of a collection in seconds. + + - **mmap.enabled** (*bool*) - + + Whether to enable mmap for the raw data and indexes of all fields in the collection. For details, refer to [Mmap-enabled Data Storage](https://milvus.io/docs/mmap.md). + + - **partitionkey.isolation** (bool) - + + Whether to enable partition key isolation. For details, refer to [Use Partition Key](https://milvus.io/docs/use-partition-key.md). + +- **timeout** (*Optional[float]*) - + + The timeout duration for this operation. + + Setting this to None indicates that this operation timeouts when any response arrives or any error occurs. + +**RETURN TYPE:** + +*NoneType* + +**RETURNS:** + +*None* + +**EXCEPTIONS:** + +- **MilvusException** + + This exception will be raised when any error occurs during this operation, especially when the specified alias does not exist. + +## Example + +```python +from pymilvus import MilvusClient + +# 1. Create a milvus client +client = MilvusClient( + uri="http://localhost:19530", + token="root:Milvus" +) + +# upsert properties +properties = {"collection.ttl.seconds": 500, "mmap.enabled": true} + +client.alter_collection_properties( + collection_name="collection_name", + properties = properties +) +``` + diff --git a/API_Reference/pymilvus/v2.5.x/MilvusClient/Collections/create_collection.md b/API_Reference/pymilvus/v2.5.x/MilvusClient/Collections/create_collection.md index ca6093d7d..8605ed968 100644 --- a/API_Reference/pymilvus/v2.5.x/MilvusClient/Collections/create_collection.md +++ b/API_Reference/pymilvus/v2.5.x/MilvusClient/Collections/create_collection.md @@ -171,6 +171,14 @@ create_collection( The time-to-live (TTL) of a collection in seconds. + - **mmap.enabled** (*bool*) - + + Whether to enable mmap for the raw data and indexes of all fields in the collection. + + - **partitionkey.isolation** (bool) - + + Whether to enable partition key isolation. For details, refer to [Use Partition Key](https://milvus.io/docs/use-partition-key.md). + **RETURN TYPE:** *NoneType* diff --git a/API_Reference/pymilvus/v2.5.x/MilvusClient/Collections/drop_collection_properties.md b/API_Reference/pymilvus/v2.5.x/MilvusClient/Collections/drop_collection_properties.md new file mode 100644 index 000000000..2c41d5a37 --- /dev/null +++ b/API_Reference/pymilvus/v2.5.x/MilvusClient/Collections/drop_collection_properties.md @@ -0,0 +1,72 @@ +# drop_collection_properties() + +This operation drops the specified collection properties. + +## Request Syntax + +```python +drop_collection_properties( + self, + collection_name: str, + property_keys: List[str], + timeout: Optional[float] = None, + **kwargs, +) +``` + +**PARAMETERS:** + +- **collection_name** (*str*) - + + The name of the target collection. + +- **property_keys** (*List[str]*) - + + The names of the properties to drop in a list. Possible values are as follows: + + - `collection.ttl.seconds` + + - `mmap.enabled` + + - `partitionkey.isolation` + +- **timeout** (*Optional[float]*) - + + The timeout duration for this operation. + + Setting this to None indicates that this operation timeouts when any response arrives or any error occurs. + +**RETURN TYPE:** + +*NoneType* + +**RETURNS:** + +*None* + +**EXCEPTIONS:** + +- **MilvusException** + + This exception will be raised when any error occurs during this operation, especially when the specified alias does not exist. + +## Example + +```python +from pymilvus import MilvusClient + +# 1. Create a milvus client +client = MilvusClient( + uri="http://localhost:19530", + token="root:Milvus" +) + +# upsert properties +property_keys = ["mmap.enabled", "collection.ttl.seconds"] + +client.drop_collection_properties( + collection_name="collection_name", + property_keys=property_keys +) +``` + diff --git a/API_Reference/pymilvus/v2.5.x/MilvusClient/Database/Database.md b/API_Reference/pymilvus/v2.5.x/MilvusClient/Database/Database.md new file mode 100644 index 000000000..061ef02e3 --- /dev/null +++ b/API_Reference/pymilvus/v2.5.x/MilvusClient/Database/Database.md @@ -0,0 +1,5 @@ +# Database + +Methods for you to manage databases. + + diff --git a/API_Reference/pymilvus/v2.5.x/MilvusClient/Database/alter_database_properties.md b/API_Reference/pymilvus/v2.5.x/MilvusClient/Database/alter_database_properties.md new file mode 100644 index 000000000..72d5b2afd --- /dev/null +++ b/API_Reference/pymilvus/v2.5.x/MilvusClient/Database/alter_database_properties.md @@ -0,0 +1,79 @@ +# alter_database_properties() + +This operation modifies the properties of the specified database. + +## Request Syntax + +```python +alter_database_properties( + db_name: str, + properties: Dict, + timeout: Optional[float] = None, + **kwargs, +) +``` + +**PARAMETERS:** + +- **db_name** (*string*) - + + **[REQUIRED]** + + Name of the database whose properties are to be modified. + +- **properties** (*dict* | *None*) - + + Properties to modify and their values after the modification. Possible database properties are as follows: + + - **database.replica.number** (*int*) - + + Number of replicas for the database. + + - **database.resource_groups** (*[]str*) - + + Resource groups dedicated to the database. + + - **database.diskQuota.mb** (*int*) - + + Disk quota allocated to the database in megabytes (**MB**). + + - **database.max.collections** (*int*) - + + Maximum number of collections allowed in the database. + + - **database.force.deny.writing** (*bool*) - + + Whether to deny all write operations in the database. + + - **database.force.deny.reading** (*bool*) - + + Whether to deny all read operations in the database. + +- **timeout** (*float* | *None*) - + + The timeout duration for this operation. Setting this to *None* indicates that this operation timeouts when any response or error occurs. + +**RETURN TYPE:** + +*NoneType* + +**RETURNS:** + +*None* + +**EXCEPTIONS:** + +- `MilvusException` - Raised if any error occurs during this operation. + +## Examples + +```python +from pymilvus import MilvusClient + +client = MilvusClient(uri, token) # db = "default" + +client.alter_database_properties( + db_name="my_db", + properties={"a": "f", "b": "g"} +) +``` diff --git a/API_Reference/pymilvus/v2.5.x/MilvusClient/Database/create_database.md b/API_Reference/pymilvus/v2.5.x/MilvusClient/Database/create_database.md new file mode 100644 index 000000000..4a5ffe87f --- /dev/null +++ b/API_Reference/pymilvus/v2.5.x/MilvusClient/Database/create_database.md @@ -0,0 +1,82 @@ +# create_database() + +This operation creates a database. + +## Request Syntax + +```python +create_database( + db_name: str, + properties: Optional[dict] = None, + timeout: Optional[float] = None, + **kwargs, +) +``` + +**PARAMETERS:** + +- **db_name** (*string*) - + + **[REQUIRED]** + + Name of the database to create. + +- **properties** (*dict* | *None*) - + + Properties of the database to be created. Possible database properties are as follows: + + - **database.replica.number** (*int*) - + + Number of replicas for the database. + + - **database.resource_groups** (*[]str*) - + + Resource groups dedicated to the database. + + - **database.diskQuota.mb** (*int*) - + + Disk quota allocated to the database in megabytes (**MB**). + + - **database.max.collections** (*int*) - + + Maximum number of collections allowed in the database. + + - **database.force.deny.writing** (*bool*) - + + Whether to deny all write operations in the database. + + - **database.force.deny.reading** (*bool*) - + + Whether to deny all read operations in the database. + +- **timeout** (*float* | *None*) - + + The timeout duration for this operation. Setting this to *None* indicates that it timeouts when a response arrives or an error occurs. + +**RETURN TYPE:** + +*NoneType* + +**RETURNS:** + +*None* + +**EXCEPTIONS:** + +- `MilvusException` - Raised if any error occurs during this operation. + +## Examples + +```python +from pymilvus import MilvusClient + +client = MilvusClient(uri, token) # db = "default" + +client.create_database( + db_name="my_db", + properties={ + "database.replica.number": 3 + } +) +``` + diff --git a/API_Reference/pymilvus/v2.5.x/MilvusClient/Database/describe_database.md b/API_Reference/pymilvus/v2.5.x/MilvusClient/Database/describe_database.md new file mode 100644 index 000000000..743e5acec --- /dev/null +++ b/API_Reference/pymilvus/v2.5.x/MilvusClient/Database/describe_database.md @@ -0,0 +1,55 @@ +# describe_database() + +This operation lists detailed information about the specified database. + +## Request Syntax + +```python +describe_database( + db_name: str, + timeout: Optional[float] = None, + **kwargs, +) -> Dict +``` + +**PARAMETERS:** + +- **db_name** (*string*) - + + **[REQUIRED]** + + Name of the database to describe. + +- **timeout** (*float* | *None*) - + + The timeout duration for this operation. Setting this to *None* indicates that it timeouts when a response arrives, or an error occurs. + +**RETURN TYPE:** + +*Dict* + +**RETURNS:** + +A dictionary that contains detailed information about the specified database. + +**EXCEPTIONS:** + +- `MilvusException` - Raised if any error occurs during this operation. + +## Examples + +```python +from pymilvus import MilvusClient + +client = MilvusClient(uri, token) # db = "default" + +client.describe_database( + db_name="my_db" +) + +# { +# "name": "my_db", +# "a": "b", +#. "c": "d", +# } +``` diff --git a/API_Reference/pymilvus/v2.5.x/MilvusClient/Database/drop_database.md b/API_Reference/pymilvus/v2.5.x/MilvusClient/Database/drop_database.md new file mode 100644 index 000000000..3fab38173 --- /dev/null +++ b/API_Reference/pymilvus/v2.5.x/MilvusClient/Database/drop_database.md @@ -0,0 +1,47 @@ +# drop_database() + +This operation drops the specified database. + +## Request Syntax + +```python +drop_database( + db_name: str, + timeout: Optional[float] = None, + **kwargs, +) +``` + +**PARAMETERS:** + +- **db_name** (*string*) - + + **[REQUIRED]** + + Name of the database to drop. + +- **timeout** (*float* | *None*) - + + The timeout duration for this operation. Setting this to *None* indicates that it timeouts when a response arrives or an error occurs. + +**RETURN TYPE:** + +*NoneType* + +**RETURNS:** + +*None* + +**EXCEPTIONS:** + +- `MilvusException` - Raised if any error occurs during this operation. + +## Examples + +```python +from pymilvus import MilvusClient + +client = MilvusClient(uri, token) # db = "default" + +client.drop_database("my_db") +``` diff --git a/API_Reference/pymilvus/v2.5.x/MilvusClient/Database/drop_database_properties.md b/API_Reference/pymilvus/v2.5.x/MilvusClient/Database/drop_database_properties.md new file mode 100644 index 000000000..89a0c7207 --- /dev/null +++ b/API_Reference/pymilvus/v2.5.x/MilvusClient/Database/drop_database_properties.md @@ -0,0 +1,79 @@ +# drop_database_properties() + +This operation drops the setting of the specified properties. + +## Request Syntax + +```python +drop_database_properties( + db_name: str, + property_keys: List[string], + timeout: Optional[float] = None, + **kwargs, +) +``` + +**PARAMETERS:** + +- **db_name** (*string*) - + + **[REQUIRED]** + + Name of the database whose properties are to be dropped. + +- **properties** (*[]string* | *None*) - + + Names of the properties to drop. Possible database properties are as follows: + + - **database.replica.number** (*int*) - + + Number of replicas for the database. + + - **database.resource_groups** (*[]str*) - + + Resource groups dedicated to the database. + + - **database.diskQuota.mb** (*int*) - + + Disk quota allocated to the database in megabytes (**MB**). + + - **database.max.collections** (*int*) - + + Maximum number of collections allowed in the database. + + - **database.force.deny.writing** (*bool*) - + + Whether to deny all write operations in the database. + + - **database.force.deny.reading** (*bool*) - + + Whether to deny all read operations in the database. + +- **timeout** (*float* | *None*) - + + The timeout duration for this operation. Setting this to *None* indicates that it timeouts when a response arrives, or an error occurs. + +**RETURN TYPE:** + +*NoneType* + +**RETURNS:** + +*None* + +**EXCEPTIONS:** + +- `MilvusException` - Raised if any error occurs during this operation. + +## Examples + +```python +from pymilvus import MilvusClient + +client = MilvusClient(uri, token) # db = "default" + +client.drop_database_properties( + db_name="my_db", + properties=["a", "b"] +) +``` diff --git a/API_Reference/pymilvus/v2.5.x/MilvusClient/Database/list_databases.md b/API_Reference/pymilvus/v2.5.x/MilvusClient/Database/list_databases.md new file mode 100644 index 000000000..278e23cc6 --- /dev/null +++ b/API_Reference/pymilvus/v2.5.x/MilvusClient/Database/list_databases.md @@ -0,0 +1,48 @@ +# list_databases() + +This operation lists all existing databases. + +## Request Syntax + +```python +list_databases( + timeout: Optional[float] = None, + **kwargs, +) -> [] string +``` + +**PARAMETERS:** + +- **db_name** (*string*) - + + **[REQUIRED]** + + Name of the database to drop. + +- **timeout** (*float* | *None*) - + + The timeout duration for this operation. Setting this to *None* indicates that it timeouts when a response arrives or an error occurs. + +**RETURN TYPE:** + +*[]string* + +**RETURNS:** + +A list of database names. + +**EXCEPTIONS:** + +- `MilvusException` - Raised if any error occurs during this operation. + +## Examples + +```python +from pymilvus import MilvusClient + +client = MilvusClient(uri, token) # db = "default" + +db_list = client.list_databases() +print(db_list) +# ["my_database", "default"] +``` diff --git a/API_Reference/pymilvus/v2.5.x/MilvusClient/Database/using_database.md b/API_Reference/pymilvus/v2.5.x/MilvusClient/Database/using_database.md new file mode 100644 index 000000000..69bcc8b6d --- /dev/null +++ b/API_Reference/pymilvus/v2.5.x/MilvusClient/Database/using_database.md @@ -0,0 +1,42 @@ +# using_database() + +This operation changes the database currently in use. + +## Request Syntax + +```python +using_database( + db_name: str, + **kwargs, +) +``` + +**PARAMETERS:** + +- **db_name** (*string*) - + + **[REQUIRED]** + + Name of the database to use. + +**RETURN TYPE:** + +*NoneType* + +**RETURNS:** + +*None* + +**EXCEPTIONS:** + +- `MilvusException` - Raised if any error occurs during this operation. + +## Examples + +```python +from pymilvus import MilvusClient + +client = MilvusClient(uri, token) # db = "default" + +client.using_database("my_db") +``` diff --git a/API_Reference/pymilvus/v2.5.x/MilvusClient/Management/Management.md b/API_Reference/pymilvus/v2.5.x/MilvusClient/Management/Management.md new file mode 100644 index 000000000..d61abe5a6 --- /dev/null +++ b/API_Reference/pymilvus/v2.5.x/MilvusClient/Management/Management.md @@ -0,0 +1,5 @@ +# Management + +Methods for you to index, load, and release a collection. + + diff --git a/API_Reference/pymilvus/v2.5.x/MilvusClient/Management/alter_index_properties.md b/API_Reference/pymilvus/v2.5.x/MilvusClient/Management/alter_index_properties.md new file mode 100644 index 000000000..3e001f781 --- /dev/null +++ b/API_Reference/pymilvus/v2.5.x/MilvusClient/Management/alter_index_properties.md @@ -0,0 +1,76 @@ +# alter_index_properties() + +This operation changes the specified index properties. + +## Request Syntax + +```python +alter_index_properties( + self, + collection_name: str, + index_name: str, + properties: dict, + timeout: Optional[float] = None, + **kwargs, +) +``` + +**PARAMETERS:** + +- **collection_name** (*str*) - + + The name of the target collection. + +- **index_name** (*str*) - + + The name of the index file to alter. + +- **properties** (*dict*) - + + The properties and their values after this operation. Possible properties to change include: + + - **mmap.enabled** (*bool*) - + + Whether to enable mmap for the specified index. Setting this to `true` offloads the specified index onto the disk. For details, refer to [Mmap-enabled Data Storage](https://milvus.io/docs/mmap.md) + +- **timeout** (*Optional[float]*) - + + The timeout duration for this operation. + + Setting this to None indicates that this operation timeouts when any response arrives or any error occurs. + +**RETURN TYPE:** + +*NoneType* + +**RETURNS:** + +None + +**EXCEPTIONS:** + +- **MilvusException** + + This exception will be raised when any error occurs during this operation. + +## Examples + +```python +from pymilvus import MilvusClient + +# 1. Create a milvus client +client = MilvusClient( + uri="https://inxx-xxxxxxxxxxxx.api.gcp-us-west1.zillizcloud.com:19530", + token="user:password" +) + +# update properties +properties = {"mmap.enabled": true} + +client.alter_index_properties( + collection_name="collection_name", + index_name="my_vector", + properties = properties +) +``` + diff --git a/API_Reference/pymilvus/v2.5.x/MilvusClient/Management/compact.md b/API_Reference/pymilvus/v2.5.x/MilvusClient/Management/compact.md new file mode 100644 index 000000000..e06b1c09e --- /dev/null +++ b/API_Reference/pymilvus/v2.5.x/MilvusClient/Management/compact.md @@ -0,0 +1,62 @@ +# compact() + +This operation compacts the collection by merging small segments into larger ones. It is recommended to call this operation after inserting a large amount of data into a collection. + +## Request Syntax + +```python +compact( + self, + collection_name: str, + is_clustering: Optional[bool] = False, + timeout: Optional[float] = None, + **kwargs, +) -> int +``` + +**PARAMETERS:** + +- **collection_name** (*str*) - + + The name of the target collection. + +- **is_clustering** (*bool*) - + + Whether to perform a clustering compaction. For details, refer to [Clustering Compaction](https://milvus.io/docs/clustering-compaction.md). + +- **timeout** (*Optional[float]*) - + + The timeout duration for this operation. + + Setting this to None indicates that this operation timeouts when any response arrives or any error occurs. + +**RETURN TYPE:** + +*int* + +**RETURNS:** + +A compaction job ID, which can be used to get the compaction status. + +**EXCEPTIONS:** + +- **MilvusException** + + This exception will be raised when any error occurs during this operation, especially when the specified alias does not exist. + +## Example + +```python +from pymilvus import MilvusClient + +# 1. Create a milvus client +client = MilvusClient( + uri="http://localhost:19530", + token="root:Milvus" +) + +client.compact( + collection_name="collection_name" +) +``` + diff --git a/API_Reference/pymilvus/v2.5.x/MilvusClient/Management/drop_index_properties.md b/API_Reference/pymilvus/v2.5.x/MilvusClient/Management/drop_index_properties.md new file mode 100644 index 000000000..2239064c2 --- /dev/null +++ b/API_Reference/pymilvus/v2.5.x/MilvusClient/Management/drop_index_properties.md @@ -0,0 +1,71 @@ +# drop_index_properties() + +This operation drops the specified index properties. + +## Request Syntax + +```python +drop_index_properties( + self, + collection_name: str, + index_name: str, + property_keys: List[str], + timeout: Optional[float] = None, + **kwargs, +) +``` + +**PARAMETERS:** + +- **collection_name** (*str*) - + + The name of the target collection. + +- **index_name** (*str*) - + + The name of the index file to drop. + +- **property_keys** (*List[str]*) - + + The names of the properties to drop in a list. Possible properties are as follows: + + - `mmap.enabled` + +- **timeout** (*Optional[float]*) - + + The timeout duration for this operation. + + Setting this to None indicates that this operation timeouts when any response arrives or any error occurs. + +**RETURN TYPE:** + +*NoneType* + +**RETURNS:** + +None + +**EXCEPTIONS:** + +- **MilvusException** + + This exception will be raised when any error occurs during this operation. + +## Examples + +```python +from pymilvus import MilvusClient + +# 1. Create a milvus client +client = MilvusClient( + uri="https://inxx-xxxxxxxxxxxx.api.gcp-us-west1.zillizcloud.com:19530", + token="user:password" +) + +client.drop_index_properties( + collection_name="collection_name", + index_name="my_vector", + property_keys = ["mmap.enabled"] +) +``` + diff --git a/API_Reference/pymilvus/v2.5.x/MilvusClient/Management/flush.md b/API_Reference/pymilvus/v2.5.x/MilvusClient/Management/flush.md new file mode 100644 index 000000000..88cea31ec --- /dev/null +++ b/API_Reference/pymilvus/v2.5.x/MilvusClient/Management/flush.md @@ -0,0 +1,57 @@ +# flush() + +This operation flushes the streaming data and seals segments. It is recommended to call this operation after all the data has been inserted into a collection. + +## Request Syntax + +```python +flush( + self, + collection_name: str, + timeout: Optional[float] = None, + **kwargs, +) +``` + +**PARAMETERS:** + +- **collection_name** (*str*) - + + The name of the target collection. + +- **timeout** (*Optional[float]*) - + + The timeout duration for this operation. + + Setting this to None indicates that this operation timeouts when any response arrives or any error occurs. + +**RETURN TYPE:** + +*NoneType* + +**RETURNS:** + +*None* + +**EXCEPTIONS:** + +- **MilvusException** + + This exception will be raised when any error occurs during this operation, especially when the specified alias does not exist. + +## Example + +```python +from pymilvus import MilvusClient + +# 1. Create a milvus client +client = MilvusClient( + uri="http://localhost:19530", + token="root:Milvus" +) + +client.flush( + collection_name="collection_name" +) +``` + diff --git a/API_Reference/pymilvus/v2.5.x/MilvusClient/Management/get_compact_state.md b/API_Reference/pymilvus/v2.5.x/MilvusClient/Management/get_compact_state.md new file mode 100644 index 000000000..d61b2beef --- /dev/null +++ b/API_Reference/pymilvus/v2.5.x/MilvusClient/Management/get_compact_state.md @@ -0,0 +1,65 @@ +# get_compact_state() + +This operation returns the status of the specified compaction job. + +## Request Syntax + +```python +get_compaction_state( + self, + job_id: int, + timeout: Optional[float] = None, + **kwargs, +) -> str +``` + +**PARAMETERS:** + +- **job_id** (*int*) - + + The compaction job ID. + +- **timeout** (*Optional[float]*) - + + The timeout duration for this operation. + + Setting this to None indicates that this operation timeouts when any response arrives or any error occurs. + +**RETURN TYPE:** + +*str* + +**RETURNS:** + +The state of the specified compaction job. Possible values are + +- `UndefinedState` + +- `Executing` + +- `Completed` + +**EXCEPTIONS:** + +- **MilvusException** + + This exception will be raised when any error occurs during this operation, especially when the specified alias does not exist. + +## Example + +```python +from pymilvus import MilvusClient + +# 1. Create a milvus client +client = MilvusClient( + uri="http://localhost:19530", + token="root:Milvus" +) + +client.get_compact_state( + job_id=45389273892800 +) + +# Completed +``` + diff --git a/API_Reference/pymilvus/v2.5.x/MilvusClient/Partitions/Partitions.md b/API_Reference/pymilvus/v2.5.x/MilvusClient/Partitions/Partitions.md new file mode 100644 index 000000000..65c73e37e --- /dev/null +++ b/API_Reference/pymilvus/v2.5.x/MilvusClient/Partitions/Partitions.md @@ -0,0 +1,5 @@ +# Partitions + +Methods related to the manipulation of the partitions in a collection. + + diff --git a/API_Reference/pymilvus/v2.5.x/MilvusClient/ResourceGroup/ResourceGroup.md b/API_Reference/pymilvus/v2.5.x/MilvusClient/ResourceGroup/ResourceGroup.md new file mode 100644 index 000000000..c5f405965 --- /dev/null +++ b/API_Reference/pymilvus/v2.5.x/MilvusClient/ResourceGroup/ResourceGroup.md @@ -0,0 +1,5 @@ +# ResourceGroup + +Methods for you to manage resource groups. + + diff --git a/API_Reference/pymilvus/v2.5.x/MilvusClient/ResourceGroup/ResourceGroupConfig.md b/API_Reference/pymilvus/v2.5.x/MilvusClient/ResourceGroup/ResourceGroupConfig.md new file mode 100644 index 000000000..a2351d814 --- /dev/null +++ b/API_Reference/pymilvus/v2.5.x/MilvusClient/ResourceGroup/ResourceGroupConfig.md @@ -0,0 +1,91 @@ +# ResourceGroupConfig + +A **ResourceGroupConfig** instance describes the configuration of a resource group. You can reference such an instance when you create a resource group or update its configuration. + +```python +class pymilvus.client.types.ResourceGroupConfig +``` + +## Constructor + +```python +ResourceGroupConfig( + requests: ResourceGroupLimit, + limits: ResourceGroupLimit, + transfer_from: List[ResourceGroupTransfer], + transfer_to: List[ResourceGroupTransfer], + node_filter: Dict +) +``` + +**PARAMETERS:** + +- **requests** (*ResourceGroupLimit*) - + + A **ResourceGroupLimit** instance that defines the number of nodes required by a resource group. It provides the following fields: + + - **node_num** (*int*) - + + Number of required nodes. + +- **limits** (*ResourceGroupLimit*) - + + A **ResourceGroupLimit** instance that defines the maximum number of nodes required by a resource group. It provides the following fields: + + - **node_num** (*int*) - + + Maximum number of required nodes. + +- **transfer_from** (*List[ResourceGroupTransfer]*) - + + A list of **ResourceGroupTransfer** instances that defines the source resource groups for necessary transfers. A **ResourceGroupTransfer** instance provides the following fields: + + - **resource_group** (*str*) - + + Name of a resource group. + +- **transfer_to** (*List[ResourceGroupTransfer]*) - + + A list of **ResourceGroupTransfer** instances that defines the target resource groups for necessary transfers. A **ResourceGroupTransfer** instance provides the following fields: + + - **resource_group** (*str*) - + + Name of a resource group. + +- **node_filter** (*dict*) - + + A filter is used to filter the query nodes with specified node labels. It has the following keys: + + - **node_labels** (*list*) - + + Node labels in key-value pairs, as in `[{ "key": "QUERYNODE_LOCATION", "value": "dc1" }]`. + +
+ +

how can i label a query node?

+ +

You can set an environment variable for Milvus to label the query node during its startup. For example, to add the QUERYNODE_LOCATION label, you need to create an environment variable named after the label, prefixed by MILVUS_SERVER_LABEL_, and set the value for the label, as in MILVUS_SERVER_LABEL_QUERYNODE_LOCATION=dc1.

+ +
+ +**RETURN TYPES:** + +*ResourceGroupConfig* + +**RETURNS:** + +A *ResourceGroupConfig* instance + +## Examples + +```python +from pymilvus.client.constants import DEFAULT_RESOURCE_GROUP + +ResourceGroupConfig( + requests={"node_num": 1}, + limits={"node_num": 1}, + transfer_from=[{"resource_group": DEFAULT_RESOURCE_GROUP}], + transfer_to=[{"resource_group": DEFAULT_RESOURCE_GROUP}], +) +``` + diff --git a/API_Reference/pymilvus/v2.5.x/MilvusClient/ResourceGroup/create_resource_group.md b/API_Reference/pymilvus/v2.5.x/MilvusClient/ResourceGroup/create_resource_group.md new file mode 100644 index 000000000..87b91c6a7 --- /dev/null +++ b/API_Reference/pymilvus/v2.5.x/MilvusClient/ResourceGroup/create_resource_group.md @@ -0,0 +1,74 @@ +# create_resource_group() + +This operation creates a resource group. This operation always succeeds no matter whether the resource group exists. + +
+ +

notes

+ +

A Milvus instance begins with a default resource group that includes all available query nodes.

+

To optimize resource utilization, you can create additional resource groups, reassign specific query nodes from the default group, and load collections into these newly configured groups.

+

This approach ensures that collections are allocated dedicated query nodes, enabling efficient and isolated search services.

+

For details about resource groups, refer to Manage Resource Group.

+ +
+ +## Request Syntax + +```python +create_resource_group( + name: str, + timeout: Optional[float] = None, + **kwargs +) -> None +``` + +**PARAMETERS:** + +- **name** (*str*) - + + Name of the resource group to create. + +- **configs** (*ResourceGroupConfig*) - + + A **[ResourceGroupConfig](ResourceGroupConfig.md)** object. + +- **timeout** (*float* | *None*) - + + The timeout duration for this operation. Setting this to *None* indicates that it timeouts when a response arrives or an error occurs. + +**RETURN TYPE:** + +*NoneType* + +**RETURNS:** + +None + +**EXCEPTIONS:** + +- `MilvusException` - Raised if any error occurs during this operation. + +## Examples + +```python +from pymilvus import ( + MilvusClient, + DataType, +) +from pymilvus.client.constants import DEFAULT_RESOURCE_GROUP +from pymilvus.client.types import ( + ResourceGroupConfig, +) + +client = MilvusClient(uri, token) + +# Create a resource group +client.create_resource_group("rg1", config=ResourceGroupConfig( + requests={"node_num": 1}, + limits={"node_num": 1}, + transfer_from=[{"resource_group": DEFAULT_RESOURCE_GROUP}], + transfer_to=[{"resource_group": DEFAULT_RESOURCE_GROUP}], +)) +``` + diff --git a/API_Reference/pymilvus/v2.5.x/MilvusClient/ResourceGroup/describe_resource_group.md b/API_Reference/pymilvus/v2.5.x/MilvusClient/ResourceGroup/describe_resource_group.md new file mode 100644 index 000000000..ba6fb59b3 --- /dev/null +++ b/API_Reference/pymilvus/v2.5.x/MilvusClient/ResourceGroup/describe_resource_group.md @@ -0,0 +1,118 @@ +# describe_resource_group() + +This operation lists detailed information about the specified resource group. + +## Request Syntax + +```python +describe_resource_group( + name: str, + timeout: Optional[float] = None +) -> ResourceGroupInfo +``` + +**PARAMETERS:** + +- **name** (*str*) - + + Name of the resource group to describe. + +- **timeout** (*float* | *None*) - + + The timeout duration for this operation. Setting this to *None* indicates that it timeouts when a response arrives or an error occurs. + +**RETURN TYPE:** + +*ResourceGroupInfo* + +**RETURNS:** + +A **ResourceGroupInfo** object that contains detailed information about the specified resource group. + +```python +ResourceGroupInfo: +, # resource group name +, # resource group capacity +, # resource group node num +, # collection loaded replica num in resource group +, # node num which still in use by replica in other resource group +, # node num which is in use by replica but belong to other resource group +, +, +, +]> +``` + +**PARAMETERS:** + +- **name** (*str*) - + + Name of the specified resource group. + +- **capacity** (*number*) - + + The number of query nodes that have been transferred to this resource group. + +- **num_available_replica** (*Object*) - + + An object that contains collection-specific statistics on the number of available replicas, with the collection names as the keys and their numbers of replicas as the values. + +- **num_outgoing_node**: (*Object*) - + + An object that contains collection-specific statistics on the number of outgoing nodes accessed by the replicas loaded in this resource group, with the collection names as the keys and their numbers of outgoing nodes as the values. + +- **num_incoming_node**: (*Object*) - + + An object that contains collection-specific statistics on the number of incoming nodes accessed by the replicas loaded in this resource group, with the collection names as the keys and their numbers of incoming nodes as the values. + +- **config** (*ResourceGroupConfig*) - + + The configurations of the specified resource group in a [ResourceGroupConfig](ResourceGroupConfig.md) instance. + +**EXCEPTIONS:** + +- `MilvusException` - Raised if any error occurs during this operation. + +## Examples + +```python +from pymilvus import ( + MilvusClient, + DataType, +) +from pymilvus.client.constants import DEFAULT_RESOURCE_GROUP + +from pymilvus.client.types import ( + ResourceGroupConfig, +) + +collection_name = "hello_milvus" +client = MilvusClient("http://localhost:19530") + +## create resource group +print("create resource group") +client.create_resource_group("rg1", config=ResourceGroupConfig( + requests={"node_num": 1}, + limits={"node_num": 1}, + transfer_from=[{"resource_group": DEFAULT_RESOURCE_GROUP}], + transfer_to=[{"resource_group": DEFAULT_RESOURCE_GROUP}], + )) + +## describe resource group +print("describe rg1") +result = client.describe_resource_group("rg1") +print(result) +``` diff --git a/API_Reference/pymilvus/v2.5.x/MilvusClient/ResourceGroup/drop_resource_group.md b/API_Reference/pymilvus/v2.5.x/MilvusClient/ResourceGroup/drop_resource_group.md new file mode 100644 index 000000000..2b13de6ec --- /dev/null +++ b/API_Reference/pymilvus/v2.5.x/MilvusClient/ResourceGroup/drop_resource_group.md @@ -0,0 +1,82 @@ +# drop_resource_group() + +This operation drops the specified resource group. + +## Request Syntax + +```python +drop_resource_group( + name: str, + timeout: Optional[float] = None +) -> None +``` + +**PARAMETERS:** + +- **name** (*str*) - + + Name of the resource group to drop. + +- **timeout** (*float* | *None*) - + + The timeout duration for this operation. Setting this to *None* indicates that it timeouts when a response arrives or an error occurs. + +**RETURN TYPE:** + +*NoneType* + +**RETURNS:** + +None + +**EXCEPTIONS:** + +- `MilvusException` - Raised if any error occurs during this operation. + +## Examples + +
+ +

notes

+ +

Before dropping a resource group, ensure that the number of required nodes and the maximum number of required nodes in its configuration are zeros.

+

You can use updateresourcegroups() to make the change.

+ +
+ +```python +from pymilvus import ( + MilvusClient, + DataType, +) +from pymilvus.client.constants import DEFAULT_RESOURCE_GROUP + +from pymilvus.client.types import ( + ResourceGroupConfig, +) + +client = MilvusClient("http://localhost:19530") + +## create resource group +print("create resource group") +client.create_resource_group("rg1", config=ResourceGroupConfig( + requests={"node_num": 1}, + limits={"node_num": 1}, + transfer_from=[{"resource_group": DEFAULT_RESOURCE_GROUP}], + transfer_to=[{"resource_group": DEFAULT_RESOURCE_GROUP}], + )) + +## drop resource group +print("drop resource group") +# create resource group +configs = { + "rg1": ResourceGroupConfig( + requests={"node_num": 0}, + limits={"node_num": 0}, + transfer_from=[{"resource_group": DEFAULT_RESOURCE_GROUP}], + transfer_to=[{"resource_group": DEFAULT_RESOURCE_GROUP}], + ), + } +client.update_resource_groups(configs) +client.drop_resource_group("rg1") +``` diff --git a/API_Reference/pymilvus/v2.5.x/MilvusClient/ResourceGroup/list_resource_groups.md b/API_Reference/pymilvus/v2.5.x/MilvusClient/ResourceGroup/list_resource_groups.md new file mode 100644 index 000000000..9b1d9bb8d --- /dev/null +++ b/API_Reference/pymilvus/v2.5.x/MilvusClient/ResourceGroup/list_resource_groups.md @@ -0,0 +1,59 @@ +# list_resource_groups() + +This operation lists all available resource groups. + +## Request Syntax + +```python +list_resource_groups( + timeout: Optional[float] = None +) -> List[str] +``` + +**PARAMETERS:** + +- **timeout** (*float* | *None*) - + + The timeout duration for this operation. Setting this to *None* indicates that it timeouts when a response arrives or an error occurs. + +**RETURN TYPE:** + +*List* + +**RETURNS:** + +A list of resource group names. + +**EXCEPTIONS:** + +- `MilvusException` - Raised if any error occurs during this operation. + +## Examples + +```python +from pymilvus import ( + MilvusClient, + DataType, +) +from pymilvus.client.constants import DEFAULT_RESOURCE_GROUP + +from pymilvus.client.types import ( + ResourceGroupConfig, +) + +client = MilvusClient("http://localhost:19530") + +## create resource group +print("create resource group") +client.create_resource_group("rg1", config=ResourceGroupConfig( + requests={"node_num": 1}, + limits={"node_num": 1}, + transfer_from=[{"resource_group": DEFAULT_RESOURCE_GROUP}], + transfer_to=[{"resource_group": DEFAULT_RESOURCE_GROUP}], + )) + +## list resource group +print("list resource group") +result = client.list_resource_groups() +print(result) +``` diff --git a/API_Reference/pymilvus/v2.5.x/MilvusClient/ResourceGroup/transfer_replica.md b/API_Reference/pymilvus/v2.5.x/MilvusClient/ResourceGroup/transfer_replica.md new file mode 100644 index 000000000..8e6593b0e --- /dev/null +++ b/API_Reference/pymilvus/v2.5.x/MilvusClient/ResourceGroup/transfer_replica.md @@ -0,0 +1,99 @@ +# transfer_replica() + +This operation reassigns the specified number of replicas from the source resource group to the target resource group. + +## Request Syntax + +```python +transfer_replica( + source_group: str, + target_group: str, + collection_name: str, + num_replicas: int, + timeout: Optional[float] = None +) -> None +``` + +**PARAMETERS:** + +- **source_name** (*str*) - + + Name of the source resource group of this operation. + +- **target_name** (*str*) - + + Name of the target resource group of this operation. + +- **collection_name** (*str*) - + + Name of the collection whose replicas will be transferred. + +- **num_replicas** (*int*) - + + Number of replicas to transfer. + +- **timeout** (*float* | *None*) - + + The timeout duration for this operation. Setting this to *None* indicates that it timeouts when a response arrives or an error occurs. + +**RETURN TYPE:** + +*NoneType* + +**RETURNS:** + +None + +**EXCEPTIONS:** + +- `MilvusException` - Raised if any error occurs during this operation. + +## Examples + +```python +from pymilvus import ( + MilvusClient, + DataType, +) +from pymilvus.client.constants import DEFAULT_RESOURCE_GROUP + +from pymilvus.client.types import ( + ResourceGroupConfig, +) + +fmt = "\n=== {:30} ===\n" +dim = 8 +collection_name = "hello_milvus" +client = MilvusClient("http://localhost:19530") + +## create collection and load collection +print("create collection and load collection") +collection_name = "hello_milvus" +has_collection = client.has_collection(collection_name, timeout=5) +if has_collection: + client.drop_collection(collection_name) + +schema = client.create_schema(enable_dynamic_field=True) +schema.add_field("id", DataType.INT64, is_primary=True) +schema.add_field("embeddings", DataType.FLOAT_VECTOR, dim=dim) +schema.add_field("title", DataType.VARCHAR, max_length=64) +client.create_collection(collection_name, schema=schema, consistency_level="Strong") +index_params = client.prepare_index_params() +index_params.add_index(field_name = "embeddings", metric_type="L2") +index_params.add_index(field_name = "title", index_type = "Trie", index_name="my_trie") +client.create_index(collection_name, index_params) +client.load_collection(collection_name) + +## create resource group +print("create resource group") +client.create_resource_group("rg1", config=ResourceGroupConfig( + requests={"node_num": 1}, + limits={"node_num": 1}, + transfer_from=[{"resource_group": DEFAULT_RESOURCE_GROUP}], + transfer_to=[{"resource_group": DEFAULT_RESOURCE_GROUP}], + )) + +## transfer replica +print("transfer replica to rg1") +client.transfer_replica(DEFAULT_RESOURCE_GROUP, "rg1", collection_name, 1) +``` diff --git a/API_Reference/pymilvus/v2.5.x/MilvusClient/ResourceGroup/update_resource_groups.md b/API_Reference/pymilvus/v2.5.x/MilvusClient/ResourceGroup/update_resource_groups.md new file mode 100644 index 000000000..98c65d032 --- /dev/null +++ b/API_Reference/pymilvus/v2.5.x/MilvusClient/ResourceGroup/update_resource_groups.md @@ -0,0 +1,75 @@ +# update_resource_groups() + +This operation updates the configurations of the specified resource group. + +## Request Syntax + +```python +update_resource_groups( + configs: Dict[str, ResourceGroupConfig], + timeout: Optional[float] = None +) -> None +``` + +**PARAMETERS:** + +- **configs** (*Dict[str, ResourceGroupConfig]*) - + + A dictionary containing the resource group name as the key and the configuration of the resource group after the update as the value. The value should be a **[ResourceGroupConfig](ResourceGroupConfig.md)** object. + +- **timeout** (*float* | *None*) - + + The timeout duration for this operation. Setting this to *None* indicates that it timeouts when a response arrives or an error occurs. + +**RETURN TYPE:** + +*NoneType* + +**RETURNS:** + +None + +**EXCEPTIONS:** + +- `MilvusException` - Raised if any error occurs during this operation. + +## Examples + +```python +from pymilvus import ( + MilvusClient, + DataType, +) +from pymilvus.client.constants import DEFAULT_RESOURCE_GROUP + +from pymilvus.client.types import ( + ResourceGroupConfig, +) + +milvus_client = MilvusClient("http://localhost:19530") + +## create resource group +print("create resource group") +milvus_client.create_resource_group("rg1", config=ResourceGroupConfig( + requests={"node_num": 1}, + limits={"node_num": 1}, + transfer_from=[{"resource_group": DEFAULT_RESOURCE_GROUP}], + transfer_to=[{"resource_group": DEFAULT_RESOURCE_GROUP}], + )) + +## update resource group +configs = { + "rg1": ResourceGroupConfig( + requests={"node_num": 5}, + limits={"node_num": 5}, + transfer_from=[{"resource_group": DEFAULT_RESOURCE_GROUP}], + transfer_to=[{"resource_group": DEFAULT_RESOURCE_GROUP}], + ), + } +milvus_client.update_resource_groups(configs) + +## describe resource group +print("describe rg1") +result = milvus_client.describe_resource_group("rg1") +print(result) +```