csi

package
v19.10.1+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 21, 2020 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Version           = "1.1"
	Provisioner       = "csi.trident.netapp.io"
	LegacyProvisioner = "netapp.io/trident"

	// CSI supported features
	CSIBlockVolumes  helpers.Feature = "CSI_BLOCK_VOLUMES"
	ExpandCSIVolumes helpers.Feature = "EXPAND_CSI_VOLUMES"
)
View Source
const (
	CSIController = "controller"
	CSINode       = "node"
	CSIAllInOne   = "allInOne"
)

Variables

This section is empty.

Functions

func ParseEndpoint

func ParseEndpoint(ep string) (string, string, error)

Types

type ListNodesResponse

type ListNodesResponse struct {
	Nodes []string `json:"nodes"`
	Error string   `json:"error,omitempty"`
}

type NonBlockingGRPCServer

type NonBlockingGRPCServer interface {
	// Start services at the endpoint
	Start(endpoint string, ids csi.IdentityServer, cs csi.ControllerServer, ns csi.NodeServer)
	// GracefulStop Stops the service gracefully
	GracefulStop()
	// Stops the service forcefully
	Stop()
}

NonBlockingGRPCServer Defines Non blocking GRPC server interfaces

func NewNonBlockingGRPCServer

func NewNonBlockingGRPCServer() NonBlockingGRPCServer

type Plugin

type Plugin struct {
	// contains filtered or unexported fields
}

func NewAllInOnePlugin

func NewAllInOnePlugin(
	nodeName, endpoint, caCert, clientCert, clientKey string,
	orchestrator core.Orchestrator, helper *helpers.HybridPlugin,
) (*Plugin, error)

The NewAllInOnePlugin is required to support the CSI Sanity test suite. CSI Sanity expects a single process to respond to controller, node, and identity interfaces.

func NewControllerPlugin

func NewControllerPlugin(
	nodeName, endpoint string, orchestrator core.Orchestrator, helper *helpers.HybridPlugin,
) (*Plugin, error)

func NewNodePlugin

func NewNodePlugin(
	nodeName, endpoint, caCert, clientCert, clientKey string, orchestrator core.Orchestrator,
) (*Plugin, error)

func (*Plugin) Activate

func (p *Plugin) Activate() error

func (*Plugin) ControllerExpandVolume

func (p *Plugin) ControllerExpandVolume(
	ctx context.Context, req *csi.ControllerExpandVolumeRequest,
) (*csi.ControllerExpandVolumeResponse, error)

func (*Plugin) ControllerPublishVolume

func (*Plugin) CreateSnapshot

func (p *Plugin) CreateSnapshot(
	ctx context.Context, req *csi.CreateSnapshotRequest,
) (*csi.CreateSnapshotResponse, error)

func (*Plugin) CreateVolume

func (p *Plugin) CreateVolume(
	ctx context.Context, req *csi.CreateVolumeRequest,
) (*csi.CreateVolumeResponse, error)

func (*Plugin) Deactivate

func (p *Plugin) Deactivate() error

func (*Plugin) DeleteSnapshot

func (p *Plugin) DeleteSnapshot(
	ctx context.Context, req *csi.DeleteSnapshotRequest,
) (*csi.DeleteSnapshotResponse, error)

func (*Plugin) DeleteVolume

func (p *Plugin) DeleteVolume(
	ctx context.Context, req *csi.DeleteVolumeRequest,
) (*csi.DeleteVolumeResponse, error)

func (*Plugin) GetCapacity

func (p *Plugin) GetCapacity(
	ctx context.Context, req *csi.GetCapacityRequest,
) (*csi.GetCapacityResponse, error)

func (*Plugin) GetName

func (p *Plugin) GetName() string

func (*Plugin) GetPluginCapabilities

func (p *Plugin) GetPluginCapabilities(
	ctx context.Context, req *csi.GetPluginCapabilitiesRequest,
) (*csi.GetPluginCapabilitiesResponse, error)

func (*Plugin) GetPluginInfo

