Files
rustfs/common/protos/src/node.proto
T
2024-11-16 20:43:34 +08:00

459 lines
10 KiB
Protocol Buffer

syntax = "proto3";
package node_service;
/* -------------------------------------------------------------------- */
message PingRequest {
uint64 version = 1;
bytes body = 2;
}
message PingResponse {
uint64 version = 1;
bytes body = 2;
}
message ListBucketRequest {
string options = 1;
}
message ListBucketResponse {
bool success = 1;
repeated string bucket_infos = 2;
optional string error_info = 3;
}
message MakeBucketRequest {
string name = 1;
string options = 2;
}
message MakeBucketResponse {
bool success = 1;
optional string error_info = 2;
}
message GetBucketInfoRequest {
string bucket = 1;
string options = 2;
}
message GetBucketInfoResponse {
bool success = 1;
string bucket_info = 2;
optional string error_info = 3;
}
message DeleteBucketRequest {
string bucket = 1;
}
message DeleteBucketResponse {
bool success = 1;
optional string error_info = 2;
}
message ReadAllRequest {
string disk = 1; // indicate which one in the disks
string volume = 2;
string path = 3;
}
message ReadAllResponse {
bool success = 1;
bytes data = 2;
optional string error_info = 3;
}
message WriteAllRequest {
string disk = 1; // indicate which one in the disks
string volume = 2;
string path = 3;
bytes data = 4;
}
message WriteAllResponse {
bool success = 1;
optional string error_info = 2;
}
message DeleteRequest {
string disk = 1; // indicate which one in the disks
string volume = 2;
string path = 3;
string options = 4;
}
message DeleteResponse {
bool success = 1;
optional string error_info = 2;
}
message VerifyFileRequest {
string disk = 1; // indicate which one in the disks
string volume = 2;
string path = 3;
string file_info = 4;
}
message VerifyFileResponse {
bool success = 1;
string check_parts_resp = 2;
optional string error_info = 3;
}
message CheckPartsRequest {
string disk = 1; // indicate which one in the disks
string volume = 2;
string path = 3;
string file_info = 4;
}
message CheckPartsResponse {
bool success = 1;
string check_parts_resp = 2;
optional string error_info = 3;
}
message RenamePartRequst {
string disk = 1;
string src_volume = 2;
string src_path = 3;
string dst_volume = 4;
string dst_path = 5;
bytes meta = 6;
}
message RenamePartResponse {
bool success = 1;
optional string error_info = 2;
}
message RenameFileRequst {
string disk = 1;
string src_volume = 2;
string src_path = 3;
string dst_volume = 4;
string dst_path = 5;
}
message RenameFileResponse {
bool success = 1;
optional string error_info = 2;
}
message WriteRequest {
string disk = 1; // indicate which one in the disks
string volume = 2;
string path = 3;
bool is_append = 4;
bytes data = 5;
}
message WriteResponse {
bool success = 1;
optional string error_info = 2;
}
// message AppendRequest {
// string disk = 1; // indicate which one in the disks
// string volume = 2;
// string path = 3;
// bytes data = 4;
// }
//
// message AppendResponse {
// bool success = 1;
// optional string error_info = 2;
// }
message ReadAtRequest {
string disk = 1; // indicate which one in the disks
string volume = 2;
string path = 3;
int64 offset = 4;
int64 length = 5;
}
message ReadAtResponse {
bool success = 1;
bytes data = 2;
int64 read_size = 3;
optional string error_info = 4;
}
message ListDirRequest {
string disk = 1; // indicate which one in the disks
string volume = 2;
}
message ListDirResponse {
bool success = 1;
repeated string volumes = 2;
optional string error_info = 3;
}
message WalkDirRequest {
string disk = 1; // indicate which one in the disks
string walk_dir_options = 2;
}
message WalkDirResponse {
bool success = 1;
repeated string meta_cache_entry = 2;
optional string error_info = 3;
}
message RenameDataRequest {
string disk = 1; // indicate which one in the disks
string src_volume = 2;
string src_path = 3;
string file_info = 4;
string dst_volume = 5;
string dst_path = 6;
}
message RenameDataResponse {
bool success = 1;
string rename_data_resp = 2;
optional string error_info = 3;
}
message MakeVolumesRequest {
string disk = 1; // indicate which one in the disks
repeated string volumes = 2;
}
message MakeVolumesResponse {
bool success = 1;
optional string error_info = 2;
}
message MakeVolumeRequest {
string disk = 1; // indicate which one in the disks
string volume = 2;
}
message MakeVolumeResponse {
bool success = 1;
optional string error_info = 2;
}
message ListVolumesRequest {
string disk = 1; // indicate which one in the disks
}
message ListVolumesResponse {
bool success = 1;
repeated string volume_infos = 2;
optional string error_info = 3;
}
message StatVolumeRequest {
string disk = 1; // indicate which one in the disks
string volume = 2;
}
message StatVolumeResponse {
bool success = 1;
string volume_info = 2;
optional string error_info = 3;
}
message DeletePathsRequest {
string disk = 1;
string volume = 2;
repeated string paths = 3;
}
message DeletePathsResponse {
bool success = 1;
optional string error_info = 2;
}
message UpdateMetadataRequest {
string disk = 1;
string volume = 2;
string path = 3;
string file_info = 4;
string opts = 5;
}
message UpdateMetadataResponse {
bool success = 1;
optional string error_info = 2;
}
message WriteMetadataRequest {
string disk = 1; // indicate which one in the disks
string volume = 2;
string path = 3;
string file_info = 4;
}
message WriteMetadataResponse {
bool success = 1;
optional string error_info = 2;
}
message ReadVersionRequest {
string disk = 1;
string volume = 2;
string path = 3;
string version_id = 4;
string opts = 5;
}
message ReadVersionResponse {
bool success = 1;
string file_info = 2;
optional string error_info = 3;
}
message ReadXLRequest {
string disk = 1;
string volume = 2;
string path = 3;
bool read_data = 4;
}
message ReadXLResponse {
bool success = 1;
string raw_file_info = 2;
optional string error_info = 3;
}
message DeleteVersionRequest {
string disk = 1;
string volume = 2;
string path = 3;
string file_info = 4;
bool force_del_marker = 5;
string opts = 6;
}
message DeleteVersionResponse {
bool success = 1;
string raw_file_info = 2;
optional string error_info = 3;
}
message DeleteVersionsRequest {
string disk = 1;
string volume = 2;
repeated string versions = 3;
string opts = 4;
}
message DeleteVersionsResponse {
bool success = 1;
repeated string errors = 2;
optional string error_info = 3;
}
message ReadMultipleRequest {
string disk = 1;
string read_multiple_req = 2;
}
message ReadMultipleResponse {
bool success = 1;
repeated string read_multiple_resps = 2;
optional string error_info = 3;
}
message DeleteVolumeRequest {
string disk = 1;
string volume = 2;
}
message DeleteVolumeResponse {
bool success = 1;
optional string error_info = 2;
}
message DiskInfoRequest {
string disk = 1;
string opts = 2;
}
message DiskInfoResponse {
bool success = 1;
string disk_info = 2;
optional string error_info = 3;
}
message NsScannerRequest {
string disk = 1;
string cache = 2;
uint64 scan_mode = 3;
}
message NsScannerResponse {
bool success = 1;
string update = 2;
string data_usage_cache = 3;
optional string error_info = 4;
}
// lock api have same argument type
message GenerallyLockRequest {
string args = 1;
}
message GenerallyLockResponse {
bool success = 1;
optional string error_info = 2;
}
/* -------------------------------------------------------------------- */
service NodeService {
/* -------------------------------meta service-------------------------- */
rpc Ping(PingRequest) returns (PingResponse) {};
rpc ListBucket(ListBucketRequest) returns (ListBucketResponse) {};
rpc MakeBucket(MakeBucketRequest) returns (MakeBucketResponse) {};
rpc GetBucketInfo(GetBucketInfoRequest) returns (GetBucketInfoResponse) {};
rpc DeleteBucket(DeleteBucketRequest) returns (DeleteBucketResponse) {};
/* -------------------------------disk service-------------------------- */
rpc ReadAll(ReadAllRequest) returns (ReadAllResponse) {};
rpc WriteAll(WriteAllRequest) returns (WriteAllResponse) {};
rpc Delete(DeleteRequest) returns (DeleteResponse) {};
rpc VerifyFile(VerifyFileRequest) returns (VerifyFileResponse) {};
rpc CheckParts(CheckPartsRequest) returns (CheckPartsResponse) {};
rpc RenamePart(RenamePartRequst) returns (RenamePartResponse) {};
rpc RenameFile(RenameFileRequst) returns (RenameFileResponse) {};
rpc Write(WriteRequest) returns (WriteResponse) {};
rpc WriteStream(stream WriteRequest) returns (stream WriteResponse) {};
// rpc Append(AppendRequest) returns (AppendResponse) {};
rpc ReadAt(stream ReadAtRequest) returns (stream ReadAtResponse) {};
rpc ListDir(ListDirRequest) returns (ListDirResponse) {};
rpc WalkDir(WalkDirRequest) returns (WalkDirResponse) {};
rpc RenameData(RenameDataRequest) returns (RenameDataResponse) {};
rpc MakeVolumes(MakeVolumesRequest) returns (MakeVolumesResponse) {};
rpc MakeVolume(MakeVolumeRequest) returns (MakeVolumeResponse) {};
rpc ListVolumes(ListVolumesRequest) returns (ListVolumesResponse) {};
rpc StatVolume(StatVolumeRequest) returns (StatVolumeResponse) {};
rpc DeletePaths(DeletePathsRequest) returns (DeletePathsResponse) {};
rpc UpdateMetadata(UpdateMetadataRequest) returns (UpdateMetadataResponse) {};
rpc WriteMetadata(WriteMetadataRequest) returns (WriteMetadataResponse) {};
rpc ReadVersion(ReadVersionRequest) returns (ReadVersionResponse) {};
rpc ReadXL(ReadXLRequest) returns (ReadXLResponse) {};
rpc DeleteVersion(DeleteVersionRequest) returns (DeleteVersionResponse) {};
rpc DeleteVersions(DeleteVersionsRequest) returns (DeleteVersionsResponse) {};
rpc ReadMultiple(ReadMultipleRequest) returns (ReadMultipleResponse) {};
rpc DeleteVolume(DeleteVolumeRequest) returns (DeleteVolumeResponse) {};
rpc DiskInfo(DiskInfoRequest) returns (DiskInfoResponse) {};
rpc NsScanner(stream NsScannerRequest) returns (stream NsScannerResponse) {};
/* -------------------------------lock service-------------------------- */
rpc Lock(GenerallyLockRequest) returns (GenerallyLockResponse) {};
rpc UnLock(GenerallyLockRequest) returns (GenerallyLockResponse) {};
rpc RLock(GenerallyLockRequest) returns (GenerallyLockResponse) {};
rpc RUnLock(GenerallyLockRequest) returns (GenerallyLockResponse) {};
rpc ForceUnLock(GenerallyLockRequest) returns (GenerallyLockResponse) {};
rpc Refresh(GenerallyLockRequest) returns (GenerallyLockResponse) {};
}