diff --git a/Makefile b/Makefile index ef5d2f84d..dc1cdf24d 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ test: go test ./...; lint: - golangci-lint run; + golangci-lint run --timeout 2m0s; integration-tests: go test ./... -args integration; \ No newline at end of file diff --git a/code/go/0chain.net/blobbercore/blobbergrpc/blobber.pb.go b/code/go/0chain.net/blobbercore/blobbergrpc/blobber.pb.go index 698e06aee..753227348 100644 --- a/code/go/0chain.net/blobbercore/blobbergrpc/blobber.pb.go +++ b/code/go/0chain.net/blobbercore/blobbergrpc/blobber.pb.go @@ -2119,6 +2119,174 @@ func (x *CopyObjectResponse) GetUploadOffset() int64 { return 0 } +type RenameObjectRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Allocation string `protobuf:"bytes,1,opt,name=allocation,proto3" json:"allocation,omitempty"` + Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"` + PathHash string `protobuf:"bytes,3,opt,name=path_hash,json=pathHash,proto3" json:"path_hash,omitempty"` + ConnectionId string `protobuf:"bytes,4,opt,name=connection_id,json=connectionId,proto3" json:"connection_id,omitempty"` + NewName string `protobuf:"bytes,5,opt,name=new_name,json=newName,proto3" json:"new_name,omitempty"` +} + +func (x *RenameObjectRequest) Reset() { + *x = RenameObjectRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_blobber_proto_msgTypes[32] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RenameObjectRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RenameObjectRequest) ProtoMessage() {} + +func (x *RenameObjectRequest) ProtoReflect() protoreflect.Message { + mi := &file_blobber_proto_msgTypes[32] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RenameObjectRequest.ProtoReflect.Descriptor instead. +func (*RenameObjectRequest) Descriptor() ([]byte, []int) { + return file_blobber_proto_rawDescGZIP(), []int{32} +} + +func (x *RenameObjectRequest) GetAllocation() string { + if x != nil { + return x.Allocation + } + return "" +} + +func (x *RenameObjectRequest) GetPath() string { + if x != nil { + return x.Path + } + return "" +} + +func (x *RenameObjectRequest) GetPathHash() string { + if x != nil { + return x.PathHash + } + return "" +} + +func (x *RenameObjectRequest) GetConnectionId() string { + if x != nil { + return x.ConnectionId + } + return "" +} + +func (x *RenameObjectRequest) GetNewName() string { + if x != nil { + return x.NewName + } + return "" +} + +type RenameObjectResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Filename string `protobuf:"bytes,1,opt,name=filename,proto3" json:"filename,omitempty"` + Size int64 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"` + ContentHash string `protobuf:"bytes,3,opt,name=content_hash,json=contentHash,proto3" json:"content_hash,omitempty"` + MerkleRoot string `protobuf:"bytes,4,opt,name=merkle_root,json=merkleRoot,proto3" json:"merkle_root,omitempty"` + //UploadLength indicates the size of the entire upload in bytes. The value MUST be a non-negative integer. + UploadLength int64 `protobuf:"varint,5,opt,name=upload_length,json=uploadLength,proto3" json:"upload_length,omitempty"` + //Upload-Offset indicates a byte offset within a resource. The value MUST be a non-negative integer. + UploadOffset int64 `protobuf:"varint,6,opt,name=upload_offset,json=uploadOffset,proto3" json:"upload_offset,omitempty"` +} + +func (x *RenameObjectResponse) Reset() { + *x = RenameObjectResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_blobber_proto_msgTypes[33] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RenameObjectResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RenameObjectResponse) ProtoMessage() {} + +func (x *RenameObjectResponse) ProtoReflect() protoreflect.Message { + mi := &file_blobber_proto_msgTypes[33] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RenameObjectResponse.ProtoReflect.Descriptor instead. +func (*RenameObjectResponse) Descriptor() ([]byte, []int) { + return file_blobber_proto_rawDescGZIP(), []int{33} +} + +func (x *RenameObjectResponse) GetFilename() string { + if x != nil { + return x.Filename + } + return "" +} + +func (x *RenameObjectResponse) GetSize() int64 { + if x != nil { + return x.Size + } + return 0 +} + +func (x *RenameObjectResponse) GetContentHash() string { + if x != nil { + return x.ContentHash + } + return "" +} + +func (x *RenameObjectResponse) GetMerkleRoot() string { + if x != nil { + return x.MerkleRoot + } + return "" +} + +func (x *RenameObjectResponse) GetUploadLength() int64 { + if x != nil { + return x.UploadLength + } + return 0 +} + +func (x *RenameObjectResponse) GetUploadOffset() int64 { + if x != nil { + return x.UploadOffset + } + return 0 +} + type Allocation struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -2146,7 +2314,7 @@ type Allocation struct { func (x *Allocation) Reset() { *x = Allocation{} if protoimpl.UnsafeEnabled { - mi := &file_blobber_proto_msgTypes[32] + mi := &file_blobber_proto_msgTypes[34] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2159,7 +2327,7 @@ func (x *Allocation) String() string { func (*Allocation) ProtoMessage() {} func (x *Allocation) ProtoReflect() protoreflect.Message { - mi := &file_blobber_proto_msgTypes[32] + mi := &file_blobber_proto_msgTypes[34] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2172,7 +2340,7 @@ func (x *Allocation) ProtoReflect() protoreflect.Message { // Deprecated: Use Allocation.ProtoReflect.Descriptor instead. func (*Allocation) Descriptor() ([]byte, []int) { - return file_blobber_proto_rawDescGZIP(), []int{32} + return file_blobber_proto_rawDescGZIP(), []int{34} } func (x *Allocation) GetID() string { @@ -2309,7 +2477,7 @@ type Term struct { func (x *Term) Reset() { *x = Term{} if protoimpl.UnsafeEnabled { - mi := &file_blobber_proto_msgTypes[33] + mi := &file_blobber_proto_msgTypes[35] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2322,7 +2490,7 @@ func (x *Term) String() string { func (*Term) ProtoMessage() {} func (x *Term) ProtoReflect() protoreflect.Message { - mi := &file_blobber_proto_msgTypes[33] + mi := &file_blobber_proto_msgTypes[35] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2335,7 +2503,7 @@ func (x *Term) ProtoReflect() protoreflect.Message { // Deprecated: Use Term.ProtoReflect.Descriptor instead. func (*Term) Descriptor() ([]byte, []int) { - return file_blobber_proto_rawDescGZIP(), []int{33} + return file_blobber_proto_rawDescGZIP(), []int{35} } func (x *Term) GetID() int64 { @@ -2386,7 +2554,7 @@ type FileRef struct { func (x *FileRef) Reset() { *x = FileRef{} if protoimpl.UnsafeEnabled { - mi := &file_blobber_proto_msgTypes[34] + mi := &file_blobber_proto_msgTypes[36] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2399,7 +2567,7 @@ func (x *FileRef) String() string { func (*FileRef) ProtoMessage() {} func (x *FileRef) ProtoReflect() protoreflect.Message { - mi := &file_blobber_proto_msgTypes[34] + mi := &file_blobber_proto_msgTypes[36] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2412,7 +2580,7 @@ func (x *FileRef) ProtoReflect() protoreflect.Message { // Deprecated: Use FileRef.ProtoReflect.Descriptor instead. func (*FileRef) Descriptor() ([]byte, []int) { - return file_blobber_proto_rawDescGZIP(), []int{34} + return file_blobber_proto_rawDescGZIP(), []int{36} } func (x *FileRef) GetType() string { @@ -2470,7 +2638,7 @@ type FileMetaData struct { func (x *FileMetaData) Reset() { *x = FileMetaData{} if protoimpl.UnsafeEnabled { - mi := &file_blobber_proto_msgTypes[35] + mi := &file_blobber_proto_msgTypes[37] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2483,7 +2651,7 @@ func (x *FileMetaData) String() string { func (*FileMetaData) ProtoMessage() {} func (x *FileMetaData) ProtoReflect() protoreflect.Message { - mi := &file_blobber_proto_msgTypes[35] + mi := &file_blobber_proto_msgTypes[37] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2496,7 +2664,7 @@ func (x *FileMetaData) ProtoReflect() protoreflect.Message { // Deprecated: Use FileMetaData.ProtoReflect.Descriptor instead. func (*FileMetaData) Descriptor() ([]byte, []int) { - return file_blobber_proto_rawDescGZIP(), []int{35} + return file_blobber_proto_rawDescGZIP(), []int{37} } func (x *FileMetaData) GetType() string { @@ -2687,7 +2855,7 @@ type DirMetaData struct { func (x *DirMetaData) Reset() { *x = DirMetaData{} if protoimpl.UnsafeEnabled { - mi := &file_blobber_proto_msgTypes[36] + mi := &file_blobber_proto_msgTypes[38] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2700,7 +2868,7 @@ func (x *DirMetaData) String() string { func (*DirMetaData) ProtoMessage() {} func (x *DirMetaData) ProtoReflect() protoreflect.Message { - mi := &file_blobber_proto_msgTypes[36] + mi := &file_blobber_proto_msgTypes[38] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2713,7 +2881,7 @@ func (x *DirMetaData) ProtoReflect() protoreflect.Message { // Deprecated: Use DirMetaData.ProtoReflect.Descriptor instead. func (*DirMetaData) Descriptor() ([]byte, []int) { - return file_blobber_proto_rawDescGZIP(), []int{36} + return file_blobber_proto_rawDescGZIP(), []int{38} } func (x *DirMetaData) GetType() string { @@ -3078,6 +3246,30 @@ var file_blobber_proto_rawDesc = []byte{ 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12, 0x23, 0x0a, 0x0d, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x75, 0x70, 0x6c, + 0x6f, 0x61, 0x64, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x22, 0xa6, 0x01, 0x0a, 0x13, 0x52, 0x65, + 0x6e, 0x61, 0x6d, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x74, 0x68, 0x5f, 0x68, 0x61, + 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x74, 0x68, 0x48, 0x61, + 0x73, 0x68, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x63, 0x6f, 0x6e, 0x6e, 0x65, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x6e, 0x65, 0x77, 0x5f, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x65, 0x77, 0x4e, 0x61, + 0x6d, 0x65, 0x22, 0xd4, 0x01, 0x0a, 0x14, 0x52, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x4f, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x66, + 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, + 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x63, + 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x48, 0x61, 0x73, 0x68, 0x12, 0x1f, + 0x0a, 0x0b, 0x6d, 0x65, 0x72, 0x6b, 0x6c, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6d, 0x65, 0x72, 0x6b, 0x6c, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, + 0x23, 0x0a, 0x0d, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x4c, 0x65, + 0x6e, 0x67, 0x74, 0x68, 0x12, 0x23, 0x0a, 0x0d, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x6f, + 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x22, 0xb6, 0x04, 0x0a, 0x0a, 0x41, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x49, 0x44, 0x12, 0x0e, 0x0a, 0x02, 0x54, 0x78, 0x18, 0x02, @@ -3202,7 +3394,7 @@ var file_blobber_proto_rawDesc = []byte{ 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, - 0x32, 0xdd, 0x0e, 0x0a, 0x07, 0x42, 0x6c, 0x6f, 0x62, 0x62, 0x65, 0x72, 0x12, 0x7c, 0x0a, 0x0d, + 0x32, 0xea, 0x0f, 0x0a, 0x07, 0x42, 0x6c, 0x6f, 0x62, 0x62, 0x65, 0x72, 0x12, 0x7c, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x28, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x62, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, @@ -3264,66 +3456,75 @@ var file_blobber_proto_rawDesc = []byte{ 0x62, 0x6a, 0x65, 0x63, 0x74, 0x54, 0x72, 0x65, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x28, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x12, 0x20, 0x2f, 0x76, 0x32, 0x2f, 0x66, 0x69, 0x6c, 0x65, 0x2f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x74, 0x72, 0x65, 0x65, 0x2f, 0x7b, - 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x7d, 0x12, 0x7e, 0x0a, 0x06, 0x43, - 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x12, 0x21, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x62, 0x65, 0x72, 0x2e, + 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x7d, 0x12, 0x8a, 0x01, 0x0a, 0x0c, + 0x52, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x27, 0x2e, 0x62, + 0x6c, 0x6f, 0x62, 0x62, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, + 0x31, 0x2e, 0x52, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x62, 0x65, 0x72, 0x2e, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x6e, 0x61, 0x6d, + 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x27, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x21, 0x22, 0x1c, 0x2f, 0x76, 0x32, 0x2f, 0x66, 0x69, 0x6c, + 0x65, 0x2f, 0x72, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x2f, 0x7b, 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x7d, 0x3a, 0x01, 0x2a, 0x12, 0x7e, 0x0a, 0x06, 0x43, 0x6f, 0x6d, 0x6d, + 0x69, 0x74, 0x12, 0x21, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x62, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x62, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, - 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x62, - 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, - 0x6d, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2d, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x27, 0x22, 0x22, 0x2f, 0x76, 0x32, 0x2f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x2f, 0x7b, 0x61, 0x6c, 0x6c, - 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x7d, 0x3a, 0x01, 0x2a, 0x12, 0x94, 0x01, 0x0a, 0x0d, - 0x43, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x48, 0x61, 0x73, 0x68, 0x12, 0x28, 0x2e, - 0x62, 0x6c, 0x6f, 0x62, 0x62, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, - 0x76, 0x31, 0x2e, 0x43, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x48, 0x61, 0x73, 0x68, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x62, 0x65, - 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x6c, - 0x63, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x48, 0x61, 0x73, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x28, 0x22, 0x23, 0x2f, 0x76, 0x32, 0x2f, - 0x66, 0x69, 0x6c, 0x65, 0x2f, 0x63, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x68, 0x61, - 0x73, 0x68, 0x2f, 0x7b, 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x7d, 0x3a, - 0x01, 0x2a, 0x12, 0x94, 0x01, 0x0a, 0x0d, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x4d, 0x65, 0x74, - 0x61, 0x54, 0x78, 0x6e, 0x12, 0x28, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x62, 0x65, 0x72, 0x2e, 0x73, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, - 0x4d, 0x65, 0x74, 0x61, 0x54, 0x78, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, - 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x62, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x54, 0x78, - 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, - 0x28, 0x22, 0x23, 0x2f, 0x76, 0x32, 0x2f, 0x66, 0x69, 0x6c, 0x65, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, - 0x69, 0x74, 0x6d, 0x65, 0x74, 0x61, 0x74, 0x78, 0x6e, 0x2f, 0x7b, 0x61, 0x6c, 0x6c, 0x6f, 0x63, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x7d, 0x3a, 0x01, 0x2a, 0x12, 0xac, 0x01, 0x0a, 0x16, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, - 0x75, 0x74, 0x65, 0x73, 0x12, 0x31, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x62, 0x65, 0x72, 0x2e, 0x73, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2d, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x27, 0x22, 0x22, 0x2f, 0x76, 0x32, 0x2f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x2f, 0x7b, 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x7d, 0x3a, 0x01, 0x2a, 0x12, 0x94, 0x01, 0x0a, 0x0d, 0x43, 0x61, 0x6c, + 0x63, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x48, 0x61, 0x73, 0x68, 0x12, 0x28, 0x2e, 0x62, 0x6c, 0x6f, + 0x62, 0x62, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x43, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x48, 0x61, 0x73, 0x68, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x62, 0x65, 0x72, 0x2e, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x6c, 0x63, 0x75, 0x6c, + 0x61, 0x74, 0x65, 0x48, 0x61, 0x73, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x28, 0x22, 0x23, 0x2f, 0x76, 0x32, 0x2f, 0x66, 0x69, 0x6c, + 0x65, 0x2f, 0x63, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x68, 0x61, 0x73, 0x68, 0x2f, + 0x7b, 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x7d, 0x3a, 0x01, 0x2a, 0x12, + 0x94, 0x01, 0x0a, 0x0d, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x54, 0x78, + 0x6e, 0x12, 0x28, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x62, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x4d, 0x65, 0x74, + 0x61, 0x54, 0x78, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x62, 0x6c, + 0x6f, 0x62, 0x62, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, + 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x54, 0x78, 0x6e, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x28, 0x22, 0x23, + 0x2f, 0x76, 0x32, 0x2f, 0x66, 0x69, 0x6c, 0x65, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, + 0x65, 0x74, 0x61, 0x74, 0x78, 0x6e, 0x2f, 0x7b, 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x7d, 0x3a, 0x01, 0x2a, 0x12, 0xac, 0x01, 0x0a, 0x16, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, + 0x73, 0x12, 0x31, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x62, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4f, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x32, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x62, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x32, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x62, 0x65, - 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, - 0x74, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2b, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x25, 0x22, 0x20, 0x2f, 0x76, 0x32, 0x2f, 0x66, 0x69, 0x6c, 0x65, 0x2f, 0x61, 0x74, - 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x2f, 0x7b, 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x7d, 0x3a, 0x01, 0x2a, 0x12, 0x82, 0x01, 0x0a, 0x0a, 0x43, 0x6f, 0x70, - 0x79, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x25, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x62, 0x65, - 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x70, - 0x79, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, - 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x62, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x70, 0x79, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x25, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x22, 0x1a, - 0x2f, 0x76, 0x32, 0x2f, 0x66, 0x69, 0x6c, 0x65, 0x2f, 0x63, 0x6f, 0x70, 0x79, 0x2f, 0x7b, 0x61, - 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x7d, 0x3a, 0x01, 0x2a, 0x12, 0x90, 0x01, - 0x0a, 0x0c, 0x43, 0x6f, 0x6c, 0x6c, 0x61, 0x62, 0x6f, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x27, - 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x62, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6c, 0x6c, 0x61, 0x62, 0x6f, 0x72, 0x61, 0x74, 0x6f, 0x72, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x62, 0x65, - 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6c, - 0x6c, 0x61, 0x62, 0x6f, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x2d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x27, 0x22, 0x22, 0x2f, 0x76, 0x32, 0x2f, 0x66, - 0x69, 0x6c, 0x65, 0x2f, 0x63, 0x6f, 0x6c, 0x6c, 0x61, 0x62, 0x6f, 0x72, 0x61, 0x74, 0x6f, 0x72, - 0x2f, 0x7b, 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x7d, 0x3a, 0x01, 0x2a, - 0x42, 0x2c, 0x5a, 0x2a, 0x63, 0x6f, 0x64, 0x65, 0x2f, 0x67, 0x6f, 0x2f, 0x30, 0x63, 0x68, 0x61, - 0x69, 0x6e, 0x2e, 0x6e, 0x65, 0x74, 0x2f, 0x62, 0x6c, 0x6f, 0x62, 0x62, 0x65, 0x72, 0x63, 0x6f, - 0x72, 0x65, 0x2f, 0x62, 0x6c, 0x6f, 0x62, 0x62, 0x65, 0x72, 0x67, 0x72, 0x70, 0x63, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x25, + 0x22, 0x20, 0x2f, 0x76, 0x32, 0x2f, 0x66, 0x69, 0x6c, 0x65, 0x2f, 0x61, 0x74, 0x74, 0x72, 0x69, + 0x62, 0x75, 0x74, 0x65, 0x73, 0x2f, 0x7b, 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x7d, 0x3a, 0x01, 0x2a, 0x12, 0x82, 0x01, 0x0a, 0x0a, 0x43, 0x6f, 0x70, 0x79, 0x4f, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x12, 0x25, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x62, 0x65, 0x72, 0x2e, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x70, 0x79, 0x4f, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x62, 0x6c, + 0x6f, 0x62, 0x62, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, + 0x2e, 0x43, 0x6f, 0x70, 0x79, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x25, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x22, 0x1a, 0x2f, 0x76, 0x32, + 0x2f, 0x66, 0x69, 0x6c, 0x65, 0x2f, 0x63, 0x6f, 0x70, 0x79, 0x2f, 0x7b, 0x61, 0x6c, 0x6c, 0x6f, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x7d, 0x3a, 0x01, 0x2a, 0x12, 0x90, 0x01, 0x0a, 0x0c, 0x43, + 0x6f, 0x6c, 0x6c, 0x61, 0x62, 0x6f, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x27, 0x2e, 0x62, 0x6c, + 0x6f, 0x62, 0x62, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, + 0x2e, 0x43, 0x6f, 0x6c, 0x6c, 0x61, 0x62, 0x6f, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x62, 0x65, 0x72, 0x2e, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6c, 0x6c, 0x61, 0x62, + 0x6f, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2d, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x27, 0x22, 0x22, 0x2f, 0x76, 0x32, 0x2f, 0x66, 0x69, 0x6c, 0x65, + 0x2f, 0x63, 0x6f, 0x6c, 0x6c, 0x61, 0x62, 0x6f, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x7b, 0x61, + 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x7d, 0x3a, 0x01, 0x2a, 0x42, 0x2c, 0x5a, + 0x2a, 0x63, 0x6f, 0x64, 0x65, 0x2f, 0x67, 0x6f, 0x2f, 0x30, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, + 0x6e, 0x65, 0x74, 0x2f, 0x62, 0x6c, 0x6f, 0x62, 0x62, 0x65, 0x72, 0x63, 0x6f, 0x72, 0x65, 0x2f, + 0x62, 0x6c, 0x6f, 0x62, 0x62, 0x65, 0x72, 0x67, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, } var ( @@ -3338,7 +3539,7 @@ func file_blobber_proto_rawDescGZIP() []byte { return file_blobber_proto_rawDescData } -var file_blobber_proto_msgTypes = make([]protoimpl.MessageInfo, 37) +var file_blobber_proto_msgTypes = make([]protoimpl.MessageInfo, 39) var file_blobber_proto_goTypes = []interface{}{ (*CollaboratorRequest)(nil), // 0: blobber.service.v1.CollaboratorRequest (*CollaboratorResponse)(nil), // 1: blobber.service.v1.CollaboratorResponse @@ -3372,11 +3573,13 @@ var file_blobber_proto_goTypes = []interface{}{ (*UpdateObjectAttributesResponse)(nil), // 29: blobber.service.v1.UpdateObjectAttributesResponse (*CopyObjectRequest)(nil), // 30: blobber.service.v1.CopyObjectRequest (*CopyObjectResponse)(nil), // 31: blobber.service.v1.CopyObjectResponse - (*Allocation)(nil), // 32: blobber.service.v1.Allocation - (*Term)(nil), // 33: blobber.service.v1.Term - (*FileRef)(nil), // 34: blobber.service.v1.FileRef - (*FileMetaData)(nil), // 35: blobber.service.v1.FileMetaData - (*DirMetaData)(nil), // 36: blobber.service.v1.DirMetaData + (*RenameObjectRequest)(nil), // 32: blobber.service.v1.RenameObjectRequest + (*RenameObjectResponse)(nil), // 33: blobber.service.v1.RenameObjectResponse + (*Allocation)(nil), // 34: blobber.service.v1.Allocation + (*Term)(nil), // 35: blobber.service.v1.Term + (*FileRef)(nil), // 36: blobber.service.v1.FileRef + (*FileMetaData)(nil), // 37: blobber.service.v1.FileMetaData + (*DirMetaData)(nil), // 38: blobber.service.v1.DirMetaData } var file_blobber_proto_depIdxs = []int32{ 25, // 0: blobber.service.v1.CollaboratorResponse.Collaborators:type_name -> blobber.service.v1.Collaborator @@ -3385,23 +3588,23 @@ var file_blobber_proto_depIdxs = []int32{ 16, // 3: blobber.service.v1.GetObjectTreeResponse.LatestWM:type_name -> blobber.service.v1.WriteMarker 12, // 4: blobber.service.v1.GetReferencePathResponse.ReferencePath:type_name -> blobber.service.v1.ReferencePath 16, // 5: blobber.service.v1.GetReferencePathResponse.LatestWM:type_name -> blobber.service.v1.WriteMarker - 34, // 6: blobber.service.v1.ReferencePath.MetaData:type_name -> blobber.service.v1.FileRef + 36, // 6: blobber.service.v1.ReferencePath.MetaData:type_name -> blobber.service.v1.FileRef 12, // 7: blobber.service.v1.ReferencePath.List:type_name -> blobber.service.v1.ReferencePath 15, // 8: blobber.service.v1.GetObjectPathResponse.ObjectPath:type_name -> blobber.service.v1.ObjectPath 16, // 9: blobber.service.v1.GetObjectPathResponse.LatestWriteMarker:type_name -> blobber.service.v1.WriteMarker - 34, // 10: blobber.service.v1.ObjectPath.Meta:type_name -> blobber.service.v1.FileRef - 34, // 11: blobber.service.v1.ObjectPath.Path:type_name -> blobber.service.v1.FileRef - 34, // 12: blobber.service.v1.ObjectPath.PathList:type_name -> blobber.service.v1.FileRef - 34, // 13: blobber.service.v1.ListEntitiesResponse.MetaData:type_name -> blobber.service.v1.FileRef - 34, // 14: blobber.service.v1.ListEntitiesResponse.Entities:type_name -> blobber.service.v1.FileRef - 34, // 15: blobber.service.v1.GetFileStatsResponse.MetaData:type_name -> blobber.service.v1.FileRef + 36, // 10: blobber.service.v1.ObjectPath.Meta:type_name -> blobber.service.v1.FileRef + 36, // 11: blobber.service.v1.ObjectPath.Path:type_name -> blobber.service.v1.FileRef + 36, // 12: blobber.service.v1.ObjectPath.PathList:type_name -> blobber.service.v1.FileRef + 36, // 13: blobber.service.v1.ListEntitiesResponse.MetaData:type_name -> blobber.service.v1.FileRef + 36, // 14: blobber.service.v1.ListEntitiesResponse.Entities:type_name -> blobber.service.v1.FileRef + 36, // 15: blobber.service.v1.GetFileStatsResponse.MetaData:type_name -> blobber.service.v1.FileRef 21, // 16: blobber.service.v1.GetFileStatsResponse.Stats:type_name -> blobber.service.v1.FileStats - 34, // 17: blobber.service.v1.GetFileMetaDataResponse.MetaData:type_name -> blobber.service.v1.FileRef + 36, // 17: blobber.service.v1.GetFileMetaDataResponse.MetaData:type_name -> blobber.service.v1.FileRef 25, // 18: blobber.service.v1.GetFileMetaDataResponse.Collaborators:type_name -> blobber.service.v1.Collaborator - 32, // 19: blobber.service.v1.GetAllocationResponse.allocation:type_name -> blobber.service.v1.Allocation - 33, // 20: blobber.service.v1.Allocation.Terms:type_name -> blobber.service.v1.Term - 35, // 21: blobber.service.v1.FileRef.FileMetaData:type_name -> blobber.service.v1.FileMetaData - 36, // 22: blobber.service.v1.FileRef.DirMetaData:type_name -> blobber.service.v1.DirMetaData + 34, // 19: blobber.service.v1.GetAllocationResponse.allocation:type_name -> blobber.service.v1.Allocation + 35, // 20: blobber.service.v1.Allocation.Terms:type_name -> blobber.service.v1.Term + 37, // 21: blobber.service.v1.FileRef.FileMetaData:type_name -> blobber.service.v1.FileMetaData + 38, // 22: blobber.service.v1.FileRef.DirMetaData:type_name -> blobber.service.v1.DirMetaData 24, // 23: blobber.service.v1.FileMetaData.CommitMetaTxns:type_name -> blobber.service.v1.CommitMetaTxn 26, // 24: blobber.service.v1.Blobber.GetAllocation:input_type -> blobber.service.v1.GetAllocationRequest 22, // 25: blobber.service.v1.Blobber.GetFileMetaData:input_type -> blobber.service.v1.GetFileMetaDataRequest @@ -3410,27 +3613,29 @@ var file_blobber_proto_depIdxs = []int32{ 13, // 28: blobber.service.v1.Blobber.GetObjectPath:input_type -> blobber.service.v1.GetObjectPathRequest 10, // 29: blobber.service.v1.Blobber.GetReferencePath:input_type -> blobber.service.v1.GetReferencePathRequest 8, // 30: blobber.service.v1.Blobber.GetObjectTree:input_type -> blobber.service.v1.GetObjectTreeRequest - 4, // 31: blobber.service.v1.Blobber.Commit:input_type -> blobber.service.v1.CommitRequest - 2, // 32: blobber.service.v1.Blobber.CalculateHash:input_type -> blobber.service.v1.CalculateHashRequest - 6, // 33: blobber.service.v1.Blobber.CommitMetaTxn:input_type -> blobber.service.v1.CommitMetaTxnRequest - 28, // 34: blobber.service.v1.Blobber.UpdateObjectAttributes:input_type -> blobber.service.v1.UpdateObjectAttributesRequest - 30, // 35: blobber.service.v1.Blobber.CopyObject:input_type -> blobber.service.v1.CopyObjectRequest - 0, // 36: blobber.service.v1.Blobber.Collaborator:input_type -> blobber.service.v1.CollaboratorRequest - 27, // 37: blobber.service.v1.Blobber.GetAllocation:output_type -> blobber.service.v1.GetAllocationResponse - 23, // 38: blobber.service.v1.Blobber.GetFileMetaData:output_type -> blobber.service.v1.GetFileMetaDataResponse - 20, // 39: blobber.service.v1.Blobber.GetFileStats:output_type -> blobber.service.v1.GetFileStatsResponse - 18, // 40: blobber.service.v1.Blobber.ListEntities:output_type -> blobber.service.v1.ListEntitiesResponse - 14, // 41: blobber.service.v1.Blobber.GetObjectPath:output_type -> blobber.service.v1.GetObjectPathResponse - 11, // 42: blobber.service.v1.Blobber.GetReferencePath:output_type -> blobber.service.v1.GetReferencePathResponse - 9, // 43: blobber.service.v1.Blobber.GetObjectTree:output_type -> blobber.service.v1.GetObjectTreeResponse - 5, // 44: blobber.service.v1.Blobber.Commit:output_type -> blobber.service.v1.CommitResponse - 3, // 45: blobber.service.v1.Blobber.CalculateHash:output_type -> blobber.service.v1.CalculateHashResponse - 7, // 46: blobber.service.v1.Blobber.CommitMetaTxn:output_type -> blobber.service.v1.CommitMetaTxnResponse - 29, // 47: blobber.service.v1.Blobber.UpdateObjectAttributes:output_type -> blobber.service.v1.UpdateObjectAttributesResponse - 31, // 48: blobber.service.v1.Blobber.CopyObject:output_type -> blobber.service.v1.CopyObjectResponse - 1, // 49: blobber.service.v1.Blobber.Collaborator:output_type -> blobber.service.v1.CollaboratorResponse - 37, // [37:50] is the sub-list for method output_type - 24, // [24:37] is the sub-list for method input_type + 32, // 31: blobber.service.v1.Blobber.RenameObject:input_type -> blobber.service.v1.RenameObjectRequest + 4, // 32: blobber.service.v1.Blobber.Commit:input_type -> blobber.service.v1.CommitRequest + 2, // 33: blobber.service.v1.Blobber.CalculateHash:input_type -> blobber.service.v1.CalculateHashRequest + 6, // 34: blobber.service.v1.Blobber.CommitMetaTxn:input_type -> blobber.service.v1.CommitMetaTxnRequest + 28, // 35: blobber.service.v1.Blobber.UpdateObjectAttributes:input_type -> blobber.service.v1.UpdateObjectAttributesRequest + 30, // 36: blobber.service.v1.Blobber.CopyObject:input_type -> blobber.service.v1.CopyObjectRequest + 0, // 37: blobber.service.v1.Blobber.Collaborator:input_type -> blobber.service.v1.CollaboratorRequest + 27, // 38: blobber.service.v1.Blobber.GetAllocation:output_type -> blobber.service.v1.GetAllocationResponse + 23, // 39: blobber.service.v1.Blobber.GetFileMetaData:output_type -> blobber.service.v1.GetFileMetaDataResponse + 20, // 40: blobber.service.v1.Blobber.GetFileStats:output_type -> blobber.service.v1.GetFileStatsResponse + 18, // 41: blobber.service.v1.Blobber.ListEntities:output_type -> blobber.service.v1.ListEntitiesResponse + 14, // 42: blobber.service.v1.Blobber.GetObjectPath:output_type -> blobber.service.v1.GetObjectPathResponse + 11, // 43: blobber.service.v1.Blobber.GetReferencePath:output_type -> blobber.service.v1.GetReferencePathResponse + 9, // 44: blobber.service.v1.Blobber.GetObjectTree:output_type -> blobber.service.v1.GetObjectTreeResponse + 33, // 45: blobber.service.v1.Blobber.RenameObject:output_type -> blobber.service.v1.RenameObjectResponse + 5, // 46: blobber.service.v1.Blobber.Commit:output_type -> blobber.service.v1.CommitResponse + 3, // 47: blobber.service.v1.Blobber.CalculateHash:output_type -> blobber.service.v1.CalculateHashResponse + 7, // 48: blobber.service.v1.Blobber.CommitMetaTxn:output_type -> blobber.service.v1.CommitMetaTxnResponse + 29, // 49: blobber.service.v1.Blobber.UpdateObjectAttributes:output_type -> blobber.service.v1.UpdateObjectAttributesResponse + 31, // 50: blobber.service.v1.Blobber.CopyObject:output_type -> blobber.service.v1.CopyObjectResponse + 1, // 51: blobber.service.v1.Blobber.Collaborator:output_type -> blobber.service.v1.CollaboratorResponse + 38, // [38:52] is the sub-list for method output_type + 24, // [24:38] is the sub-list for method input_type 24, // [24:24] is the sub-list for extension type_name 24, // [24:24] is the sub-list for extension extendee 0, // [0:24] is the sub-list for field type_name @@ -3827,7 +4032,7 @@ func file_blobber_proto_init() { } } file_blobber_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Allocation); i { + switch v := v.(*RenameObjectRequest); i { case 0: return &v.state case 1: @@ -3839,7 +4044,7 @@ func file_blobber_proto_init() { } } file_blobber_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Term); i { + switch v := v.(*RenameObjectResponse); i { case 0: return &v.state case 1: @@ -3851,7 +4056,7 @@ func file_blobber_proto_init() { } } file_blobber_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FileRef); i { + switch v := v.(*Allocation); i { case 0: return &v.state case 1: @@ -3863,7 +4068,7 @@ func file_blobber_proto_init() { } } file_blobber_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FileMetaData); i { + switch v := v.(*Term); i { case 0: return &v.state case 1: @@ -3875,6 +4080,30 @@ func file_blobber_proto_init() { } } file_blobber_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FileRef); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_blobber_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FileMetaData); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_blobber_proto_msgTypes[38].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DirMetaData); i { case 0: return &v.state @@ -3893,7 +4122,7 @@ func file_blobber_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_blobber_proto_rawDesc, NumEnums: 0, - NumMessages: 37, + NumMessages: 39, NumExtensions: 0, NumServices: 1, }, diff --git a/code/go/0chain.net/blobbercore/blobbergrpc/blobber.pb.gw.go b/code/go/0chain.net/blobbercore/blobbergrpc/blobber.pb.gw.go index 7e9699e7e..c5107a240 100644 --- a/code/go/0chain.net/blobbercore/blobbergrpc/blobber.pb.gw.go +++ b/code/go/0chain.net/blobbercore/blobbergrpc/blobber.pb.gw.go @@ -487,6 +487,74 @@ func local_request_Blobber_GetObjectTree_0(ctx context.Context, marshaler runtim } +func request_Blobber_RenameObject_0(ctx context.Context, marshaler runtime.Marshaler, client BlobberClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq RenameObjectRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["allocation"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "allocation") + } + + protoReq.Allocation, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "allocation", err) + } + + msg, err := client.RenameObject(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Blobber_RenameObject_0(ctx context.Context, marshaler runtime.Marshaler, server BlobberServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq RenameObjectRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["allocation"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "allocation") + } + + protoReq.Allocation, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "allocation", err) + } + + msg, err := server.RenameObject(ctx, &protoReq) + return msg, metadata, err + +} + func request_Blobber_Commit_0(ctx context.Context, marshaler runtime.Marshaler, client BlobberClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq CommitRequest var metadata runtime.ServerMetadata @@ -1062,6 +1130,29 @@ func RegisterBlobberHandlerServer(ctx context.Context, mux *runtime.ServeMux, se }) + mux.Handle("POST", pattern_Blobber_RenameObject_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/blobber.service.v1.Blobber/RenameObject") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Blobber_RenameObject_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Blobber_RenameObject_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("POST", pattern_Blobber_Commit_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -1381,6 +1472,26 @@ func RegisterBlobberHandlerClient(ctx context.Context, mux *runtime.ServeMux, cl }) + mux.Handle("POST", pattern_Blobber_RenameObject_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/blobber.service.v1.Blobber/RenameObject") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Blobber_RenameObject_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Blobber_RenameObject_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("POST", pattern_Blobber_Commit_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -1519,6 +1630,8 @@ var ( pattern_Blobber_GetObjectTree_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v2", "file", "objecttree", "allocation"}, "")) + pattern_Blobber_RenameObject_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v2", "file", "rename", "allocation"}, "")) + pattern_Blobber_Commit_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v2", "connection", "commit", "allocation"}, "")) pattern_Blobber_CalculateHash_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v2", "file", "calculatehash", "allocation"}, "")) @@ -1547,6 +1660,8 @@ var ( forward_Blobber_GetObjectTree_0 = runtime.ForwardResponseMessage + forward_Blobber_RenameObject_0 = runtime.ForwardResponseMessage + forward_Blobber_Commit_0 = runtime.ForwardResponseMessage forward_Blobber_CalculateHash_0 = runtime.ForwardResponseMessage diff --git a/code/go/0chain.net/blobbercore/blobbergrpc/blobber_grpc.pb.go b/code/go/0chain.net/blobbercore/blobbergrpc/blobber_grpc.pb.go index ffd23725f..fb0f314fa 100644 --- a/code/go/0chain.net/blobbercore/blobbergrpc/blobber_grpc.pb.go +++ b/code/go/0chain.net/blobbercore/blobbergrpc/blobber_grpc.pb.go @@ -24,6 +24,7 @@ type BlobberClient interface { GetObjectPath(ctx context.Context, in *GetObjectPathRequest, opts ...grpc.CallOption) (*GetObjectPathResponse, error) GetReferencePath(ctx context.Context, in *GetReferencePathRequest, opts ...grpc.CallOption) (*GetReferencePathResponse, error) GetObjectTree(ctx context.Context, in *GetObjectTreeRequest, opts ...grpc.CallOption) (*GetObjectTreeResponse, error) + RenameObject(ctx context.Context, in *RenameObjectRequest, opts ...grpc.CallOption) (*RenameObjectResponse, error) Commit(ctx context.Context, in *CommitRequest, opts ...grpc.CallOption) (*CommitResponse, error) CalculateHash(ctx context.Context, in *CalculateHashRequest, opts ...grpc.CallOption) (*CalculateHashResponse, error) CommitMetaTxn(ctx context.Context, in *CommitMetaTxnRequest, opts ...grpc.CallOption) (*CommitMetaTxnResponse, error) @@ -103,6 +104,15 @@ func (c *blobberClient) GetObjectTree(ctx context.Context, in *GetObjectTreeRequ return out, nil } +func (c *blobberClient) RenameObject(ctx context.Context, in *RenameObjectRequest, opts ...grpc.CallOption) (*RenameObjectResponse, error) { + out := new(RenameObjectResponse) + err := c.cc.Invoke(ctx, "/blobber.service.v1.Blobber/RenameObject", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *blobberClient) Commit(ctx context.Context, in *CommitRequest, opts ...grpc.CallOption) (*CommitResponse, error) { out := new(CommitResponse) err := c.cc.Invoke(ctx, "/blobber.service.v1.Blobber/Commit", in, out, opts...) @@ -168,6 +178,7 @@ type BlobberServer interface { GetObjectPath(context.Context, *GetObjectPathRequest) (*GetObjectPathResponse, error) GetReferencePath(context.Context, *GetReferencePathRequest) (*GetReferencePathResponse, error) GetObjectTree(context.Context, *GetObjectTreeRequest) (*GetObjectTreeResponse, error) + RenameObject(context.Context, *RenameObjectRequest) (*RenameObjectResponse, error) Commit(context.Context, *CommitRequest) (*CommitResponse, error) CalculateHash(context.Context, *CalculateHashRequest) (*CalculateHashResponse, error) CommitMetaTxn(context.Context, *CommitMetaTxnRequest) (*CommitMetaTxnResponse, error) @@ -202,6 +213,9 @@ func (UnimplementedBlobberServer) GetReferencePath(context.Context, *GetReferenc func (UnimplementedBlobberServer) GetObjectTree(context.Context, *GetObjectTreeRequest) (*GetObjectTreeResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetObjectTree not implemented") } +func (UnimplementedBlobberServer) RenameObject(context.Context, *RenameObjectRequest) (*RenameObjectResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RenameObject not implemented") +} func (UnimplementedBlobberServer) Commit(context.Context, *CommitRequest) (*CommitResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Commit not implemented") } @@ -359,6 +373,24 @@ func _Blobber_GetObjectTree_Handler(srv interface{}, ctx context.Context, dec fu return interceptor(ctx, in, info, handler) } +func _Blobber_RenameObject_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RenameObjectRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BlobberServer).RenameObject(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/blobber.service.v1.Blobber/RenameObject", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BlobberServer).RenameObject(ctx, req.(*RenameObjectRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Blobber_Commit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(CommitRequest) if err := dec(in); err != nil { @@ -499,6 +531,10 @@ var _Blobber_serviceDesc = grpc.ServiceDesc{ MethodName: "GetObjectTree", Handler: _Blobber_GetObjectTree_Handler, }, + { + MethodName: "RenameObject", + Handler: _Blobber_RenameObject_Handler, + }, { MethodName: "Commit", Handler: _Blobber_Commit_Handler, diff --git a/code/go/0chain.net/blobbercore/blobbergrpc/proto/blobber.proto b/code/go/0chain.net/blobbercore/blobbergrpc/proto/blobber.proto index beb16c3a5..529e6ef5f 100644 --- a/code/go/0chain.net/blobbercore/blobbergrpc/proto/blobber.proto +++ b/code/go/0chain.net/blobbercore/blobbergrpc/proto/blobber.proto @@ -42,6 +42,12 @@ service Blobber { get: "/v2/file/objecttree/{allocation}" }; } + rpc RenameObject(RenameObjectRequest) returns (RenameObjectResponse) { + option (google.api.http) = { + post: "/v2/file/rename/{allocation}" + body: "*" + }; + } rpc Commit(CommitRequest) returns (CommitResponse) { option (google.api.http) = { @@ -286,6 +292,24 @@ message CopyObjectResponse { int64 upload_offset = 6; } +message RenameObjectRequest { + string allocation = 1; + string path = 2; + string path_hash = 3; + string connection_id = 4; + string new_name = 5; +} +message RenameObjectResponse { + string filename = 1; + int64 size = 2; + string content_hash = 3; + string merkle_root = 4; + //UploadLength indicates the size of the entire upload in bytes. The value MUST be a non-negative integer. + int64 upload_length = 5; + //Upload-Offset indicates a byte offset within a resource. The value MUST be a non-negative integer. + int64 upload_offset = 6; +} + message Allocation { string ID = 1; string Tx = 2; diff --git a/code/go/0chain.net/blobbercore/convert/responseHandler.go b/code/go/0chain.net/blobbercore/convert/responseHandler.go index c19f553c0..8ddd47302 100644 --- a/code/go/0chain.net/blobbercore/convert/responseHandler.go +++ b/code/go/0chain.net/blobbercore/convert/responseHandler.go @@ -354,3 +354,19 @@ func CopyObjectResponseHandler(copyObjectResponse *blobbergrpc.CopyObjectRespons UploadOffset: copyObjectResponse.UploadOffset, } } + +func RenameObjectResponseCreator(r interface{}) *blobbergrpc.RenameObjectResponse { + if r == nil { + return nil + } + + httpResp, _ := r.(*blobberHTTP.UploadResult) + return &blobbergrpc.RenameObjectResponse{ + Filename: httpResp.Filename, + Size: httpResp.Size, + ContentHash: httpResp.Hash, + MerkleRoot: httpResp.MerkleRoot, + UploadLength: httpResp.UploadLength, + UploadOffset: httpResp.UploadOffset, + } +} diff --git a/code/go/0chain.net/blobbercore/handler/object_operation_grpc_handler.go b/code/go/0chain.net/blobbercore/handler/object_operation_grpc_handler.go index 9a12df35a..151d2f146 100644 --- a/code/go/0chain.net/blobbercore/handler/object_operation_grpc_handler.go +++ b/code/go/0chain.net/blobbercore/handler/object_operation_grpc_handler.go @@ -49,3 +49,24 @@ func (b *blobberGRPCService) CopyObject(ctx context.Context, req *blobbergrpc.Co return convert.CopyObjectResponseCreator(resp), nil } + +func (b *blobberGRPCService) RenameObject(ctx context.Context, req *blobbergrpc.RenameObjectRequest) (*blobbergrpc.RenameObjectResponse, error) { + r, err := http.NewRequest("POST", "", nil) + if err != nil { + return nil, err + } + httpRequestWithMetaData(r, GetGRPCMetaDataFromCtx(ctx), req.Allocation) + r.Form = map[string][]string{ + "path": {req.Path}, + "path_hash": {req.PathHash}, + "connection_id": {req.ConnectionId}, + "new_name": {req.NewName}, + } + + resp, err := RenameHandler(ctx, r) + if err != nil { + return nil, err + } + + return convert.RenameObjectResponseCreator(resp), nil +} diff --git a/code/go/0chain.net/blobbercore/openapi/blobber.swagger.json b/code/go/0chain.net/blobbercore/openapi/blobber.swagger.json index e352732fa..390965c04 100644 --- a/code/go/0chain.net/blobbercore/openapi/blobber.swagger.json +++ b/code/go/0chain.net/blobbercore/openapi/blobber.swagger.json @@ -490,6 +490,44 @@ ] } }, + "/v2/file/rename/{allocation}": { + "post": { + "operationId": "Blobber_RenameObject", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1RenameObjectResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "allocation", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1RenameObjectRequest" + } + } + ], + "tags": [ + "Blobber" + ] + } + }, "/v2/file/stats/{allocation}": { "get": { "operationId": "Blobber_GetFileStats", @@ -1129,6 +1167,54 @@ } } }, + "v1RenameObjectRequest": { + "type": "object", + "properties": { + "allocation": { + "type": "string" + }, + "path": { + "type": "string" + }, + "pathHash": { + "type": "string" + }, + "connectionId": { + "type": "string" + }, + "newName": { + "type": "string" + } + } + }, + "v1RenameObjectResponse": { + "type": "object", + "properties": { + "filename": { + "type": "string" + }, + "size": { + "type": "string", + "format": "int64" + }, + "contentHash": { + "type": "string" + }, + "merkleRoot": { + "type": "string" + }, + "uploadLength": { + "type": "string", + "format": "int64", + "description": "UploadLength indicates the size of the entire upload in bytes. The value MUST be a non-negative integer." + }, + "uploadOffset": { + "type": "string", + "format": "int64", + "description": "Upload-Offset indicates a byte offset within a resource. The value MUST be a non-negative integer." + } + } + }, "v1Term": { "type": "object", "properties": {