1
+ // Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License"). You may
4
+ // not use this file except in compliance with the License. A copy of the
5
+ // License is located at
6
+ //
7
+ // http://aws.amazon.com/apache2.0/
8
+ //
9
+ // or in the "license" file accompanying this file. This file is distributed
10
+ // on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
11
+ // express or implied. See the License for the specific language governing
12
+ // permissions and limitations under the License.
13
+
1
14
package csiclient
2
15
3
16
import (
@@ -18,13 +31,21 @@ const (
18
31
PROTOCOL = "unix"
19
32
)
20
33
34
+ // CSIClient is an interface that specifies all supported operations in the Container Storage Interface(CSI)
35
+ // driver for Agent uses. The CSI driver provides many volume related operations to manage the lifecycle of
36
+ // Amazon EBS volumes, including mounting, umounting, resizing and volume stats.
37
+ type CSIClient interface {
38
+ GetVolumeMetrics (volumeId string , hostMountPath string ) (* Metrics , error )
39
+ }
40
+
21
41
// csiClient encapsulates all CSI methods.
22
42
type csiClient struct {
23
43
csiSocket string
24
44
}
25
45
26
- func NewCSIClient (socketIn string ) csiClient {
27
- return csiClient {csiSocket : socketIn }
46
+ // NewCSIClient creates a CSI client for the communication with CSI driver daemon.
47
+ func NewCSIClient (socketIn string ) CSIClient {
48
+ return & csiClient {csiSocket : socketIn }
28
49
}
29
50
30
51
// GetVolumeMetrics returns volume usage.
0 commit comments