diff options
| author | Konstantin Lebedev <lebedev_k@tochka.com> | 2020-10-28 22:47:09 +0500 |
|---|---|---|
| committer | Konstantin Lebedev <lebedev_k@tochka.com> | 2020-10-28 22:47:09 +0500 |
| commit | 884db215a14258d73e5744ae32fdb97e6f3cb09b (patch) | |
| tree | ddb6a6400c61b92cc48d507a940e575b3b8fbd28 /weed/shell/command_volume_move.go | |
| parent | c321378976b22bdb7224629747c2ecc57c67d3f6 (diff) | |
| download | seaweedfs-884db215a14258d73e5744ae32fdb97e6f3cb09b.tar.xz seaweedfs-884db215a14258d73e5744ae32fdb97e6f3cb09b.zip | |
add shell command volume mark writable
Diffstat (limited to 'weed/shell/command_volume_move.go')
| -rw-r--r-- | weed/shell/command_volume_move.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/weed/shell/command_volume_move.go b/weed/shell/command_volume_move.go index b136604e5..2bc8dfad8 100644 --- a/weed/shell/command_volume_move.go +++ b/weed/shell/command_volume_move.go @@ -166,3 +166,18 @@ func deleteVolume(grpcDialOption grpc.DialOption, volumeId needle.VolumeId, sour return deleteErr }) } + +func markVolumeWritable(grpcDialOption grpc.DialOption, volumeId needle.VolumeId, sourceVolumeServer string, writable bool) (err error) { + return operation.WithVolumeServerClient(sourceVolumeServer, grpcDialOption, func(volumeServerClient volume_server_pb.VolumeServerClient) error { + if writable { + _, err = volumeServerClient.VolumeMarkWritable(context.Background(), &volume_server_pb.VolumeMarkWritableRequest{ + VolumeId: uint32(volumeId), + }) + } else { + _, err = volumeServerClient.VolumeMarkReadonly(context.Background(), &volume_server_pb.VolumeMarkReadonlyRequest{ + VolumeId: uint32(volumeId), + }) + } + return err + }) +} |