func (p *Plugin) GetPluginInfo(
	ctx context.Context, req *csi.GetPluginInfoRequest,
) (*csi.GetPluginInfoResponse, error)

func (*Plugin) ListSnapshots

func (p *Plugin) ListSnapshots(
	ctx context.Context, req *csi.ListSnapshotsRequest,
) (*csi.ListSnapshotsResponse, error)

func (*Plugin) ListVolumes

func (p *Plugin) ListVolumes(
	ctx context.Context, req *csi.ListVolumesRequest,
) (*csi.ListVolumesResponse, error)

func (*Plugin) NodeExpandVolume

func (p *Plugin) NodeExpandVolume(
	ctx context.Context, req *csi.NodeExpandVolumeRequest,
) (*csi.NodeExpandVolumeResponse, error)

The CO only calls NodeExpandVolume for the Block protocol as the filesystem has to be mounted to perform the resize. This is enforced in our ControllerExpandVolume method where we return true for nodeExpansionRequired when the protocol is Block and return false when the protocol is file.

func (*Plugin) NodeGetCapabilities

func (p *Plugin) NodeGetCapabilities(
	ctx context.Context, req *csi.NodeGetCapabilitiesRequest,
) (*csi.NodeGetCapabilitiesResponse, error)

func (*Plugin) NodeGetInfo

func (p *Plugin) NodeGetInfo(
	ctx context.Context, req *csi.NodeGetInfoRequest,
) (*csi.NodeGetInfoResponse, error)

func (*Plugin) NodeGetVolumeStats

func (p *Plugin) NodeGetVolumeStats(
	ctx context.Context, req *csi.NodeGetVolumeStatsRequest,
) (*csi.NodeGetVolumeStatsResponse, error)

func (*Plugin) NodePublishVolume

func (p *Plugin) NodePublishVolume(
	ctx context.Context, req *csi.NodePublishVolumeRequest,
) (*csi.NodePublishVolumeResponse, error)

func (*Plugin) NodeStageVolume

func (p *Plugin) NodeStageVolume(
	ctx context.Context, req *csi.NodeStageVolumeRequest,
) (*csi.NodeStageVolumeResponse, error)

func (*Plugin) NodeUnpublishVolume

func (p *Plugin) NodeUnpublishVolume(
	ctx context.Context, req *csi.NodeUnpublishVolumeRequest,
) (*csi.NodeUnpublishVolumeResponse, error)

func (*Plugin) NodeUnstageVolume

func (p *Plugin) NodeUnstageVolume(
	ctx context.Context, req *csi.NodeUnstageVolumeRequest,
) (*csi.NodeUnstageVolumeResponse, error)

func (*Plugin) Probe

func (p *Plugin) Probe(
	ctx context.Context, req *csi.ProbeRequest,
) (*csi.ProbeResponse, error)

func (*Plugin) Version

func (p *Plugin) Version() string

type RequestHandler

type RequestHandler interface {
	GetVolumeId() string
	GetStagingTargetPath() string
}

type RestClient

type RestClient struct {
	// contains filtered or unexported fields
}

func CreateTLSRestClient

func CreateTLSRestClient(url, caFile, certFile, keyFile string) (*RestClient, error)

func (*RestClient) CreateNode

func (c *RestClient) CreateNode(node *utils.Node) error

CreateNode registers the node with the CSI controller server

func (*RestClient) DeleteNode

func (c *RestClient) DeleteNode(name string) error

DeleteNode deregisters the node with the CSI controller server

func (*RestClient) GetNodes

func (c *RestClient) GetNodes() ([]string, error)

GetNodes returns a list of nodes registered with the controller

func (*RestClient) InvokeAPI

func (c *RestClient) InvokeAPI(requestBody []byte, method string, resourcePath string) (*http.Response, []byte, error)

InvokeAPI makes a REST call to the CSI Controller REST endpoint. The body must be a marshaled JSON byte array ( or nil). The method is the HTTP verb (i.e. GET, POST, ...). The resource path is appended to the base URL to identify the desired server resource; it should start with '/'.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL