Documentation ¶
Overview ¶
Example (Error) ¶
package main import ( "context" "fmt" "net/url" "github.com/LINBIT/golinstor/client" log "github.com/sirupsen/logrus" ) func main() { ctx := context.TODO() u, err := url.Parse("http://controller:3370") if err != nil { log.Fatal(err) } c, err := client.NewClient(client.BaseURL(u), client.Log(log.StandardLogger())) if err != nil { log.Fatal(err) } rs, err := c.Resources.GetAll(ctx, "foo") if errs, ok := err.(client.ApiCallError); ok { log.Error("A LINSTOR API error occurred:") for i, e := range errs { log.Errorf(" Message #%d:", i) log.Errorf(" Code: %d", e.RetCode) log.Errorf(" Message: %s", e.Message) log.Errorf(" Cause: %s", e.Cause) log.Errorf(" Details: %s", e.Details) log.Errorf(" Correction: %s", e.Correction) log.Errorf(" Error Reports: %v", e.ErrorReportIds) } return } if err != nil { log.Fatalf("Some other error occurred: %s", err.Error()) } for _, r := range rs { fmt.Printf("Resource with name '%s' on node with name '%s'\n", r.Name, r.NodeName) } }
Output:
Example (Events) ¶
package main import ( "context" "fmt" "net/url" "github.com/LINBIT/golinstor/client" log "github.com/sirupsen/logrus" ) func main() { ctx := context.TODO() u, err := url.Parse("http://controller:3370") if err != nil { log.Fatal(err) } c, err := client.NewClient(client.BaseURL(u)) if err != nil { log.Fatal(err) } mayPromoteStream, err := c.Events.DRBDPromotion(ctx, "") if err != nil { log.Fatal(err) } defer mayPromoteStream.Close() for ev := range mayPromoteStream.Events { fmt.Printf("Resource '%s' on node with name '%s' may promote: %t\n", ev.ResourceName, ev.NodeName, ev.MayPromote) } }
Output:
Example (Https) ¶
package main import ( "context" "crypto/tls" "fmt" "net/http" "net/url" "github.com/LINBIT/golinstor/client" log "github.com/sirupsen/logrus" ) func main() { ctx := context.TODO() u, err := url.Parse("https://controller:3371") if err != nil { log.Fatal(err) } // Be careful if that is really what you want! trSkipVerify := &http.Transport{ TLSClientConfig: &tls.Config{ InsecureSkipVerify: true, }, } httpClient := &http.Client{ Transport: trSkipVerify, } c, err := client.NewClient(client.BaseURL(u), client.HTTPClient(httpClient)) if err != nil { log.Fatal(err) } rs, err := c.Resources.GetAll(ctx, "foo") if err != nil { log.Fatal(err) } for _, r := range rs { fmt.Printf("Resource with name '%s' on node with name '%s'\n", r.Name, r.NodeName) } }
Output:
Example (Httpsauth) ¶
package main import ( "context" "crypto/tls" "fmt" "net/http" "net/url" "github.com/LINBIT/golinstor/client" log "github.com/sirupsen/logrus" ) func main() { ctx := context.TODO() u, err := url.Parse("https://controller:3371") if err != nil { log.Fatal(err) } // Be careful if that is really what you want! trSkipVerify := &http.Transport{ TLSClientConfig: &tls.Config{ InsecureSkipVerify: true, }, } httpClient := &http.Client{ Transport: trSkipVerify, } c, err := client.NewClient(client.BaseURL(u), client.HTTPClient(httpClient), client.BasicAuth(&client.BasicAuthCfg{Username: "Username", Password: "Password"})) if err != nil { log.Fatal(err) } rs, err := c.Resources.GetAll(ctx, "foo") if err != nil { log.Fatal(err) } for _, r := range rs { fmt.Printf("Resource with name '%s' on node with name '%s'\n", r.Name, r.NodeName) } }
Output:
Example (MultipleControllers) ¶
package main import ( "context" "fmt" "github.com/LINBIT/golinstor/client" log "github.com/sirupsen/logrus" ) func main() { ctx := context.TODO() controllers := []string{"alfa:3370", "bravo:3370", "charlie:3370"} c, err := client.NewClient(client.Controllers(controllers)) if err != nil { log.Fatal(err) } // This call will try each of the controllers and use the first one that responds version, err := c.Controller.GetVersion(ctx) if err != nil { log.Fatal(err) } fmt.Printf("Controller Version: %v", version) }
Output:
Example (Simple) ¶
package main import ( "context" "fmt" "net/url" "github.com/LINBIT/golinstor/client" log "github.com/sirupsen/logrus" ) func main() { ctx := context.TODO() u, err := url.Parse("http://controller:3370") if err != nil { log.Fatal(err) } c, err := client.NewClient(client.BaseURL(u), client.Log(log.StandardLogger())) if err != nil { log.Fatal(err) } rs, err := c.Resources.GetAll(ctx, "foo") if err != nil { log.Fatal(err) } for _, r := range rs { fmt.Printf("Resource with name '%s' on node with name '%s'\n", r.Name, r.NodeName) } }
Output:
Index ¶
- Constants
- func IsApiCallError(err error, mask uint64) bool
- type ApiCallError
- type ApiCallRc
- type AutoPlaceRequest
- type AutoSelectFilter
- type BCacheResource
- type BCacheVolume
- type Backup
- type BackupAbortRequest
- type BackupCreate
- type BackupDeleteOpts
- type BackupInfo
- type BackupInfoRequest
- type BackupInfoStorPool
- type BackupInfoVolume
- type BackupList
- type BackupOther
- type BackupProvider
- type BackupRestoreRequest
- type BackupS3
- type BackupService
- func (b *BackupService) Abort(ctx context.Context, remoteName string, request BackupAbortRequest) error
- func (b *BackupService) Create(ctx context.Context, remoteName string, request BackupCreate) (string, error)
- func (b *BackupService) DeleteAll(ctx context.Context, remoteName string, filter BackupDeleteOpts) error
- func (b *BackupService) GetAll(ctx context.Context, remoteName string, rscName string, snapName string) (*BackupList, error)
- func (b *BackupService) Info(ctx context.Context, remoteName string, request BackupInfoRequest) (*BackupInfo, error)
- func (b *BackupService) Restore(ctx context.Context, remoteName string, request BackupRestoreRequest) error
- func (b *BackupService) Ship(ctx context.Context, remoteName string, request BackupShipRequest) (string, error)
- type BackupShipRequest
- type BackupVolumes
- type BackupVolumesS3
- type BasicAuthCfg
- type CacheResource
- type CacheVolume
- type Candidate
- type Client
- type Connection
- type ConnectionProvider
- type ConnectionService
- func (c *ConnectionService) GetNodeConnections(ctx context.Context, nodeA, nodeB string) ([]Connection, error)
- func (c *ConnectionService) GetResourceConnection(ctx context.Context, resource, nodeA, nodeB string) (*Connection, error)
- func (c *ConnectionService) GetResourceConnections(ctx context.Context, resource string) ([]Connection, error)
- func (c *ConnectionService) SetNodeConnection(ctx context.Context, nodeA, nodeB string, props GenericPropsModify) error
- func (c *ConnectionService) SetResourceConnection(ctx context.Context, resource, nodeA, nodeB string, props GenericPropsModify) error
- type ControllerConfig
- type ControllerConfigConfig
- type ControllerConfigDb
- type ControllerConfigDbEtcd
- type ControllerConfigDebug
- type ControllerConfigHttp
- type ControllerConfigHttps
- type ControllerConfigLdap
- type ControllerConfigLog
- type ControllerProps
- type ControllerProvider
- type ControllerService
- func (s *ControllerService) CreateSOSReport(ctx context.Context, opts ...*ListOpts) error
- func (s *ControllerService) DeleteErrorReports(ctx context.Context, del ErrorReportDelete) error
- func (s *ControllerService) DeleteExternalFile(ctx context.Context, name string) error
- func (s *ControllerService) DeleteProp(ctx context.Context, prop string) error
- func (s *ControllerService) DownloadSOSReport(ctx context.Context, opts ...*ListOpts) error
- func (s *ControllerService) GetConfig(ctx context.Context, opts ...*ListOpts) (ControllerConfig, error)
- func (s *ControllerService) GetErrorReport(ctx context.Context, id string, opts ...*ListOpts) (ErrorReport, error)
- func (s *ControllerService) GetErrorReports(ctx context.Context, opts ...*ListOpts) ([]ErrorReport, error)
- func (s *ControllerService) GetErrorReportsSince(ctx context.Context, since time.Time, opts ...*ListOpts) ([]ErrorReport, error)
- func (s *ControllerService) GetExternalFile(ctx context.Context, name string) (ExternalFile, error)
- func (s *ControllerService) GetExternalFiles(ctx context.Context, opts ...*ListOpts) ([]ExternalFile, error)
- func (s *ControllerService) GetProps(ctx context.Context, opts ...*ListOpts) (ControllerProps, error)
- func (s *ControllerService) GetPropsInfos(ctx context.Context, opts ...*ListOpts) ([]PropsInfo, error)
- func (s *ControllerService) GetPropsInfosAll(ctx context.Context, opts ...*ListOpts) ([]PropsInfo, error)
- func (s *ControllerService) GetSatelliteConfig(ctx context.Context, node string) (SatelliteConfig, error)
- func (s *ControllerService) GetVersion(ctx context.Context, opts ...*ListOpts) (ControllerVersion, error)
- func (s *ControllerService) Modify(ctx context.Context, props GenericPropsModify) error
- func (s *ControllerService) ModifyExternalFile(ctx context.Context, name string, file ExternalFile) error
- func (s *ControllerService) ModifySatelliteConfig(ctx context.Context, node string, cfg SatelliteConfig) error
- type ControllerVersion
- type DRBDMayPromoteStream
- type DeleteNamespaces
- type DeleteProps
- type DrbdConnection
- type DrbdProxyModify
- type DrbdResource
- type DrbdResourceDefinitionLayer
- type DrbdVolume
- type DrbdVolumeDefinition
- type EbsRemote
- type EncryptionProvider
- type EncryptionService
- type ErrorReport
- type ErrorReportDelete
- type EventMayPromoteChange
- type EventProvider
- type EventService
- type ExosConnectionMap
- type ExosDefaults
- type ExosDefaultsModify
- type ExosDefaultsModifyAllOf
- type ExosEnclosure
- type ExosEnclosureEvent
- type ExosEnclosureHealth
- type ExternalFile
- type GenericPropsModify
- type KV
- type KeyValueStoreProvider
- type KeyValueStoreService
- func (k *KeyValueStoreService) CreateOrModify(ctx context.Context, kv string, modify GenericPropsModify) error
- func (k *KeyValueStoreService) Delete(ctx context.Context, kv string) error
- func (k *KeyValueStoreService) Get(ctx context.Context, kv string) (*KV, error)
- func (k *KeyValueStoreService) List(ctx context.Context) ([]KV, error)
- type LeveledLogger
- type LinstorRemote
- type ListOpts
- type LogLevel
- type Logger
- type LuksResource
- type LuksVolume
- type MaxVolumeSizes
- type NetInterface
- type Node
- type NodeModify
- type NodeProvider
- type NodeRestore
- type NodeService
- func (n *NodeService) Create(ctx context.Context, node Node) error
- func (n *NodeService) CreateDevicePool(ctx context.Context, nodeName string, psc PhysicalStorageCreate) error
- func (n *NodeService) CreateEbsNode(ctx context.Context, name, remoteName string) error
- func (n *NodeService) CreateNetInterface(ctx context.Context, nodeName string, nif NetInterface) error
- func (n *NodeService) CreateStoragePool(ctx context.Context, nodeName string, sp StoragePool) error
- func (n *NodeService) Delete(ctx context.Context, nodeName string) error
- func (n *NodeService) DeleteNetinterface(ctx context.Context, nodeName, nifName string) error
- func (n *NodeService) DeleteStoragePool(ctx context.Context, nodeName, spName string) error
- func (n NodeService) Evacuate(ctx context.Context, nodeName string) error
- func (n NodeService) Evict(ctx context.Context, nodeName string) error
- func (n *NodeService) Get(ctx context.Context, nodeName string, opts ...*ListOpts) (Node, error)
- func (n *NodeService) GetAll(ctx context.Context, opts ...*ListOpts) ([]Node, error)
- func (n *NodeService) GetNetInterface(ctx context.Context, nodeName, nifName string, opts ...*ListOpts) (NetInterface, error)
- func (n *NodeService) GetNetInterfaces(ctx context.Context, nodeName string, opts ...*ListOpts) ([]NetInterface, error)
- func (n *NodeService) GetPhysicalStorage(ctx context.Context, nodeName string) ([]PhysicalStorageNode, error)
- func (n *NodeService) GetPhysicalStorageView(ctx context.Context, opts ...*ListOpts) ([]PhysicalStorageViewItem, error)
- func (n *NodeService) GetPropsInfos(ctx context.Context, opts ...*ListOpts) ([]PropsInfo, error)
- func (n *NodeService) GetStoragePool(ctx context.Context, nodeName, spName string, opts ...*ListOpts) (StoragePool, error)
- func (n *NodeService) GetStoragePoolPropsInfos(ctx context.Context, nodeName string, opts ...*ListOpts) ([]PropsInfo, error)
- func (n *NodeService) GetStoragePoolView(ctx context.Context, opts ...*ListOpts) ([]StoragePool, error)
- func (n *NodeService) GetStoragePools(ctx context.Context, nodeName string, opts ...*ListOpts) ([]StoragePool, error)
- func (n *NodeService) Lost(ctx context.Context, nodeName string) error
- func (n *NodeService) Modify(ctx context.Context, nodeName string, props NodeModify) error
- func (n *NodeService) ModifyNetInterface(ctx context.Context, nodeName, nifName string, nif NetInterface) error
- func (n *NodeService) ModifyStoragePool(ctx context.Context, nodeName, spName string, genericProps GenericPropsModify) error
- func (n *NodeService) Reconnect(ctx context.Context, nodeName string) error
- func (n *NodeService) Restore(ctx context.Context, nodeName string, restore NodeRestore) error
- type NvmeResource
- type NvmeVolume
- type OneOfDrbdVolumeDefinition
- type OneOfDrbdVolumeLuksVolumeStorageVolumeNvmeVolumeWritecacheVolumeCacheVolumeBCacheVolume
- type Option
- func BaseURL(URL *url.URL) Option
- func BasicAuth(basicauth *BasicAuthCfg) Option
- func BearerToken(token string) Option
- func Controllers(controllers []string) Option
- func HTTPClient(httpClient *http.Client) Option
- func Limit(r rate.Limit, b int) Option
- func Limiter(limiter *rate.Limiter) Option
- func Log(logger interface{}) Option
- func UserAgent(ua string) Option
- type OverrideProps
- type Passphrase
- type PhysicalStorageCreate
- type PhysicalStorageDevice
- type PhysicalStorageNode
- type PhysicalStorageStoragePoolCreate
- type PhysicalStorageViewItem
- type PropsInfo
- type ProviderKind
- type RDGetAllRequest
- type RemoteList
- type RemoteProvider
- type RemoteService
- func (r *RemoteService) CreateEbs(ctx context.Context, create EbsRemote) error
- func (r *RemoteService) CreateLinstor(ctx context.Context, create LinstorRemote) error
- func (r *RemoteService) CreateS3(ctx context.Context, create S3Remote) error
- func (r *RemoteService) Delete(ctx context.Context, remoteName string) error
- func (r *RemoteService) GetAll(ctx context.Context, opts ...*ListOpts) (RemoteList, error)
- func (r *RemoteService) GetAllEbs(ctx context.Context, opts ...*ListOpts) ([]EbsRemote, error)
- func (r *RemoteService) GetAllLinstor(ctx context.Context, opts ...*ListOpts) ([]LinstorRemote, error)
- func (r *RemoteService) GetAllS3(ctx context.Context, opts ...*ListOpts) ([]S3Remote, error)
- func (r *RemoteService) ModifyEbs(ctx context.Context, remoteName string, modify EbsRemote) error
- func (r *RemoteService) ModifyLinstor(ctx context.Context, remoteName string, modify LinstorRemote) error
- func (r *RemoteService) ModifyS3(ctx context.Context, remoteName string, modify S3Remote) error
- type Resource
- type ResourceConnection
- type ResourceCreate
- type ResourceDefinition
- type ResourceDefinitionCloneRequest
- type ResourceDefinitionCloneStarted
- type ResourceDefinitionCloneStatus
- type ResourceDefinitionCreate
- type ResourceDefinitionLayer
- type ResourceDefinitionModify
- type ResourceDefinitionProvider
- type ResourceDefinitionService
- func (n *ResourceDefinitionService) AttachExternalFile(ctx context.Context, resDefName string, filePath string) error
- func (n *ResourceDefinitionService) Clone(ctx context.Context, srcResDef string, request ResourceDefinitionCloneRequest) (ResourceDefinitionCloneStarted, error)
- func (n *ResourceDefinitionService) CloneStatus(ctx context.Context, srcResDef, targetResDef string) (ResourceDefinitionCloneStatus, error)
- func (n *ResourceDefinitionService) Create(ctx context.Context, resDef ResourceDefinitionCreate) error
- func (n *ResourceDefinitionService) CreateVolumeDefinition(ctx context.Context, resDefName string, volDef VolumeDefinitionCreate) error
- func (n *ResourceDefinitionService) Delete(ctx context.Context, resDefName string) error
- func (n *ResourceDefinitionService) DeleteVolumeDefinition(ctx context.Context, resDefName string, volNr int) error
- func (n *ResourceDefinitionService) DetachExternalFile(ctx context.Context, resDefName string, filePath string) error
- func (n *ResourceDefinitionService) Get(ctx context.Context, resDefName string, opts ...*ListOpts) (ResourceDefinition, error)
- func (n *ResourceDefinitionService) GetAll(ctx context.Context, request RDGetAllRequest) ([]ResourceDefinitionWithVolumeDefinition, error)
- func (n *ResourceDefinitionService) GetDRBDProxyPropsInfos(ctx context.Context, resDefName string, opts ...*ListOpts) ([]PropsInfo, error)
- func (n *ResourceDefinitionService) GetPropsInfos(ctx context.Context, opts ...*ListOpts) ([]PropsInfo, error)
- func (n *ResourceDefinitionService) GetVolumeDefinition(ctx context.Context, resDefName string, volNr int, opts ...*ListOpts) (VolumeDefinition, error)
- func (n *ResourceDefinitionService) GetVolumeDefinitions(ctx context.Context, resDefName string, opts ...*ListOpts) ([]VolumeDefinition, error)
- func (n *ResourceDefinitionService) Modify(ctx context.Context, resDefName string, props GenericPropsModify) error
- func (n *ResourceDefinitionService) ModifyVolumeDefinition(ctx context.Context, resDefName string, volNr int, ...) error
- func (n *ResourceDefinitionService) SyncStatus(ctx context.Context, resDef string) (ResourceDefinitionSyncStatus, error)
- type ResourceDefinitionSyncStatus
- type ResourceDefinitionWithVolumeDefinition
- type ResourceGroup
- type ResourceGroupAdjust
- type ResourceGroupModify
- type ResourceGroupProvider
- type ResourceGroupService
- func (n *ResourceGroupService) Adjust(ctx context.Context, resGrpName string, adjust ResourceGroupAdjust) error
- func (n *ResourceGroupService) AdjustAll(ctx context.Context, adjust ResourceGroupAdjust) error
- func (n *ResourceGroupService) Create(ctx context.Context, resGrp ResourceGroup) error
- func (n *ResourceGroupService) CreateVolumeGroup(ctx context.Context, resGrpName string, volGrp VolumeGroup) error
- func (n *ResourceGroupService) Delete(ctx context.Context, resGrpName string) error
- func (n *ResourceGroupService) DeleteVolumeGroup(ctx context.Context, resGrpName string, volNr int) error
- func (n *ResourceGroupService) Get(ctx context.Context, resGrpName string, opts ...*ListOpts) (ResourceGroup, error)
- func (n *ResourceGroupService) GetAll(ctx context.Context, opts ...*ListOpts) ([]ResourceGroup, error)
- func (n *ResourceGroupService) GetPropsInfos(ctx context.Context, opts ...*ListOpts) ([]PropsInfo, error)
- func (n *ResourceGroupService) GetVolumeGroup(ctx context.Context, resGrpName string, volNr int, opts ...*ListOpts) (VolumeGroup, error)
- func (n *ResourceGroupService) GetVolumeGroupPropsInfos(ctx context.Context, resGrpName string, opts ...*ListOpts) ([]PropsInfo, error)
- func (n *ResourceGroupService) GetVolumeGroups(ctx context.Context, resGrpName string, opts ...*ListOpts) ([]VolumeGroup, error)
- func (n *ResourceGroupService) Modify(ctx context.Context, resGrpName string, props ResourceGroupModify) error
- func (n *ResourceGroupService) ModifyVolumeGroup(ctx context.Context, resGrpName string, volNr int, props VolumeGroupModify) error
- func (n *ResourceGroupService) Spawn(ctx context.Context, resGrpName string, resGrpSpwn ResourceGroupSpawn) error
- type ResourceGroupSpawn
- type ResourceLayer
- type ResourceMakeAvailable
- type ResourceProvider
- type ResourceService
- func (n *ResourceService) Activate(ctx context.Context, resName, nodeName string) error
- func (n *ResourceService) Autoplace(ctx context.Context, resName string, apr AutoPlaceRequest) error
- func (n *ResourceService) Create(ctx context.Context, res ResourceCreate) error
- func (n *ResourceService) CreateSnapshot(ctx context.Context, snapshot Snapshot) error
- func (n *ResourceService) Deactivate(ctx context.Context, resName, nodeName string) error
- func (n *ResourceService) Delete(ctx context.Context, resName, nodeName string) error
- func (n *ResourceService) DeleteSnapshot(ctx context.Context, resName, snapName string, nodes ...string) error
- func (n *ResourceService) DisableDRBDProxy(ctx context.Context, resName, nodeAName, nodeBName string) error
- func (n *ResourceService) Diskful(ctx context.Context, resName, nodeName, storagePoolName string, ...) error
- func (n *ResourceService) Diskless(ctx context.Context, resName, nodeName, disklessPoolName string) error
- func (n *ResourceService) EnableDRBDProxy(ctx context.Context, resName, nodeAName, nodeBName string) error
- func (n *ResourceService) EnableSnapshotShipping(ctx context.Context, resName string, ship SnapshotShipping) error
- func (n *ResourceService) Get(ctx context.Context, resName, nodeName string, opts ...*ListOpts) (Resource, error)
- func (n *ResourceService) GetAll(ctx context.Context, resName string, opts ...*ListOpts) ([]Resource, error)
- func (n *ResourceService) GetConnectionPropsInfos(ctx context.Context, resName string, opts ...*ListOpts) ([]PropsInfo, error)
- func (n *ResourceService) GetConnections(ctx context.Context, resName, nodeAName, nodeBName string, opts ...*ListOpts) ([]ResourceConnection, error)
- func (n *ResourceService) GetPropsInfos(ctx context.Context, resName string, opts ...*ListOpts) ([]PropsInfo, error)
- func (n *ResourceService) GetResourceView(ctx context.Context, opts ...*ListOpts) ([]ResourceWithVolumes, error)
- func (n *ResourceService) GetSnapshot(ctx context.Context, resName, snapName string, opts ...*ListOpts) (Snapshot, error)
- func (n *ResourceService) GetSnapshotShippings(ctx context.Context, opts ...*ListOpts) ([]SnapshotShippingStatus, error)
- func (r *ResourceService) GetSnapshotView(ctx context.Context, opts ...*ListOpts) ([]Snapshot, error)
- func (n *ResourceService) GetSnapshots(ctx context.Context, resName string, opts ...*ListOpts) ([]Snapshot, error)
- func (n *ResourceService) GetVolume(ctx context.Context, resName, nodeName string, volNr int, opts ...*ListOpts) (Volume, error)
- func (n *ResourceService) GetVolumeDefinitionPropsInfos(ctx context.Context, resName string, opts ...*ListOpts) ([]PropsInfo, error)
- func (n *ResourceService) GetVolumePropsInfos(ctx context.Context, resName, nodeName string, opts ...*ListOpts) ([]PropsInfo, error)
- func (n *ResourceService) GetVolumes(ctx context.Context, resName, nodeName string, opts ...*ListOpts) ([]Volume, error)
- func (n *ResourceService) MakeAvailable(ctx context.Context, resName, nodeName string, ...) error
- func (n *ResourceService) Migrate(ctx context.Context, resName, fromNodeName, toNodeName, storagePoolName string) error
- func (n *ResourceService) Modify(ctx context.Context, resName, nodeName string, props GenericPropsModify) error
- func (n *ResourceService) ModifyConnection(ctx context.Context, resName, nodeAName, nodeBName string, ...) error
- func (n *ResourceService) ModifyDRBDProxy(ctx context.Context, resName string, props DrbdProxyModify) error
- func (n *ResourceService) ModifyVolume(ctx context.Context, resName, nodeName string, volNr int, ...) error
- func (n *ResourceService) QueryMaxVolumeSize(ctx context.Context, filter AutoSelectFilter) (MaxVolumeSizes, error)
- func (n *ResourceService) RestoreSnapshot(ctx context.Context, origResName, snapName string, ...) error
- func (n *ResourceService) RestoreVolumeDefinitionSnapshot(ctx context.Context, origResName, snapName string, ...) error
- func (n *ResourceService) RollbackSnapshot(ctx context.Context, resName, snapName string) error
- type ResourceState
- type ResourceWithVolumes
- type S3Remote
- type SatelliteConfig
- type SatelliteConfigLog
- type SatelliteConfigNet
- type Snapshot
- type SnapshotNode
- type SnapshotRestore
- type SnapshotShipping
- type SnapshotShippingStatus
- type SnapshotVolumeDefinition
- type SnapshotVolumeNode
- type StoragePool
- type StoragePoolDefinition
- type StoragePoolDefinitionModify
- type StoragePoolDefinitionProvider
- type StoragePoolDefinitionService
- func (s *StoragePoolDefinitionService) Create(ctx context.Context, spd StoragePoolDefinition) error
- func (s *StoragePoolDefinitionService) Delete(ctx context.Context, spdName string) error
- func (s *StoragePoolDefinitionService) Get(ctx context.Context, spdName string, opts ...*ListOpts) (StoragePoolDefinition, error)
- func (s *StoragePoolDefinitionService) GetAll(ctx context.Context, opts ...*ListOpts) ([]StoragePoolDefinition, error)
- func (s *StoragePoolDefinitionService) GetPropsInfos(ctx context.Context, opts ...*ListOpts) ([]PropsInfo, error)
- func (s *StoragePoolDefinitionService) Modify(ctx context.Context, spdName string, props StoragePoolDefinitionModify) error
- type StorageResource
- type StorageVolume
- type TimeStampMs
- type ToggleDiskDiskfulProps
- type VendorProvider
- type VendorService
- func (s *VendorService) CreateExosEnclosure(ctx context.Context, enclosure ExosEnclosure) error
- func (s *VendorService) DeleteExosEnclosure(ctx context.Context, name string) error
- func (s *VendorService) GetExosConnectionMap(ctx context.Context) (ExosConnectionMap, error)
- func (s *VendorService) GetExosDefaults(ctx context.Context) (ExosDefaults, error)
- func (s *VendorService) GetExosEnclosures(ctx context.Context, noCache bool) ([]ExosEnclosure, error)
- func (s *VendorService) GetExosEvents(ctx context.Context, name string, count int32) ([]ExosEnclosureEvent, error)
- func (s *VendorService) ModifyExosDefaults(ctx context.Context, defaults ExosDefaultsModify) error
- func (s *VendorService) ModifyExosEnclosure(ctx context.Context, name string, enclosure ExosEnclosure) error
- type Volume
- type VolumeDefinition
- type VolumeDefinitionCreate
- type VolumeDefinitionLayer
- type VolumeDefinitionModify
- type VolumeGroup
- type VolumeGroupModify
- type VolumeLayer
- type VolumeState
- type WritecacheResource
- type WritecacheVolume
Examples ¶
Constants ¶
const ( // NotFoundError is the error type returned in case of a 404 error. This is required to test for this kind of error. NotFoundError = clientError("404 Not Found") // Name of the environment variable that stores the certificate used for TLS client authentication UserCertEnv = "LS_USER_CERTIFICATE" // Name of the environment variable that stores the key used for TLS client authentication UserKeyEnv = "LS_USER_KEY" // Name of the environment variable that stores the certificate authority for the LINSTOR HTTPS API RootCAEnv = "LS_ROOT_CA" // Name of the environment variable that holds the URL(s) of LINSTOR controllers ControllerUrlEnv = "LS_CONTROLLERS" // Name of the environment variable that holds the username for authentication UsernameEnv = "LS_USERNAME" // Name of the environment variable that holds the password for authentication PasswordEnv = "LS_PASSWORD" // Name of the environment variable that points to the file containing the token for authentication BearerTokenFileEnv = "LS_BEARER_TOKEN_FILE" )
Variables ¶
This section is empty.
Functions ¶
func IsApiCallError ¶ added in v0.35.1
IsApiCallError checks if an error is a specific type of LINSTOR error.
Types ¶
type ApiCallError ¶ added in v0.21.0
type ApiCallError []ApiCallRc
func (ApiCallError) Error ¶ added in v0.21.0
func (e ApiCallError) Error() string
func (ApiCallError) Is ¶ added in v0.21.0
func (e ApiCallError) Is(mask uint64) bool
Is is a shorthand for checking all ApiCallRcs of an ApiCallError against a given mask.
type ApiCallRc ¶
type ApiCallRc struct { // A masked error number RetCode int64 `json:"ret_code"` Message string `json:"message"` // Cause of the error Cause string `json:"cause,omitempty"` // Details to the error message Details string `json:"details,omitempty"` // Possible correction options Correction string `json:"correction,omitempty"` // List of error report ids related to this api call return code. ErrorReportIds []string `json:"error_report_ids,omitempty"` // Map of objection that have been involved by the operation. ObjRefs map[string]string `json:"obj_refs,omitempty"` }
ApiCallRc represents the struct returned by LINSTOR, when accessing its REST API.
func (ApiCallRc) Is ¶ added in v0.21.0
Is can be used to check the return code against a given mask. Since LINSTOR return codes are designed to be machine readable, this can be used to check for a very specific type of error. Refer to package apiconsts.go in package linstor for a list of possible mask values.
type AutoPlaceRequest ¶
type AutoPlaceRequest struct { DisklessOnRemaining bool `json:"diskless_on_remaining,omitempty"` SelectFilter AutoSelectFilter `json:"select_filter,omitempty"` LayerList []devicelayerkind.DeviceLayerKind `json:"layer_list,omitempty"` }
AutoPlaceRequest is a struct to store the paramters for the linstor auto-place command
type AutoSelectFilter ¶
type AutoSelectFilter struct { PlaceCount int32 `json:"place_count,omitempty"` AdditionalPlaceCount int32 `json:"additional_place_count,omitempty"` NodeNameList []string `json:"node_name_list,omitempty"` StoragePool string `json:"storage_pool,omitempty"` StoragePoolList []string `json:"storage_pool_list,omitempty"` StoragePoolDisklessList []string `json:"storage_pool_diskless_list,omitempty"` NotPlaceWithRsc []string `json:"not_place_with_rsc,omitempty"` NotPlaceWithRscRegex string `json:"not_place_with_rsc_regex,omitempty"` ReplicasOnSame []string `json:"replicas_on_same,omitempty"` ReplicasOnDifferent []string `json:"replicas_on_different,omitempty"` LayerStack []string `json:"layer_stack,omitempty"` ProviderList []string `json:"provider_list,omitempty"` DisklessOnRemaining bool `json:"diskless_on_remaining,omitempty"` DisklessType string `json:"diskless_type,omitempty"` Overprovision *float64 `json:"overprovision,omitempty"` }
AutoSelectFilter is a struct used to have information about the auto-select function
type BCacheResource ¶ added in v0.36.0
type BCacheResource struct {
BCacheVolumes []BCacheVolume `json:"bcache_volumes,omitempty"`
}
type BCacheVolume ¶ added in v0.36.0
type BCacheVolume struct { VolumeNumber int32 `json:"volume_number,omitempty"` // block device path DevicePath string `json:"device_path,omitempty"` // block device path used as cache device DevicePathCache string `json:"device_path_cache,omitempty"` AllocatedSizeKib int64 `json:"allocated_size_kib,omitempty"` UsableSizeKib int64 `json:"usable_size_kib,omitempty"` // String describing current volume state DiskState string `json:"disk_state,omitempty"` }
type Backup ¶ added in v0.37.0
type Backup struct { Id string `json:"id"` StartTime string `json:"start_time,omitempty"` StartTimestamp *TimeStampMs `json:"start_timestamp,omitempty"` FinishedTime string `json:"finished_time,omitempty"` FinishedTimestamp *TimeStampMs `json:"finished_timestamp,omitempty"` OriginRsc string `json:"origin_rsc"` OriginSnap string `json:"origin_snap"` OriginNode string `json:"origin_node,omitempty"` FailMessages string `json:"fail_messages,omitempty"` Vlms []BackupVolumes `json:"vlms"` Success bool `json:"success,omitempty"` Shipping bool `json:"shipping,omitempty"` Restorable bool `json:"restorable,omitempty"` S3 BackupS3 `json:"s3,omitempty"` BasedOnId string `json:"based_on_id,omitempty"` }
type BackupAbortRequest ¶ added in v0.37.0
type BackupCreate ¶ added in v0.37.0
type BackupDeleteOpts ¶ added in v0.37.0
type BackupDeleteOpts struct { ID string `url:"id,omitempty"` IDPrefix string `url:"id_prefix,omitempty"` Cascading bool `url:"cascading,omitempty"` Timestamp *TimeStampMs `url:"timestamp,omitempty"` ResourceName string `url:"resource_name,omitempty"` NodeName string `url:"node_name,omitempty"` AllLocalCluster bool `url:"all_local_cluster,omitempty"` All bool `url:"all,omitempty"` S3Key string `url:"s3key,omitempty"` S3KeyForce string `url:"s3key_force,omitempty"` DryRun bool `url:"dryrun,omitempty"` }
type BackupInfo ¶ added in v0.37.0
type BackupInfoRequest ¶ added in v0.37.0
type BackupInfoStorPool ¶ added in v0.37.0
type BackupInfoStorPool struct { Name string `json:"name"` ProviderKind ProviderKind `json:"provider_kind,omitempty"` TargetName string `json:"target_name,omitempty"` RemainingSpaceKib int64 `json:"remaining_space_kib,omitempty"` Vlms []BackupInfoVolume `json:"vlms"` }
type BackupInfoVolume ¶ added in v0.37.0
type BackupInfoVolume struct { Name string `json:"name,omitempty"` LayerType devicelayerkind.DeviceLayerKind `json:"layer_type"` DlSizeKib int64 `json:"dl_size_kib,omitempty"` AllocSizeKib int64 `json:"alloc_size_kib"` UsableSizeKib int64 `json:"usable_size_kib,omitempty"` }
type BackupList ¶ added in v0.37.0
type BackupList struct { // Linstor is a map of all entries found that could be parsed as LINSTOR backups. Linstor map[string]Backup `json:"linstor,omitempty"` // Other are files that could not be parsed as LINSTOR backups. Other BackupOther `json:"other,omitempty"` }
type BackupOther ¶ added in v0.37.0
type BackupOther struct {
Files *[]string `json:"files,omitempty"`
}
type BackupProvider ¶ added in v0.37.0
type BackupProvider interface { // GetAll fetches information on all backups stored at the given remote. Optionally limited to the given // resource names. GetAll(ctx context.Context, remoteName string, rscName string, snapName string) (*BackupList, error) // DeleteAll backups that fit the given criteria. DeleteAll(ctx context.Context, remoteName string, filter BackupDeleteOpts) error // Create a new backup operation. Create(ctx context.Context, remoteName string, request BackupCreate) (string, error) // Info retrieves information about a specific backup instance. Info(ctx context.Context, remoteName string, request BackupInfoRequest) (*BackupInfo, error) // Abort all running backup operations of a resource. Abort(ctx context.Context, remoteName string, request BackupAbortRequest) error // Ship ships a backup from one LINSTOR cluster to another. Ship(ctx context.Context, remoteName string, request BackupShipRequest) (string, error) // Restore starts to restore a resource from a backup. Restore(ctx context.Context, remoteName string, request BackupRestoreRequest) error }
type BackupRestoreRequest ¶ added in v0.37.0
type BackupRestoreRequest struct { SrcRscName string `json:"src_rsc_name,omitempty"` SrcSnapName string `json:"src_snap_name,omitempty"` LastBackup string `json:"last_backup,omitempty"` StorPoolMap map[string]string `json:"stor_pool_map,omitempty"` TargetRscName string `json:"target_rsc_name"` Passphrase string `json:"passphrase,omitempty"` NodeName string `json:"node_name"` DownloadOnly bool `json:"download_only,omitempty"` }
type BackupS3 ¶ added in v0.37.0
type BackupS3 struct {
MetaName string `json:"meta_name,omitempty"`
}
type BackupService ¶ added in v0.37.0
type BackupService struct {
// contains filtered or unexported fields
}
func (*BackupService) Abort ¶ added in v0.37.0
func (b *BackupService) Abort(ctx context.Context, remoteName string, request BackupAbortRequest) error
func (*BackupService) Create ¶ added in v0.37.0
func (b *BackupService) Create(ctx context.Context, remoteName string, request BackupCreate) (string, error)
func (*BackupService) DeleteAll ¶ added in v0.37.0
func (b *BackupService) DeleteAll(ctx context.Context, remoteName string, filter BackupDeleteOpts) error
func (*BackupService) GetAll ¶ added in v0.37.0
func (b *BackupService) GetAll(ctx context.Context, remoteName string, rscName string, snapName string) (*BackupList, error)
func (*BackupService) Info ¶ added in v0.37.0
func (b *BackupService) Info(ctx context.Context, remoteName string, request BackupInfoRequest) (*BackupInfo, error)
func (*BackupService) Restore ¶ added in v0.37.0
func (b *BackupService) Restore(ctx context.Context, remoteName string, request BackupRestoreRequest) error
func (*BackupService) Ship ¶ added in v0.37.0
func (b *BackupService) Ship(ctx context.Context, remoteName string, request BackupShipRequest) (string, error)
type BackupShipRequest ¶ added in v0.37.0
type BackupShipRequest struct { SrcNodeName string `json:"src_node_name,omitempty"` SrcRscName string `json:"src_rsc_name"` DstRscName string `json:"dst_rsc_name"` DstNodeName string `json:"dst_node_name,omitempty"` DstNetIfName string `json:"dst_net_if_name,omitempty"` DstStorPool string `json:"dst_stor_pool,omitempty"` StorPoolRename map[string]string `json:"stor_pool_rename,omitempty"` DownloadOnly *bool `json:"download_only,omitempty"` }
type BackupVolumes ¶ added in v0.37.0
type BackupVolumes struct { VlmNr int64 `json:"vlm_nr"` FinishedTime *string `json:"finished_time,omitempty"` FinishedTimestamp *TimeStampMs `json:"finished_timestamp,omitempty"` S3 *BackupVolumesS3 `json:"s3,omitempty"` }
type BackupVolumesS3 ¶ added in v0.37.0
type BackupVolumesS3 struct {
Key *string `json:"key,omitempty"`
}
type BasicAuthCfg ¶ added in v0.16.2
type BasicAuthCfg struct {
Username, Password string
}
type CacheResource ¶ added in v0.24.0
type CacheResource struct {
CacheVolumes []CacheVolume `json:"cache_volumes,omitempty"`
}
type CacheVolume ¶ added in v0.24.0
type CacheVolume struct { VolumeNumber int32 `json:"volume_number,omitempty"` // block device path DevicePath string `json:"device_path,omitempty"` // block device path used as cache device DevicePathCache string `json:"device_path_cache,omitempty"` // block device path used as meta device DeviceMetaCache string `json:"device_meta_cache,omitempty"` AllocatedSizeKib int64 `json:"allocated_size_kib,omitempty"` UsableSizeKib int64 `json:"usable_size_kib,omitempty"` // String describing current volume state DiskState string `json:"disk_state,omitempty"` }
type Candidate ¶ added in v0.17.3
type Candidate struct { StoragePool string `json:"storage_pool,omitempty"` // maximum size in KiB MaxVolumeSizeKib int64 `json:"max_volume_size_kib,omitempty"` NodeNames []string `json:"node_names,omitempty"` AllThin bool `json:"all_thin,omitempty"` }
Candidate struct for Candidate
type Client ¶
type Client struct { Nodes NodeProvider ResourceDefinitions ResourceDefinitionProvider Resources ResourceProvider ResourceGroups ResourceGroupProvider StoragePoolDefinitions StoragePoolDefinitionProvider Encryption EncryptionProvider Controller ControllerProvider Events EventProvider Vendor VendorProvider Remote RemoteProvider Backup BackupProvider KeyValueStore KeyValueStoreProvider Connections ConnectionProvider // contains filtered or unexported fields }
Client is a struct representing a LINSTOR REST client.
func NewClient ¶
NewClient takes an arbitrary number of options and returns a Client or an error. It recognizes several environment variables which can be used to configure the client at runtime:
- LS_CONTROLLERS: a comma-separated list of LINSTOR controllers to connect to.
- LS_USERNAME, LS_PASSWORD: can be used to authenticate against the LINSTOR controller using HTTP basic authentication.
- LS_USER_CERTIFICATE, LS_USER_KEY, LS_ROOT_CA: can be used to enable TLS on the HTTP client, enabling encrypted communication with the LINSTOR controller.
- LS_BEARER_TOKEN_FILE: can be set to a file containing the bearer token used for authentication.
Options passed to NewClient take precedence over options passed in via environment variables.
type Connection ¶ added in v0.49.0
type ConnectionProvider ¶ added in v0.49.0
type ConnectionProvider interface { // GetNodeConnections lists all node connections, optionally limites to nodes A and B, if not empty. GetNodeConnections(ctx context.Context, nodeA, nodeB string) ([]Connection, error) // GetResourceConnections returns all connections of the given resource. GetResourceConnections(ctx context.Context, resource string) ([]Connection, error) // GetResourceConnection returns the connection between node A and B for the given resource. GetResourceConnection(ctx context.Context, resource, nodeA, nodeB string) (*Connection, error) // SetNodeConnection sets or updates the node connection between node A and B. SetNodeConnection(ctx context.Context, nodeA, nodeB string, props GenericPropsModify) error // SetResourceConnection sets or updates the connection between node A and B for a resource. SetResourceConnection(ctx context.Context, resource, nodeA, nodeB string, props GenericPropsModify) error }
ConnectionProvider acts as an abstraction for a ConnectionService. It can be swapped out for another ConnectionService implementation, for example for testing.
type ConnectionService ¶ added in v0.49.0
type ConnectionService struct {
// contains filtered or unexported fields
}
ConnectionService is the service that deals with connection related tasks.
func (*ConnectionService) GetNodeConnections ¶ added in v0.49.0
func (c *ConnectionService) GetNodeConnections(ctx context.Context, nodeA, nodeB string) ([]Connection, error)
func (*ConnectionService) GetResourceConnection ¶ added in v0.49.0
func (c *ConnectionService) GetResourceConnection(ctx context.Context, resource, nodeA, nodeB string) (*Connection, error)
func (*ConnectionService) GetResourceConnections ¶ added in v0.49.0
func (c *ConnectionService) GetResourceConnections(ctx context.Context, resource string) ([]Connection, error)
func (*ConnectionService) SetNodeConnection ¶ added in v0.49.0
func (c *ConnectionService) SetNodeConnection(ctx context.Context, nodeA, nodeB string, props GenericPropsModify) error
func (*ConnectionService) SetResourceConnection ¶ added in v0.49.0
func (c *ConnectionService) SetResourceConnection(ctx context.Context, resource, nodeA, nodeB string, props GenericPropsModify) error
type ControllerConfig ¶ added in v0.22.0
type ControllerConfig struct { Config ControllerConfigConfig `json:"config,omitempty"` Debug ControllerConfigDebug `json:"debug,omitempty"` Log ControllerConfigLog `json:"log,omitempty"` Db ControllerConfigDb `json:"db,omitempty"` Http ControllerConfigHttp `json:"http,omitempty"` Https ControllerConfigHttps `json:"https,omitempty"` Ldap ControllerConfigLdap `json:"ldap,omitempty"` }
type ControllerConfigConfig ¶ added in v0.22.0
type ControllerConfigConfig struct {
Dir string `json:"dir,omitempty"`
}
type ControllerConfigDb ¶ added in v0.22.0
type ControllerConfigDb struct { ConnectionUrl string `json:"connection_url,omitempty"` CaCertificate string `json:"ca_certificate,omitempty"` ClientCertificate string `json:"client_certificate,omitempty"` ClientKeyPkcs8Pem string `json:"client_key_pkcs8_pem,omitempty"` InMemory string `json:"in_memory,omitempty"` VersionCheckDisabled bool `json:"version_check_disabled,omitempty"` Etcd ControllerConfigDbEtcd `json:"etcd,omitempty"` }
type ControllerConfigDbEtcd ¶ added in v0.22.0
type ControllerConfigDebug ¶ added in v0.22.0
type ControllerConfigDebug struct {
ConsoleEnabled bool `json:"console_enabled,omitempty"`
}
type ControllerConfigHttp ¶ added in v0.22.0
type ControllerConfigHttps ¶ added in v0.22.0
type ControllerConfigHttps struct { Enabled bool `json:"enabled,omitempty"` ListenAddress string `json:"listen_address,omitempty"` Port int32 `json:"port,omitempty"` Keystore string `json:"keystore,omitempty"` KeystorePassword string `json:"keystore_password,omitempty"` Truststore string `json:"truststore,omitempty"` TruststorePassword string `json:"truststore_password,omitempty"` }
type ControllerConfigLdap ¶ added in v0.22.0
type ControllerConfigLdap struct { Enabled bool `json:"enabled,omitempty"` PublicAccessAllowed bool `json:"public_access_allowed,omitempty"` Uri string `json:"uri,omitempty"` Dn string `json:"dn,omitempty"` SearchBase string `json:"search_base,omitempty"` SearchFilter string `json:"search_filter,omitempty"` }
type ControllerConfigLog ¶ added in v0.22.0
type ControllerConfigLog struct { PrintStackTrace bool `json:"print_stack_trace,omitempty"` Directory string `json:"directory,omitempty"` Level LogLevel `json:"level,omitempty"` LevelGlobal LogLevel `json:"level_global,omitempty"` LevelLinstor LogLevel `json:"level_linstor,omitempty"` LevelLinstorGlobal LogLevel `json:"level_linstor_global,omitempty"` RestAccessLogPath string `json:"rest_access_log_path,omitempty"` RestAccessMode string `json:"rest_access_mode,omitempty"` }
type ControllerProps ¶ added in v0.24.0
type ControllerProvider ¶ added in v0.34.0
type ControllerProvider interface { // GetVersion queries version information for the controller. GetVersion(ctx context.Context, opts ...*ListOpts) (ControllerVersion, error) // GetConfig queries the configuration of a controller GetConfig(ctx context.Context, opts ...*ListOpts) (ControllerConfig, error) // Modify modifies the controller node and sets/deletes the given properties. Modify(ctx context.Context, props GenericPropsModify) error // GetProps gets all properties of a controller GetProps(ctx context.Context, opts ...*ListOpts) (ControllerProps, error) // DeleteProp deletes the given property/key from the controller object. DeleteProp(ctx context.Context, prop string) error // GetErrorReports returns all error reports. The Text field is not populated, // use GetErrorReport to get the text of an error report. GetErrorReports(ctx context.Context, opts ...*ListOpts) ([]ErrorReport, error) // DeleteErrorReports deletes error reports as specified by the ErrorReportDelete struct. DeleteErrorReports(ctx context.Context, del ErrorReportDelete) error // GetErrorReportsSince returns all error reports created after a certain point in time. GetErrorReportsSince(ctx context.Context, since time.Time, opts ...*ListOpts) ([]ErrorReport, error) // GetErrorReport returns a specific error report, including its text. GetErrorReport(ctx context.Context, id string, opts ...*ListOpts) (ErrorReport, error) // CreateSOSReport creates an SOS report in the log directory of the controller CreateSOSReport(ctx context.Context, opts ...*ListOpts) error // DownloadSOSReport request sos report to download DownloadSOSReport(ctx context.Context, opts ...*ListOpts) error GetSatelliteConfig(ctx context.Context, node string) (SatelliteConfig, error) ModifySatelliteConfig(ctx context.Context, node string, cfg SatelliteConfig) error // GetPropsInfos gets meta information about the properties that can be // set on a controller. GetPropsInfos(ctx context.Context, opts ...*ListOpts) ([]PropsInfo, error) // GetPropsInfosAll gets meta information about all properties that can // be set on a controller and all entities it contains (nodes, resource // definitions, ...). GetPropsInfosAll(ctx context.Context, opts ...*ListOpts) ([]PropsInfo, error) // GetExternalFiles gets a list of previously registered external files. GetExternalFiles(ctx context.Context, opts ...*ListOpts) ([]ExternalFile, error) // GetExternalFile gets the requested external file including its content GetExternalFile(ctx context.Context, name string) (ExternalFile, error) // ModifyExternalFile registers or modifies a previously registered // external file ModifyExternalFile(ctx context.Context, name string, file ExternalFile) error // DeleteExternalFile deletes the given external file. This effectively // also deletes the file on all satellites DeleteExternalFile(ctx context.Context, name string) error }
ControllerProvider acts as an abstraction for a ControllerService. It can be swapped out for another ControllerService implementation, for example for testing.
type ControllerService ¶ added in v0.27.0
type ControllerService struct {
// contains filtered or unexported fields
}
ControllerService is the service that deals with the LINSTOR controller.
func (*ControllerService) CreateSOSReport ¶ added in v0.29.0
func (s *ControllerService) CreateSOSReport(ctx context.Context, opts ...*ListOpts) error
CreateSOSReport creates an SOS report in the log directory of the controller
func (*ControllerService) DeleteErrorReports ¶ added in v0.30.0
func (s *ControllerService) DeleteErrorReports(ctx context.Context, del ErrorReportDelete) error
DeleteErrorReports deletes error reports as specified by the ErrorReportDelete struct.
func (*ControllerService) DeleteExternalFile ¶ added in v0.34.0
func (s *ControllerService) DeleteExternalFile(ctx context.Context, name string) error
DeleteExternalFile deletes the given external file. This effectively also deletes the file on all satellites
func (*ControllerService) DeleteProp ¶ added in v0.27.0
func (s *ControllerService) DeleteProp(ctx context.Context, prop string) error
DeleteProp deletes the given property/key from the controller object.
func (*ControllerService) DownloadSOSReport ¶ added in v0.29.0
func (s *ControllerService) DownloadSOSReport(ctx context.Context, opts ...*ListOpts) error
DownloadSOSReport request sos report to download
func (*ControllerService) GetConfig ¶ added in v0.27.0
func (s *ControllerService) GetConfig(ctx context.Context, opts ...*ListOpts) (ControllerConfig, error)
GetConfig queries the configuration of a controller
func (*ControllerService) GetErrorReport ¶ added in v0.27.0
func (s *ControllerService) GetErrorReport(ctx context.Context, id string, opts ...*ListOpts) (ErrorReport, error)
GetErrorReport returns a specific error report, including its text.
func (*ControllerService) GetErrorReports ¶ added in v0.27.0
func (s *ControllerService) GetErrorReports(ctx context.Context, opts ...*ListOpts) ([]ErrorReport, error)
GetErrorReports returns all error reports. The Text field is not populated, use GetErrorReport to get the text of an error report.
func (*ControllerService) GetErrorReportsSince ¶ added in v0.27.0
func (s *ControllerService) GetErrorReportsSince(ctx context.Context, since time.Time, opts ...*ListOpts) ([]ErrorReport, error)
GetErrorReportsSince returns all error reports created after a certain point in time.
func (*ControllerService) GetExternalFile ¶ added in v0.34.0
func (s *ControllerService) GetExternalFile(ctx context.Context, name string) (ExternalFile, error)
GetExternalFile gets the requested external file including its content
func (*ControllerService) GetExternalFiles ¶ added in v0.34.0
func (s *ControllerService) GetExternalFiles(ctx context.Context, opts ...*ListOpts) ([]ExternalFile, error)
GetExternalFiles get a list of previously registered external files. File contents are not included, unless ListOpts.Content is true.
func (*ControllerService) GetProps ¶ added in v0.27.0
func (s *ControllerService) GetProps(ctx context.Context, opts ...*ListOpts) (ControllerProps, error)
GetProps gets all properties of a controller
func (*ControllerService) GetPropsInfos ¶ added in v0.34.0
func (s *ControllerService) GetPropsInfos(ctx context.Context, opts ...*ListOpts) ([]PropsInfo, error)
GetPropsInfos gets meta information about the properties that can be set on a controller.
func (*ControllerService) GetPropsInfosAll ¶ added in v0.34.0
func (s *ControllerService) GetPropsInfosAll(ctx context.Context, opts ...*ListOpts) ([]PropsInfo, error)
GetPropsInfosAll gets meta information about all properties that can be set on a controller and all entities it contains (nodes, resource definitions, ...).
func (*ControllerService) GetSatelliteConfig ¶ added in v0.29.0
func (s *ControllerService) GetSatelliteConfig(ctx context.Context, node string) (SatelliteConfig, error)
func (*ControllerService) GetVersion ¶ added in v0.27.0
func (s *ControllerService) GetVersion(ctx context.Context, opts ...*ListOpts) (ControllerVersion, error)
GetVersion queries version information for the controller.
func (*ControllerService) Modify ¶ added in v0.27.0
func (s *ControllerService) Modify(ctx context.Context, props GenericPropsModify) error
Modify modifies the controller node and sets/deletes the given properties.
func (*ControllerService) ModifyExternalFile ¶ added in v0.34.0
func (s *ControllerService) ModifyExternalFile(ctx context.Context, name string, file ExternalFile) error
ModifyExternalFile registers or modifies a previously registered external file
func (*ControllerService) ModifySatelliteConfig ¶ added in v0.29.0
func (s *ControllerService) ModifySatelliteConfig(ctx context.Context, node string, cfg SatelliteConfig) error
type ControllerVersion ¶ added in v0.16.4
type ControllerVersion struct { Version string `json:"version,omitempty"` GitHash string `json:"git_hash,omitempty"` BuildTime string `json:"build_time,omitempty"` RestApiVersion string `json:"rest_api_version,omitempty"` }
ControllerVersion represents version information of the LINSTOR controller
type DRBDMayPromoteStream ¶ added in v0.30.0
type DRBDMayPromoteStream struct { Events chan EventMayPromoteChange // contains filtered or unexported fields }
DRBDMayPromoteStream is a struct that contains a channel of EventMayPromoteChange events It has a Close() method that needs to be called/defered.
func (*DRBDMayPromoteStream) Close ¶ added in v0.30.0
func (dmp *DRBDMayPromoteStream) Close()
Close is used to close the underlying stream and all Go routines
type DrbdConnection ¶ added in v0.23.0
type DrbdConnection struct { Connected bool `json:"connected,omitempty"` // DRBD connection status Message string `json:"message,omitempty"` }
DrbdConnection is a struct representing the DRBD connection status
type DrbdProxyModify ¶ added in v0.16.0
type DrbdProxyModify struct { // Compression type used by the proxy. CompressionType string `json:"compression_type,omitempty"` // A string to string property map. CompressionProps map[string]string `json:"compression_props,omitempty"` GenericPropsModify }
type DrbdResource ¶
type DrbdResource struct { DrbdResourceDefinition DrbdResourceDefinitionLayer `json:"drbd_resource_definition,omitempty"` NodeId int32 `json:"node_id,omitempty"` PeerSlots int32 `json:"peer_slots,omitempty"` AlStripes int32 `json:"al_stripes,omitempty"` AlSize int64 `json:"al_size,omitempty"` Flags []string `json:"flags,omitempty"` DrbdVolumes []DrbdVolume `json:"drbd_volumes,omitempty"` Connections map[string]DrbdConnection `json:"connections,omitempty"` PromotionScore int32 `json:"promotion_score,omitempty"` MayPromote bool `json:"may_promote,omitempty"` }
DrbdResource is a struct used to give linstor drbd properties for a resource
type DrbdResourceDefinitionLayer ¶
type DrbdResourceDefinitionLayer struct { ResourceNameSuffix string `json:"resource_name_suffix,omitempty"` PeerSlots int32 `json:"peer_slots,omitempty"` AlStripes int64 `json:"al_stripes,omitempty"` // used drbd port for this resource Port int32 `json:"port,omitempty"` TransportType string `json:"transport_type,omitempty"` // drbd resource secret Secret string `json:"secret,omitempty"` Down bool `json:"down,omitempty"` }
DrbdResourceDefinitionLayer is a struct which contains the information about the layertype of a resource-definition on drbd level
type DrbdVolume ¶
type DrbdVolume struct { DrbdVolumeDefinition DrbdVolumeDefinition `json:"drbd_volume_definition,omitempty"` // drbd device path e.g. '/dev/drbd1000' DevicePath string `json:"device_path,omitempty"` // block device used by drbd BackingDevice string `json:"backing_device,omitempty"` MetaDisk string `json:"meta_disk,omitempty"` AllocatedSizeKib int64 `json:"allocated_size_kib,omitempty"` UsableSizeKib int64 `json:"usable_size_kib,omitempty"` // String describing current volume state DiskState string `json:"disk_state,omitempty"` // Storage pool name used for external meta data; null for internal ExtMetaStorPool string `json:"ext_meta_stor_pool,omitempty"` }
DrbdVolume is a struct for linstor to get inormation about a drbd-volume
type DrbdVolumeDefinition ¶
type DrbdVolumeDefinition struct { ResourceNameSuffix string `json:"resource_name_suffix,omitempty"` VolumeNumber int32 `json:"volume_number,omitempty"` MinorNumber int32 `json:"minor_number,omitempty"` }
DrbdVolumeDefinition is a struct containing volume-definition on drbd level
type EbsRemote ¶ added in v0.46.0
type EbsRemote struct { RemoteName string `json:"remote_name,omitempty"` Endpoint string `json:"endpoint,omitempty"` Region string `json:"region,omitempty"` AvailabilityZone string `json:"availability_zone,omitempty"` AccessKey string `json:"access_key,omitempty"` SecretKey string `json:"secret_key,omitempty"` }
type EncryptionProvider ¶ added in v0.34.0
type EncryptionProvider interface { // Create creates an encryption with the given passphrase Create(ctx context.Context, passphrase Passphrase) error // Modify modifies an existing passphrase Modify(ctx context.Context, passphrase Passphrase) error // Enter is used to enter a password so that content can be decrypted Enter(ctx context.Context, password string) error }
EncryptionProvider acts as an abstraction for an EncryptionService. It can be swapped out for another EncryptionService implementation, for example for testing.
type EncryptionService ¶
type EncryptionService struct {
// contains filtered or unexported fields
}
EncryptionService is the service that deals with encyrption related tasks.
func (*EncryptionService) Create ¶
func (n *EncryptionService) Create(ctx context.Context, passphrase Passphrase) error
Create creates an encryption with the given passphrase
func (*EncryptionService) Enter ¶
func (n *EncryptionService) Enter(ctx context.Context, password string) error
Enter is used to enter a password so that content can be decrypted
func (*EncryptionService) Modify ¶
func (n *EncryptionService) Modify(ctx context.Context, passphrase Passphrase) error
Modify modifies an existing passphrase
type ErrorReport ¶ added in v0.27.0
type ErrorReport struct { NodeName string `json:"node_name,omitempty"` ErrorTime TimeStampMs `json:"error_time"` // Filename of the error report on the server. Format is: “`ErrorReport-{instanceid}-{nodeid}-{sequencenumber}.log“` Filename string `json:"filename,omitempty"` // Contains the full text of the error report file. Text string `json:"text,omitempty"` // Which module this error occurred. Module string `json:"module,omitempty"` // Linstor version this error report was created. Version string `json:"version,omitempty"` // Peer client that was involved. Peer string `json:"peer,omitempty"` // Exception that occurred Exception string `json:"exception,omitempty"` // Exception message ExceptionMessage string `json:"exception_message,omitempty"` // Origin file of the exception OriginFile string `json:"origin_file,omitempty"` // Origin method where the exception occurred OriginMethod string `json:"origin_method,omitempty"` // Origin line number OriginLine int32 `json:"origin_line,omitempty"` }
ErrorReport struct for ErrorReport
type ErrorReportDelete ¶ added in v0.30.0
type ErrorReportDelete struct { Since *TimeStampMs `json:"since,omitempty"` To *TimeStampMs `json:"to,omitempty"` // on which nodes to delete error-reports, if empty/null all nodes Nodes []string `json:"nodes,omitempty"` // delete all error reports with the given exception Exception string `json:"exception,omitempty"` // delete all error reports from the given version Version string `json:"version,omitempty"` // error report ids to delete Ids []string `json:"ids,omitempty"` }
type EventMayPromoteChange ¶ added in v0.30.0
type EventProvider ¶ added in v0.34.0
type EventProvider interface { // DRBDPromotion is used to subscribe to LINSTOR DRBD Promotion events DRBDPromotion(ctx context.Context, lastEventId string) (*DRBDMayPromoteStream, error) }
EventProvider acts as an abstraction for an EventService. It can be swapped out for another EventService implementation, for example for testing.
type EventService ¶ added in v0.30.0
type EventService struct {
// contains filtered or unexported fields
}
EventService is the service that deals with LINSTOR server side event streams.
func (*EventService) DRBDPromotion ¶ added in v0.30.0
func (e *EventService) DRBDPromotion(ctx context.Context, lastEventId string) (*DRBDMayPromoteStream, error)
DRBDPromotion is used to subscribe to LINSTOR DRBD Promotion events
type ExosConnectionMap ¶ added in v0.34.0
type ExosConnectionMap struct { NodeName string `json:"node_name,omitempty"` EnclosureName string `json:"enclosure_name,omitempty"` Connections []string `json:"connections,omitempty"` }
ExosConnectionMap struct for ExosConnectionMap
type ExosDefaults ¶ added in v0.34.0
type ExosDefaults struct { Username string `json:"username,omitempty"` UsernameEnv string `json:"username_env,omitempty"` Password string `json:"password,omitempty"` PasswordEnv string `json:"password_env,omitempty"` }
ExosDefaults Default settings for EXOS enclosures
type ExosDefaultsModify ¶ added in v0.34.0
type ExosDefaultsModify struct { Username string `json:"username,omitempty"` UsernameEnv string `json:"username_env,omitempty"` Password string `json:"password,omitempty"` PasswordEnv string `json:"password_env,omitempty"` // A list of keys to unset. The keys have to exist in ExosDefaults UnsetKeys []string `json:"unset_keys,omitempty"` }
ExosDefaultsModify struct for ExosDefaultsModify
type ExosDefaultsModifyAllOf ¶ added in v0.34.0
type ExosDefaultsModifyAllOf struct { // A list of keys to unset. The keys have to exist in ExosDefaults UnsetKeys []string `json:"unset_keys,omitempty"` }
ExosDefaultsModifyAllOf struct for ExosDefaultsModifyAllOf
type ExosEnclosure ¶ added in v0.34.0
type ExosEnclosure struct { Name string `json:"name,omitempty"` CtrlAIp string `json:"ctrl_a_ip,omitempty"` CtrlBIp string `json:"ctrl_b_ip,omitempty"` Username string `json:"username,omitempty"` UsernameEnv string `json:"username_env,omitempty"` Password string `json:"password,omitempty"` PasswordEnv string `json:"password_env,omitempty"` }
ExosEnclosure EXOS enclosure
type ExosEnclosureEvent ¶ added in v0.34.0
type ExosEnclosureEvent struct { Severity string `json:"severity,omitempty"` EventId string `json:"event_id,omitempty"` Controller string `json:"controller,omitempty"` TimeStamp string `json:"time_stamp,omitempty"` TimeStampNumeric int64 `json:"time_stamp_numeric,omitempty"` Message string `json:"message,omitempty"` AdditionalInformation string `json:"additional_information,omitempty"` RecommendedAction string `json:"recommended_action,omitempty"` }
ExosEnclosureEvent EXOS event
type ExosEnclosureHealth ¶ added in v0.34.0
type ExosEnclosureHealth struct { Name string `json:"name,omitempty"` CtrlAIp string `json:"ctrl_a_ip,omitempty"` CtrlBIp string `json:"ctrl_b_ip,omitempty"` Health string `json:"health,omitempty"` HealthReason string `json:"health_reason,omitempty"` }
ExosEnclosureHealth EXOS enclosure name, controller IPs and health status
type ExternalFile ¶ added in v0.34.0
ExternalFile is an external file which can be configured to be deployed by Linstor
func (*ExternalFile) MarshalJSON ¶ added in v0.35.0
func (e *ExternalFile) MarshalJSON() ([]byte, error)
func (*ExternalFile) UnmarshalJSON ¶ added in v0.35.0
func (e *ExternalFile) UnmarshalJSON(text []byte) error
type GenericPropsModify ¶ added in v0.16.0
type GenericPropsModify struct { DeleteProps DeleteProps `json:"delete_props,omitempty"` OverrideProps OverrideProps `json:"override_props,omitempty"` DeleteNamespaces DeleteNamespaces `json:"delete_namespaces,omitempty"` }
GenericPropsModify is a struct combining DeleteProps and OverrideProps
type KeyValueStoreProvider ¶ added in v0.40.0
type KeyValueStoreService ¶ added in v0.40.0
type KeyValueStoreService struct {
// contains filtered or unexported fields
}
func (*KeyValueStoreService) CreateOrModify ¶ added in v0.40.0
func (k *KeyValueStoreService) CreateOrModify(ctx context.Context, kv string, modify GenericPropsModify) error
func (*KeyValueStoreService) Delete ¶ added in v0.40.0
func (k *KeyValueStoreService) Delete(ctx context.Context, kv string) error
type LeveledLogger ¶ added in v0.18.0
type LeveledLogger interface { Errorf(string, ...interface{}) Infof(string, ...interface{}) Debugf(string, ...interface{}) Warnf(string, ...interface{}) }
LeveledLogger interface implements the basic methods that a logger library needs
type LinstorRemote ¶ added in v0.37.0
type ListOpts ¶
type ListOpts struct { // Number of items to skip. Only used if Limit is a positive value Offset int `url:"offset"` // Maximum number of items to retrieve Limit int `url:"limit"` // Some responses can be cached controller side, such as snapshot lists Cached *bool `url:"cached,omitempty"` StoragePool []string `url:"storage_pools"` Resource []string `url:"resources"` Node []string `url:"nodes"` Prop []string `url:"props"` Snapshots []string `url:"snapshots"` Status string `url:"status,omitempty"` // Content is used in the files API. If true, fetching files will include the content. Content bool `url:"content,omitempty"` }
ListOpts is a struct primarily used to define parameters used for pagination. It is also used for filtering (e.g., the /view/ calls)
type Logger ¶ added in v0.18.0
type Logger interface {
Printf(string, ...interface{})
}
Logger represents a standard logger interface
type LuksResource ¶
type LuksResource struct {
StorageVolumes []LuksVolume `json:"storage_volumes,omitempty"`
}
LuksResource is a struct to store storage-volumes for a luks-resource
type LuksVolume ¶
type LuksVolume struct { VolumeNumber int32 `json:"volume_number,omitempty"` // block device path DevicePath string `json:"device_path,omitempty"` // block device used by luks BackingDevice string `json:"backing_device,omitempty"` AllocatedSizeKib int64 `json:"allocated_size_kib,omitempty"` UsableSizeKib int64 `json:"usable_size_kib,omitempty"` // String describing current volume state DiskState string `json:"disk_state,omitempty"` Opened bool `json:"opened,omitempty"` }
LuksVolume is a struct used for information about a luks-volume
type MaxVolumeSizes ¶ added in v0.17.3
type MaxVolumeSizes struct { Candidates []Candidate `json:"candidates,omitempty"` DefaultMaxOversubscriptionRatio float64 `json:"default_max_oversubscription_ratio,omitempty"` }
MaxVolumeSizes struct for MaxVolumeSizes
type NetInterface ¶
type NetInterface struct { Name string `json:"name"` Address net.IP `json:"address"` SatellitePort int32 `json:"satellite_port,omitempty"` SatelliteEncryptionType string `json:"satellite_encryption_type,omitempty"` // Defines if this netinterface should be used for the satellite connection IsActive bool `json:"is_active,omitempty"` // unique object id Uuid string `json:"uuid,omitempty"` }
NetInterface represents a node's network interface.
type Node ¶
type Node struct { Name string `json:"name"` Type string `json:"type"` Flags []string `json:"flags,omitempty"` // A string to string property map. Props map[string]string `json:"props,omitempty"` NetInterfaces []NetInterface `json:"net_interfaces,omitempty"` // Enum describing the current connection status. ConnectionStatus string `json:"connection_status,omitempty"` // unique object id Uuid string `json:"uuid,omitempty"` StorageProviders []ProviderKind `json:"storage_providers,omitempty"` ResourceLayers []devicelayerkind.DeviceLayerKind `json:"resource_layers,omitempty"` UnsupportedProviders map[ProviderKind][]string `json:"unsupported_providers,omitempty"` UnsupportedLayers map[devicelayerkind.DeviceLayerKind][]string `json:"unsupported_layers,omitempty"` // milliseconds since unix epoch in UTC EvictionTimestamp *TimeStampMs `json:"eviction_timestamp,omitempty"` }
Node represents a node in LINSTOR
type NodeModify ¶ added in v0.16.0
type NodeModify struct { NodeType string `json:"node_type,omitempty"` // A string to string property map. GenericPropsModify }
type NodeProvider ¶ added in v0.34.0
type NodeProvider interface { // GetAll gets information for all registered nodes. GetAll(ctx context.Context, opts ...*ListOpts) ([]Node, error) // Get gets information for a particular node. Get(ctx context.Context, nodeName string, opts ...*ListOpts) (Node, error) // Create creates a new node object. Create(ctx context.Context, node Node) error // CreateEbsNode creates a special virtual satellite for interacting with EBS. CreateEbsNode(ctx context.Context, name string, remoteName string) error // Modify modifies the given node and sets/deletes the given properties. Modify(ctx context.Context, nodeName string, props NodeModify) error // Delete deletes the given node. Delete(ctx context.Context, nodeName string) error // Lost marks the given node as lost to delete an unrecoverable node. Lost(ctx context.Context, nodeName string) error // Reconnect reconnects a node to the controller. Reconnect(ctx context.Context, nodeName string) error // GetNetInterfaces gets information about all network interfaces of a given node. GetNetInterfaces(ctx context.Context, nodeName string, opts ...*ListOpts) ([]NetInterface, error) // GetNetInterface gets information about a particular network interface on a given node. GetNetInterface(ctx context.Context, nodeName, nifName string, opts ...*ListOpts) (NetInterface, error) // CreateNetInterface creates the given network interface on a given node. CreateNetInterface(ctx context.Context, nodeName string, nif NetInterface) error // ModifyNetInterface modifies the given network interface on a given node. ModifyNetInterface(ctx context.Context, nodeName, nifName string, nif NetInterface) error // DeleteNetinterface deletes the given network interface on a given node. DeleteNetinterface(ctx context.Context, nodeName, nifName string) error // GetStoragePoolView gets information about all storage pools in the cluster. GetStoragePoolView(ctx context.Context, opts ...*ListOpts) ([]StoragePool, error) // GetStoragePools gets information about all storage pools on a given node. GetStoragePools(ctx context.Context, nodeName string, opts ...*ListOpts) ([]StoragePool, error) // GetStoragePool gets information about a specific storage pool on a given node. GetStoragePool(ctx context.Context, nodeName, spName string, opts ...*ListOpts) (StoragePool, error) // CreateStoragePool creates a storage pool on a given node. CreateStoragePool(ctx context.Context, nodeName string, sp StoragePool) error // ModifyStoragePool modifies a storage pool on a given node. ModifyStoragePool(ctx context.Context, nodeName, spName string, genericProps GenericPropsModify) error // DeleteStoragePool deletes a storage pool on a given node. DeleteStoragePool(ctx context.Context, nodeName, spName string) error // CreateDevicePool creates an LVM, LVM-thin or ZFS pool, optional VDO under it on a given node. CreateDevicePool(ctx context.Context, nodeName string, psc PhysicalStorageCreate) error // GetPhysicalStorageView gets a grouped list of physical storage that can be turned into a LINSTOR storage-pool GetPhysicalStorageView(ctx context.Context, opts ...*ListOpts) ([]PhysicalStorageViewItem, error) // GetPhysicalStorage gets a list of unconfigured physical storage on a node. GetPhysicalStorage(ctx context.Context, nodeName string) ([]PhysicalStorageNode, error) // GetStoragePoolPropsInfos gets meta information about the properties // that can be set on a storage pool on a particular node. GetStoragePoolPropsInfos(ctx context.Context, nodeName string, opts ...*ListOpts) ([]PropsInfo, error) // GetPropsInfos gets meta information about the properties that can be // set on a node. GetPropsInfos(ctx context.Context, opts ...*ListOpts) ([]PropsInfo, error) // Evict the given node, migrating resources to the remaining nodes, if possible. This is meant for offline nodes. Evict(ctx context.Context, nodeName string) error // Restore an evicted node, optionally keeping existing resources. Restore(ctx context.Context, nodeName string, restore NodeRestore) error // Evacuate the given node, migrating resources to remaining nodes. While Evict works only on offline nodes, this // is meant for online nodes. Evacuate(ctx context.Context, nodeName string) error }
NodeProvider acts as an abstraction for a NodeService. It can be swapped out for another NodeService implementation, for example for testing.
type NodeRestore ¶ added in v0.37.0
type NodeService ¶
type NodeService struct {
// contains filtered or unexported fields
}
NodeService is the service that deals with node related tasks.
func (*NodeService) Create ¶
func (n *NodeService) Create(ctx context.Context, node Node) error
Create creates a new node object.
func (*NodeService) CreateDevicePool ¶ added in v0.17.0
func (n *NodeService) CreateDevicePool(ctx context.Context, nodeName string, psc PhysicalStorageCreate) error
CreateDevicePool creates an LVM, LVM-thin or ZFS pool, optional VDO under it on a given node.
func (*NodeService) CreateEbsNode ¶ added in v0.46.0
func (n *NodeService) CreateEbsNode(ctx context.Context, name, remoteName string) error
func (*NodeService) CreateNetInterface ¶
func (n *NodeService) CreateNetInterface(ctx context.Context, nodeName string, nif NetInterface) error
CreateNetInterface creates the given network interface on a given node.
func (*NodeService) CreateStoragePool ¶
func (n *NodeService) CreateStoragePool(ctx context.Context, nodeName string, sp StoragePool) error
CreateStoragePool creates a storage pool on a given node.
func (*NodeService) Delete ¶
func (n *NodeService) Delete(ctx context.Context, nodeName string) error
Delete deletes the given node.
func (*NodeService) DeleteNetinterface ¶
func (n *NodeService) DeleteNetinterface(ctx context.Context, nodeName, nifName string) error
DeleteNetinterface deletes the given network interface on a given node.
func (*NodeService) DeleteStoragePool ¶
func (n *NodeService) DeleteStoragePool(ctx context.Context, nodeName, spName string) error
DeleteStoragePool deletes a storage pool on a given node.
func (NodeService) Evacuate ¶ added in v0.41.0
func (n NodeService) Evacuate(ctx context.Context, nodeName string) error
Evacuate the given node, migrating resources to remaining nodes. While Evict works only on offline nodes, this is meant for online nodes.
func (NodeService) Evict ¶ added in v0.37.0
func (n NodeService) Evict(ctx context.Context, nodeName string) error
Evict the given node, migrating resources to the remaining nodes, if possible.
func (*NodeService) GetNetInterface ¶
func (n *NodeService) GetNetInterface(ctx context.Context, nodeName, nifName string, opts ...*ListOpts) (NetInterface, error)
GetNetInterface gets information about a particular network interface on a given node.
func (*NodeService) GetNetInterfaces ¶
func (n *NodeService) GetNetInterfaces(ctx context.Context, nodeName string, opts ...*ListOpts) ([]NetInterface, error)
GetNetInterfaces gets information about all network interfaces of a given node.
func (*NodeService) GetPhysicalStorage ¶ added in v0.17.0
func (n *NodeService) GetPhysicalStorage(ctx context.Context, nodeName string) ([]PhysicalStorageNode, error)
func (*NodeService) GetPhysicalStorageView ¶ added in v0.44.0
func (n *NodeService) GetPhysicalStorageView(ctx context.Context, opts ...*ListOpts) ([]PhysicalStorageViewItem, error)
GetPhysicalStorageView gets a grouped list of physical storage that can be turned into a LINSTOR storage-pool
func (*NodeService) GetPropsInfos ¶ added in v0.34.0
GetPropsInfos gets meta information about the properties that can be set on a node.
func (*NodeService) GetStoragePool ¶
func (n *NodeService) GetStoragePool(ctx context.Context, nodeName, spName string, opts ...*ListOpts) (StoragePool, error)
GetStoragePool gets information about a specific storage pool on a given node.
func (*NodeService) GetStoragePoolPropsInfos ¶ added in v0.34.0
func (n *NodeService) GetStoragePoolPropsInfos(ctx context.Context, nodeName string, opts ...*ListOpts) ([]PropsInfo, error)
GetStoragePoolPropsInfos gets meta information about the properties that can be set on a storage pool on a particular node.
func (*NodeService) GetStoragePoolView ¶ added in v0.16.0
func (n *NodeService) GetStoragePoolView(ctx context.Context, opts ...*ListOpts) ([]StoragePool, error)
GetStoragePoolView gets information about all storage pools in the cluster.
func (*NodeService) GetStoragePools ¶
func (n *NodeService) GetStoragePools(ctx context.Context, nodeName string, opts ...*ListOpts) ([]StoragePool, error)
GetStoragePools gets information about all storage pools on a given node.
func (*NodeService) Lost ¶
func (n *NodeService) Lost(ctx context.Context, nodeName string) error
Lost marks the given node as lost to delete an unrecoverable node.
func (*NodeService) Modify ¶
func (n *NodeService) Modify(ctx context.Context, nodeName string, props NodeModify) error
Modify modifies the given node and sets/deletes the given properties.
func (*NodeService) ModifyNetInterface ¶
func (n *NodeService) ModifyNetInterface(ctx context.Context, nodeName, nifName string, nif NetInterface) error
ModifyNetInterface modifies the given network interface on a given node.
func (*NodeService) ModifyStoragePool ¶
func (n *NodeService) ModifyStoragePool(ctx context.Context, nodeName, spName string, genericProps GenericPropsModify) error
ModifyStoragePool modifies a storage pool on a given node.
func (*NodeService) Reconnect ¶
func (n *NodeService) Reconnect(ctx context.Context, nodeName string) error
Reconnect reconnects a node to the controller.
func (*NodeService) Restore ¶ added in v0.34.0
func (n *NodeService) Restore(ctx context.Context, nodeName string, restore NodeRestore) error
Restore an evicted node, optionally keeping existing resources.
type NvmeResource ¶ added in v0.15.0
type NvmeResource struct {
NvmeVolumes []NvmeVolume `json:"nvme_volumes,omitempty"`
}
type NvmeVolume ¶ added in v0.15.0
type NvmeVolume struct { VolumeNumber int32 `json:"volume_number,omitempty"` // block device path DevicePath string `json:"device_path,omitempty"` // block device used by nvme BackingDevice string `json:"backing_device,omitempty"` AllocatedSizeKib int64 `json:"allocated_size_kib,omitempty"` UsableSizeKib int64 `json:"usable_size_kib,omitempty"` // String describing current volume state DiskState string `json:"disk_state,omitempty"` }
type OneOfDrbdVolumeDefinition ¶
type OneOfDrbdVolumeDefinition interface {
// contains filtered or unexported methods
}
OneOfDrbdVolumeDefinition is used to prevent other layertypes than drbd-volume-defintion
type OneOfDrbdVolumeLuksVolumeStorageVolumeNvmeVolumeWritecacheVolumeCacheVolumeBCacheVolume ¶ added in v0.36.0
type OneOfDrbdVolumeLuksVolumeStorageVolumeNvmeVolumeWritecacheVolumeCacheVolumeBCacheVolume interface {
// contains filtered or unexported methods
}
OneOfDrbdVolumeLuksVolumeStorageVolumeNvmeVolumeWritecacheVolumeCacheVolume is used to prevent that other types than drbd- luks- and storage-volume are used for a VolumeLayer
type Option ¶ added in v0.21.0
Option configures a LINSTOR Client
func BasicAuth ¶ added in v0.16.2
func BasicAuth(basicauth *BasicAuthCfg) Option
BasicAuth is a client's option to set username and password for the REST client.
func BearerToken ¶ added in v0.46.0
BearerToken configures authentication via the given token send in the Authorization Header. If set, this will override any authentication happening via Basic Authentication.
func Controllers ¶ added in v0.36.0
func HTTPClient ¶
HTTPClient is a client's option to set a specific http.Client.
func Limit ¶ added in v0.15.0
Limit is the client's option to set number of requests per second and max number of bursts. Mutually exclusive with Limiter, last applied option wins. Deprecated: Use Limiter instead.
type OverrideProps ¶
OverrideProps is a map of properties to modify (key/value pairs)
type Passphrase ¶
type Passphrase struct { NewPassphrase string `json:"new_passphrase,omitempty"` OldPassphrase string `json:"old_passphrase,omitempty"` }
Passphrase represents a LINSTOR passphrase
type PhysicalStorageCreate ¶ added in v0.17.0
type PhysicalStorageCreate struct { ProviderKind ProviderKind `json:"provider_kind"` DevicePaths []string `json:"device_paths"` // RAID level to use for pool. RaidLevel string `json:"raid_level,omitempty"` PoolName string `json:"pool_name,omitempty"` VdoEnable bool `json:"vdo_enable,omitempty"` VdoSlabSizeKib int64 `json:"vdo_slab_size_kib,omitempty"` VdoLogicalSizeKib int64 `json:"vdo_logical_size_kib,omitempty"` WithStoragePool PhysicalStorageStoragePoolCreate `json:"with_storage_pool,omitempty"` }
PhysicalStorageCreate is a configuration struct used to represent pysical storage on a given node. If with_storage_pool is set a linstor storage pool will also be created using this device pool
type PhysicalStorageDevice ¶ added in v0.17.0
type PhysicalStorageDevice struct { Device string `json:"device,omitempty"` Model string `json:"model,omitempty"` Serial string `json:"serial,omitempty"` Wwn string `json:"wwn,omitempty"` }
PhysicalStorageDevice represents a physical storage device on a a node.
type PhysicalStorageNode ¶ added in v0.44.0
type PhysicalStorageNode struct { PhysicalStorageDevice Size int64 `json:"size,omitempty"` Rotational bool `json:"rotational,omitempty"` }
type PhysicalStorageStoragePoolCreate ¶ added in v0.19.0
type PhysicalStorageStoragePoolCreate struct { // Name of the linstor storage pool Name string `json:"name,omitempty"` // A string to string property map. Props map[string]string `json:"props,omitempty"` SharedSpace string `json:"shared_space,omitempty"` // true if a shared storage pool uses linstor-external locking, like cLVM ExternalLocking bool `json:"external_locking,omitempty"` }
PhysicalStorageStoragePoolCreate is used for create physical-storage
type PhysicalStorageViewItem ¶ added in v0.44.0
type PhysicalStorageViewItem struct { Size int64 `json:"size,omitempty"` Rotational bool `json:"rotational,omitempty"` Nodes map[string][]PhysicalStorageDevice `json:"nodes,omitempty"` }
PhysicalStorageViewItem is a view on a physical storage on multiple nodes.
type ProviderKind ¶
type ProviderKind string
ProviderKind is a type that represents various types of storage.
const ( DISKLESS ProviderKind = "DISKLESS" LVM ProviderKind = "LVM" LVM_THIN ProviderKind = "LVM_THIN" ZFS ProviderKind = "ZFS" ZFS_THIN ProviderKind = "ZFS_THIN" FILE ProviderKind = "FILE" FILE_THIN ProviderKind = "FILE_THIN" SPDK ProviderKind = "SPDK" EBS_TARGET ProviderKind = "EBS_TARGET" EBS_INIT ProviderKind = "EBS_INIT" )
List of ProviderKind
type RDGetAllRequest ¶ added in v0.37.1
type RDGetAllRequest struct { // ResourceDefinitions filters the returned resource definitions by the given names ResourceDefinitions []string `url:"resource_definitions,omitempty"` // Props filters the returned resource definitions on their property values (uses key=value syntax) Props []string `url:"props,omitempty"` Offset int `url:"offset,omitempty"` Limit int `url:"offset,omitempty"` // WithVolumeDefinitions, if set to true, LINSTOR will also include volume definitions in the response. WithVolumeDefinitions bool `url:"with_volume_definitions,omitempty"` }
type RemoteList ¶ added in v0.37.0
type RemoteList struct { S3Remotes []S3Remote `json:"s3_remotes,omitempty"` LinstorRemotes []LinstorRemote `json:"linstor_remotes,omitempty"` EbsRemotes []EbsRemote `json:"ebs_remotes,omitempty"` }
type RemoteProvider ¶ added in v0.37.0
type RemoteProvider interface { // GetAll returns the list of all registered remotes. GetAll(ctx context.Context, opts ...*ListOpts) (RemoteList, error) // GetAllLinstor returns the list of LINSTOR remotes. GetAllLinstor(ctx context.Context, opts ...*ListOpts) ([]LinstorRemote, error) // GetAllS3 returns the list of S3 remotes. GetAllS3(ctx context.Context, opts ...*ListOpts) ([]S3Remote, error) // GetAllEbs returns the list of EBS remotes. GetAllEbs(ctx context.Context, opts ...*ListOpts) ([]EbsRemote, error) // CreateLinstor creates a new LINSTOR remote. CreateLinstor(ctx context.Context, create LinstorRemote) error // CreateS3 creates a new S3 remote. CreateS3(ctx context.Context, create S3Remote) error // CreateEbs creates a new EBS remote. CreateEbs(ctx context.Context, create EbsRemote) error // Delete a named remote. Delete(ctx context.Context, remoteName string) error // ModifyLinstor modifies the given LINSTOR remote. ModifyLinstor(ctx context.Context, remoteName string, modify LinstorRemote) error // ModifyS3 modifies the given S3 remote. ModifyS3(ctx context.Context, remoteName string, modify S3Remote) error // ModifyEbs modifies the given EBS remote. ModifyEbs(ctx context.Context, remoteName string, modify EbsRemote) error }
type RemoteService ¶ added in v0.37.0
type RemoteService struct {
// contains filtered or unexported fields
}
func (*RemoteService) CreateEbs ¶ added in v0.46.0
func (r *RemoteService) CreateEbs(ctx context.Context, create EbsRemote) error
func (*RemoteService) CreateLinstor ¶ added in v0.37.0
func (r *RemoteService) CreateLinstor(ctx context.Context, create LinstorRemote) error
func (*RemoteService) CreateS3 ¶ added in v0.37.0
func (r *RemoteService) CreateS3(ctx context.Context, create S3Remote) error
func (*RemoteService) Delete ¶ added in v0.37.0
func (r *RemoteService) Delete(ctx context.Context, remoteName string) error
func (*RemoteService) GetAll ¶ added in v0.37.0
func (r *RemoteService) GetAll(ctx context.Context, opts ...*ListOpts) (RemoteList, error)
func (*RemoteService) GetAllLinstor ¶ added in v0.37.0
func (r *RemoteService) GetAllLinstor(ctx context.Context, opts ...*ListOpts) ([]LinstorRemote, error)
func (*RemoteService) ModifyLinstor ¶ added in v0.37.0
func (r *RemoteService) ModifyLinstor(ctx context.Context, remoteName string, modify LinstorRemote) error
type Resource ¶
type Resource struct { Name string `json:"name,omitempty"` NodeName string `json:"node_name,omitempty"` // A string to string property map. Props map[string]string `json:"props,omitempty"` Flags []string `json:"flags,omitempty"` LayerObject *ResourceLayer `json:"layer_object,omitempty"` State *ResourceState `json:"state,omitempty"` // unique object id Uuid string `json:"uuid,omitempty"` // milliseconds since unix epoch in UTC CreateTimestamp *TimeStampMs `json:"create_timestamp,omitempty"` }
Resource is a struct which holds the information of a resource
type ResourceConnection ¶
type ResourceConnection struct { // source node of the connection NodeA string `json:"node_a,omitempty"` // target node of the connection NodeB string `json:"node_b,omitempty"` // A string to string property map. Props map[string]string `json:"props,omitempty"` Flags []string `json:"flags,omitempty"` Port int32 `json:"port,omitempty"` }
ResourceConnection is a struct which holds information about a connection between to nodes
type ResourceCreate ¶ added in v0.15.0
type ResourceCreate struct { Resource Resource `json:"resource,omitempty"` LayerList []devicelayerkind.DeviceLayerKind `json:"layer_list,omitempty"` DrbdNodeId int32 `json:"drbd_node_id,omitempty"` }
ResourceCreate is a struct where the properties of a resource are stored to create it
type ResourceDefinition ¶
type ResourceDefinition struct { Name string `json:"name,omitempty"` // External name can be used to have native resource names. If you need to store a non Linstor compatible resource name use this field and Linstor will generate a compatible name. ExternalName string `json:"external_name,omitempty"` // A string to string property map. Props map[string]string `json:"props,omitempty"` Flags []string `json:"flags,omitempty"` LayerData []ResourceDefinitionLayer `json:"layer_data,omitempty"` // unique object id Uuid string `json:"uuid,omitempty"` // name of the linked resource group, if there is a link ResourceGroupName string `json:"resource_group_name,omitempty"` }
ResourceDefinition is a struct to store the information about a resource-definition
type ResourceDefinitionCloneRequest ¶ added in v0.37.0
type ResourceDefinitionCloneStarted ¶ added in v0.37.0
type ResourceDefinitionCloneStatus ¶ added in v0.37.0
type ResourceDefinitionCloneStatus struct {
Status clonestatus.CloneStatus `json:"status"`
}
type ResourceDefinitionCreate ¶ added in v0.15.0
type ResourceDefinitionCreate struct { // drbd port for resources DrbdPort int32 `json:"drbd_port,omitempty"` // drbd resource secret DrbdSecret string `json:"drbd_secret,omitempty"` DrbdTransportType string `json:"drbd_transport_type,omitempty"` ResourceDefinition ResourceDefinition `json:"resource_definition"` }
ResourceDefinitionCreate is a struct for holding the data needed to create a resource-defintion
type ResourceDefinitionLayer ¶
type ResourceDefinitionLayer struct { Type devicelayerkind.DeviceLayerKind `json:"type,omitempty"` Data *DrbdResourceDefinitionLayer `json:"data,omitempty"` }
ResourceDefinitionLayer is a struct for the storing the layertype of a resource-defintion
func (*ResourceDefinitionLayer) UnmarshalJSON ¶
func (rd *ResourceDefinitionLayer) UnmarshalJSON(b []byte) error
UnmarshalJSON is needed for the unmarshal interface for ResourceDefinitionLayer types
type ResourceDefinitionModify ¶ added in v0.16.0
type ResourceDefinitionModify struct { // drbd port for resources DrbdPort int32 `json:"drbd_port,omitempty"` // drbd peer slot number DrbdPeerSlots int32 `json:"drbd_peer_slots,omitempty"` LayerStack []devicelayerkind.DeviceLayerKind `json:"layer_stack,omitempty"` // change resource group to the given group name ResourceGroup string `json:"resource_group,omitempty"` GenericPropsModify }
type ResourceDefinitionProvider ¶ added in v0.34.0
type ResourceDefinitionProvider interface { // GetAll lists all resource-definitions GetAll(ctx context.Context, request RDGetAllRequest) ([]ResourceDefinitionWithVolumeDefinition, error) // Get return information about a resource-defintion Get(ctx context.Context, resDefName string, opts ...*ListOpts) (ResourceDefinition, error) // Create adds a new resource-definition Create(ctx context.Context, resDef ResourceDefinitionCreate) error // Modify allows to modify a resource-definition Modify(ctx context.Context, resDefName string, props GenericPropsModify) error // Delete completely deletes a resource-definition Delete(ctx context.Context, resDefName string) error // GetVolumeDefinitions returns all volume-definitions of a resource-definition GetVolumeDefinitions(ctx context.Context, resDefName string, opts ...*ListOpts) ([]VolumeDefinition, error) // GetVolumeDefinition shows the properties of a specific volume-definition GetVolumeDefinition(ctx context.Context, resDefName string, volNr int, opts ...*ListOpts) (VolumeDefinition, error) // CreateVolumeDefinition adds a volume-definition to a resource-definition. Only the size is required. CreateVolumeDefinition(ctx context.Context, resDefName string, volDef VolumeDefinitionCreate) error // ModifyVolumeDefinition give the abilty to modify a specific volume-definition ModifyVolumeDefinition(ctx context.Context, resDefName string, volNr int, props VolumeDefinitionModify) error // DeleteVolumeDefinition deletes a specific volume-definition DeleteVolumeDefinition(ctx context.Context, resDefName string, volNr int) error // GetPropsInfos gets meta information about the properties that can be // set on a resource definition. GetPropsInfos(ctx context.Context, opts ...*ListOpts) ([]PropsInfo, error) // GetDRBDProxyPropsInfos gets meta information about the properties // that can be set on a resource definition for drbd proxy. GetDRBDProxyPropsInfos(ctx context.Context, resDefName string, opts ...*ListOpts) ([]PropsInfo, error) // AttachExternalFile adds an external file to the resource definition. This // means that the file will be deployed to every node the resource is deployed on. AttachExternalFile(ctx context.Context, resDefName string, filePath string) error // DetachExternalFile removes a binding between an external file and a resource definition. // This means that the file will no longer be deployed on every node the resource // is deployed on. DetachExternalFile(ctx context.Context, resDefName string, filePath string) error // Clone starts cloning a resource definition and all resources using a method optimized for the storage driver. Clone(ctx context.Context, srcResDef string, request ResourceDefinitionCloneRequest) (ResourceDefinitionCloneStarted, error) // CloneStatus fetches the current status of a clone operation started by Clone. CloneStatus(ctx context.Context, srcResDef, targetResDef string) (ResourceDefinitionCloneStatus, error) // SyncStatus checks if a resource is currently in sync on all nodes SyncStatus(ctx context.Context, resDef string) (ResourceDefinitionSyncStatus, error) }
ResourceDefinitionProvider acts as an abstraction for a ResourceDefinitionService. It can be swapped out for another ResourceDefinitionService implementation, for example for testing.
type ResourceDefinitionService ¶
type ResourceDefinitionService struct {
// contains filtered or unexported fields
}
ResourceDefinitionService is a struct for the client pointer
func (*ResourceDefinitionService) AttachExternalFile ¶ added in v0.35.0
func (n *ResourceDefinitionService) AttachExternalFile(ctx context.Context, resDefName string, filePath string) error
AttachExternalFile adds an external file to the resource definition. This means that the file will be deployed to every node the resource is deployed on.
func (*ResourceDefinitionService) Clone ¶ added in v0.37.0
func (n *ResourceDefinitionService) Clone(ctx context.Context, srcResDef string, request ResourceDefinitionCloneRequest) (ResourceDefinitionCloneStarted, error)
Clone starts cloning a resource definition and all resources using a method optimized for the storage driver.
func (*ResourceDefinitionService) CloneStatus ¶ added in v0.37.0
func (n *ResourceDefinitionService) CloneStatus(ctx context.Context, srcResDef, targetResDef string) (ResourceDefinitionCloneStatus, error)
CloneStatus fetches the current status of a clone operation started by Clone.
func (*ResourceDefinitionService) Create ¶
func (n *ResourceDefinitionService) Create(ctx context.Context, resDef ResourceDefinitionCreate) error
Create adds a new resource-definition
func (*ResourceDefinitionService) CreateVolumeDefinition ¶
func (n *ResourceDefinitionService) CreateVolumeDefinition(ctx context.Context, resDefName string, volDef VolumeDefinitionCreate) error
CreateVolumeDefinition adds a volume-definition to a resource-definition. Only the size is required.
func (*ResourceDefinitionService) Delete ¶
func (n *ResourceDefinitionService) Delete(ctx context.Context, resDefName string) error
Delete completely deletes a resource-definition
func (*ResourceDefinitionService) DeleteVolumeDefinition ¶
func (n *ResourceDefinitionService) DeleteVolumeDefinition(ctx context.Context, resDefName string, volNr int) error
DeleteVolumeDefinition deletes a specific volume-definition
func (*ResourceDefinitionService) DetachExternalFile ¶ added in v0.35.0
func (n *ResourceDefinitionService) DetachExternalFile(ctx context.Context, resDefName string, filePath string) error
DetachExternalFile removes a binding between an external file and a resource definition. This means that the file will no longer be deployed on every node the resource is deployed on.
func (*ResourceDefinitionService) Get ¶
func (n *ResourceDefinitionService) Get(ctx context.Context, resDefName string, opts ...*ListOpts) (ResourceDefinition, error)
Get return information about a resource-defintion
func (*ResourceDefinitionService) GetAll ¶
func (n *ResourceDefinitionService) GetAll(ctx context.Context, request RDGetAllRequest) ([]ResourceDefinitionWithVolumeDefinition, error)
GetAll lists all resource-definitions
func (*ResourceDefinitionService) GetDRBDProxyPropsInfos ¶ added in v0.34.0
func (n *ResourceDefinitionService) GetDRBDProxyPropsInfos(ctx context.Context, resDefName string, opts ...*ListOpts) ([]PropsInfo, error)
GetDRBDProxyPropsInfos gets meta information about the properties that can be set on a resource definition for drbd proxy.
func (*ResourceDefinitionService) GetPropsInfos ¶ added in v0.34.0
func (n *ResourceDefinitionService) GetPropsInfos(ctx context.Context, opts ...*ListOpts) ([]PropsInfo, error)
GetPropsInfos gets meta information about the properties that can be set on a resource definition.
func (*ResourceDefinitionService) GetVolumeDefinition ¶
func (n *ResourceDefinitionService) GetVolumeDefinition(ctx context.Context, resDefName string, volNr int, opts ...*ListOpts) (VolumeDefinition, error)
GetVolumeDefinition shows the properties of a specific volume-definition
func (*ResourceDefinitionService) GetVolumeDefinitions ¶
func (n *ResourceDefinitionService) GetVolumeDefinitions(ctx context.Context, resDefName string, opts ...*ListOpts) ([]VolumeDefinition, error)
GetVolumeDefinitions returns all volume-definitions of a resource-definition
func (*ResourceDefinitionService) Modify ¶
func (n *ResourceDefinitionService) Modify(ctx context.Context, resDefName string, props GenericPropsModify) error
Modify allows to modify a resource-definition
func (*ResourceDefinitionService) ModifyVolumeDefinition ¶
func (n *ResourceDefinitionService) ModifyVolumeDefinition(ctx context.Context, resDefName string, volNr int, props VolumeDefinitionModify) error
ModifyVolumeDefinition give the abilty to modify a specific volume-definition
func (*ResourceDefinitionService) SyncStatus ¶ added in v0.41.1
func (n *ResourceDefinitionService) SyncStatus(ctx context.Context, resDef string) (ResourceDefinitionSyncStatus, error)
SyncStatus checks if a resource is currently in sync on all nodes
type ResourceDefinitionSyncStatus ¶ added in v0.41.1
type ResourceDefinitionSyncStatus struct {
SyncedOnAll bool `json:"synced_on_all"`
}
type ResourceDefinitionWithVolumeDefinition ¶ added in v0.37.1
type ResourceDefinitionWithVolumeDefinition struct { ResourceDefinition VolumeDefinitions []VolumeDefinition `json:"volume_definitions,omitempty"` }
type ResourceGroup ¶ added in v0.16.3
type ResourceGroup struct { Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` // A string to string property map. Props map[string]string `json:"props,omitempty"` SelectFilter AutoSelectFilter `json:"select_filter,omitempty"` // unique object id Uuid string `json:"uuid,omitempty"` }
type ResourceGroupAdjust ¶ added in v0.37.0
type ResourceGroupAdjust struct {
SelectFilter *AutoSelectFilter `json:"select_filter,omitempty"`
}
type ResourceGroupModify ¶ added in v0.16.3
type ResourceGroupModify struct { Description string `json:"description,omitempty"` // A string to string property map. OverrideProps map[string]string `json:"override_props,omitempty"` DeleteProps []string `json:"delete_props,omitempty"` DeleteNamespaces []string `json:"delete_namespaces,omitempty"` SelectFilter AutoSelectFilter `json:"select_filter,omitempty"` }
type ResourceGroupProvider ¶ added in v0.34.0
type ResourceGroupProvider interface { // GetAll lists all resource-groups GetAll(ctx context.Context, opts ...*ListOpts) ([]ResourceGroup, error) // Get return information about a resource-defintion Get(ctx context.Context, resGrpName string, opts ...*ListOpts) (ResourceGroup, error) // Create adds a new resource-group Create(ctx context.Context, resGrp ResourceGroup) error // Modify allows to modify a resource-group Modify(ctx context.Context, resGrpName string, props ResourceGroupModify) error // Delete deletes a resource-group Delete(ctx context.Context, resGrpName string) error // Spawn creates a new resource-definition and auto-deploys if configured to do so Spawn(ctx context.Context, resGrpName string, resGrpSpwn ResourceGroupSpawn) error // GetVolumeGroups lists all volume-groups for a resource-group GetVolumeGroups(ctx context.Context, resGrpName string, opts ...*ListOpts) ([]VolumeGroup, error) // GetVolumeGroup lists a volume-group for a resource-group GetVolumeGroup(ctx context.Context, resGrpName string, volNr int, opts ...*ListOpts) (VolumeGroup, error) // Create adds a new volume-group to a resource-group CreateVolumeGroup(ctx context.Context, resGrpName string, volGrp VolumeGroup) error // Modify allows to modify a volume-group of a resource-group ModifyVolumeGroup(ctx context.Context, resGrpName string, volNr int, props VolumeGroupModify) error DeleteVolumeGroup(ctx context.Context, resGrpName string, volNr int) error // GetPropsInfos gets meta information about the properties that can be // set on a resource group. GetPropsInfos(ctx context.Context, opts ...*ListOpts) ([]PropsInfo, error) // GetVolumeGroupPropsInfos gets meta information about the properties // that can be set on a resource group. GetVolumeGroupPropsInfos(ctx context.Context, resGrpName string, opts ...*ListOpts) ([]PropsInfo, error) // Adjust all resource-definitions (calls autoplace for) of the given resource-group Adjust(ctx context.Context, resGrpName string, adjust ResourceGroupAdjust) error // AdjustAll adjusts all resource-definitions (calls autoplace) according to their associated resource group. AdjustAll(ctx context.Context, adjust ResourceGroupAdjust) error }
ResourceGroupProvider acts as an abstraction for a ResourceGroupService. It can be swapped out for another ResourceGroupService implementation, for example for testing.
type ResourceGroupService ¶ added in v0.16.3
type ResourceGroupService struct {
// contains filtered or unexported fields
}
ResourceGroupService is the service that deals with resource group related tasks.
func (*ResourceGroupService) Adjust ¶ added in v0.37.0
func (n *ResourceGroupService) Adjust(ctx context.Context, resGrpName string, adjust ResourceGroupAdjust) error
Adjust all resource-definitions (calls autoplace for) of the given resource-group
func (*ResourceGroupService) AdjustAll ¶ added in v0.37.0
func (n *ResourceGroupService) AdjustAll(ctx context.Context, adjust ResourceGroupAdjust) error
AdjustAll adjusts all resource-definitions (calls autoplace) according to their associated resource group.
func (*ResourceGroupService) Create ¶ added in v0.16.3
func (n *ResourceGroupService) Create(ctx context.Context, resGrp ResourceGroup) error
Create adds a new resource-group
func (*ResourceGroupService) CreateVolumeGroup ¶ added in v0.16.3
func (n *ResourceGroupService) CreateVolumeGroup(ctx context.Context, resGrpName string, volGrp VolumeGroup) error
Create adds a new volume-group to a resource-group
func (*ResourceGroupService) Delete ¶ added in v0.16.3
func (n *ResourceGroupService) Delete(ctx context.Context, resGrpName string) error
Delete deletes a resource-group
func (*ResourceGroupService) DeleteVolumeGroup ¶ added in v0.16.3
func (*ResourceGroupService) Get ¶ added in v0.16.3
func (n *ResourceGroupService) Get(ctx context.Context, resGrpName string, opts ...*ListOpts) (ResourceGroup, error)
Get return information about a resource-defintion
func (*ResourceGroupService) GetAll ¶ added in v0.16.3
func (n *ResourceGroupService) GetAll(ctx context.Context, opts ...*ListOpts) ([]ResourceGroup, error)
GetAll lists all resource-groups
func (*ResourceGroupService) GetPropsInfos ¶ added in v0.34.0
func (n *ResourceGroupService) GetPropsInfos(ctx context.Context, opts ...*ListOpts) ([]PropsInfo, error)
GetPropsInfos gets meta information about the properties that can be set on a resource group.
func (*ResourceGroupService) GetVolumeGroup ¶ added in v0.16.3
func (n *ResourceGroupService) GetVolumeGroup(ctx context.Context, resGrpName string, volNr int, opts ...*ListOpts) (VolumeGroup, error)
GetVolumeGroup lists a volume-group for a resource-group
func (*ResourceGroupService) GetVolumeGroupPropsInfos ¶ added in v0.34.0
func (n *ResourceGroupService) GetVolumeGroupPropsInfos(ctx context.Context, resGrpName string, opts ...*ListOpts) ([]PropsInfo, error)
GetVolumeGroupPropsInfos gets meta information about the properties that can be set on a resource group.
func (*ResourceGroupService) GetVolumeGroups ¶ added in v0.16.3
func (n *ResourceGroupService) GetVolumeGroups(ctx context.Context, resGrpName string, opts ...*ListOpts) ([]VolumeGroup, error)
GetVolumeGroups lists all volume-groups for a resource-group
func (*ResourceGroupService) Modify ¶ added in v0.16.3
func (n *ResourceGroupService) Modify(ctx context.Context, resGrpName string, props ResourceGroupModify) error
Modify allows to modify a resource-group
func (*ResourceGroupService) ModifyVolumeGroup ¶ added in v0.16.3
func (n *ResourceGroupService) ModifyVolumeGroup(ctx context.Context, resGrpName string, volNr int, props VolumeGroupModify) error
Modify allows to modify a volume-group of a resource-group
func (*ResourceGroupService) Spawn ¶ added in v0.16.3
func (n *ResourceGroupService) Spawn(ctx context.Context, resGrpName string, resGrpSpwn ResourceGroupSpawn) error
Spawn creates a new resource-definition and auto-deploys if configured to do so
type ResourceGroupSpawn ¶ added in v0.16.3
type ResourceGroupSpawn struct { // name of the resulting resource-definition ResourceDefinitionName string `json:"resource_definition_name"` // External name can be used to have native resource names. If you need to store a non Linstor compatible resource name use this field and Linstor will generate a compatible name. ResourceDefinitionExternalName string `json:"resource_definition_external_name,omitempty"` // sizes (in kib) of the resulting volume-definitions VolumeSizes []int64 `json:"volume_sizes,omitempty"` SelectFilter AutoSelectFilter `json:"select_filter,omitempty"` // If false, the length of the vlm_sizes has to match the number of volume-groups or an error is returned. If true and there are more vlm_sizes than volume-groups, the additional volume-definitions will simply have no pre-set properties (i.e. \"empty\" volume-definitions) If true and there are less vlm_sizes than volume-groups, the additional volume-groups won't be used. If the count of vlm_sizes matches the number of volume-groups, this \"partial\" parameter has no effect. Partial bool `json:"partial,omitempty"` // If true, the spawn command will only create the resource-definition with the volume-definitions but will not perform an auto-place, even if it is configured. DefinitionsOnly bool `json:"definitions_only,omitempty"` }
type ResourceLayer ¶
type ResourceLayer struct { Children []ResourceLayer `json:"children,omitempty"` ResourceNameSuffix string `json:"resource_name_suffix,omitempty"` Type devicelayerkind.DeviceLayerKind `json:"type,omitempty"` Drbd *DrbdResource `json:"drbd,omitempty"` Luks *LuksResource `json:"luks,omitempty"` Storage *StorageResource `json:"storage,omitempty"` Nvme *NvmeResource `json:"nvme,omitempty"` Writecache *WritecacheResource `json:"writecache,omitempty"` Cache *CacheResource `json:"cache,omitempty"` BCache *BCacheResource `json:"bcache,omitempty"` }
ResourceLayer is a struct to store layer-information abour a resource
type ResourceMakeAvailable ¶ added in v0.34.0
type ResourceMakeAvailable struct { LayerList []devicelayerkind.DeviceLayerKind `json:"layer_list,omitempty"` // if true resource will be created as diskful even if diskless would be possible Diskful bool `json:"diskful,omitempty"` }
type ResourceProvider ¶ added in v0.34.0
type ResourceProvider interface { // GetResourceView returns all resources in the cluster. Filters can be set via ListOpts. GetResourceView(ctx context.Context, opts ...*ListOpts) ([]ResourceWithVolumes, error) // GetAll returns all resources for a resource-definition GetAll(ctx context.Context, resName string, opts ...*ListOpts) ([]Resource, error) // Get returns information about a resource on a specific node Get(ctx context.Context, resName, nodeName string, opts ...*ListOpts) (Resource, error) // Create is used to create a resource on a node Create(ctx context.Context, res ResourceCreate) error // Modify gives the ability to modify a resource on a node Modify(ctx context.Context, resName, nodeName string, props GenericPropsModify) error // Delete deletes a resource on a specific node Delete(ctx context.Context, resName, nodeName string) error // GetVolumes lists als volumes of a resource GetVolumes(ctx context.Context, resName, nodeName string, opts ...*ListOpts) ([]Volume, error) // GetVolume returns information about a specific volume defined by it resource,node and volume-number GetVolume(ctx context.Context, resName, nodeName string, volNr int, opts ...*ListOpts) (Volume, error) // ModifyVolume modifies an existing volume with the given props ModifyVolume(ctx context.Context, resName, nodeName string, volNr int, props GenericPropsModify) error // Diskless toggles a resource on a node to diskless - the parameter disklesspool can be set if its needed Diskless(ctx context.Context, resName, nodeName, disklessPoolName string) error // Diskful toggles a resource to diskful - the parameter storagepool can be set if its needed Diskful(ctx context.Context, resName, nodeName, storagePoolName string, props *ToggleDiskDiskfulProps) error // Migrate mirgates a resource from one node to another node Migrate(ctx context.Context, resName, fromNodeName, toNodeName, storagePoolName string) error // Autoplace places a resource on your nodes autmatically Autoplace(ctx context.Context, resName string, apr AutoPlaceRequest) error // GetConnections lists all resource connections if no node-names are given- if two node-names are given it shows the connection between them GetConnections(ctx context.Context, resName, nodeAName, nodeBName string, opts ...*ListOpts) ([]ResourceConnection, error) // ModifyConnection allows to modify the connection between two nodes ModifyConnection(ctx context.Context, resName, nodeAName, nodeBName string, props GenericPropsModify) error // GetSnapshots lists all snapshots of a resource GetSnapshots(ctx context.Context, resName string, opts ...*ListOpts) ([]Snapshot, error) // GetSnapshotView gets information about all snapshots GetSnapshotView(ctx context.Context, opts ...*ListOpts) ([]Snapshot, error) // GetSnapshot returns information about a specific Snapshot by its name GetSnapshot(ctx context.Context, resName, snapName string, opts ...*ListOpts) (Snapshot, error) // CreateSnapshot creates a snapshot of a resource CreateSnapshot(ctx context.Context, snapshot Snapshot) error // DeleteSnapshot deletes a snapshot by its name. Specify nodes to only delete snapshots on specific nodes. DeleteSnapshot(ctx context.Context, resName, snapName string, nodes ...string) error // RestoreSnapshot restores a snapshot on a resource RestoreSnapshot(ctx context.Context, origResName, snapName string, snapRestoreConf SnapshotRestore) error // RestoreVolumeDefinitionSnapshot restores a volume-definition-snapshot on a resource RestoreVolumeDefinitionSnapshot(ctx context.Context, origResName, snapName string, snapRestoreConf SnapshotRestore) error // RollbackSnapshot rolls back a snapshot from a specific resource RollbackSnapshot(ctx context.Context, resName, snapName string) error // EnableSnapshotShipping enables snapshot shipping for a resource EnableSnapshotShipping(ctx context.Context, resName string, ship SnapshotShipping) error // ModifyDRBDProxy is used to modify drbd-proxy properties ModifyDRBDProxy(ctx context.Context, resName string, props DrbdProxyModify) error // EnableDRBDProxy is used to enable drbd-proxy with the rest-api call from the function enableDisableDRBDProxy EnableDRBDProxy(ctx context.Context, resName, nodeAName, nodeBName string) error // DisableDRBDProxy is used to disable drbd-proxy with the rest-api call from the function enableDisableDRBDProxy DisableDRBDProxy(ctx context.Context, resName, nodeAName, nodeBName string) error // QueryMaxVolumeSize finds the maximum size of a volume for a given filter QueryMaxVolumeSize(ctx context.Context, filter AutoSelectFilter) (MaxVolumeSizes, error) // GetSnapshotShippings gets a view of all snapshot shippings GetSnapshotShippings(ctx context.Context, opts ...*ListOpts) ([]SnapshotShippingStatus, error) // GetPropsInfos gets meta information about the properties that can be // set on a resource. GetPropsInfos(ctx context.Context, resName string, opts ...*ListOpts) ([]PropsInfo, error) // GetVolumeDefinitionPropsInfos gets meta information about the // properties that can be set on a volume definition. GetVolumeDefinitionPropsInfos(ctx context.Context, resName string, opts ...*ListOpts) ([]PropsInfo, error) // GetVolumePropsInfos gets meta information about the properties that // can be set on a volume. GetVolumePropsInfos(ctx context.Context, resName, nodeName string, opts ...*ListOpts) ([]PropsInfo, error) // GetConnectionPropsInfos gets meta information about the properties // that can be set on a connection. GetConnectionPropsInfos(ctx context.Context, resName string, opts ...*ListOpts) ([]PropsInfo, error) // Activate starts an inactive resource on a given node. Activate(ctx context.Context, resName string, nodeName string) error // Deactivate stops an active resource on given node. Deactivate(ctx context.Context, resName string, nodeName string) error // MakeAvailable adds a resource on a node if not already deployed. // To use a specific storage pool add the StorPoolName property and use // the storage pool name as value. If the StorPoolName property is not // set, a storage pool will be chosen automatically using the // auto-placer. // To create a diskless resource you have to set the "DISKLESS" flag in // the flags list. MakeAvailable(ctx context.Context, resName, nodeName string, makeAvailable ResourceMakeAvailable) error }
ResourceProvider acts as an abstraction for an ResourceService. It can be swapped out for another ResourceService implementation, for example for testing.
type ResourceService ¶
type ResourceService struct {
// contains filtered or unexported fields
}
ResourceService is a struct which contains the pointer of the client
func (*ResourceService) Activate ¶ added in v0.34.1
func (n *ResourceService) Activate(ctx context.Context, resName, nodeName string) error
func (*ResourceService) Autoplace ¶
func (n *ResourceService) Autoplace(ctx context.Context, resName string, apr AutoPlaceRequest) error
Autoplace places a resource on your nodes autmatically
func (*ResourceService) Create ¶
func (n *ResourceService) Create(ctx context.Context, res ResourceCreate) error
Create is used to create a resource on a node
func (*ResourceService) CreateSnapshot ¶
func (n *ResourceService) CreateSnapshot(ctx context.Context, snapshot Snapshot) error
CreateSnapshot creates a snapshot of a resource
func (*ResourceService) Deactivate ¶ added in v0.34.1
func (n *ResourceService) Deactivate(ctx context.Context, resName, nodeName string) error
func (*ResourceService) Delete ¶
func (n *ResourceService) Delete(ctx context.Context, resName, nodeName string) error
Delete deletes a resource on a specific node
func (*ResourceService) DeleteSnapshot ¶
func (n *ResourceService) DeleteSnapshot(ctx context.Context, resName, snapName string, nodes ...string) error
DeleteSnapshot deletes a snapshot by its name. Specify nodes to only delete snapshots on specific nodes.
func (*ResourceService) DisableDRBDProxy ¶
func (n *ResourceService) DisableDRBDProxy(ctx context.Context, resName, nodeAName, nodeBName string) error
DisableDRBDProxy is used to disable drbd-proxy with the rest-api call from the function enableDisableDRBDProxy
func (*ResourceService) Diskful ¶
func (n *ResourceService) Diskful(ctx context.Context, resName, nodeName, storagePoolName string, props *ToggleDiskDiskfulProps) error
Diskful toggles a resource to diskful - the parameter storagepool can be set if its needed
func (*ResourceService) Diskless ¶
func (n *ResourceService) Diskless(ctx context.Context, resName, nodeName, disklessPoolName string) error
Diskless toggles a resource on a node to diskless - the parameter disklesspool can be set if its needed
func (*ResourceService) EnableDRBDProxy ¶
func (n *ResourceService) EnableDRBDProxy(ctx context.Context, resName, nodeAName, nodeBName string) error
EnableDRBDProxy is used to enable drbd-proxy with the rest-api call from the function enableDisableDRBDProxy
func (*ResourceService) EnableSnapshotShipping ¶ added in v0.29.0
func (n *ResourceService) EnableSnapshotShipping(ctx context.Context, resName string, ship SnapshotShipping) error
EnableSnapshotShipping enables snapshot shipping for a resource
func (*ResourceService) Get ¶
func (n *ResourceService) Get(ctx context.Context, resName, nodeName string, opts ...*ListOpts) (Resource, error)
Get returns information about a resource on a specific node
func (*ResourceService) GetAll ¶
func (n *ResourceService) GetAll(ctx context.Context, resName string, opts ...*ListOpts) ([]Resource, error)
GetAll returns all resources for a resource-definition
func (*ResourceService) GetConnectionPropsInfos ¶ added in v0.34.0
func (n *ResourceService) GetConnectionPropsInfos(ctx context.Context, resName string, opts ...*ListOpts) ([]PropsInfo, error)
GetConnectionPropsInfos gets meta information about the properties that can be set on a connection.
func (*ResourceService) GetConnections ¶
func (n *ResourceService) GetConnections(ctx context.Context, resName, nodeAName, nodeBName string, opts ...*ListOpts) ([]ResourceConnection, error)
GetConnections lists all resource connections if no node-names are given- if two node-names are given it shows the connection between them
func (*ResourceService) GetPropsInfos ¶ added in v0.34.0
func (n *ResourceService) GetPropsInfos(ctx context.Context, resName string, opts ...*ListOpts) ([]PropsInfo, error)
GetPropsInfos gets meta information about the properties that can be set on a resource.
func (*ResourceService) GetResourceView ¶ added in v0.16.0
func (n *ResourceService) GetResourceView(ctx context.Context, opts ...*ListOpts) ([]ResourceWithVolumes, error)
GetResourceView returns all resources in the cluster. Filters can be set via ListOpts.
func (*ResourceService) GetSnapshot ¶
func (n *ResourceService) GetSnapshot(ctx context.Context, resName, snapName string, opts ...*ListOpts) (Snapshot, error)
GetSnapshot returns information about a specific Snapshot by its name
func (*ResourceService) GetSnapshotShippings ¶ added in v0.29.0
func (n *ResourceService) GetSnapshotShippings(ctx context.Context, opts ...*ListOpts) ([]SnapshotShippingStatus, error)
GetSnapshotShippings gets a view of all snapshot shippings
func (*ResourceService) GetSnapshotView ¶ added in v0.28.0
func (r *ResourceService) GetSnapshotView(ctx context.Context, opts ...*ListOpts) ([]Snapshot, error)
GetSnapshotView gets information about all snapshots
func (*ResourceService) GetSnapshots ¶
func (n *ResourceService) GetSnapshots(ctx context.Context, resName string, opts ...*ListOpts) ([]Snapshot, error)
GetSnapshots lists all snapshots of a resource
func (*ResourceService) GetVolume ¶
func (n *ResourceService) GetVolume(ctx context.Context, resName, nodeName string, volNr int, opts ...*ListOpts) (Volume, error)
GetVolume returns information about a specific volume defined by it resource,node and volume-number
func (*ResourceService) GetVolumeDefinitionPropsInfos ¶ added in v0.34.0
func (n *ResourceService) GetVolumeDefinitionPropsInfos(ctx context.Context, resName string, opts ...*ListOpts) ([]PropsInfo, error)
GetVolumeDefinitionPropsInfos gets meta information about the properties that can be set on a volume definition.
func (*ResourceService) GetVolumePropsInfos ¶ added in v0.34.0
func (n *ResourceService) GetVolumePropsInfos(ctx context.Context, resName, nodeName string, opts ...*ListOpts) ([]PropsInfo, error)
GetVolumePropsInfos gets meta information about the properties that can be set on a volume.
func (*ResourceService) GetVolumes ¶
func (n *ResourceService) GetVolumes(ctx context.Context, resName, nodeName string, opts ...*ListOpts) ([]Volume, error)
GetVolumes lists als volumes of a resource
func (*ResourceService) MakeAvailable ¶ added in v0.34.0
func (n *ResourceService) MakeAvailable(ctx context.Context, resName, nodeName string, makeAvailable ResourceMakeAvailable) error
MakeAvailable adds a resource on a node if not already deployed. To use a specific storage pool add the StorPoolName property and use the storage pool name as value. If the StorPoolName property is not set, a storage pool will be chosen automatically using the auto-placer. To create a diskless resource you have to set the "DISKLESS" flag in the flags list.
func (*ResourceService) Migrate ¶
func (n *ResourceService) Migrate(ctx context.Context, resName, fromNodeName, toNodeName, storagePoolName string) error
Migrate mirgates a resource from one node to another node
func (*ResourceService) Modify ¶
func (n *ResourceService) Modify(ctx context.Context, resName, nodeName string, props GenericPropsModify) error
Modify gives the ability to modify a resource on a node
func (*ResourceService) ModifyConnection ¶
func (n *ResourceService) ModifyConnection(ctx context.Context, resName, nodeAName, nodeBName string, props GenericPropsModify) error
ModifyConnection allows to modify the connection between two nodes
func (*ResourceService) ModifyDRBDProxy ¶
func (n *ResourceService) ModifyDRBDProxy(ctx context.Context, resName string, props DrbdProxyModify) error
ModifyDRBDProxy is used to modify drbd-proxy properties
func (*ResourceService) ModifyVolume ¶ added in v0.16.1
func (n *ResourceService) ModifyVolume(ctx context.Context, resName, nodeName string, volNr int, props GenericPropsModify) error
ModifyVolume modifies an existing volume with the given props
func (*ResourceService) QueryMaxVolumeSize ¶ added in v0.17.3
func (n *ResourceService) QueryMaxVolumeSize(ctx context.Context, filter AutoSelectFilter) (MaxVolumeSizes, error)
QueryMaxVolumeSize finds the maximum size of a volume for a given filter
func (*ResourceService) RestoreSnapshot ¶
func (n *ResourceService) RestoreSnapshot(ctx context.Context, origResName, snapName string, snapRestoreConf SnapshotRestore) error
RestoreSnapshot restores a snapshot on a resource
func (*ResourceService) RestoreVolumeDefinitionSnapshot ¶
func (n *ResourceService) RestoreVolumeDefinitionSnapshot(ctx context.Context, origResName, snapName string, snapRestoreConf SnapshotRestore) error
RestoreVolumeDefinitionSnapshot restores a volume-definition-snapshot on a resource
func (*ResourceService) RollbackSnapshot ¶
func (n *ResourceService) RollbackSnapshot(ctx context.Context, resName, snapName string) error
RollbackSnapshot rolls back a snapshot from a specific resource
type ResourceState ¶
type ResourceState struct {
InUse *bool `json:"in_use,omitempty"`
}
ResourceState is a struct for getting the status of a resource
type ResourceWithVolumes ¶ added in v0.16.3
type ResourceWithVolumes struct { Resource // milliseconds since unix epoch in UTC CreateTimestamp *TimeStampMs `json:"create_timestamp,omitempty"` Volumes []Volume `json:"volumes,omitempty"` // the resource or empty if data storage pool is not shared SharedName string `json:"shared_name,omitempty"` }
type S3Remote ¶ added in v0.37.0
type S3Remote struct { RemoteName string `json:"remote_name,omitempty"` Endpoint string `json:"endpoint,omitempty"` Bucket string `json:"bucket,omitempty"` Region string `json:"region,omitempty"` AccessKey string `json:"access_key,omitempty"` SecretKey string `json:"secret_key,omitempty"` UsePathStyle bool `json:"use_path_style,omitempty"` }
type SatelliteConfig ¶ added in v0.29.0
type SatelliteConfig struct { Config ControllerConfigConfig `json:"config,omitempty"` Debug ControllerConfigDebug `json:"debug,omitempty"` Log SatelliteConfigLog `json:"log,omitempty"` StltOverrideNodeName string `json:"stlt_override_node_name,omitempty"` RemoteSpdk bool `json:"remote_spdk,omitempty"` Ebs bool `json:"ebs,omitempty"` SpecialSatellite bool `json:"special_satellite,omitempty"` DrbdKeepResPattern string `json:"drbd_keep_res_pattern,omitempty"` Net SatelliteConfigNet `json:"net,omitempty"` }
SatelliteConfig struct for SatelliteConfig
type SatelliteConfigLog ¶ added in v0.29.0
type SatelliteConfigLog struct { PrintStackTrace bool `json:"print_stack_trace,omitempty"` Directory string `json:"directory,omitempty"` Level LogLevel `json:"level,omitempty"` LevelLinstor LogLevel `json:"level_linstor,omitempty"` }
SatelliteConfigLog struct for SatelliteConfigLog
type SatelliteConfigNet ¶ added in v0.29.0
type SatelliteConfigNet struct { BindAddress string `json:"bind_address,omitempty"` Port int32 `json:"port,omitempty"` ComType string `json:"com_type,omitempty"` }
SatelliteConfigNet struct for SatelliteConfigNet
type Snapshot ¶
type Snapshot struct { Name string `json:"name,omitempty"` ResourceName string `json:"resource_name,omitempty"` Nodes []string `json:"nodes,omitempty"` // A string to string property map. Props map[string]string `json:"props,omitempty"` Flags []string `json:"flags,omitempty"` VolumeDefinitions []SnapshotVolumeDefinition `json:"volume_definitions,omitempty"` // unique object id Uuid string `json:"uuid,omitempty"` Snapshots []SnapshotNode `json:"snapshots,omitempty"` }
Snapshot is a struct for information about a snapshot
type SnapshotNode ¶ added in v0.29.0
type SnapshotNode struct { // Snapshot name this snapshots belongs to SnapshotName string `json:"snapshot_name,omitempty"` // Node name where this snapshot was taken NodeName string `json:"node_name,omitempty"` // milliseconds since unix epoch in UTC CreateTimestamp *TimeStampMs `json:"create_timestamp,omitempty"` Flags []string `json:"flags,omitempty"` // unique object id Uuid string `json:"uuid,omitempty"` // SnapshotVolumes holds per-volume information about snapshots on this node. SnapshotVolumes []SnapshotVolumeNode `json:"snapshot_volumes,omitempty"` }
SnapshotNode Actual snapshot data from a node
type SnapshotRestore ¶
type SnapshotRestore struct { // Resource where to restore the snapshot ToResource string `json:"to_resource"` // List of nodes where to place the restored snapshot Nodes []string `json:"nodes,omitempty"` }
SnapshotRestore is a struct used to hold the information about where a Snapshot has to be restored
type SnapshotShipping ¶ added in v0.29.0
type SnapshotShipping struct { // Node where to ship the snapshot from FromNode string `json:"from_node"` // NetInterface of the source node FromNic string `json:"from_nic,omitempty"` // Node where to ship the snapshot ToNode string `json:"to_node"` // NetInterface of the destination node ToNic string `json:"to_nic,omitempty"` }
SnapshotShipping struct for SnapshotShipping
type SnapshotShippingStatus ¶ added in v0.29.0
type SnapshotShippingStatus struct { Snapshot Snapshot `json:"snapshot,omitempty"` FromNodeName string `json:"from_node_name,omitempty"` ToNodeName string `json:"to_node_name,omitempty"` Status snapshotshipstatus.SnapshotShipStatus `json:"status,omitempty"` }
SnapshotShippingStatus struct for SnapshotShippingStatus
type SnapshotVolumeDefinition ¶
type SnapshotVolumeDefinition struct { VolumeNumber int32 `json:"volume_number,omitempty"` // Volume size in KiB SizeKib uint64 `json:"size_kib,omitempty"` }
SnapshotVolumeDefinition is a struct to store the properties of a volume from a snapshot
type SnapshotVolumeNode ¶ added in v0.46.0
type SnapshotVolumeNode struct { // unique object id Uuid string `json:"uuid,omitempty"` // Volume number of the snapshot VlmNr int32 `json:"vlm_nr,omitempty"` // A string to string property map. Props map[string]string `json:"props,omitempty"` // Optional state for the given snapshot State string `json:"state,omitempty"` }
type StoragePool ¶
type StoragePool struct { StoragePoolName string `json:"storage_pool_name"` NodeName string `json:"node_name,omitempty"` ProviderKind ProviderKind `json:"provider_kind"` // A string to string property map. Props map[string]string `json:"props,omitempty"` // read only map of static storage pool traits StaticTraits map[string]string `json:"static_traits,omitempty"` // Kibi - read only FreeCapacity int64 `json:"free_capacity,omitempty"` // Kibi - read only TotalCapacity int64 `json:"total_capacity,omitempty"` // read only FreeSpaceMgrName string `json:"free_space_mgr_name,omitempty"` // unique object id Uuid string `json:"uuid,omitempty"` // Currently known report messages for this storage pool Reports []ApiCallRc `json:"reports,omitempty"` // true if the storage pool supports snapshots. false otherwise SupportsSnapshots bool `json:"supports_snapshots,omitempty"` SharedSpace string `json:"shared_space,omitempty"` // true if a shared storage pool uses linstor-external locking, like cLVM ExternalLocking bool `json:"external_locking,omitempty"` }
StoragePool represents a nodes storage pool as defined in LINSTOR.
type StoragePoolDefinition ¶ added in v0.25.0
type StoragePoolDefinition struct { StoragePoolName string `json:"storage_pool_name,omitempty"` // A string to string property map. Props map[string]string `json:"props,omitempty"` }
StoragePoolDefinition represents a storage pool definition in LINSTOR
type StoragePoolDefinitionModify ¶ added in v0.25.0
type StoragePoolDefinitionModify struct {
GenericPropsModify
}
StoragePoolDefinitionModify holds properties of a storage pool definition to modify such a definition.
type StoragePoolDefinitionProvider ¶ added in v0.34.0
type StoragePoolDefinitionProvider interface { // GetAll gets information for all existing storage pool definitions. GetAll(ctx context.Context, opts ...*ListOpts) ([]StoragePoolDefinition, error) // Get gets information for a particular storage pool definition. Get(ctx context.Context, spdName string, opts ...*ListOpts) (StoragePoolDefinition, error) // Create creates a new storage pool definition Create(ctx context.Context, spd StoragePoolDefinition) error // Modify modifies the given storage pool definition and sets/deletes the given properties. Modify(ctx context.Context, spdName string, props StoragePoolDefinitionModify) error // Delete deletes the given storage pool definition. Delete(ctx context.Context, spdName string) error // GetPropsInfos gets meta information about the properties that can be // set on a storage pool definition. GetPropsInfos(ctx context.Context, opts ...*ListOpts) ([]PropsInfo, error) }
StoragePoolDefinitionProvider acts as an abstraction for a StoragePoolDefinitionService. It can be swapped out for another StoragePoolDefinitionService implementation, for example for testing.
type StoragePoolDefinitionService ¶ added in v0.25.0
type StoragePoolDefinitionService struct {
// contains filtered or unexported fields
}
StoragePoolDefinitionService is the service that deals with storage pool definition related tasks.
func (*StoragePoolDefinitionService) Create ¶ added in v0.25.0
func (s *StoragePoolDefinitionService) Create(ctx context.Context, spd StoragePoolDefinition) error
Create creates a new storage pool definition
func (*StoragePoolDefinitionService) Delete ¶ added in v0.25.0
func (s *StoragePoolDefinitionService) Delete(ctx context.Context, spdName string) error
Delete deletes the given storage pool definition.
func (*StoragePoolDefinitionService) Get ¶ added in v0.25.0
func (s *StoragePoolDefinitionService) Get(ctx context.Context, spdName string, opts ...*ListOpts) (StoragePoolDefinition, error)
Get gets information for a particular storage pool definition.
func (*StoragePoolDefinitionService) GetAll ¶ added in v0.25.0
func (s *StoragePoolDefinitionService) GetAll(ctx context.Context, opts ...*ListOpts) ([]StoragePoolDefinition, error)
GetAll gets information for all existing storage pool definitions.
func (*StoragePoolDefinitionService) GetPropsInfos ¶ added in v0.34.0
func (s *StoragePoolDefinitionService) GetPropsInfos(ctx context.Context, opts ...*ListOpts) ([]PropsInfo, error)
GetPropsInfos gets meta information about the properties that can be set on a storage pool definition.
func (*StoragePoolDefinitionService) Modify ¶ added in v0.25.0
func (s *StoragePoolDefinitionService) Modify(ctx context.Context, spdName string, props StoragePoolDefinitionModify) error
Modify modifies the given storage pool definition and sets/deletes the given properties.
type StorageResource ¶
type StorageResource struct {
StorageVolumes []StorageVolume `json:"storage_volumes,omitempty"`
}
StorageResource is a struct which contains the storage-volumes for a storage-resource
type StorageVolume ¶
type StorageVolume struct { VolumeNumber int32 `json:"volume_number,omitempty"` // block device path DevicePath string `json:"device_path,omitempty"` AllocatedSizeKib int64 `json:"allocated_size_kib,omitempty"` UsableSizeKib int64 `json:"usable_size_kib,omitempty"` // String describing current volume state DiskState string `json:"disk_state,omitempty"` }
StorageVolume is a struct to store standard poperties of a Volume
type TimeStampMs ¶ added in v0.37.0
func (TimeStampMs) EncodeValues ¶ added in v0.37.0
func (t TimeStampMs) EncodeValues(key string, v *url.Values) error
func (TimeStampMs) MarshalJSON ¶ added in v0.37.0
func (t TimeStampMs) MarshalJSON() ([]byte, error)
func (*TimeStampMs) UnmarshalJSON ¶ added in v0.37.0
func (t *TimeStampMs) UnmarshalJSON(s []byte) (err error)
type ToggleDiskDiskfulProps ¶ added in v0.36.0
type ToggleDiskDiskfulProps struct {
LayerList []devicelayerkind.DeviceLayerKind `json:"layer_list,omitempty"`
}
type VendorProvider ¶ added in v0.34.0
type VendorProvider interface { // GetExosDefaults lists default settings for all EXOS enclosures GetExosDefaults(ctx context.Context) (ExosDefaults, error) // ModifyExosDefaults sets or modifies default username / password for EXOS enclosures ModifyExosDefaults(ctx context.Context, defaults ExosDefaultsModify) error // GetExosEnclosures lists EXOS enclosures including controller IP and health status GetExosEnclosures(ctx context.Context, noCache bool) ([]ExosEnclosure, error) // CreateExosEnclosure creates a new enclosure unless it already exists CreateExosEnclosure(ctx context.Context, enclosure ExosEnclosure) error // ModifyExosEnclosure modifies an existing enclosure ModifyExosEnclosure(ctx context.Context, name string, enclosure ExosEnclosure) error // DeleteExosEnclosure deletes an existing enclosure DeleteExosEnclosure(ctx context.Context, name string) error // GetExosEvents lists the most current "count" events GetExosEvents(ctx context.Context, name string, count int32) ([]ExosEnclosureEvent, error) // GetExosConnectionMap lists the connection-mesh of EXOS Ports to LINSTOR Nodes GetExosConnectionMap(ctx context.Context) (ExosConnectionMap, error) }
type VendorService ¶ added in v0.34.0
type VendorService struct {
// contains filtered or unexported fields
}
func (*VendorService) CreateExosEnclosure ¶ added in v0.34.0
func (s *VendorService) CreateExosEnclosure(ctx context.Context, enclosure ExosEnclosure) error
CreateExosEnclosure creates a new enclosure unless it already exists
func (*VendorService) DeleteExosEnclosure ¶ added in v0.34.0
func (s *VendorService) DeleteExosEnclosure(ctx context.Context, name string) error
DeleteExosEnclosure deletes an existing enclosure
func (*VendorService) GetExosConnectionMap ¶ added in v0.34.0
func (s *VendorService) GetExosConnectionMap(ctx context.Context) (ExosConnectionMap, error)
GetExosConnectionMap lists the connection-mesh of EXOS Ports to LINSTOR Nodes
func (*VendorService) GetExosDefaults ¶ added in v0.34.0
func (s *VendorService) GetExosDefaults(ctx context.Context) (ExosDefaults, error)
GetExosDefaults lists default settings for all EXOS enclosures
func (*VendorService) GetExosEnclosures ¶ added in v0.34.0
func (s *VendorService) GetExosEnclosures(ctx context.Context, noCache bool) ([]ExosEnclosure, error)
GetExosEnclosures lists EXOS enclosures including controller IP and health status
func (*VendorService) GetExosEvents ¶ added in v0.34.0
func (s *VendorService) GetExosEvents(ctx context.Context, name string, count int32) ([]ExosEnclosureEvent, error)
GetExosEvents lists the most current "count" events
func (*VendorService) ModifyExosDefaults ¶ added in v0.34.0
func (s *VendorService) ModifyExosDefaults(ctx context.Context, defaults ExosDefaultsModify) error
ModifyExosDefaults sets or modifies default username / password for EXOS enclosures
func (*VendorService) ModifyExosEnclosure ¶ added in v0.34.0
func (s *VendorService) ModifyExosEnclosure(ctx context.Context, name string, enclosure ExosEnclosure) error
ModifyExosEnclosure modifies an existing enclosure
type Volume ¶
type Volume struct { VolumeNumber int32 `json:"volume_number,omitempty"` StoragePoolName string `json:"storage_pool_name,omitempty"` ProviderKind ProviderKind `json:"provider_kind,omitempty"` DevicePath string `json:"device_path,omitempty"` AllocatedSizeKib int64 `json:"allocated_size_kib,omitempty"` UsableSizeKib int64 `json:"usable_size_kib,omitempty"` // A string to string property map. Props map[string]string `json:"props,omitempty"` Flags []string `json:"flags,omitempty"` State VolumeState `json:"state,omitempty"` LayerDataList []VolumeLayer `json:"layer_data_list,omitempty"` // unique object id Uuid string `json:"uuid,omitempty"` Reports []ApiCallRc `json:"reports,omitempty"` }
Volume is a struct which holds the information about a linstor-volume
type VolumeDefinition ¶
type VolumeDefinition struct { VolumeNumber *int32 `json:"volume_number,omitempty"` // Size of the volume in Kibi. SizeKib uint64 `json:"size_kib"` // A string to string property map. Props map[string]string `json:"props,omitempty"` Flags []string `json:"flags,omitempty"` LayerData []VolumeDefinitionLayer `json:"layer_data,omitempty"` // unique object id Uuid string `json:"uuid,omitempty"` }
VolumeDefinition is a struct which is used to store volume-definition properties
type VolumeDefinitionCreate ¶ added in v0.15.0
type VolumeDefinitionCreate struct { VolumeDefinition VolumeDefinition `json:"volume_definition"` DrbdMinorNumber int32 `json:"drbd_minor_number,omitempty"` }
VolumeDefinitionCreate is a struct used for creating volume-definitions
type VolumeDefinitionLayer ¶
type VolumeDefinitionLayer struct { Type devicelayerkind.DeviceLayerKind `json:"type"` Data OneOfDrbdVolumeDefinition `json:"data,omitempty"` }
VolumeDefinitionLayer is a struct for the layer-type of a volume-definition
func (*VolumeDefinitionLayer) UnmarshalJSON ¶
func (vd *VolumeDefinitionLayer) UnmarshalJSON(b []byte) error
UnmarshalJSON is needed for the unmarshal interface for VolumeDefinitionLayer types
type VolumeDefinitionModify ¶ added in v0.16.0
type VolumeDefinitionModify struct { SizeKib uint64 `json:"size_kib,omitempty"` GenericPropsModify // To add a flag just specify the flag name, to remove a flag prepend it with a '-'. Flags: * GROSS_SIZE Flags []string `json:"flags,omitempty"` }
type VolumeGroup ¶ added in v0.16.3
type VolumeGroupModify ¶ added in v0.20.0
type VolumeGroupModify struct { // A string to string property map. OverrideProps map[string]string `json:"override_props,omitempty"` // To add a flag just specify the flag name, to remove a flag prepend it with a '-'. Flags: * GROSS_SIZE Flags []string `json:"flags,omitempty"` DeleteProps []string `json:"delete_props,omitempty"` DeleteNamespaces []string `json:"delete_namespaces,omitempty"` }
type VolumeLayer ¶
type VolumeLayer struct { Type devicelayerkind.DeviceLayerKind `json:"type,omitempty"` Data OneOfDrbdVolumeLuksVolumeStorageVolumeNvmeVolumeWritecacheVolumeCacheVolumeBCacheVolume `json:"data,omitempty"` }
VolumeLayer is a struct for storing the layer-properties of a linstor-volume
func (*VolumeLayer) UnmarshalJSON ¶
func (v *VolumeLayer) UnmarshalJSON(b []byte) error
UnmarshalJSON fulfills the unmarshal interface for the VolumeLayer type
type VolumeState ¶
type VolumeState struct {
DiskState string `json:"disk_state,omitempty"`
}
VolumeState is a struct which contains the disk-state for volume
type WritecacheResource ¶ added in v0.19.0
type WritecacheResource struct {
WritecacheVolumes []WritecacheVolume `json:"writecache_volumes,omitempty"`
}
type WritecacheVolume ¶ added in v0.19.0
type WritecacheVolume struct { VolumeNumber int32 `json:"volume_number,omitempty"` // block device path DevicePath string `json:"device_path,omitempty"` // block device path used as cache device DevicePathCache string `json:"device_path_cache,omitempty"` AllocatedSizeKib int64 `json:"allocated_size_kib,omitempty"` UsableSizeKib int64 `json:"usable_size_kib,omitempty"` // String describing current volume state DiskState string `json:"disk_state,omitempty"` }