Skip to content

Commit

Permalink
fix: gen grpc for test
Browse files Browse the repository at this point in the history
Signed-off-by: tasty-gumi <[email protected]>
  • Loading branch information
tasty-gumi committed Sep 5, 2024
1 parent 35d7e8f commit 6ff4294
Show file tree
Hide file tree
Showing 7 changed files with 592 additions and 401 deletions.
36 changes: 18 additions & 18 deletions pymilvus/grpc_gen/common_pb2.py

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions pymilvus/grpc_gen/common_pb2.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ class MsgType(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
Flush: _ClassVar[MsgType]
ResendSegmentStats: _ClassVar[MsgType]
Upsert: _ClassVar[MsgType]
ManualFlush: _ClassVar[MsgType]
FlushSegment: _ClassVar[MsgType]
Search: _ClassVar[MsgType]
SearchResult: _ClassVar[MsgType]
GetIndexState: _ClassVar[MsgType]
Expand Down Expand Up @@ -302,6 +304,11 @@ class ObjectPrivilege(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
PrivilegeUpdateResourceGroups: _ClassVar[ObjectPrivilege]
PrivilegeAlterDatabase: _ClassVar[ObjectPrivilege]
PrivilegeDescribeDatabase: _ClassVar[ObjectPrivilege]
PrivilegeBackupRBAC: _ClassVar[ObjectPrivilege]
PrivilegeRestoreRBAC: _ClassVar[ObjectPrivilege]
PrivilegeGroupReadOnly: _ClassVar[ObjectPrivilege]
PrivilegeGroupReadWrite: _ClassVar[ObjectPrivilege]
PrivilegeGroupAdmin: _ClassVar[ObjectPrivilege]

class StateCode(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
__slots__ = ()
Expand Down Expand Up @@ -444,6 +451,8 @@ Delete: MsgType
Flush: MsgType
ResendSegmentStats: MsgType
Upsert: MsgType
ManualFlush: MsgType
FlushSegment: MsgType
Search: MsgType
SearchResult: MsgType
GetIndexState: MsgType
Expand Down Expand Up @@ -577,6 +586,11 @@ PrivilegeListAliases: ObjectPrivilege
PrivilegeUpdateResourceGroups: ObjectPrivilege
PrivilegeAlterDatabase: ObjectPrivilege
PrivilegeDescribeDatabase: ObjectPrivilege
PrivilegeBackupRBAC: ObjectPrivilege
PrivilegeRestoreRBAC: ObjectPrivilege
PrivilegeGroupReadOnly: ObjectPrivilege
PrivilegeGroupReadWrite: ObjectPrivilege
PrivilegeGroupAdmin: ObjectPrivilege
Initializing: StateCode
Healthy: StateCode
Abnormal: StateCode
Expand Down
678 changes: 346 additions & 332 deletions pymilvus/grpc_gen/milvus_pb2.py

Large diffs are not rendered by default.

48 changes: 46 additions & 2 deletions pymilvus/grpc_gen/milvus_pb2.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -1461,12 +1461,14 @@ class CreateRoleRequest(_message.Message):
def __init__(self, base: _Optional[_Union[_common_pb2.MsgBase, _Mapping]] = ..., entity: _Optional[_Union[RoleEntity, _Mapping]] = ...) -> None: ...

class DropRoleRequest(_message.Message):
__slots__ = ("base", "role_name")
__slots__ = ("base", "role_name", "force_drop")
BASE_FIELD_NUMBER: _ClassVar[int]
ROLE_NAME_FIELD_NUMBER: _ClassVar[int]
FORCE_DROP_FIELD_NUMBER: _ClassVar[int]
base: _common_pb2.MsgBase
role_name: str
def __init__(self, base: _Optional[_Union[_common_pb2.MsgBase, _Mapping]] = ..., role_name: _Optional[str] = ...) -> None: ...
force_drop: bool
def __init__(self, base: _Optional[_Union[_common_pb2.MsgBase, _Mapping]] = ..., role_name: _Optional[str] = ..., force_drop: bool = ...) -> None: ...

class OperateUserRoleRequest(_message.Message):
__slots__ = ("base", "username", "role_name", "type")
Expand Down Expand Up @@ -1598,6 +1600,48 @@ class OperatePrivilegeRequest(_message.Message):
type: OperatePrivilegeType
def __init__(self, base: _Optional[_Union[_common_pb2.MsgBase, _Mapping]] = ..., entity: _Optional[_Union[GrantEntity, _Mapping]] = ..., type: _Optional[_Union[OperatePrivilegeType, str]] = ...) -> None: ...

class UserInfo(_message.Message):
__slots__ = ("user", "password", "roles")
USER_FIELD_NUMBER: _ClassVar[int]
PASSWORD_FIELD_NUMBER: _ClassVar[int]
ROLES_FIELD_NUMBER: _ClassVar[int]
user: str
password: str
roles: _containers.RepeatedCompositeFieldContainer[RoleEntity]
def __init__(self, user: _Optional[str] = ..., password: _Optional[str] = ..., roles: _Optional[_Iterable[_Union[RoleEntity, _Mapping]]] = ...) -> None: ...

class RBACMeta(_message.Message):
__slots__ = ("users", "roles", "grants")
USERS_FIELD_NUMBER: _ClassVar[int]
ROLES_FIELD_NUMBER: _ClassVar[int]
GRANTS_FIELD_NUMBER: _ClassVar[int]
users: _containers.RepeatedCompositeFieldContainer[UserInfo]
roles: _containers.RepeatedCompositeFieldContainer[RoleEntity]
grants: _containers.RepeatedCompositeFieldContainer[GrantEntity]
def __init__(self, users: _Optional[_Iterable[_Union[UserInfo, _Mapping]]] = ..., roles: _Optional[_Iterable[_Union[RoleEntity, _Mapping]]] = ..., grants: _Optional[_Iterable[_Union[GrantEntity, _Mapping]]] = ...) -> None: ...

class BackupRBACMetaRequest(_message.Message):
__slots__ = ("base",)
BASE_FIELD_NUMBER: _ClassVar[int]
base: _common_pb2.MsgBase
def __init__(self, base: _Optional[_Union[_common_pb2.MsgBase, _Mapping]] = ...) -> None: ...

class BackupRBACMetaResponse(_message.Message):
__slots__ = ("status", "RBAC_meta")
STATUS_FIELD_NUMBER: _ClassVar[int]
RBAC_META_FIELD_NUMBER: _ClassVar[int]
status: _common_pb2.Status
RBAC_meta: RBACMeta
def __init__(self, status: _Optional[_Union[_common_pb2.Status, _Mapping]] = ..., RBAC_meta: _Optional[_Union[RBACMeta, _Mapping]] = ...) -> None: ...

class RestoreRBACMetaRequest(_message.Message):
__slots__ = ("base", "RBAC_meta")
BASE_FIELD_NUMBER: _ClassVar[int]
RBAC_META_FIELD_NUMBER: _ClassVar[int]
base: _common_pb2.MsgBase
RBAC_meta: RBACMeta
def __init__(self, base: _Optional[_Union[_common_pb2.MsgBase, _Mapping]] = ..., RBAC_meta: _Optional[_Union[RBACMeta, _Mapping]] = ...) -> None: ...

class GetLoadingProgressRequest(_message.Message):
__slots__ = ("base", "collection_name", "partition_names", "db_name")
BASE_FIELD_NUMBER: _ClassVar[int]
Expand Down
86 changes: 86 additions & 0 deletions pymilvus/grpc_gen/milvus_pb2_grpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,16 @@ def __init__(self, channel):
request_serializer=milvus__pb2.ReplicateMessageRequest.SerializeToString,
response_deserializer=milvus__pb2.ReplicateMessageResponse.FromString,
_registered_method=True)
self.BackupRBAC = channel.unary_unary(
'/milvus.proto.milvus.MilvusService/BackupRBAC',
request_serializer=milvus__pb2.BackupRBACMetaRequest.SerializeToString,
response_deserializer=milvus__pb2.BackupRBACMetaResponse.FromString,
_registered_method=True)
self.RestoreRBAC = channel.unary_unary(
'/milvus.proto.milvus.MilvusService/RestoreRBAC',
request_serializer=milvus__pb2.RestoreRBACMetaRequest.SerializeToString,
response_deserializer=common__pb2.Status.FromString,
_registered_method=True)


class MilvusServiceServicer(object):
Expand Down Expand Up @@ -999,6 +1009,18 @@ def ReplicateMessage(self, request, context):
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')

def BackupRBAC(self, request, context):
"""Missing associated documentation comment in .proto file."""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')

def RestoreRBAC(self, request, context):
"""Missing associated documentation comment in .proto file."""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')


def add_MilvusServiceServicer_to_server(servicer, server):
rpc_method_handlers = {
Expand Down Expand Up @@ -1432,6 +1454,16 @@ def add_MilvusServiceServicer_to_server(servicer, server):
request_deserializer=milvus__pb2.ReplicateMessageRequest.FromString,
response_serializer=milvus__pb2.ReplicateMessageResponse.SerializeToString,
),
'BackupRBAC': grpc.unary_unary_rpc_method_handler(
servicer.BackupRBAC,
request_deserializer=milvus__pb2.BackupRBACMetaRequest.FromString,
response_serializer=milvus__pb2.BackupRBACMetaResponse.SerializeToString,
),
'RestoreRBAC': grpc.unary_unary_rpc_method_handler(
servicer.RestoreRBAC,
request_deserializer=milvus__pb2.RestoreRBACMetaRequest.FromString,
response_serializer=common__pb2.Status.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'milvus.proto.milvus.MilvusService', rpc_method_handlers)
Expand Down Expand Up @@ -3765,6 +3797,60 @@ def ReplicateMessage(request,
metadata,
_registered_method=True)

@staticmethod
def BackupRBAC(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(
request,
target,
'/milvus.proto.milvus.MilvusService/BackupRBAC',
milvus__pb2.BackupRBACMetaRequest.SerializeToString,
milvus__pb2.BackupRBACMetaResponse.FromString,
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)

@staticmethod
def RestoreRBAC(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(
request,
target,
'/milvus.proto.milvus.MilvusService/RestoreRBAC',
milvus__pb2.RestoreRBACMetaRequest.SerializeToString,
common__pb2.Status.FromString,
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)


class ProxyServiceStub(object):
"""Missing associated documentation comment in .proto file."""
Expand Down
Loading

0 comments on commit 6ff4294

Please sign in to comment.