// Copyright (C) 2019 Storj Labs, Inc. // See LICENSE for copying information. syntax = "proto3"; option go_package = "pb"; import "gogo.proto"; import "metainfo.proto"; import "orders.proto"; package gracefulexit; service SatelliteGracefulExit { // Process is called by storage nodes to initiate the graceful exit, get pieces to transfer, and receive exit status. rpc Process(stream StorageNodeMessage) returns (stream SatelliteMessage); } message TransferSucceeded { metainfo.AddressedOrderLimit addressed_order_limit = 1; orders.PieceHash original_piece_hash = 2; orders.PieceHash replacement_piece_hash = 3; } message TransferFailed { bytes piece_id = 1 [(gogoproto.customtype) = "PieceID", (gogoproto.nullable) = false]; enum Error { NOT_FOUND = 0; STORAGE_NODE_UNAVAILABLE = 1; UNKNOWN = 2; } Error error = 2; } message StorageNodeMessage { oneof Message { TransferSucceeded succeeded = 1; TransferFailed failed = 2; } } message NotReady {} message TransferPiece { bytes piece_id = 1 [(gogoproto.customtype) = "PieceID", (gogoproto.nullable) = false]; // the current piece-id bytes private_key = 2 [(gogoproto.customtype) = "PiecePrivateKey", (gogoproto.nullable) = false]; // addressed_order_limit contains the new piece id. metainfo.AddressedOrderLimit addressed_order_limit =3; } message DeletePiece { bytes piece_id = 1 [(gogoproto.customtype) = "PieceID", (gogoproto.nullable) = false]; } message ExitCompleted { // when everything is completed bytes exit_complete_signature = 1; } message ExitFailed { enum Reason { VERIFICATION_FAILED = 0; } // on failure bytes exit_failure_signature = 1; Reason reason = 2; } message SatelliteMessage { oneof Message { NotReady not_ready = 1; TransferPiece transfer_piece = 2; DeletePiece delete_piece = 3; ExitCompleted exit_completed = 4; ExitFailed exit_failed = 5; } }