/
githubmirror
/
nbs
Обзор
Документация
Войти
/
githubmirror
/
nbs
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
cloud/disk_manager/api/disk_service.proto
198 строк
5 KB
BarkovBG
[Disk Manager] support relocation between cells (#4827)
15 дек 2025, 23:40
Не верифицирован
15 дек 2025, 23:40
11f7e81
Код
Авторство
О чём код?
syntax = "proto3"; package cloud.disk_manager; import "cloud/disk_manager/api/disk.proto"; import "cloud/disk_manager/api/operation.proto"; import "google/protobuf/empty.proto"; import "google/protobuf/timestamp.proto"; option go_package = "github.com/ydb-platform/nbs/cloud/disk_manager/api;disk_manager"; service DiskService { // Returns operation with: // metadata: CreateDiskMetadata // response: google.protobuf.Empty rpc Create(CreateDiskRequest) returns (Operation); // Delete the disk without deleting its snapshots. // // Returns operation with: // metadata: DeleteDiskMetadata // response: google.protobuf.Empty rpc Delete(DeleteDiskRequest) returns (Operation); // Returns operation with: // response: google.protobuf.Empty rpc Resize(ResizeDiskRequest) returns (Operation); // Returns operation with: // response: google.protobuf.Empty rpc Alter(AlterDiskRequest) returns (Operation); // Should be called before starting the VM with proper token. // // Returns operation with: // response: google.protobuf.Empty rpc Assign(AssignDiskRequest) returns (Operation); // Should be called after stopping the VM. // // Returns operation with: // response: google.protobuf.Empty rpc Unassign(UnassignDiskRequest) returns (Operation); rpc DescribeModel(DescribeDiskModelRequest) returns (DiskModel) {} rpc Stat(StatDiskRequest) returns (DiskStats) {} // Creates a disk in the destination zone and starts replicating data to it from the source disk, and after replication is finished, replaces the source disk with the destination disk. // // In order to finish this operation, firstly FINISH_REPLICATION, and then FINISH_MIGRATION signals should be sent via |SendMigrationSignal|. // // Can be cancelled by performing |operations.Cancel| on returned operation, but only before FINISH_MIGRATION signal has been sent. // // Returns operation with: // metadata: MigrateDiskMetadata // response: google.protobuf.Empty rpc Migrate(MigrateDiskRequest) returns (Operation); // Sends a signal to the migration operation, advancing migration process forward. rpc SendMigrationSignal(SendMigrationSignalRequest) returns (google.protobuf.Empty); rpc Describe(DescribeDiskRequest) returns (DiskParams) {} rpc ListStates(ListDiskStatesRequest) returns (ListDiskStatesResponse) {} } message CreateDiskRequest { reserved 13, 14, 15, 16; oneof src { google.protobuf.Empty src_empty = 1; // It's (generally) very fast to create disk from image, because it'll create a layered disk basing on some disk from image's pool string src_image_id = 2; // This is similar to creating from Image, except it performs full copy and so is very slow. string src_snapshot_id = 3; } int64 size = 4; DiskId disk_id = 5; int64 block_size = 6; DiskKind kind = 7; string cloud_id = 8; string folder_id = 9; int64 tablet_version = 10; string placement_group_id = 11; // Prevents from creating layered (overlay) disk. bool force_not_layered = 12; string storage_pool_name = 17; repeated string agent_ids = 18; EncryptionDesc encryption_desc = 19; uint32 placement_partition_index = 20; bool require_exact_cell_id_match = 21; } message CreateDiskMetadata { double progress = 1; } message DeleteDiskRequest { reserved 2; // `disk_id.zone_id` is optional. DiskId disk_id = 1; bool sync = 3; } message DeleteDiskMetadata { DiskId disk_id = 1; } message ResizeDiskRequest { DiskId disk_id = 1; int64 size = 2; } message AlterDiskRequest { DiskId disk_id = 1; string cloud_id = 2; string folder_id = 3; } message AssignDiskRequest { DiskId disk_id = 1; string instance_id = 2; string host = 3; // Empty token is not allowed. string token = 4; } message UnassignDiskRequest { DiskId disk_id = 1; } message DescribeDiskModelRequest { string zone_id = 1; int64 block_size = 2; int64 size = 3; DiskKind kind = 4; int64 tablet_version = 5; } message StatDiskRequest { DiskId disk_id = 1; } message MigrateDiskRequest { DiskId disk_id = 1; string dst_zone_id = 2; string dst_placement_group_id = 3; uint32 dst_placement_partition_index = 4; bool is_migration_between_cells = 5; } message MigrateDiskMetadata { enum Status { STATUS_UNSPECIFIED = 0; REPLICATING = 1; FINISHING_REPLICATION = 2; REPLICATION_FINISHED = 3; FINISHING = 4; } Status status = 1; double progress = 2; int64 seconds_remaining = 3; // To copy the rest of the data. google.protobuf.Timestamp updated_at = 4; } message SendMigrationSignalRequest { enum Signal { SIGNAL_UNSPECIFIED = 0; // Signal to freeze source disk and finish data replication. FINISH_REPLICATION = 1; // Signal to delete source disk and replace it with destination disk. Can only be sent after FinishReplication signal. FINISH_MIGRATION = 2; } string operation_id = 1; Signal signal = 2; } message DescribeDiskRequest { DiskId disk_id = 1; } message ListDiskStatesRequest { string zone_id = 1; } message ListDiskStatesResponse { message Item { string disk_id = 1; DiskState state = 2; string state_message = 3; } repeated Item items = 1; }