Documentation
¶
Index ¶
- Constants
- Variables
- func GRPCLogger(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, ...) (interface{}, error)
- func NewMounter(log *logrus.Entry) *mounter
- type Mounter
- type NonBlockingGRPCServer
- type UpCloudClient
- func (client *UpCloudClient) CreateStorage(size int, tier, title, zone string) (*UpCloudCreateStorageResp, error)
- func (client *UpCloudClient) DeleteStorage(UUID string) error
- func (client *UpCloudClient) ListServers() (*UpCloudListServerResp, error)
- func (client *UpCloudClient) ListStorages() (*UpCloudListStoragesResp, error)
- func (client *UpCloudClient) ListStoragesWithDetails() (*UpCloudListStoragesResp, error)
- func (client *UpCloudClient) ServerDetail(UUID string) (*UpCloudServerDetailResp, error)
- func (client *UpCloudClient) StorageDetail(UUID string) (*UpCloudListStorageDetailsResp, error)
- func (client *UpCloudClient) StorageOP(serverID, volID, OP string) (*UpCloudStorageOPResp, error)
- type UpCloudControllerServer
- func (c *UpCloudControllerServer) ControllerExpandVolume(context.Context, *csi.ControllerExpandVolumeRequest) (*csi.ControllerExpandVolumeResponse, error)
- func (c *UpCloudControllerServer) ControllerGetCapabilities(context.Context, *csi.ControllerGetCapabilitiesRequest) (*csi.ControllerGetCapabilitiesResponse, error)
- func (c *UpCloudControllerServer) ControllerGetVolume(ctx context.Context, request *csi.ControllerGetVolumeRequest) (*csi.ControllerGetVolumeResponse, error)
- func (c *UpCloudControllerServer) ControllerPublishVolume(ctx context.Context, req *csi.ControllerPublishVolumeRequest) (*csi.ControllerPublishVolumeResponse, error)
- func (c *UpCloudControllerServer) ControllerUnpublishVolume(ctx context.Context, req *csi.ControllerUnpublishVolumeRequest) (*csi.ControllerUnpublishVolumeResponse, error)
- func (c *UpCloudControllerServer) CreateSnapshot(context.Context, *csi.CreateSnapshotRequest) (*csi.CreateSnapshotResponse, error)
- func (c *UpCloudControllerServer) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest) (*csi.CreateVolumeResponse, error)
- func (c *UpCloudControllerServer) DeleteSnapshot(context.Context, *csi.DeleteSnapshotRequest) (*csi.DeleteSnapshotResponse, error)
- func (c *UpCloudControllerServer) DeleteVolume(ctx context.Context, req *csi.DeleteVolumeRequest) (*csi.DeleteVolumeResponse, error)
- func (c *UpCloudControllerServer) GetCapacity(context.Context, *csi.GetCapacityRequest) (*csi.GetCapacityResponse, error)
- func (c *UpCloudControllerServer) ListSnapshots(context.Context, *csi.ListSnapshotsRequest) (*csi.ListSnapshotsResponse, error)
- func (c *UpCloudControllerServer) ListVolumes(ctx context.Context, req *csi.ListVolumesRequest) (*csi.ListVolumesResponse, error)
- func (c *UpCloudControllerServer) ValidateVolumeCapabilities(ctx context.Context, req *csi.ValidateVolumeCapabilitiesRequest) (*csi.ValidateVolumeCapabilitiesResponse, error)
- type UpCloudCreateStorageResp
- type UpCloudDriver
- type UpCloudIdentityServer
- func (upCloudIdentity *UpCloudIdentityServer) GetPluginCapabilities(_ context.Context, req *csi.GetPluginCapabilitiesRequest) (*csi.GetPluginCapabilitiesResponse, error)
- func (upCloudIdentity *UpCloudIdentityServer) GetPluginInfo(context.Context, *csi.GetPluginInfoRequest) (*csi.GetPluginInfoResponse, error)
- func (upCloudIdentity *UpCloudIdentityServer) Probe(_ context.Context, req *csi.ProbeRequest) (*csi.ProbeResponse, error)
- type UpCloudListServerResp
- type UpCloudListStorageDetailsResp
- type UpCloudListStoragesResp
- type UpCloudNodeServer
- func (n *UpCloudNodeServer) NodeExpandVolume(context.Context, *csi.NodeExpandVolumeRequest) (*csi.NodeExpandVolumeResponse, error)
- func (n *UpCloudNodeServer) NodeGetCapabilities(context.Context, *csi.NodeGetCapabilitiesRequest) (*csi.NodeGetCapabilitiesResponse, error)
- func (n *UpCloudNodeServer) NodeGetInfo(ctx context.Context, req *csi.NodeGetInfoRequest) (*csi.NodeGetInfoResponse, error)
- func (n *UpCloudNodeServer) NodeGetVolumeStats(context.Context, *csi.NodeGetVolumeStatsRequest) (*csi.NodeGetVolumeStatsResponse, error)
- func (n *UpCloudNodeServer) NodePublishVolume(ctx context.Context, req *csi.NodePublishVolumeRequest) (*csi.NodePublishVolumeResponse, error)
- func (n *UpCloudNodeServer) NodeStageVolume(ctx context.Context, req *csi.NodeStageVolumeRequest) (*csi.NodeStageVolumeResponse, error)
- func (n *UpCloudNodeServer) NodeUnpublishVolume(ctx context.Context, req *csi.NodeUnpublishVolumeRequest) (*csi.NodeUnpublishVolumeResponse, error)
- func (n *UpCloudNodeServer) NodeUnstageVolume(ctx context.Context, req *csi.NodeUnstageVolumeRequest) (*csi.NodeUnstageVolumeResponse, error)
- type UpCloudServerDetailResp
- type UpCloudStorageOPResp
Constants ¶
View Source
const (
DefaultDriverName = "block.csi.upcloud.com"
)
Variables ¶
View Source
var UpCloudApiEndpoint = "https://api.upcloud.com"
View Source
var UpCloudApiVersion = "1.3"
Functions ¶
func GRPCLogger ¶
func GRPCLogger(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)
GRPCLogger provides better error handling for gRPC calls
func NewMounter ¶
Types ¶
type NonBlockingGRPCServer ¶
type NonBlockingGRPCServer interface { // Start services at the endpoint Start(endpoint string, ids csi.IdentityServer, cs csi.ControllerServer, ns csi.NodeServer) // Waits for the service to stop Wait() // Stops the service gracefully Stop() // Stops the service forcefully ForceStop() }
Defines Non blocking GRPC server interfaces
func NewNonBlockingGRPCServer ¶
func NewNonBlockingGRPCServer() NonBlockingGRPCServer
type UpCloudClient ¶
type UpCloudClient struct {
// contains filtered or unexported fields
}
func NewUpCloudClient ¶
func NewUpCloudClient(token string) *UpCloudClient
func (*UpCloudClient) CreateStorage ¶
func (client *UpCloudClient) CreateStorage(size int, tier, title, zone string) (*UpCloudCreateStorageResp, error)
func (*UpCloudClient) DeleteStorage ¶
func (client *UpCloudClient) DeleteStorage(UUID string) error
func (*UpCloudClient) ListServers ¶
func (client *UpCloudClient) ListServers() (*UpCloudListServerResp, error)
func (*UpCloudClient) ListStorages ¶
func (client *UpCloudClient) ListStorages() (*UpCloudListStoragesResp, error)
func (*UpCloudClient) ListStoragesWithDetails ¶
func (client *UpCloudClient) ListStoragesWithDetails() (*UpCloudListStoragesResp, error)
func (*UpCloudClient) ServerDetail ¶
func (client *UpCloudClient) ServerDetail(UUID string) (*UpCloudServerDetailResp, error)
func (*UpCloudClient) StorageDetail ¶
func (client *UpCloudClient) StorageDetail(UUID string) (*UpCloudListStorageDetailsResp, error)
func (*UpCloudClient) StorageOP ¶
func (client *UpCloudClient) StorageOP(serverID, volID, OP string) (*UpCloudStorageOPResp, error)
type UpCloudControllerServer ¶
type UpCloudControllerServer struct {
Driver *UpCloudDriver
}
func NewUpCloudControllerServer ¶
func NewUpCloudControllerServer(driver *UpCloudDriver) *UpCloudControllerServer
func (*UpCloudControllerServer) ControllerExpandVolume ¶
func (c *UpCloudControllerServer) ControllerExpandVolume(context.Context, *csi.ControllerExpandVolumeRequest) (*csi.ControllerExpandVolumeResponse, error)
func (*UpCloudControllerServer) ControllerGetCapabilities ¶
func (c *UpCloudControllerServer) ControllerGetCapabilities(context.Context, *csi.ControllerGetCapabilitiesRequest) (*csi.ControllerGetCapabilitiesResponse, error)
ControllerGetCapabilities get capabilities of the controller
func (*UpCloudControllerServer) ControllerGetVolume ¶
func (c *UpCloudControllerServer) ControllerGetVolume(ctx context.Context, request *csi.ControllerGetVolumeRequest) (*csi.ControllerGetVolumeResponse, error)
This relates to being able to get health checks on a PV. We do not have this
func (*UpCloudControllerServer) ControllerPublishVolume ¶
func (c *UpCloudControllerServer) ControllerPublishVolume(ctx context.Context, req *csi.ControllerPublishVolumeRequest) (*csi.ControllerPublishVolumeResponse, error)
func (*UpCloudControllerServer) ControllerUnpublishVolume ¶
func (c *UpCloudControllerServer) ControllerUnpublishVolume(ctx context.Context, req *csi.ControllerUnpublishVolumeRequest) (*csi.ControllerUnpublishVolumeResponse, error)
func (*UpCloudControllerServer) CreateSnapshot ¶
func (c *UpCloudControllerServer) CreateSnapshot(context.Context, *csi.CreateSnapshotRequest) (*csi.CreateSnapshotResponse, error)
func (*UpCloudControllerServer) CreateVolume ¶
func (c *UpCloudControllerServer) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest) (*csi.CreateVolumeResponse, error)
CreateVolume provisions a new volume on behalf of the user
func (*UpCloudControllerServer) DeleteSnapshot ¶
func (c *UpCloudControllerServer) DeleteSnapshot(context.Context, *csi.DeleteSnapshotRequest) (*csi.DeleteSnapshotResponse, error)
func (*UpCloudControllerServer) DeleteVolume ¶
func (c *UpCloudControllerServer) DeleteVolume(ctx context.Context, req *csi.DeleteVolumeRequest) (*csi.DeleteVolumeResponse, error)
func (*UpCloudControllerServer) GetCapacity ¶
func (c *UpCloudControllerServer) GetCapacity(context.Context, *csi.GetCapacityRequest) (*csi.GetCapacityResponse, error)
func (*UpCloudControllerServer) ListSnapshots ¶
func (c *UpCloudControllerServer) ListSnapshots(context.Context, *csi.ListSnapshotsRequest) (*csi.ListSnapshotsResponse, error)
func (*UpCloudControllerServer) ListVolumes ¶
func (c *UpCloudControllerServer) ListVolumes(ctx context.Context, req *csi.ListVolumesRequest) (*csi.ListVolumesResponse, error)
func (*UpCloudControllerServer) ValidateVolumeCapabilities ¶
func (c *UpCloudControllerServer) ValidateVolumeCapabilities(ctx context.Context, req *csi.ValidateVolumeCapabilitiesRequest) (*csi.ValidateVolumeCapabilitiesResponse, error)
ValidateVolumeCapabilities checks if requested capabilities are supported
type UpCloudCreateStorageResp ¶
type UpCloudCreateStorageResp struct { Storage struct { Access string `json:"access"` BackupRule struct { } `json:"backup_rule"` Backups struct { Backup []interface{} `json:"backup"` } `json:"backups"` Created time.Time `json:"created"` License int `json:"license"` Servers struct { Server []interface{} `json:"server"` } `json:"servers"` Size int `json:"size"` State string `json:"state"` Tier string `json:"tier"` Title string `json:"title"` Type string `json:"type"` UUID string `json:"uuid"` Zone string `json:"zone"` } `json:"storage"` }
type UpCloudDriver ¶
type UpCloudDriver struct {
// contains filtered or unexported fields
}
UpCloudDriver struct
func NewDriver ¶
func NewDriver(endpoint, token, driverName, version, userAgent string, isController bool) (*UpCloudDriver, error)
func (*UpCloudDriver) Run ¶
func (d *UpCloudDriver) Run()
type UpCloudIdentityServer ¶
type UpCloudIdentityServer struct {
Driver *UpCloudDriver
}
UpCloudIdentityServer
func NewUpCloudIdentityServer ¶
func NewUpCloudIdentityServer(driver *UpCloudDriver) *UpCloudIdentityServer
func (*UpCloudIdentityServer) GetPluginCapabilities ¶
func (upCloudIdentity *UpCloudIdentityServer) GetPluginCapabilities(_ context.Context, req *csi.GetPluginCapabilitiesRequest) (*csi.GetPluginCapabilitiesResponse, error)
GetPluginCapabilities returns plugins available capabilities
func (*UpCloudIdentityServer) GetPluginInfo ¶
func (upCloudIdentity *UpCloudIdentityServer) GetPluginInfo(context.Context, *csi.GetPluginInfoRequest) (*csi.GetPluginInfoResponse, error)
GetPluginInfo returns basic plugin data
func (*UpCloudIdentityServer) Probe ¶
func (upCloudIdentity *UpCloudIdentityServer) Probe(_ context.Context, req *csi.ProbeRequest) (*csi.ProbeResponse, error)
type UpCloudListServerResp ¶
type UpCloudListServerResp struct { Servers struct { Server []struct { CoreNumber string `json:"core_number"` Hostname string `json:"hostname"` License int `json:"license"` MemoryAmount string `json:"memory_amount"` Plan string `json:"plan"` PlanIvp4Bytes string `json:"plan_ivp4_bytes,omitempty"` PlanIpv6Bytes string `json:"plan_ipv6_bytes,omitempty"` State string `json:"state"` Tags struct { Tag []string `json:"tag"` } `json:"tags"` Title string `json:"title"` UUID string `json:"uuid"` Zone string `json:"zone"` } `json:"server"` } `json:"servers"` }
type UpCloudListStorageDetailsResp ¶
type UpCloudListStorageDetailsResp struct { Storage struct { Access string `json:"access"` License int `json:"license"` Servers struct { Server []string `json:"server"` } `json:"servers"` Size int `json:"size"` State string `json:"state"` Tier string `json:"tier"` Title string `json:"title"` Type string `json:"type"` UUID string `json:"uuid"` Zone string `json:"zone"` } `json:"storage"` }
type UpCloudListStoragesResp ¶
type UpCloudListStoragesResp struct { Storages struct { Storage []struct { Access string `json:"access"` Created time.Time `json:"created"` License int `json:"license"` Size int `json:"size"` State string `json:"state"` Tier string `json:"tier"` Title string `json:"title"` Type string `json:"type"` UUID string `json:"uuid"` Zone string `json:"zone"` PartOfPlan string `json:"part_of_plan,omitempty"` Details *UpCloudListStorageDetailsResp } `json:"storage"` } `json:"storages"` }
type UpCloudNodeServer ¶
type UpCloudNodeServer struct {
Driver *UpCloudDriver
}
func NewUpCloudNodeDriver ¶
func NewUpCloudNodeDriver(driver *UpCloudDriver) *UpCloudNodeServer
func (*UpCloudNodeServer) NodeExpandVolume ¶
func (n *UpCloudNodeServer) NodeExpandVolume(context.Context, *csi.NodeExpandVolumeRequest) (*csi.NodeExpandVolumeResponse, error)
func (*UpCloudNodeServer) NodeGetCapabilities ¶
func (n *UpCloudNodeServer) NodeGetCapabilities(context.Context, *csi.NodeGetCapabilitiesRequest) (*csi.NodeGetCapabilitiesResponse, error)
func (*UpCloudNodeServer) NodeGetInfo ¶
func (n *UpCloudNodeServer) NodeGetInfo(ctx context.Context, req *csi.NodeGetInfoRequest) (*csi.NodeGetInfoResponse, error)
func (*UpCloudNodeServer) NodeGetVolumeStats ¶
func (n *UpCloudNodeServer) NodeGetVolumeStats(context.Context, *csi.NodeGetVolumeStatsRequest) (*csi.NodeGetVolumeStatsResponse, error)
func (*UpCloudNodeServer) NodePublishVolume ¶
func (n *UpCloudNodeServer) NodePublishVolume(ctx context.Context, req *csi.NodePublishVolumeRequest) (*csi.NodePublishVolumeResponse, error)
func (*UpCloudNodeServer) NodeStageVolume ¶
func (n *UpCloudNodeServer) NodeStageVolume(ctx context.Context, req *csi.NodeStageVolumeRequest) (*csi.NodeStageVolumeResponse, error)
func (*UpCloudNodeServer) NodeUnpublishVolume ¶
func (n *UpCloudNodeServer) NodeUnpublishVolume(ctx context.Context, req *csi.NodeUnpublishVolumeRequest) (*csi.NodeUnpublishVolumeResponse, error)
func (*UpCloudNodeServer) NodeUnstageVolume ¶
func (n *UpCloudNodeServer) NodeUnstageVolume(ctx context.Context, req *csi.NodeUnstageVolumeRequest) (*csi.NodeUnstageVolumeResponse, error)
type UpCloudServerDetailResp ¶
type UpCloudServerDetailResp struct { Server struct { BootOrder string `json:"boot_order"` CoreNumber string `json:"core_number"` Firewall string `json:"firewall"` Host int64 `json:"host"` Hostname string `json:"hostname"` IPAddresses struct { IPAddress []struct { Access string `json:"access"` Address string `json:"address"` Family string `json:"family"` } `json:"ip_address"` } `json:"ip_addresses"` License int `json:"license"` MemoryAmount string `json:"memory_amount"` Networking struct { Interfaces struct { Interface []struct { Index int `json:"index"` IPAddresses struct { IPAddress []struct { Address string `json:"address"` Family string `json:"family"` Floating string `json:"floating"` } `json:"ip_address"` } `json:"ip_addresses"` Mac string `json:"mac"` Network string `json:"network"` Type string `json:"type"` Bootable string `json:"bootable"` } `json:"interface"` } `json:"interfaces"` } `json:"networking"` NicModel string `json:"nic_model"` Plan string `json:"plan"` PlanIpv4Bytes string `json:"plan_ipv4_bytes"` PlanIpv6Bytes string `json:"plan_ipv6_bytes"` SimpleBackup string `json:"simple_backup"` State string `json:"state"` StorageDevices struct { StorageDevice []struct { Address string `json:"address"` PartOfPlan string `json:"part_of_plan"` Storage string `json:"storage"` StorageSize int `json:"storage_size"` StorageTier string `json:"storage_tier"` StorageTitle string `json:"storage_title"` Type string `json:"type"` BootDisk string `json:"boot_disk"` } `json:"storage_device"` } `json:"storage_devices"` Tags struct { Tag []string `json:"tag"` } `json:"tags"` Timezone string `json:"timezone"` Title string `json:"title"` UUID string `json:"uuid"` VideoModel string `json:"video_model"` RemoteAccessEnabled string `json:"remote_access_enabled"` RemoteAccessType string `json:"remote_access_type"` RemoteAccessHost string `json:"remote_access_host"` RemoteAccessPassword string `json:"remote_access_password"` RemoteAccessPort string `json:"remote_access_port"` Zone string `json:"zone"` } `json:"server"` }
type UpCloudStorageOPResp ¶
type UpCloudStorageOPResp struct { Server struct { BootOrder string `json:"boot_order"` CoreNumber string `json:"core_number"` Created int `json:"created"` Firewall string `json:"firewall"` Host int64 `json:"host"` Hostname string `json:"hostname"` IPAddresses struct { IPAddress []struct { Access string `json:"access"` Address string `json:"address"` Family string `json:"family"` PartOfPlan string `json:"part_of_plan,omitempty"` } `json:"ip_address"` } `json:"ip_addresses"` License int `json:"license"` MemoryAmount string `json:"memory_amount"` Metadata string `json:"metadata"` Networking struct { Interfaces struct { Interface []struct { Bootable string `json:"bootable"` Index int `json:"index"` IPAddresses struct { IPAddress []struct { Address string `json:"address"` Family string `json:"family"` Floating string `json:"floating"` } `json:"ip_address"` } `json:"ip_addresses"` Mac string `json:"mac"` Network string `json:"network"` SourceIPFiltering string `json:"source_ip_filtering"` Type string `json:"type"` } `json:"interface"` } `json:"interfaces"` } `json:"networking"` NicModel string `json:"nic_model"` Plan string `json:"plan"` PlanIpv4Bytes string `json:"plan_ipv4_bytes"` PlanIpv6Bytes string `json:"plan_ipv6_bytes"` RemoteAccessEnabled string `json:"remote_access_enabled"` RemoteAccessPassword string `json:"remote_access_password"` RemoteAccessType string `json:"remote_access_type"` SimpleBackup string `json:"simple_backup"` State string `json:"state"` StorageDevices struct { StorageDevice []struct { Address string `json:"address"` BootDisk string `json:"boot_disk"` PartOfPlan string `json:"part_of_plan,omitempty"` Storage string `json:"storage"` StorageSize int `json:"storage_size"` StorageTier string `json:"storage_tier"` StorageTitle string `json:"storage_title"` Type string `json:"type"` } `json:"storage_device"` } `json:"storage_devices"` Tags struct { Tag []interface{} `json:"tag"` } `json:"tags"` Timezone string `json:"timezone"` Title string `json:"title"` UUID string `json:"uuid"` VideoModel string `json:"video_model"` Zone string `json:"zone"` } `json:"server"` }
Click to show internal directories.
Click to hide internal directories.