/** * LVMd manages logical volumes of an LVM volume group. * * The protocol consists of two services: * - VGService provides information of the volume group. * - LVService provides management functions for logical volumes on the volume group. */ syntax = "proto3"; package proto; option go_package = "github.com/topolvm/topolvm/pkg/lvmd/proto"; message Empty {} // Represents a logical volume. message LogicalVolume { string name = 1; // The logical volume name. uint32 dev_major = 3; // Device major number. uint32 dev_minor = 4; // Device minor number. repeated string tags = 5; // Tags to add to the volume during creation int64 size_bytes = 6; // Volume size in canonical CSI bytes. string path = 7; // Path to the lv as per lvm. string attr = 8; // Attributes of the lv. reserved 2; } // Represents the input for CreateLV. message CreateLVRequest { string name = 1; // The logical volume name. repeated string tags = 3; // Tags to add to the volume during creation string device_class = 4; string lvcreate_option_class = 5; int64 size_bytes = 6; // Volume size in canonical CSI bytes. reserved 2; } // Represents the response of CreateLV. message CreateLVResponse { LogicalVolume volume = 1; // Information of the created volume. } // Represents the input for RemoveLV. message RemoveLVRequest { string name = 1; // The logical volume name. string device_class = 2; } message CreateLVSnapshotRequest { string name = 1; // The logical volume name. repeated string tags = 2; // Tags to add to the volume during creation string device_class = 3; string source_volume = 4; // Source lv of snapshot. string access_type = 6; // Access type of snapshot int64 size_bytes = 7; // Volume size in canonical CSI bytes. reserved 5; } message CreateLVSnapshotResponse { LogicalVolume snapshot = 1; // Information of the created snapshot lv. } // Represents the input for ResizeLV. // // The volume must already exist. // The volume size will be expanded to at least "size_bytes". message ResizeLVRequest { string name = 1; // The logical volume name. int64 size_bytes = 7; // Volume size in canonical CSI bytes. string device_class = 3; reserved 2; } message ResizeLVResponse { int64 size_bytes = 1; // Volume size in canonical CSI bytes. } // Represents the response of GetLVList. message GetLVListResponse { repeated LogicalVolume volumes = 1; // Information of volumes. } // Represents the response of GetFreeBytes. message GetFreeBytesResponse { uint64 free_bytes = 1; // Free space of the volume group in bytes. } message GetLVListRequest { string device_class = 1; } message GetFreeBytesRequest { string device_class = 1; } // Represents the stream output from Watch. message WatchResponse { uint64 free_bytes = 1; // Free space of the default volume group in bytes. In the case of thin pools, free space on the thinpool with overprovision in bytes. repeated WatchItem items = 2; } // Represents the details of thinpool. message ThinPoolItem { double data_percent = 1; // Data percent occupied on the thinpool, used for monitoring. double metadata_percent = 2; // Metadata percent occupied on the thinpool, used for monitoring. uint64 overprovision_bytes = 3; // Free space on the thinpool with overprovision, used for annotating node. uint64 size_bytes = 4; // Physical data space size of the thinpool. } // Represents the response corresponding to device class targets. message WatchItem { uint64 free_bytes = 1; // Free space in the volume group in bytes. string device_class = 2; uint64 size_bytes = 3; // Size of volume group in bytes. ThinPoolItem thin_pool = 4; } // Service to manage logical volumes of the volume group. service LVService { // Create a logical volume. rpc CreateLV(CreateLVRequest) returns (CreateLVResponse); // Remove a logical volume. rpc RemoveLV(RemoveLVRequest) returns (Empty); // Resize a logical volume. rpc ResizeLV(ResizeLVRequest) returns (ResizeLVResponse); rpc CreateLVSnapshot(CreateLVSnapshotRequest) returns (CreateLVSnapshotResponse); } // Service to retrieve information of the volume group. service VGService { // Get the list of logical volumes in the volume group. rpc GetLVList(GetLVListRequest) returns (GetLVListResponse); // Get the free space of the volume group in bytes. rpc GetFreeBytes(GetFreeBytesRequest) returns (GetFreeBytesResponse); // Stream the volume group metrics. rpc Watch(Empty) returns (stream WatchResponse); }