Skip to content

Commit c76bbd5

Browse files
authored
Merge pull request #76 from ddebroy/beta-apis
Beta APIs for FileSystem and SMB APIGroups
2 parents 1c9b573 + 8ca8935 commit c76bbd5

File tree

16 files changed

+2163
-24
lines changed

16 files changed

+2163
-24
lines changed

client/api/filesystem/v1beta1/api.pb.go

+872
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
+168
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
syntax = "proto3";
2+
3+
package v1beta1;
4+
5+
service Filesystem {
6+
// PathExists checks if the requested path exists in the host's filesystem
7+
rpc PathExists(PathExistsRequest) returns (PathExistsResponse) {}
8+
9+
// Mkdir creates a directory at the requested path in the host's filesystem
10+
rpc Mkdir(MkdirRequest) returns (MkdirResponse) {}
11+
12+
// Rmdir removes the directory at the requested path in the host's filesystem.
13+
// This may be used for unlinking a symlink created through LinkPath
14+
rpc Rmdir(RmdirRequest) returns (RmdirResponse) {}
15+
16+
// LinkPath creates a local directory symbolic link between a source path
17+
// and target path in the host's filesystem
18+
rpc LinkPath(LinkPathRequest) returns (LinkPathResponse) {}
19+
20+
//IsMountPoint checks if a given path is mount or not
21+
rpc IsMountPoint(IsMountPointRequest) returns (IsMountPointResponse) {}
22+
}
23+
24+
// Context of the paths used for path prefix validation
25+
enum PathContext {
26+
// Indicates the kubelet-csi-plugins-path parameter of csi-proxy be used as
27+
// the path context. This may be used while handling NodeStageVolume where
28+
// a volume may need to be mounted at a plugin-specific path like:
29+
// kubelet\plugins\kubernetes.io\csi\pv\<pv-name>\globalmount
30+
PLUGIN = 0;
31+
// Indicates the kubelet-pod-path parameter of csi-proxy be used as the path
32+
// context. This may be used while handling NodePublishVolume where a staged
33+
// volume may be need to be symlinked to a pod-specific path like:
34+
// kubelet\pods\<pod-uuid>\volumes\kubernetes.io~csi\<pvc-name>\mount
35+
POD = 1;
36+
}
37+
38+
message PathExistsRequest {
39+
// The path whose existence we want to check in the host's filesystem
40+
string path = 1;
41+
42+
// Context of the path parameter.
43+
// This is used to validate prefix for absolute paths passed
44+
PathContext context = 2;
45+
}
46+
47+
message PathExistsResponse {
48+
// Error message if any. Empty string indicates success
49+
string error = 1;
50+
51+
// Indicates whether the path in PathExistsRequest exists in the host's filesystem
52+
bool exists = 2;
53+
}
54+
55+
message MkdirRequest {
56+
// The path to create in the host's filesystem.
57+
// All special characters allowed by Windows in path names will be allowed
58+
// except for restrictions noted below. For details, please check:
59+
// https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file
60+
// Non-existent parent directories in the path will be automatically created.
61+
// Directories will be created with Read and Write privileges of the Windows
62+
// User account under which csi-proxy is started (typically LocalSystem).
63+
//
64+
// Restrictions:
65+
// Only absolute path (indicated by a drive letter prefix: e.g. "C:\") is accepted.
66+
// Depending on the context parameter of this function, the path prefix needs
67+
// to match the paths specified either as kubelet-csi-plugins-path
68+
// or as kubelet-pod-path parameters of csi-proxy.
69+
// The path parameter cannot already exist in the host's filesystem.
70+
// UNC paths of the form "\\server\share\path\file" are not allowed.
71+
// All directory separators need to be backslash character: "\".
72+
// Characters: .. / : | ? * in the path are not allowed.
73+
// Maximum path length will be capped to 260 characters.
74+
string path = 1;
75+
76+
// Context of the path parameter.
77+
// This is used to validate prefix for absolute paths passed
78+
PathContext context = 2;
79+
}
80+
81+
message MkdirResponse {
82+
// Error message if any. Empty string indicates success
83+
string error = 1;
84+
}
85+
86+
message RmdirRequest {
87+
// The path to remove in the host's filesystem.
88+
// All special characters allowed by Windows in path names will be allowed
89+
// except for restrictions noted below. For details, please check:
90+
// https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file
91+
//
92+
// Restrictions:
93+
// Only absolute path (indicated by a drive letter prefix: e.g. "C:\") is accepted.
94+
// Depending on the context parameter of this function, the path prefix needs
95+
// to match the paths specified either as kubelet-csi-plugins-path
96+
// or as kubelet-pod-path parameters of csi-proxy.
97+
// UNC paths of the form "\\server\share\path\file" are not allowed.
98+
// All directory separators need to be backslash character: "\".
99+
// Characters: .. / : | ? * in the path are not allowed.
100+
// Path cannot be a file of type symlink.
101+
// Maximum path length will be capped to 260 characters.
102+
string path = 1;
103+
104+
// Context of the path parameter.
105+
// This is used to validate prefix for absolute paths passed
106+
PathContext context = 2;
107+
108+
// Force remove all contents under path (if any).
109+
bool force = 3;
110+
}
111+
112+
message RmdirResponse {
113+
// Error message if any. Empty string indicates success
114+
string error = 1;
115+
}
116+
117+
message LinkPathRequest {
118+
// The path where the symlink is created in the host's filesystem.
119+
// All special characters allowed by Windows in path names will be allowed
120+
// except for restrictions noted below. For details, please check:
121+
// https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file
122+
//
123+
// Restrictions:
124+
// Only absolute path (indicated by a drive letter prefix: e.g. "C:\") is accepted.
125+
// The path prefix needs needs to match the paths specified as
126+
// kubelet-csi-plugins-path parameter of csi-proxy.
127+
// UNC paths of the form "\\server\share\path\file" are not allowed.
128+
// All directory separators need to be backslash character: "\".
129+
// Characters: .. / : | ? * in the path are not allowed.
130+
// source_path cannot already exist in the host filesystem.
131+
// Maximum path length will be capped to 260 characters.
132+
string source_path = 1;
133+
134+
// Target path in the host's filesystem used for the symlink creation.
135+
// All special characters allowed by Windows in path names will be allowed
136+
// except for restrictions noted below. For details, please check:
137+
// https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file
138+
//
139+
// Restrictions:
140+
// Only absolute path (indicated by a drive letter prefix: e.g. "C:\") is accepted.
141+
// The path prefix needs to match the paths specified as
142+
// kubelet-pod-path parameter of csi-proxy.
143+
// UNC paths of the form "\\server\share\path\file" are not allowed.
144+
// All directory separators need to be backslash character: "\".
145+
// Characters: .. / : | ? * in the path are not allowed.
146+
// target_path needs to exist as a directory in the host that is empty.
147+
// target_path cannot be a symbolic link.
148+
// Maximum path length will be capped to 260 characters.
149+
string target_path = 2;
150+
}
151+
152+
message LinkPathResponse {
153+
// Error message if any. Empty string indicates success
154+
string error = 1;
155+
}
156+
157+
message IsMountPointRequest {
158+
// The path whose existence we want to check in the host's filesystem
159+
string path = 1;
160+
}
161+
162+
message IsMountPointResponse {
163+
// Error message if any. Empty string indicates success
164+
string error = 1;
165+
166+
// Indicates whether the path in PathExistsRequest exists in the host's filesystem
167+
bool is_mount_point = 2;
168+
}

0 commit comments

Comments
 (0)