@@ -2,27 +2,156 @@ 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 the path context
24+ PLUGIN = 0 ;
25+ // Indicates the kubelet-pod-path parameter of csi-proxy be used as the path context
26+ CONTAINER = 1 ;
1427}
1528
1629message PathExistsRequest {
17- // The path to check in the host file system.
30+ // The path whose existence we want to check in the host's filesystem
1831 string path = 1 ;
32+
33+ // Context of the path parameter.
34+ // This is used to determine the root for relative path parameters
35+ PathContext context = 2 ;
1936}
2037
2138message PathExistsResponse {
22- bool success = 1 ;
39+ // Error message if any. Empty string indicates success
40+ string error = 1 ;
41+
42+ // Indicates whether the path in PathExistsRequest exists in the host's filesystem
43+ bool exists = 2 ;
44+ }
45+
46+ message MkdirRequest {
47+ // The path to create in the host's filesystem.
48+ // All special characters allowed by Windows in path names will be allowed
49+ // except for restrictions noted below. For details, please check:
50+ // https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file
51+ // Non-existent parent directories in the path will be automatically created.
52+ // Directories will be created with Read and Write privileges of the Windows
53+ // User account under which csi-proxy is started (typically LocalSystem).
54+ //
55+ // Restrictions:
56+ // If an absolute path (indicated by a drive letter prefix: e.g. "C:\") is passed,
57+ // depending on the context parameter of this function, the path prefix needs
58+ // to match the paths specified either as kubelet-csi-plugins-path
59+ // or as kubelet-pod-path parameters of csi-proxy.
60+ // If a relative path is passed, depending on the context parameter of this
61+ // function, the path will be considered relative to the path specified either as
62+ // kubelet-csi-plugins-path or as kubelet-pod-path parameters of csi-proxy.
63+ // The path parameter cannot already exist on host filesystem.
64+ // UNC paths of the form "\\server\share\path\file" are not allowed.
65+ // All directory separators need to be backslash character: "\".
66+ // Characters: .. / : | ? * in the path are not allowed.
67+ // Maximum path length will be capped to 260 characters.
68+ string path = 1 ;
2369
24- // present iff success is false
25- api.CmdletError cmdlet_error = 2 ;
70+ // Context of the path parameter.
71+ // This is used to [1] determine the root for relative path parameters
72+ // or [2] validate prefix for absolute paths (indicated by a drive letter
73+ // prefix: e.g. "C:\")
74+ PathContext context = 2 ;
75+ }
76+
77+ message MkdirResponse {
78+ // Error message if any. Empty string indicates success
79+ string error = 1 ;
80+ }
81+
82+ message RmdirRequest {
83+ // The path to remove in the host's filesystem.
84+ // All special characters allowed by Windows in path names will be allowed
85+ // except for restrictions noted below. For details, please check:
86+ // https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file
87+ //
88+ // Restrictions:
89+ // If an absolute path (indicated by a drive letter prefix: e.g. "C:\") is passed,
90+ // depending on the context parameter of this function, the path prefix needs
91+ // to match the paths specified either as kubelet-csi-plugins-path
92+ // or as kubelet-pod-path parameters of csi-proxy.
93+ // If a relative path is passed, depending on the context parameter of this
94+ // function, the path will be considered relative to the path specified either as
95+ // kubelet-csi-plugins-path or as kubelet-pod-path parameters of csi-proxy.
96+ // UNC paths of the form "\\server\share\path\file" are not allowed.
97+ // All directory separators need to be backslash character: "\".
98+ // Characters: .. / : | ? * in the path are not allowed.
99+ // Path cannot be a file of type symlink.
100+ // Maximum path length will be capped to 260 characters.
101+ string path = 1 ;
102+
103+ // Context of the path creation used for path prefix validation
104+ // This is used to [1] determine the root for relative path parameters
105+ // or [2] validate prefix for absolute paths (indicated by a drive letter
106+ // prefix: e.g. "C:\")
107+ PathContext context = 2 ;
108+ }
109+
110+ message RmdirResponse {
111+ // Error message if any. Empty string indicates success
112+ string error = 1 ;
113+ }
114+
115+ message LinkPathRequest {
116+ // The path where the symlink is created in the host's filesystem.
117+ // All special characters allowed by Windows in path names will be allowed
118+ // except for restrictions noted below. For details, please check:
119+ // https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file
120+ //
121+ // Restrictions:
122+ // If an absolute path (indicated by a drive letter prefix: e.g. "C:\") is passed,
123+ // the path prefix needs to match the path specified as kubelet-csi-plugins-path
124+ // parameter of csi-proxy.
125+ // If a relative path is passed, the path will be considered relative to the
126+ // path specified as 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+ // If an absolute path (indicated by a drive letter prefix: e.g. "C:\") is passed,
141+ // the path prefix needs to match the path specified as kubelet-pod-path
142+ // parameter of csi-proxy.
143+ // If a relative path is passed, the path will be considered relative to the
144+ // path specified as kubelet-pod-path parameter of csi-proxy.
145+ // UNC paths of the form "\\server\share\path\file" are not allowed.
146+ // All directory separators need to be backslash character: "\".
147+ // Characters: .. / : | ? * in the path are not allowed.
148+ // target_path needs to exist as a directory in the host that is empty.
149+ // target_path cannot be a symbolic link.
150+ // Maximum path length will be capped to 260 characters.
151+ string target_path = 2 ;
152+ }
26153
27- bool exists = 4 ;
154+ message LinkPathResponse {
155+ // Error message if any. Empty string indicates success
156+ string error = 1 ;
28157}
0 commit comments