Documentation ¶
Index ¶
- Variables
- func Run(driver *driver.DiskDriver, cloud cloud.CloudManager, ...)
- type ControllerServer
- func (cs *ControllerServer) ControllerExpandVolume(ctx context.Context, req *csi.ControllerExpandVolumeRequest) (*csi.ControllerExpandVolumeResponse, error)
- func (cs *ControllerServer) ControllerGetCapabilities(ctx context.Context, req *csi.ControllerGetCapabilitiesRequest) (*csi.ControllerGetCapabilitiesResponse, error)
- func (cs *ControllerServer) ControllerGetVolume(ctx context.Context, req *csi.ControllerGetVolumeRequest) (*csi.ControllerGetVolumeResponse, error)
- func (cs *ControllerServer) ControllerPublishVolume(ctx context.Context, req *csi.ControllerPublishVolumeRequest) (..., error)
- func (cs *ControllerServer) ControllerUnpublishVolume(ctx context.Context, req *csi.ControllerUnpublishVolumeRequest) (..., error)
- func (cs *ControllerServer) CreateSnapshot(ctx context.Context, req *csi.CreateSnapshotRequest) (..., error)
- func (cs *ControllerServer) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest) (*csi.CreateVolumeResponse, error)
- func (cs *ControllerServer) DeleteSnapshot(ctx context.Context, req *csi.DeleteSnapshotRequest) (*csi.DeleteSnapshotResponse, error)
- func (cs *ControllerServer) DeleteVolume(ctx context.Context, req *csi.DeleteVolumeRequest) (*csi.DeleteVolumeResponse, error)
- func (cs *ControllerServer) GetCapacity(ctx context.Context, req *csi.GetCapacityRequest) (*csi.GetCapacityResponse, error)
- func (cs *ControllerServer) GetVolumeTopology(volume *service.Volume) []*csi.Topology
- func (cs *ControllerServer) IsValidTopology(volume *service.Volume, requirement *csi.TopologyRequirement) bool
- func (cs *ControllerServer) ListSnapshots(ctx context.Context, req *csi.ListSnapshotsRequest) (*csi.ListSnapshotsResponse, error)
- func (cs *ControllerServer) ListVolumes(ctx context.Context, req *csi.ListVolumesRequest) (*csi.ListVolumesResponse, error)
- func (cs *ControllerServer) PickTopology(requirement *csi.TopologyRequirement) (*driver.Topology, error)
- func (cs *ControllerServer) ValidateVolumeCapabilities(ctx context.Context, req *csi.ValidateVolumeCapabilitiesRequest) (..., error)
- type IdentityServer
- func (d *IdentityServer) GetPluginCapabilities(ctx context.Context, req *csi.GetPluginCapabilitiesRequest) (..., error)
- func (d *IdentityServer) GetPluginInfo(ctx context.Context, req *csi.GetPluginInfoRequest) (*csi.GetPluginInfoResponse, error)
- func (is *IdentityServer) Probe(ctx context.Context, req *csi.ProbeRequest) (*csi.ProbeResponse, error)
- type NodeServer
- func (ns *NodeServer) NodeExpandVolume(ctx context.Context, req *csi.NodeExpandVolumeRequest) (*csi.NodeExpandVolumeResponse, error)
- func (ns *NodeServer) NodeGetCapabilities(ctx context.Context, req *csi.NodeGetCapabilitiesRequest) (..., error)
- func (ns *NodeServer) NodeGetInfo(ctx context.Context, req *csi.NodeGetInfoRequest) (*csi.NodeGetInfoResponse, error)
- func (ns *NodeServer) NodeGetVolumeStats(ctx context.Context, req *csi.NodeGetVolumeStatsRequest) (*csi.NodeGetVolumeStatsResponse, error)
- func (ns *NodeServer) NodePublishVolume(ctx context.Context, req *csi.NodePublishVolumeRequest) (..., error)
- func (ns *NodeServer) NodeStageVolume(ctx context.Context, req *csi.NodeStageVolumeRequest) (*csi.NodeStageVolumeResponse, error)
- func (ns *NodeServer) NodeUnpublishVolume(ctx context.Context, req *csi.NodeUnpublishVolumeRequest) (..., error)
- func (ns *NodeServer) NodeUnstageVolume(ctx context.Context, req *csi.NodeUnstageVolumeRequest) (..., error)
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func Run ¶
func Run(driver *driver.DiskDriver, cloud cloud.CloudManager, mounter *mount.SafeFormatAndMount, endpoint string, retryTimesMax int)
Run Initial and start CSI driver
Types ¶
type ControllerServer ¶
type ControllerServer struct {
// contains filtered or unexported fields
}
func NewControllerServer ¶
func NewControllerServer(d *driver.DiskDriver, c cloud.CloudManager, maxRetry int) *ControllerServer
NewControllerServer Create controller server
func (*ControllerServer) ControllerExpandVolume ¶
func (cs *ControllerServer) ControllerExpandVolume(ctx context.Context, req *csi.ControllerExpandVolumeRequest, ) (*csi.ControllerExpandVolumeResponse, error)
ControllerExpandVolume allows the CO to expand the size of a volume volume id is REQUIRED in csi.ControllerExpandVolumeRequest capacity range is REQUIRED in csi.ControllerExpandVolumeRequest
func (*ControllerServer) ControllerGetCapabilities ¶
func (cs *ControllerServer) ControllerGetCapabilities(ctx context.Context, req *csi.ControllerGetCapabilitiesRequest) (*csi.ControllerGetCapabilitiesResponse, error)
func (*ControllerServer) ControllerGetVolume ¶ added in v1.3.0
func (cs *ControllerServer) ControllerGetVolume(ctx context.Context, req *csi.ControllerGetVolumeRequest) (*csi.ControllerGetVolumeResponse, error)
func (*ControllerServer) ControllerPublishVolume ¶
func (cs *ControllerServer) ControllerPublishVolume(ctx context.Context, req *csi.ControllerPublishVolumeRequest) (*csi. ControllerPublishVolumeResponse, error)
csi.ControllerPublishVolumeRequest: volume id + Required
node id + Required volume capability + Required readonly + Required (This field is NOT provided when requesting in Kubernetes)
func (*ControllerServer) ControllerUnpublishVolume ¶
func (cs *ControllerServer) ControllerUnpublishVolume(ctx context.Context, req *csi.ControllerUnpublishVolumeRequest) (*csi. ControllerUnpublishVolumeResponse, error)
This operation MUST be idempotent csi.ControllerUnpublishVolumeRequest: volume id +Required
func (*ControllerServer) CreateSnapshot ¶
func (cs *ControllerServer) CreateSnapshot(ctx context.Context, req *csi.CreateSnapshotRequest) (*csi. CreateSnapshotResponse, error)
CreateSnapshot allows the CO to create a snapshot. This operation MUST be idempotent. 1. If snapshot successfully cut and ready to use, the plugin MUST reply 0 OK. 2. If an error occurs before a snapshot is cut, the plugin SHOULD reply a corresponding error code. 3. If snapshot successfully cut but still being precessed, the plugin SHOULD return 0 OK and ready_to_use SHOULD be set to false. Source volume id is REQUIRED Snapshot name is REQUIRED
func (*ControllerServer) CreateVolume ¶
func (cs *ControllerServer) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest) (*csi.CreateVolumeResponse, error)
This operation MUST be idempotent This operation MAY create three types of volumes: 1. Empty volumes: CREATE_DELETE_VOLUME 2. Restore volume from snapshot: CREATE_DELETE_VOLUME and CREATE_DELETE_SNAPSHOT 3. Clone volume: CREATE_DELETE_VOLUME and CLONE_VOLUME csi.CreateVolumeRequest: name +Required
capability +Required
func (*ControllerServer) DeleteSnapshot ¶
func (cs *ControllerServer) DeleteSnapshot(ctx context.Context, req *csi.DeleteSnapshotRequest) (*csi.DeleteSnapshotResponse, error)
CreateSnapshot allows the CO to delete a snapshot. This operation MUST be idempotent. Snapshot id is REQUIRED
func (*ControllerServer) DeleteVolume ¶
func (cs *ControllerServer) DeleteVolume(ctx context.Context, req *csi.DeleteVolumeRequest) (*csi.DeleteVolumeResponse, error)
This operation MUST be idempotent volume id is REQUIRED in csi.DeleteVolumeRequest
func (*ControllerServer) GetCapacity ¶
func (cs *ControllerServer) GetCapacity(ctx context.Context, req *csi.GetCapacityRequest) (*csi.GetCapacityResponse, error)
func (*ControllerServer) GetVolumeTopology ¶
func (cs *ControllerServer) GetVolumeTopology(volume *service.Volume) []*csi.Topology
GetVolumeTopology gets csi topology from volume info.
func (*ControllerServer) IsValidTopology ¶
func (cs *ControllerServer) IsValidTopology(volume *service.Volume, requirement *csi.TopologyRequirement) bool
func (*ControllerServer) ListSnapshots ¶
func (cs *ControllerServer) ListSnapshots(ctx context.Context, req *csi.ListSnapshotsRequest) (*csi.ListSnapshotsResponse, error)
func (*ControllerServer) ListVolumes ¶
func (cs *ControllerServer) ListVolumes(ctx context.Context, req *csi.ListVolumesRequest) (*csi.ListVolumesResponse, error)
func (*ControllerServer) PickTopology ¶
func (cs *ControllerServer) PickTopology(requirement *csi.TopologyRequirement) (*driver.Topology, error)
pickAvailabilityZone selects 1 zone given topology requirement. if not found, empty string is returned.
func (*ControllerServer) ValidateVolumeCapabilities ¶
func (cs *ControllerServer) ValidateVolumeCapabilities(ctx context.Context, req *csi.ValidateVolumeCapabilitiesRequest) (*csi. ValidateVolumeCapabilitiesResponse, error)
This operation MUST be idempotent csi.ValidateVolumeCapabilitiesRequest: volume id + Required
volume capability + Required
type IdentityServer ¶
type IdentityServer struct {
// contains filtered or unexported fields
}
func NewIdentityServer ¶
func NewIdentityServer(d *driver.DiskDriver, c cloud.CloudManager) *IdentityServer
NewIdentityServer Create identity server
func (*IdentityServer) GetPluginCapabilities ¶
func (d *IdentityServer) GetPluginCapabilities(ctx context.Context, req *csi.GetPluginCapabilitiesRequest) (*csi. GetPluginCapabilitiesResponse, error)
Get plugin capabilities: CONTROLLER, ACCESSIBILITY, EXPANSION
func (*IdentityServer) GetPluginInfo ¶
func (d *IdentityServer) GetPluginInfo(ctx context.Context, req *csi.GetPluginInfoRequest) (*csi.GetPluginInfoResponse, error)
func (*IdentityServer) Probe ¶
func (is *IdentityServer) Probe(ctx context.Context, req *csi.ProbeRequest) (*csi.ProbeResponse, error)
Plugin MUST implement this RPC call
type NodeServer ¶
type NodeServer struct {
// contains filtered or unexported fields
}
func NewNodeServer ¶
func NewNodeServer(d *driver.DiskDriver, c cloud.CloudManager, mnt *mount.SafeFormatAndMount) *NodeServer
NewNodeServer Create node server
func (*NodeServer) NodeExpandVolume ¶
func (ns *NodeServer) NodeExpandVolume(ctx context.Context, req *csi.NodeExpandVolumeRequest) ( *csi.NodeExpandVolumeResponse, error)
NodeExpandVolume will expand filesystem of volume. Input Parameters:
volume id: REQUIRED volume path: REQUIRED
func (*NodeServer) NodeGetCapabilities ¶
func (ns *NodeServer) NodeGetCapabilities(ctx context.Context, req *csi.NodeGetCapabilitiesRequest) (*csi. NodeGetCapabilitiesResponse, error)
func (*NodeServer) NodeGetInfo ¶
func (ns *NodeServer) NodeGetInfo(ctx context.Context, req *csi.NodeGetInfoRequest) (*csi.NodeGetInfoResponse, error)
func (*NodeServer) NodeGetVolumeStats ¶
func (ns *NodeServer) NodeGetVolumeStats(ctx context.Context, req *csi.NodeGetVolumeStatsRequest) (*csi.NodeGetVolumeStatsResponse, error)
NodeGetVolumeStats Input Arguments:
volume id: REQUIRED volume path: REQUIRED
func (*NodeServer) NodePublishVolume ¶
func (ns *NodeServer) NodePublishVolume(ctx context.Context, req *csi.NodePublishVolumeRequest) (*csi. NodePublishVolumeResponse, error)
This operation MUST be idempotent If the volume corresponding to the volume id has already been published at the specified target path, and is compatible with the specified volume capability and readonly flag, the plugin MUST reply 0 OK. csi.NodePublishVolumeRequest: volume id + Required
target path + Required volume capability + Required read only + Required (This field is NOT provided when requesting in Kubernetes)
func (*NodeServer) NodeStageVolume ¶
func (ns *NodeServer) NodeStageVolume(ctx context.Context, req *csi.NodeStageVolumeRequest) (*csi.NodeStageVolumeResponse, error)
This operation MUST be idempotent csi.NodeStageVolumeRequest: volume id + Required
stage target path + Required volume capability + Required
func (*NodeServer) NodeUnpublishVolume ¶
func (ns *NodeServer) NodeUnpublishVolume(ctx context.Context, req *csi.NodeUnpublishVolumeRequest) (*csi. NodeUnpublishVolumeResponse, error)
csi.NodeUnpublishVolumeRequest: volume id + Required
target path + Required
func (*NodeServer) NodeUnstageVolume ¶
func (ns *NodeServer) NodeUnstageVolume(ctx context.Context, req *csi.NodeUnstageVolumeRequest) (*csi. NodeUnstageVolumeResponse, error)
This operation MUST be idempotent csi.NodeUnstageVolumeRequest: volume id + Required
target path + Required
In block volume mode, the target path is never mounted to so this call will be a no-op