Skip to content

Commit

Permalink
Merge pull request #41 from aerospike/dev
Browse files Browse the repository at this point in the history
AVS-Python-Client-1.0.1
  • Loading branch information
DomPeliniAerospike authored Aug 6, 2024
2 parents ecdaf04 + ea19a94 commit a7e9591
Show file tree
Hide file tree
Showing 17 changed files with 688 additions and 472 deletions.
2 changes: 1 addition & 1 deletion docs/sync.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Synchronous Clients
=====================

This module contains clients with coroutine methods used for asynchronous programming.
This module contains clients with methods used for synchronous programming.


.. toctree::
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ classifiers = [
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: Database"
]
version = "1.0.0"
version = "1.0.1"
requires-python = ">3.8"
dependencies = [
"grpcio == 1.64.1",
Expand Down
63 changes: 33 additions & 30 deletions src/aerospike_vector_search/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Client(BaseClient):
This client is designed to conduct Aerospike Vector Search administrative operation such as creating indexes, querying index information, and dropping indexes.
:param seeds: Defines the Aerospike Database cluster nodes to which you want AVS to connect. AVS iterates through the seed nodes. After connecting to a node, AVS discovers all of the nodes in the cluster.
:param seeds: Defines the AVS nodes to which you want AVS to connect. AVS iterates through the seed nodes. After connecting to a node, AVS discovers all of the nodes in the cluster.
:type seeds: Union[types.HostPort, tuple[types.HostPort, ...]]
:param listener_name: An external (NATed) address and port combination that differs from the actual address and port where AVS is listening. Clients can access AVS on a node using the advertised listener address and port. Defaults to None.
Expand All @@ -38,10 +38,10 @@ class Client(BaseClient):
:param root_certificate: The PEM-encoded root certificates as a byte string. Defaults to None.
:type root_certificate: Optional[list[bytes], bytes]
:param certificate_chain: The PEM-encoded private key as a byte string. Defaults to None.
:param certificate_chain: The PEM-encoded certificate chain as a byte string. Defaults to None.
:type certificate_chain: Optional[bytes]
:param private_key: The PEM-encoded certificate chain as a byte string. Defaults to None.
:param private_key: The PEM-encoded private key as a byte string. Defaults to None.
:type private_key: Optional[bytes]
:raises AVSClientError: Raised when no seed host is provided.
Expand Down Expand Up @@ -109,21 +109,24 @@ def index_create(
:param vector_distance_metric:
The distance metric used to compare when performing a vector search.
Defaults to :class:`VectorDistanceMetric.SQUARED_EUCLIDEAN`.
:type dimensions: Optional[types.VectorDistanceMetric]
:type vector_distance_metric: Optional[types.VectorDistanceMetric]
:param sets: The set used for the index. Defaults to None.
:type dimensions: Optional[str]
:type sets: Optional[str]
:param index_params: (Optional[types.HnswParams], optional): Parameters used for tuning
vector search. Defaults to None. If index_params is None, then the default values
specified for :class:`types.HnswParams` will be used.
:type dimensions: Optional[types.HnswParams]
:type index_params: Optional[types.HnswParams]
:param index_labels: Meta data associated with the index. Defaults to None.
:type dimensions: Optional[dict[str, str]]
:type index_labels: Optional[dict[str, str]]
:param index_storage: Namespace and set where index overhead (non-vector data) is stored.
:type index_storage: Optional[types.IndexStorage]
:param timeout: Time in seconds this operation will wait before raising an :class:`AVSServerError <aerospike_vector_search.types.AVSServerError>`. Defaults to None.
:type dimensions: int
:type timeout: int
Raises:
AVSServerError: Raised if an error occurs during the RPC communication with the server while attempting to create the index.
Expand Down Expand Up @@ -178,10 +181,10 @@ def index_drop(
:type name: str
:param timeout: Time in seconds this operation will wait before raising an :class:`AVSServerError <aerospike_vector_search.types.AVSServerError>`. Defaults to None.
:type dimensions: int
:type timeout: int
Raises:
AVSServerError: Raised if an error occurs during the RPC communication with the server while attempting to drop the index..
AVSServerError: Raised if an error occurs during the RPC communication with the server while attempting to drop the index.
This error could occur due to various reasons such as network issues, server-side failures, or invalid request parameters.
Note:
Expand Down Expand Up @@ -215,12 +218,12 @@ def index_list(self, timeout: Optional[int] = None) -> list[dict]:
List all indices.
:param timeout: Time in seconds this operation will wait before raising an :class:`AVSServerError <aerospike_vector_search.types.AVSServerError>`. Defaults to None.
:type dimensions: int
:type timeout: int
Returns: list[dict]: A list of indices.
Raises:
AVSServerError: Raised if an error occurs during the RPC communication with the server while attempting to list the index..
AVSServerError: Raised if an error occurs during the RPC communication with the server while attempting to list the index.
This error could occur due to various reasons such as network issues, server-side failures, or invalid request parameters.
"""

Expand All @@ -246,18 +249,18 @@ def index_get(
Retrieve the information related with an index.
:param namespace: The namespace of the index.
:type name: str
:type namespace: str
:param name: The name of the index.
:type name: str
:param timeout: Time in seconds this operation will wait before raising an :class:`AVSServerError <aerospike_vector_search.types.AVSServerError>`. Defaults to None.
:type dimensions: int
:type timeout: int
Returns: dict[str, Union[int, str]: Information about an index.
Raises:
AVSServerError: Raised if an error occurs during the RPC communication with the server while attempting to get the index..
AVSServerError: Raised if an error occurs during the RPC communication with the server while attempting to get the index.
This error could occur due to various reasons such as network issues, server-side failures, or invalid request parameters.
"""
Expand Down Expand Up @@ -290,7 +293,7 @@ def index_get_status(
:type name: str
:param timeout: Time in seconds this operation will wait before raising an :class:`AVSServerError <aerospike_vector_search.types.AVSServerError>`. Defaults to None.
:type dimensions: int
:type timeout: int
Returns: int: Records queued to be merged into an index.
Expand Down Expand Up @@ -341,7 +344,7 @@ def add_user(
:type password: list[str]
:param timeout: Time in seconds this operation will wait before raising an :class:`AVSServerError <aerospike_vector_search.types.AVSServerError>`. Defaults to None.
:type dimensions: int
:type timeout: int
Raises:
Expand Down Expand Up @@ -372,11 +375,11 @@ def update_credentials(
:param username: Username of the user to update.
:type username: str
:param password: New password for the userr.
:param password: New password for the user.
:type password: str
:param timeout: Time in seconds this operation will wait before raising an :class:`AVSServerError <aerospike_vector_search.types.AVSServerError>`. Defaults to None.
:type dimensions: int
:type timeout: int
Raises:
Expand Down Expand Up @@ -406,7 +409,7 @@ def drop_user(self, *, username: str, timeout: Optional[int] = None) -> None:
:type username: str
:param timeout: Time in seconds this operation will wait before raising an :class:`AVSServerError <aerospike_vector_search.types.AVSServerError>`. Defaults to None.
:type dimensions: int
:type timeout: int
Raises:
Expand All @@ -430,13 +433,13 @@ def drop_user(self, *, username: str, timeout: Optional[int] = None) -> None:

def get_user(self, *, username: str, timeout: Optional[int] = None) -> types.User:
"""
Retrieves AVS User information from the AVS Server
Retrieves AVS User information from the AVS Server.
:param username: Username of the user to be retrieved.
:type username: str
:param timeout: Time in seconds this operation will wait before raising an :class:`AVSServerError <aerospike_vector_search.types.AVSServerError>`. Defaults to None.
:type dimensions: int
:type timeout: int
return: types.User: AVS User
Expand Down Expand Up @@ -466,7 +469,7 @@ def list_users(self, timeout: Optional[int] = None) -> list[types.User]:
List all users existing on the AVS Server.
:param timeout: Time in seconds this operation will wait before raising an :class:`AVSServerError <aerospike_vector_search.types.AVSServerError>`. Defaults to None.
:type dimensions: int
:type timeout: int
return: list[types.User]: list of AVS Users
Expand Down Expand Up @@ -494,7 +497,7 @@ def grant_roles(
self, *, username: str, roles: list[str], timeout: Optional[int] = None
) -> None:
"""
grant roles to existing AVS Users.
Grant roles to existing AVS Users.
:param username: Username of the user which will receive the roles.
:type username: str
Expand All @@ -503,7 +506,7 @@ def grant_roles(
:type roles: list[str]
:param timeout: Time in seconds this operation will wait before raising an :class:`AVSServerError <aerospike_vector_search.types.AVSServerError>`. Defaults to None.
:type dimensions: int
:type timeout: int
Raises:
AVSServerError: Raised if an error occurs during the RPC communication with the server while attempting to grant roles.
Expand All @@ -528,16 +531,16 @@ def revoke_roles(
self, *, username: str, roles: list[str], timeout: Optional[int] = None
) -> None:
"""
grant roles to existing AVS Users.
Revoke roles from existing AVS Users.
:param username: Username of the user undergoing role removal.
:type username: str
:param roles: Roles the specified user will no longer maintain..
:param roles: Roles to be revoked.
:type roles: list[str]
:param timeout: Time in seconds this operation will wait before raising an :class:`AVSServerError <aerospike_vector_search.types.AVSServerError>`. Defaults to None.
:type dimensions: int
:type timeout: int
Raises:
AVSServerError: Raised if an error occurs during the RPC communication with the server while attempting to revoke roles.
Expand All @@ -560,10 +563,10 @@ def revoke_roles(

def list_roles(self, timeout: Optional[int] = None) -> list[dict]:
"""
grant roles to existing AVS Users.
List roles available on the AVS server.
:param timeout: Time in seconds this operation will wait before raising an :class:`AVSServerError <aerospike_vector_search.types.AVSServerError>`. Defaults to None.
:type dimensions: int
:type timeout: int
returns: list[str]: Roles available in the AVS Server.
Expand Down
Loading

0 comments on commit a7e9591

Please sign in to comment.