@@ -2,27 +2,151 @@ syntax = "proto3";
22
33package v1alpha1 ;
44
5- import "github.com/kubernetes-csi/csi-proxy/client/api/errors.proto" ;
6-
7- // FIXME: this is just an almost empty service, not actually implemented; it's just
8- // here as an example of what API group and versions will look like. It will actually
9- // be implemented in a later patch.
10-
115service Filesystem {
12- // PathExists checks if the given path exists on the host.
6+ // PathExists checks if the requested path exists in the host's filesystem
137 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+
21+ // Context of the paths used for path prefix validation
22+ enum PathContext {
23+ // Indicates the kubelet-csi-plugins-path parameter of csi-proxy be used as
24+ // the path context. This may be used while handling NodeStageVolume where
25+ // a volume may need to be mounted at a plugin-specific path like:
26+ // kubelet\plugins\kubernetes.io\csi\pv\<pv-name>\globalmount
27+ PLUGIN = 0 ;
28+ // Indicates the kubelet-pod-path parameter of csi-proxy be used as the path
29+ // context. This may be used while handling NodePublishVolume where a staged
30+ // volume may be need to be symlinked to a pod-specific path like:
31+ // kubelet\pods\<pod-uuid>\volumes\kubernetes.io~csi\<pvc-name>\mount
32+ POD = 1 ;
1433}
1534
1635message PathExistsRequest {
17- // The path to check in the host file system.
36+ // The path whose existence we want to check in the host's filesystem
1837 string path = 1 ;
38+
39+ // Context of the path parameter.
40+ // This is used to validate prefix for absolute paths passed
41+ PathContext context = 2 ;
1942}
2043
2144message PathExistsResponse {
22- bool success = 1 ;
45+ // Error message if any. Empty string indicates success
46+ string error = 1 ;
47+
48+ // Indicates whether the path in PathExistsRequest exists in the host's filesystem
49+ bool exists = 2 ;
50+ }
2351
24- // present iff success is false
25- api.CmdletError cmdlet_error = 2 ;
52+ message MkdirRequest {
53+ // The path to create in the host's filesystem.
54+ // All special characters allowed by Windows in path names will be allowed
55+ // except for restrictions noted below. For details, please check:
56+ // https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file
57+ // Non-existent parent directories in the path will be automatically created.
58+ // Directories will be created with Read and Write privileges of the Windows
59+ // User account under which csi-proxy is started (typically LocalSystem).
60+ //
61+ // Restrictions:
62+ // Only absolute path (indicated by a drive letter prefix: e.g. "C:\") is accepted.
63+ // Depending on the context parameter of this function, the path prefix needs
64+ // to match the paths specified either as kubelet-csi-plugins-path
65+ // or as kubelet-pod-path parameters of csi-proxy.
66+ // The path parameter cannot already exist in the host's filesystem.
67+ // UNC paths of the form "\\server\share\path\file" are not allowed.
68+ // All directory separators need to be backslash character: "\".
69+ // Characters: .. / : | ? * in the path are not allowed.
70+ // Maximum path length will be capped to 260 characters.
71+ string path = 1 ;
72+
73+ // Context of the path parameter.
74+ // This is used to validate prefix for absolute paths passed
75+ PathContext context = 2 ;
76+ }
77+
78+ message MkdirResponse {
79+ // Error message if any. Empty string indicates success
80+ string error = 1 ;
81+ }
82+
83+ message RmdirRequest {
84+ // The path to remove in the host's filesystem.
85+ // All special characters allowed by Windows in path names will be allowed
86+ // except for restrictions noted below. For details, please check:
87+ // https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file
88+ //
89+ // Restrictions:
90+ // Only absolute path (indicated by a drive letter prefix: e.g. "C:\") is accepted.
91+ // Depending on the context parameter of this function, the path prefix needs
92+ // to match the paths specified either as kubelet-csi-plugins-path
93+ // or as kubelet-pod-path parameters of csi-proxy.
94+ // UNC paths of the form "\\server\share\path\file" are not allowed.
95+ // All directory separators need to be backslash character: "\".
96+ // Characters: .. / : | ? * in the path are not allowed.
97+ // Path cannot be a file of type symlink.
98+ // Maximum path length will be capped to 260 characters.
99+ string path = 1 ;
100+
101+ // Context of the path parameter.
102+ // This is used to validate prefix for absolute paths passed
103+ PathContext context = 2 ;
104+
105+ // Force remove all contents under path (if any).
106+ bool force = 3 ;
107+ }
108+
109+ message RmdirResponse {
110+ // Error message if any. Empty string indicates success
111+ string error = 1 ;
112+ }
113+
114+ message LinkPathRequest {
115+ // The path where the symlink is created in the host's filesystem.
116+ // All special characters allowed by Windows in path names will be allowed
117+ // except for restrictions noted below. For details, please check:
118+ // https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file
119+ //
120+ // Restrictions:
121+ // Only absolute path (indicated by a drive letter prefix: e.g. "C:\") is accepted.
122+ // The path prefix needs needs to match the paths specified as
123+ // kubelet-csi-plugins-path parameter of csi-proxy.
124+ // UNC paths of the form "\\server\share\path\file" are not allowed.
125+ // All directory separators need to be backslash character: "\".
126+ // Characters: .. / : | ? * in the path are not allowed.
127+ // source_path cannot already exist in the host filesystem.
128+ // Maximum path length will be capped to 260 characters.
129+ string source_path = 1 ;
130+
131+ // Target path in the host's filesystem used for the symlink creation.
132+ // All special characters allowed by Windows in path names will be allowed
133+ // except for restrictions noted below. For details, please check:
134+ // https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file
135+ //
136+ // Restrictions:
137+ // Only absolute path (indicated by a drive letter prefix: e.g. "C:\") is accepted.
138+ // The path prefix needs to match the paths specified as
139+ // kubelet-pod-path parameter of csi-proxy.
140+ // UNC paths of the form "\\server\share\path\file" are not allowed.
141+ // All directory separators need to be backslash character: "\".
142+ // Characters: .. / : | ? * in the path are not allowed.
143+ // target_path needs to exist as a directory in the host that is empty.
144+ // target_path cannot be a symbolic link.
145+ // Maximum path length will be capped to 260 characters.
146+ string target_path = 2 ;
147+ }
26148
27- bool exists = 4 ;
149+ message LinkPathResponse {
150+ // Error message if any. Empty string indicates success
151+ string error = 1 ;
28152}
0 commit comments