Skip to content

Commit

Permalink
Merge pull request #188 from mauriciopoppe/volume-v2alpha1
Browse files Browse the repository at this point in the history
Bump volume api from v1 to v2alpha1
  • Loading branch information
k8s-ci-robot authored Jan 8, 2022
2 parents 4d9f851 + 858205e commit 7ed8d11
Show file tree
Hide file tree
Showing 13 changed files with 5,079 additions and 0 deletions.
1,884 changes: 1,884 additions & 0 deletions client/api/volume/v2alpha1/api.pb.go

Large diffs are not rendered by default.

143 changes: 143 additions & 0 deletions client/api/volume/v2alpha1/api.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
syntax = "proto3";

package v2alpha1;

option go_package = "github.com/kubernetes-csi/csi-proxy/client/api/volume/v2alpha1";

service Volume {
// ListVolumesOnDisk returns the volume IDs (in \\.\Volume{GUID} format) for all volumes from a
// given disk number and partition number (optional)
rpc ListVolumesOnDisk(ListVolumesOnDiskRequest) returns (ListVolumesOnDiskResponse) {}

// MountVolume mounts the volume at the requested global staging path.
rpc MountVolume(MountVolumeRequest) returns (MountVolumeResponse) {}

// UnmountVolume flushes data cache to disk and removes the global staging path.
rpc UnmountVolume(UnmountVolumeRequest) returns (UnmountVolumeResponse) {}

// IsVolumeFormatted checks if a volume is formatted.
rpc IsVolumeFormatted(IsVolumeFormattedRequest) returns (IsVolumeFormattedResponse) {}

// FormatVolume formats a volume with NTFS.
rpc FormatVolume(FormatVolumeRequest) returns (FormatVolumeResponse) {}

// ResizeVolume performs resizing of the partition and file system for a block based volume.
rpc ResizeVolume(ResizeVolumeRequest) returns (ResizeVolumeResponse) {}

// GetVolumeStats gathers total bytes and used bytes for a volume.
rpc GetVolumeStats(GetVolumeStatsRequest) returns (GetVolumeStatsResponse) {}

// GetDiskNumberFromVolumeID gets the disk number of the disk where the volume is located.
rpc GetDiskNumberFromVolumeID(GetDiskNumberFromVolumeIDRequest) returns (GetDiskNumberFromVolumeIDResponse ) {}

// GetVolumeIDFromTargetPath gets the volume id for a given target path.
rpc GetVolumeIDFromTargetPath(GetVolumeIDFromTargetPathRequest) returns (GetVolumeIDFromTargetPathResponse) {}

// WriteVolumeCache write volume cache to disk.
rpc WriteVolumeCache(WriteVolumeCacheRequest) returns (WriteVolumeCacheResponse) {}
}

message ListVolumesOnDiskRequest {
// Disk device number of the disk to query for volumes.
uint32 disk_number = 1;
// The partition number (optional), by default it uses the first partition of the disk.
uint32 partition_number = 2;
}

message ListVolumesOnDiskResponse {
// Volume device IDs of volumes on the specified disk.
repeated string volume_ids = 1;
}

message MountVolumeRequest {
// Volume device ID of the volume to mount.
string volume_id = 1;
// Path in the host's file system where the volume needs to be mounted.
string target_path = 2;
}

message MountVolumeResponse {
// Intentionally empty.
}

message UnmountVolumeRequest {
// Volume device ID of the volume to dismount.
string volume_id = 1;
// Path where the volume has been mounted.
string target_path = 2;
}

message UnmountVolumeResponse {
// Intentionally empty.
}

message IsVolumeFormattedRequest {
// Volume device ID of the volume to check.
string volume_id = 1;
}

message IsVolumeFormattedResponse {
// Is the volume formatted with NTFS.
bool formatted = 1;
}

message FormatVolumeRequest {
// Volume device ID of the volume to format.
string volume_id = 1;
}

message FormatVolumeResponse {
// Intentionally empty.
}

message ResizeVolumeRequest {
// Volume device ID of the volume to resize.
string volume_id = 1;
// New size in bytes of the volume.
int64 size_bytes = 2;
}

message ResizeVolumeResponse {
// Intentionally empty.
}

message GetVolumeStatsRequest{
// Volume device Id of the volume to get the stats for.
string volume_id = 1;
}

message GetVolumeStatsResponse{
// Total bytes
int64 total_bytes = 1;
// Used bytes
int64 used_bytes = 2;
}

message GetDiskNumberFromVolumeIDRequest {
// Volume device ID of the volume to get the disk number for.
string volume_id = 1;
}

message GetDiskNumberFromVolumeIDResponse {
// Corresponding disk number.
uint32 disk_number = 1;
}

message GetVolumeIDFromTargetPathRequest {
// The target path.
string target_path = 1;
}

message GetVolumeIDFromTargetPathResponse {
// The volume device ID.
string volume_id = 1;
}

message WriteVolumeCacheRequest {
// Volume device ID of the volume to flush the cache.
string volume_id = 1;
}

message WriteVolumeCacheResponse {
// Intentionally empty.
}
106 changes: 106 additions & 0 deletions client/groups/volume/v2alpha1/client_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions integrationtests/volume_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,4 +172,8 @@ func TestVolumeAPIs(t *testing.T) {
skipTestOnCondition(t, isRunningOnGhActions())
v1VolumeTests(t)
})
t.Run("v2alpha1Tests", func(t *testing.T) {
skipTestOnCondition(t, isRunningOnGhActions())
v2alpha1VolumeTests(t)
})
}
Loading

0 comments on commit 7ed8d11

Please sign in to comment.