Skip to content

Commit 7ed8d11

Browse files
authored
Merge pull request #188 from mauriciopoppe/volume-v2alpha1
Bump volume api from v1 to v2alpha1
2 parents 4d9f851 + 858205e commit 7ed8d11

File tree

13 files changed

+5079
-0
lines changed

13 files changed

+5079
-0
lines changed

client/api/volume/v2alpha1/api.pb.go

Lines changed: 1884 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/api/volume/v2alpha1/api.proto

Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
syntax = "proto3";
2+
3+
package v2alpha1;
4+
5+
option go_package = "github.com/kubernetes-csi/csi-proxy/client/api/volume/v2alpha1";
6+
7+
service Volume {
8+
// ListVolumesOnDisk returns the volume IDs (in \\.\Volume{GUID} format) for all volumes from a
9+
// given disk number and partition number (optional)
10+
rpc ListVolumesOnDisk(ListVolumesOnDiskRequest) returns (ListVolumesOnDiskResponse) {}
11+
12+
// MountVolume mounts the volume at the requested global staging path.
13+
rpc MountVolume(MountVolumeRequest) returns (MountVolumeResponse) {}
14+
15+
// UnmountVolume flushes data cache to disk and removes the global staging path.
16+
rpc UnmountVolume(UnmountVolumeRequest) returns (UnmountVolumeResponse) {}
17+
18+
// IsVolumeFormatted checks if a volume is formatted.
19+
rpc IsVolumeFormatted(IsVolumeFormattedRequest) returns (IsVolumeFormattedResponse) {}
20+
21+
// FormatVolume formats a volume with NTFS.
22+
rpc FormatVolume(FormatVolumeRequest) returns (FormatVolumeResponse) {}
23+
24+
// ResizeVolume performs resizing of the partition and file system for a block based volume.
25+
rpc ResizeVolume(ResizeVolumeRequest) returns (ResizeVolumeResponse) {}
26+
27+
// GetVolumeStats gathers total bytes and used bytes for a volume.
28+
rpc GetVolumeStats(GetVolumeStatsRequest) returns (GetVolumeStatsResponse) {}
29+
30+
// GetDiskNumberFromVolumeID gets the disk number of the disk where the volume is located.
31+
rpc GetDiskNumberFromVolumeID(GetDiskNumberFromVolumeIDRequest) returns (GetDiskNumberFromVolumeIDResponse ) {}
32+
33+
// GetVolumeIDFromTargetPath gets the volume id for a given target path.
34+
rpc GetVolumeIDFromTargetPath(GetVolumeIDFromTargetPathRequest) returns (GetVolumeIDFromTargetPathResponse) {}
35+
36+
// WriteVolumeCache write volume cache to disk.
37+
rpc WriteVolumeCache(WriteVolumeCacheRequest) returns (WriteVolumeCacheResponse) {}
38+
}
39+
40+
message ListVolumesOnDiskRequest {
41+
// Disk device number of the disk to query for volumes.
42+
uint32 disk_number = 1;
43+
// The partition number (optional), by default it uses the first partition of the disk.
44+
uint32 partition_number = 2;
45+
}
46+
47+
message ListVolumesOnDiskResponse {
48+
// Volume device IDs of volumes on the specified disk.
49+
repeated string volume_ids = 1;
50+
}
51+
52+
message MountVolumeRequest {
53+
// Volume device ID of the volume to mount.
54+
string volume_id = 1;
55+
// Path in the host's file system where the volume needs to be mounted.
56+
string target_path = 2;
57+
}
58+
59+
message MountVolumeResponse {
60+
// Intentionally empty.
61+
}
62+
63+
message UnmountVolumeRequest {
64+
// Volume device ID of the volume to dismount.
65+
string volume_id = 1;
66+
// Path where the volume has been mounted.
67+
string target_path = 2;
68+
}
69+
70+
message UnmountVolumeResponse {
71+
// Intentionally empty.
72+
}
73+
74+
message IsVolumeFormattedRequest {
75+
// Volume device ID of the volume to check.
76+
string volume_id = 1;
77+
}
78+
79+
message IsVolumeFormattedResponse {
80+
// Is the volume formatted with NTFS.
81+
bool formatted = 1;
82+
}
83+
84+
message FormatVolumeRequest {
85+
// Volume device ID of the volume to format.
86+
string volume_id = 1;
87+
}
88+
89+
message FormatVolumeResponse {
90+
// Intentionally empty.
91+
}
92+
93+
message ResizeVolumeRequest {
94+
// Volume device ID of the volume to resize.
95+
string volume_id = 1;
96+
// New size in bytes of the volume.
97+
int64 size_bytes = 2;
98+
}
99+
100+
message ResizeVolumeResponse {
101+
// Intentionally empty.
102+
}
103+
104+
message GetVolumeStatsRequest{
105+
// Volume device Id of the volume to get the stats for.
106+
string volume_id = 1;
107+
}
108+
109+
message GetVolumeStatsResponse{
110+
// Total bytes
111+
int64 total_bytes = 1;
112+
// Used bytes
113+
int64 used_bytes = 2;
114+
}
115+
116+
message GetDiskNumberFromVolumeIDRequest {
117+
// Volume device ID of the volume to get the disk number for.
118+
string volume_id = 1;
119+
}
120+
121+
message GetDiskNumberFromVolumeIDResponse {
122+
// Corresponding disk number.
123+
uint32 disk_number = 1;
124+
}
125+
126+
message GetVolumeIDFromTargetPathRequest {
127+
// The target path.
128+
string target_path = 1;
129+
}
130+
131+
message GetVolumeIDFromTargetPathResponse {
132+
// The volume device ID.
133+
string volume_id = 1;
134+
}
135+
136+
message WriteVolumeCacheRequest {
137+
// Volume device ID of the volume to flush the cache.
138+
string volume_id = 1;
139+
}
140+
141+
message WriteVolumeCacheResponse {
142+
// Intentionally empty.
143+
}

client/groups/volume/v2alpha1/client_generated.go

Lines changed: 106 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

integrationtests/volume_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,4 +172,8 @@ func TestVolumeAPIs(t *testing.T) {
172172
skipTestOnCondition(t, isRunningOnGhActions())
173173
v1VolumeTests(t)
174174
})
175+
t.Run("v2alpha1Tests", func(t *testing.T) {
176+
skipTestOnCondition(t, isRunningOnGhActions())
177+
v2alpha1VolumeTests(t)
178+
})
175179
}

0 commit comments

Comments
 (0)