linstor

package module
v0.16.3 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2019 License: GPL-2.0 Imports: 12 Imported by: 28

README

golinstor

This library aims to be a simple go interface for Linstor

This library is in an early stage and does not yet have a stable API: vendor this package, should you use it.

Documentation

godocs

License

GPL2

Documentation

Index

Constants

View Source
const ApiAutoPlaceRsc = "AutoPlaceRsc"
View Source
const ApiCallAuthReq = (0x0FFFFFFFFFFFFFFE | MaskError)
View Source
const ApiCallParseError = (0x0FFFFFFFFFFFFFFD | MaskError)
View Source
const ApiCmdShutdown = "Shutdown"
View Source
const ApiControlCtrl = "ControlCtrl"

## Command APIs ###

View Source
const ApiCrtCryptPass = "CrtCryptPass"
View Source
const ApiCrtDbgCnsl = "CrtDbgCnsl"

## Debug APIs ###

View Source
const ApiCrtNetIf = "CrtNetIf"
View Source
const ApiCrtNode = "CrtNode"

## Create object APIs ###

View Source
const ApiCrtNodeConn = "CrtNodeConn"
View Source
const ApiCrtRsc = "CrtRsc"
View Source
const ApiCrtRscConn = "CrtRscConn"
View Source
const ApiCrtRscDfn = "CrtRscDfn"
View Source
const ApiCrtSfTargetNode = "CrtSfTargetNode"
View Source
const ApiCrtSnapshot = "CrtSnapshot"
View Source
const ApiCrtStorPool = "CrtStorPool"
View Source
const ApiCrtStorPoolDfn = "CrtStorPoolDfn"
View Source
const ApiCrtVlmConn = "CrtVlmConn"
View Source
const ApiCrtVlmDfn = "CrtVlmDfn"
View Source
const ApiCrtWatch = "CrtWatch"

## Event APIs ###

View Source
const ApiDelCtrlProp = "DelCtrlProp"
View Source
const ApiDelKvs = "DelKvs"
View Source
const ApiDelNetIf = "DelNetIf"
View Source
const ApiDelNode = "DelNode"

## Delete object APIs ###

View Source
const ApiDelNodeConn = "DelNodeConn"
View Source
const ApiDelRsc = "DelRsc"
View Source
const ApiDelRscConn = "DelRscConn"
View Source
const ApiDelRscDfn = "DelRscDfn"
View Source
const ApiDelSnapshot = "DelSnapshot"
View Source
const ApiDelStorPool = "DelStorPool"
View Source
const ApiDelStorPoolDfn = "DelStorPoolDfn"
View Source
const ApiDelVlmConn = "DelVlmConn"
View Source
const ApiDelVlmDfn = "DelVlmDfn"
View Source
const ApiDelWatch = "DelWatch"
View Source
const ApiDisableDrbdProxy = "DisableDrbdProxy"
View Source
const ApiDstrDbgCnsl = "DstrDbgCnsl"
View Source
const ApiEnableDrbdProxy = "EnableDrbdProxy"
View Source
const ApiEndOfImmediateAnswers = "EndOfImmediateAnswers"

Indicates that the immediate answers to the API call are complete

View Source
const ApiEnterCryptPass = "EnterCryptPass"

## Encryption APIs ###

View Source
const ApiEvent = "Event"
View Source
const ApiHostname = "Hostname"
View Source
const ApiLostNode = "LostNode"
View Source
const ApiLstCtrlProps = "LstCtrlProps"
View Source
const ApiLstErrorReports = "LstErrorReports"
View Source
const ApiLstKvs = "LstKvs"
View Source
const ApiLstNetIf = "LstNetIf"
View Source
const ApiLstNode = "LstNode"

## List object APIs ###

View Source
const ApiLstRsc = "LstRsc"
View Source
const ApiLstRscConn = "LstRscConn"
View Source
const ApiLstRscDfn = "LstRscDfn"
View Source
const ApiLstSnapshotDfn = "LstSnapshotDfn"
View Source
const ApiLstStorPool = "LstStorPool"
View Source
const ApiLstStorPoolDfn = "LstStorPoolDfn"
View Source
const ApiLstVlm = "LstVlm"
View Source
const ApiLstVlmDfn = "LstVlmDfn"
View Source
const ApiModCryptPass = "ModCryptPass"
View Source
const ApiModDrbdProxy = "ModifyDrbdProxy"
View Source
const ApiModInf = "ModInf"
View Source
const ApiModKvs = "ModifyKvs"
View Source
const ApiModNetIf = "ModNetIf"
View Source
const ApiModNode = "ModNode"

## Modify object APIs ###

View Source
const ApiModNodeConn = "ModNodeConn"
View Source
const ApiModRsc = "ModRsc"
View Source
const ApiModRscConn = "ModRscConn"
View Source
const ApiModRscDfn = "ModRscDfn"
View Source
const ApiModSnapshot = "ModSnapshot"
View Source
const ApiModStorPool = "ModStorPool"
View Source
const ApiModStorPoolDfn = "ModStorPoolDfn"
View Source
const ApiModVlm = "ModVlm"
View Source
const ApiModVlmConn = "ModVlmConn"
View Source
const ApiModVlmDfn = "ModVlmDfn"
View Source
const ApiNodeReconnect = "NodeReconnect"
View Source
const ApiPing = "Ping"
View Source
const ApiPong = "Pong"
View Source
const ApiPrepareDisks = "PrepareDisks"
View Source
const ApiQryMaxVlmSize = "QryMaxVlmSize"

## Query APIs ###

View Source
const ApiReply = "Reply"

## Special answer message content types ### Textual MsgApiCallResponse responses

View Source
const ApiReqErrorReports = "ReqErrorReports"
View Source
const ApiReqRscConnList = "ReqRscConnList"
View Source
const ApiRestoreSnapshot = "RestoreSnapshot"
View Source
const ApiRestoreVlmDfn = "RestoreVlmDfn"
View Source
const ApiRollbackSnapshot = "RollbackSnapshot"
View Source
const ApiRptSpc = "RptSpc"
View Source
const ApiRspMaxVlmSize = "RspMaxVlmSize"
View Source
const ApiSetCtrlProp = "SetCtrlProp"
View Source
const ApiSignIn = "SignIn"

## Authentication APIs ###

View Source
const ApiToggleDisk = "ToggleDisk"
View Source
const ApiVersion = "Version"
View Source
const ApiVsnInf = "VsnInf"
View Source
const ConnStatusAuthenticationError = 5
View Source
const ConnStatusConnected = 1
View Source
const ConnStatusFullSyncFailed = 4
View Source
const ConnStatusHostnameMismatch = 7
View Source
const ConnStatusOffline = 0

## Satellite connection statuses ###

View Source
const ConnStatusOnline = 2
View Source
const ConnStatusUnknown = 6
View Source
const ConnStatusVersionMismatch = 3
View Source
const Created = (1 | MaskSuccess)

## Codes 1-9: success ###

View Source
const Deleted = (2 | MaskSuccess)
View Source
const DfltCtrlPortPlain = 3376
View Source
const DfltCtrlPortSsl = 3377

## Default ports ###

View Source
const DfltStltPortPlain = 3366
View Source
const DfltStltPortSsl = 3367
View Source
const EventResourceState = "ResourceState"

State of resource based on DRBD status (or other underlying system)

View Source
const EventStreamCloseNoConnection = "CloseNoConnection"
View Source
const EventStreamCloseRemoved = "CloseRemoved"
View Source
const EventStreamValue = "Value"

## Event stream actions ###

View Source
const EventVolumeDiskState = "VlmDiskState"

## Events ###

View Source
const FailAccDeniedCommand = (412 | MaskError)
View Source
const FailAccDeniedCtrlCfg = (411 | MaskError)
View Source
const FailAccDeniedFreeSpaceMgr = (417 | MaskError)
View Source
const FailAccDeniedKvs = (418 | MaskError)
View Source
const FailAccDeniedNode = (400 | MaskError)

## Codes 400-499: access denied failures ###

View Source
const FailAccDeniedNodeConn = (407 | MaskError)
View Source
const FailAccDeniedRsc = (402 | MaskError)
View Source
const FailAccDeniedRscConn = (408 | MaskError)
View Source
const FailAccDeniedRscDfn = (401 | MaskError)
View Source
const FailAccDeniedSnapshot = (415 | MaskError)
View Source
const FailAccDeniedSnapshotDfn = (414 | MaskError)
View Source
const FailAccDeniedSnapshotVlmDfn = (416 | MaskError)
View Source
const FailAccDeniedStltConn = (410 | MaskError)
View Source
const FailAccDeniedStorPool = (406 | MaskError)
View Source
const FailAccDeniedStorPoolDfn = (405 | MaskError)
View Source
const FailAccDeniedVlm = (404 | MaskError)
View Source
const FailAccDeniedVlmConn = (409 | MaskError)
View Source
const FailAccDeniedVlmDfn = (403 | MaskError)
View Source
const FailAccDeniedWatch = (413 | MaskError)
View Source
const FailExistsCryptPassphrase = (512 | MaskError)
View Source
const FailExistsExtName = (517 | MaskError)
View Source
const FailExistsNetIf = (505 | MaskError)
View Source
const FailExistsNode = (500 | MaskError)

## Codes 500-599: data already exists failures ###

View Source
const FailExistsNodeConn = (506 | MaskError)
View Source
const FailExistsRsc = (502 | MaskError)
View Source
const FailExistsRscConn = (507 | MaskError)
View Source
const FailExistsRscDfn = (501 | MaskError)
View Source
const FailExistsSnapshot = (516 | MaskError)
View Source
const FailExistsSnapshotDfn = (514 | MaskError)
View Source
const FailExistsStltConn = (511 | MaskError)
View Source
const FailExistsStorPool = (510 | MaskError)
View Source
const FailExistsStorPoolDfn = (509 | MaskError)
View Source
const FailExistsSwordfishTargetPerRscDfn = (515 | MaskError)
View Source
const FailExistsVlm = (504 | MaskError)
View Source
const FailExistsVlmConn = (508 | MaskError)
View Source
const FailExistsVlmDfn = (503 | MaskError)
View Source
const FailExistsWatch = (513 | MaskError)
View Source
const FailImplError = (999 | MaskError)
View Source
const FailInUse = (997 | MaskError)
View Source
const FailInsufficientPeerSlots = (993 | MaskError)
View Source
const FailInsufficientReplicaCount = (991 | MaskError)
View Source
const FailInvldCryptPassphrase = (216 | MaskError)
View Source
const FailInvldDrbdProxyCompressionType = (222 | MaskError)
View Source
const FailInvldEncryptType = (217 | MaskError)
View Source
const FailInvldExtName = (226 | MaskError)
View Source
const FailInvldFreeSpaceMgrName = (220 | MaskError)
View Source
const FailInvldKvsName = (223 | MaskError)
View Source
const FailInvldLayerKind = (224 | MaskError)
View Source
const FailInvldLayerStack = (225 | MaskError)
View Source
const FailInvldMinorNr = (207 | MaskError)
View Source
const FailInvldNetAddr = (210 | MaskError)
View Source
const FailInvldNetName = (209 | MaskError)
View Source
const FailInvldNetPort = (211 | MaskError)
View Source
const FailInvldNetType = (212 | MaskError)
View Source
const FailInvldNodeId = (204 | MaskError)
View Source
const FailInvldNodeName = (200 | MaskError)

## Codes 200-299: invalid * failures ###

View Source
const FailInvldNodeType = (201 | MaskError)
View Source
const FailInvldPlaceCount = (219 | MaskError)
View Source
const FailInvldProp = (213 | MaskError)
View Source
const FailInvldRscName = (202 | MaskError)
View Source
const FailInvldRscPort = (203 | MaskError)
View Source
const FailInvldSnapshotName = (218 | MaskError)
View Source
const FailInvldStorDriver = (221 | MaskError)
View Source
const FailInvldStorPoolName = (208 | MaskError)
View Source
const FailInvldTcpPort = (215 | MaskError)
View Source
const FailInvldTransportType = (214 | MaskError)
View Source
const FailInvldVlmNr = (205 | MaskError)
View Source
const FailInvldVlmSize = (206 | MaskError)
View Source
const FailMissingExtName = (606 | MaskError)
View Source
const FailMissingNetcom = (603 | MaskError)
View Source
const FailMissingProps = (600 | MaskError)

## Codes 600-699: data missing failures ###

View Source
const FailMissingPropsNetcomPort = (602 | MaskError)
View Source
const FailMissingPropsNetcomType = (601 | MaskError)
View Source
const FailMissingPropsNetifName = (604 | MaskError)
View Source
const FailMissingStltConn = (605 | MaskError)
View Source
const FailNotConnected = (995 | MaskError)
View Source
const FailNotEnoughNodes = (996 | MaskError)
View Source
const FailNotFoundCryptKey = (312 | MaskError)
View Source
const FailNotFoundDfltStorPool = (311 | MaskError)
View Source
const FailNotFoundKvs = (316 | MaskError)
View Source
const FailNotFoundNetIf = (305 | MaskError)
View Source
const FailNotFoundNode = (300 | MaskError)

## Codes 300-399: dependency not found failures ###

View Source
const FailNotFoundNodeConn = (306 | MaskError)
View Source
const FailNotFoundRsc = (302 | MaskError)
View Source
const FailNotFoundRscConn = (307 | MaskError)
View Source
const FailNotFoundRscDfn = (301 | MaskError)
View Source
const FailNotFoundSnapshot = (315 | MaskError)
View Source
const FailNotFoundSnapshotDfn = (313 | MaskError)
View Source
const FailNotFoundSnapshotVlmDfn = (314 | MaskError)
View Source
const FailNotFoundStorPool = (310 | MaskError)
View Source
const FailNotFoundStorPoolDfn = (309 | MaskError)
View Source
const FailNotFoundVlm = (304 | MaskError)
View Source
const FailNotFoundVlmConn = (308 | MaskError)
View Source
const FailNotFoundVlmDfn = (303 | MaskError)
View Source
const FailPoolExhaustedMinorNr = (801 | MaskError)
View Source
const FailPoolExhaustedNodeId = (803 | MaskError)
View Source
const FailPoolExhaustedRscLayerId = (804 | MaskError)
View Source
const FailPoolExhaustedTcpPort = (802 | MaskError)
View Source
const FailPoolExhaustedVlmNr = (800 | MaskError)

## Codes 800-899: number pools exhausted ###

View Source
const FailRscBusy = (992 | MaskError)
View Source
const FailSnapshotsNotSupported = (994 | MaskError)
View Source
const FailSql = (100 | MaskError)

## Codes 100 - 199: sql failures ###

View Source
const FailSqlRollback = (101 | MaskError)
View Source
const FailStorPoolConfigurationError = (990 | MaskError)

## Other failures ###

View Source
const FailUnknownError = (998 | MaskError)
View Source
const FailUuidKvs = (711 | MaskError)
View Source
const FailUuidNetIf = (705 | MaskError)
View Source
const FailUuidNode = (700 | MaskError)

## Codes 700-799: uuid mismatch failures ###

View Source
const FailUuidNodeConn = (706 | MaskError)
View Source
const FailUuidRsc = (702 | MaskError)
View Source
const FailUuidRscConn = (707 | MaskError)
View Source
const FailUuidRscDfn = (701 | MaskError)
View Source
const FailUuidStorPool = (710 | MaskError)
View Source
const FailUuidStorPoolDfn = (709 | MaskError)
View Source
const FailUuidVlm = (704 | MaskError)
View Source
const FailUuidVlmConn = (708 | MaskError)
View Source
const FailUuidVlmDfn = (703 | MaskError)
View Source
const FlagClean = "CLEAN"

## Flag string values ###

View Source
const FlagDelete = "DELETE"
View Source
const FlagDiskAddRequested = "DISK_ADD_REQUESTED"
View Source
const FlagDiskAdding = "DISK_ADDING"
View Source
const FlagDiskRemoveRequested = "DISK_REMOVE_REQUESTED"
View Source
const FlagDiskRemoving = "DISK_REMOVING"
View Source
const FlagDiskless = "DISKLESS"
View Source
const FlagEncrypted = "ENCRYPTED"
View Source
const FlagFailedDeployment = "FAILED_DEPLOYMENT"
View Source
const FlagFailedDisconnect = "FAILED_DISCONNECT"
View Source
const FlagQignore = "QIGNORE"
View Source
const FlagResize = "RESIZE"
View Source
const FlagSuccessful = "SUCCESSFUL"
View Source
const Key1StNode = "FirstNode"
View Source
const Key1StNodeName = "FirstNodeName"
View Source
const Key2NdNode = "SecondNode"
View Source
const Key2NdNodeName = "SecondNodeName"
View Source
const KeyAlSize = "AlSize"
View Source
const KeyAlStripes = "AlStripes"
View Source
const KeyAllowLargerVolumeSize = "AllowLargerVolumeSize"
View Source
const KeyBindAddr = "bindAddress"
View Source
const KeyBindPort = "port"
View Source
const KeyCurStltConnName = "CurStltConnName"
View Source
const KeyDmstats = "DMStats"
View Source
const KeyDrbdBitmapGi = "DrbdBitmapGi"
View Source
const KeyDrbdCurrentGi = "DrbdCurrentGi"
View Source
const KeyDrbdHistory1Gi = "DrbdHistory1Gi"
View Source
const KeyDrbdHistory2Gi = "DrbdHistory2Gi"
View Source
const KeyDrbdProxyCompressionType = "CompressionType"

## DRBD Proxy keys (other than 'options') ###

View Source
const KeyEnabled = "enabled"
View Source
const KeyGlobalSeqApiCalls = "GlobSeqApiCalls"
View Source
const KeyId = "ID"
View Source
const KeyIpAddr = "IPAddr"
View Source
const KeyKeyPwd = "KeyPwd"
View Source
const KeyKeystore = "Keystore"
View Source
const KeyKeystorePwd = "KeystorePwd"
View Source
const KeyKvs = "Kvs"

## Object property keys ###

View Source
const KeyMinorNr = "MinorNr"
View Source
const KeyMinorNrAutoRange = "MinorNrAutoRange"
View Source
const KeyMissingNamespc = "MissingNameSpace"
View Source
const KeyNetIfName = "NetIfName"
View Source
const KeyNetcomEnabled = "NetComEnabled"
View Source
const KeyNetcomType = "NetComType"
View Source
const KeyNetifName = "NetIfName"
View Source
const KeyNetifType = "NetIfType"
View Source
const KeyNode = "Node"
View Source
const KeyNodeFlags = "NodeFlags"
View Source
const KeyNodeId = "NodeId"
View Source
const KeyNodeName = "NodeName"
View Source
const KeyNodeType = "NodeType"
View Source
const KeyPeerCount = "PeerCount"
View Source
const KeyPeerSlots = "PeerSlots"
View Source
const KeyPeerSlotsNewResource = "PeerSlotsNewResource"
View Source
const KeyPortNr = "PortNr"

## Property keys ###

View Source
const KeyRole = "Role"
View Source
const KeyRscDfn = "RscDfn"
View Source
const KeyRscMigrateFrom = "MigrateFrom"
View Source
const KeyRscName = "RscName"
View Source
const KeyRscRollbackTarget = "RollbackTarget"
View Source
const KeySecDomain = "SecDomain"
View Source
const KeySecIdentity = "SecIdentity"

## Authentication keys ###

View Source
const KeySecPassword = "SecPassword"
View Source
const KeySecRole = "SecRole"
View Source
const KeySecType = "SecType"
View Source
const KeySfTargetPortAutoRange = "SwordfishTargetPortAutoRange"
View Source
const KeySnapshot = "Snapshot"
View Source
const KeySnapshotDfnSequenceNumber = "SequenceNumber"
View Source
const KeySnapshotName = "SnapshotName"
View Source
const KeySslProto = "SslProto"
View Source
const KeyStorPoolAllocationUnit = "AllocationUnit"

Unit of smallest allocation. The size in KiB as a decimal number.

View Source
const KeyStorPoolCryptPasswd = "CryptPasswd"
View Source
const KeyStorPoolDfn = "StorPoolDfn"
View Source
const KeyStorPoolDfnMaxOversubscriptionRatio = "MaxOversubscriptionRatio"
View Source
const KeyStorPoolName = "StorPoolName"
View Source
const KeyStorPoolOverrideVlmId = "OverrideVlmId"
View Source
const KeyStorPoolPrefNic = "PrefNic"
View Source
const KeyStorPoolProvisioning = "Provisioning"
View Source
const KeyStorPoolSfComposedNodeName = "SwordfishComposedNodeName"
View Source
const KeyStorPoolSfPollRetriesAttachVlm = "SwordfishAttachVolumeRetries"
View Source
const KeyStorPoolSfPollRetriesGrepNvmeUuid = "SwordfishGrepNvmeUuidRetries"
View Source
const KeyStorPoolSfPollRetriesVlmCrt = "SwordfishVolumeCreateRetries"
View Source
const KeyStorPoolSfPollTimeoutAttachVlm = "SwordfishAttachVolumeTimeout"
View Source
const KeyStorPoolSfPollTimeoutGrepNvmeUuid = "SwordfishGrepNvmeUuidTimeout"
View Source
const KeyStorPoolSfPollTimeoutVlmCrt = "SwordfishVolumeCreateTimeout"
View Source
const KeyStorPoolSfRetryCount = "SwordfishRetryCount"
View Source
const KeyStorPoolSfRetryDelay = "SwordfishRetryDelay"
View Source
const KeyStorPoolSfStorPool = "SwordfishStorPool"
View Source
const KeyStorPoolSfStorSvc = "SwordfishStorSvc"
View Source
const KeyStorPoolSfUrl = "SwordfishUrl"
View Source
const KeyStorPoolSfUserName = "SwordfishUserName"
View Source
const KeyStorPoolSfUserPw = "SwordfishUserPw"
View Source
const KeyStorPoolSupportsSnapshots = "SupportsSnapshots"

## Storage pool traits keys ###

View Source
const KeyStorPoolThinPool = "ThinPool"
View Source
const KeyStorPoolVolumeGroup = "LvmVg"

## Storage pool property keys ###

View Source
const KeyStorPoolZpool = "ZPool"
View Source
const KeyStorPoolZpoolthin = "ZPoolThin"
View Source
const KeyTcpPortAutoRange = "TcpPortAutoRange"
View Source
const KeyTruststore = "Truststore"
View Source
const KeyTruststorePwd = "TruststorePwd"
View Source
const KeyUuid = "UUID"
View Source
const KeyVlmNr = "VlmNr"
View Source
const KeyVlmRestoreFromResource = "RestoreFromResource"
View Source
const KeyVlmRestoreFromSnapshot = "RestoreFromSnapshot"
View Source
const KeyVlmSize = "VlmSize"
View Source
const MaskBitsCode = 0x0000000000007FFF

## Codes ###

View Source
const MaskBitsObj = 0x00000000007C0000

## Type masks (Node, ResDfn, Res, VolDfn, Vol, NetInterface, ...) ###

View Source
const MaskBitsOp = 0x0000000003000000

## Operation type masks ###

View Source
const MaskBitsType = 0xC000000000000000

## Bits 62 - 63 (most significant 2) are reserved for the message type masks (error, warning, info) Bits 25 - 26 are reserved for the operation type masks (create, modify, delete) Bits 18 - 22 are reserved for the object type masks (node, resource, resource definition, ...) Bits 0 - 14 are reserved for codes ###

View Source
const MaskCrt = 0x0000000001000000
View Source
const MaskCtrlConf = 0x0000000000100000
View Source
const MaskDel = 0x0000000003000000
View Source
const MaskError = 0xC000000000000000
View Source
const MaskInfo = 0x4000000000000000
View Source
const MaskKvs = 0x0000000000400000
View Source
const MaskMod = 0x0000000002000000
View Source
const MaskNetIf = 0x00000000001C0000
View Source
const MaskNode = 0x00000000003C0000
View Source
const MaskNodeConn = 0x0000000000280000
View Source
const MaskRsc = 0x0000000000340000
View Source
const MaskRscConn = 0x0000000000240000
View Source
const MaskRscDfn = 0x0000000000380000
View Source
const MaskSnapshot = 0x00000000000C0000
View Source
const MaskStorPool = 0x0000000000140000
View Source
const MaskStorPoolDfn = 0x0000000000180000
View Source
const MaskSuccess = 0x0000000000000000
View Source
const MaskVlm = 0x00000000002C0000
View Source
const MaskVlmConn = 0x0000000000200000
View Source
const MaskVlmDfn = 0x0000000000300000
View Source
const MaskWarn = 0x8000000000000000
View Source
const Modified = (3 | MaskSuccess)
View Source
const NamespcAlloc = "Allocation"
View Source
const NamespcAuxiliary = "Aux"
View Source
const NamespcConnectionPaths = "Paths"
View Source
const NamespcDflt = "Default"
View Source
const NamespcDrbdDiskOptions = "DrbdOptions/Disk"
View Source
const NamespcDrbdNetOptions = "DrbdOptions/Net"
View Source
const NamespcDrbdOptions = "DrbdOptions"
View Source
const NamespcDrbdPeerDeviceOptions = "DrbdOptions/PeerDevice"
View Source
const NamespcDrbdProxy = "DrbdProxy"
View Source
const NamespcDrbdProxyCompressionOptions = "DrbdOptions/ProxyCompression"
View Source
const NamespcDrbdProxyOptions = "DrbdOptions/Proxy"
View Source
const NamespcDrbdResourceOptions = "DrbdOptions/Resource"
View Source
const NamespcLogging = "Logging"
View Source
const NamespcNetcom = "NetCom"

## Property namespaces ###

View Source
const NamespcNetif = "NetIf"
View Source
const NamespcRest = "REST"
View Source
const NamespcStlt = "Satellite"
View Source
const NamespcStorageDriver = "StorDriver"
View Source
const PassphraseAccepted = (4 | MaskSuccess)
View Source
const RcSigninFail = (10000 | MaskError)
View Source
const RcSigninPass = (10000 | MaskSuccess)

## SignIn codes ###

View Source
const UnknownApiCall = (0x0FFFFFFFFFFFFFFF | MaskError)

## Special codes ###

View Source
const ValDrbdProxyCompressionLz4 = "lz4"
View Source
const ValDrbdProxyCompressionLzma = "lzma"
View Source
const ValDrbdProxyCompressionNone = "none"

## DRBD Proxy compression type property values ###

View Source
const ValDrbdProxyCompressionZlib = "zlib"
View Source
const ValFalse = "False"
View Source
const ValNetcomTypePlain = "Plain"
View Source
const ValNetcomTypeSsl = "SSL"

## Property values ###

View Source
const ValNetifTypeIp = "IP"

## Net interface Type values ###

View Source
const ValNetifTypeRdma = "RDMA"
View Source
const ValNetifTypeRoce = "RoCE"
View Source
const ValNodeTypeAux = "Auxiliary"
View Source
const ValNodeTypeCmbd = "Combined"
View Source
const ValNodeTypeCtrl = "Controller"

## Node Type values ###

View Source
const ValNodeTypeStlt = "Satellite"
View Source
const ValNodeTypeSwfishTarget = "SWORDFISH_TARGET"
View Source
const ValSslProtoTlsv1 = "TLSv1"
View Source
const ValStorPoolProvisioningFat = "Fat"

## Storage pool traits values ###

View Source
const ValStorPoolProvisioningThin = "Thin"
View Source
const ValTrue = "True"

## Boolean values ###

View Source
const WarnAllDiskless = (1009 | MaskWarn)
View Source
const WarnDelUnsetProp = (1005 | MaskWarn)
View Source
const WarnInvldOptPropNetcomEnabled = (1001 | MaskWarn)

## Codes 1000-1999: warnings ###

View Source
const WarnNoStltConnDefined = (1004 | MaskWarn)
View Source
const WarnNotConnected = (1002 | MaskWarn)
View Source
const WarnNotFound = (3000 | MaskWarn)
View Source
const WarnNotFoundCryptKey = (1011 | MaskWarn)
View Source
const WarnRscAlreadyDeployed = (1006 | MaskWarn)
View Source
const WarnRscAlreadyDiskless = (1008 | MaskWarn)
View Source
const WarnRscAlreadyHasDisk = (1007 | MaskWarn)
View Source
const WarnStltNotUpdated = (1003 | MaskWarn)
View Source
const WarnStorageError = (1010 | MaskWarn)
View Source
const WarnStorageKindAdded = (1012 | MaskWarn)

Variables

This section is empty.

Functions

func EnoughFreeSpace

func EnoughFreeSpace(requestedKiB, replicas string) error

EnoughFreeSpace checks to see if there's enough free space to create a new resource.

Types

type FSUtil

type FSUtil struct {
	*ResourceDeployment
	FSType    string
	FSOpts    string
	MountOpts string
	// contains filtered or unexported fields
}

FSUtil handles creating a filesystem and mounting resources.

func (FSUtil) Mount

func (f FSUtil) Mount(source, target string) error

Mount the FSUtil's resource on the path.

func (FSUtil) SafeFormat added in v0.11.0

func (f FSUtil) SafeFormat(path string) error

func (FSUtil) UnMount

func (f FSUtil) UnMount(path string) error

UnMount the FSUtil's resource from the path.

type ResDef added in v0.11.0

type ResDef struct {
	VlmDfns []struct {
		VlmDfnUUID string `json:"vlm_dfn_uuid"`
		VlmMinor   int    `json:"vlm_minor"`
		VlmNr      int    `json:"vlm_nr"`
		VlmSize    int    `json:"vlm_size"`
	} `json:"vlm_dfns,omitempty"`
	RscDfnSecret string `json:"rsc_dfn_secret"`
	RscDfnUUID   string `json:"rsc_dfn_uuid"`
	RscName      string `json:"rsc_name"`
	RscDfnPort   int    `json:"rsc_dfn_port"`
	RscDfnProps  []struct {
		Value string `json:"value"`
		Key   string `json:"key"`
	} `json:"rsc_dfn_props,omitempty"`
}

type ResourceDeployment added in v0.8.2

type ResourceDeployment struct {
	ResourceDeploymentConfig
	// contains filtered or unexported fields
}

ResourceDeployment contains all the information needed to query and assign/deploy a resource.

func NewResourceDeployment added in v0.8.2

func NewResourceDeployment(c ResourceDeploymentConfig) ResourceDeployment

NewResourceDeployment creates a new ResourceDeployment object. This tolerates some pretty janky ResourceDeploymentConfigs here is the breakdown of how that is handled: If no Name is given, a UUID is generated and used. If no NodeList is given, assignment will be automatically placed. If no ClientList is given, no client assignments will be made. If there are duplicates within ClientList or NodeList, they will be removed. If there are duplicates between ClientList and NodeList, duplicates in the ClientList will be removed. If no AutoPlace Value is given AND there is no NodeList and no ClientList, it will default to 1. If no DisklessOnRemaining is given, no diskless assignments on non replica nodes will be made. If no DoNotPlaceWithRegex, ReplicasOnSame, or ReplicasOnDifferent are provided resource assignment will occur without them. If no SizeKiB is provided, it will be given a size of 4096kb. If no StoragePool is provided, the default storage pool will be used. If no DisklessStoragePool is provided, the default diskless storage pool will be used. If no Encryption is specified, none will be used. If no MigrateOnAttach is specified, none will be used. If no Controllers are specified, none will be used. If no LogOut is specified, ioutil.Discard will be used. TODO: Document DR stuff.

func (ResourceDeployment) Assign added in v0.8.2

func (r ResourceDeployment) Assign() error

Assign assigns a resource with diskfull storage to all nodes in its NodeList, then attaches the resource disklessly to all nodes in its ClientList.

func (ResourceDeployment) Attach added in v0.12.0

func (r ResourceDeployment) Attach(node string, asClient bool) error

Attach assigns a resource on a single node disklessly or diskfully. If migrateOnAttach is true the migration will be be performed directly after assignment.

func (ResourceDeployment) Create added in v0.8.2

func (r ResourceDeployment) Create() error

Create reserves the resource name in Linstor.

func (ResourceDeployment) CreateAndAssign added in v0.8.2

func (r ResourceDeployment) CreateAndAssign() error

CreateAndAssign deploys the resource, created a new one if it doesn't exist.

func (ResourceDeployment) Delete added in v0.8.2

func (r ResourceDeployment) Delete() error

Delete removes a resource entirely from all nodes.

func (ResourceDeployment) DeployedNodes added in v0.13.1

func (r ResourceDeployment) DeployedNodes() ([]string, error)

DeployedNodes returns a list of nodes where the reource is deployed diskfully.

func (ResourceDeployment) Exists added in v0.8.2

func (r ResourceDeployment) Exists() (bool, error)

Exists checks to see if a resource is defined in LINSTOR.

func (ResourceDeployment) GetDevPath added in v0.10.0

func (r ResourceDeployment) GetDevPath(node string, stat bool) (string, error)

GetDevPath returns the path to the linstor volume on the given node. If stat is set to true, the device will be stat'd as a loose test to see if it is ready for IO.

func (ResourceDeployment) GetSnapByID added in v0.13.0

func (r ResourceDeployment) GetSnapByID(snapshots []Snapshot, id string) *Snapshot

func (ResourceDeployment) GetSnapByName added in v0.13.0

func (r ResourceDeployment) GetSnapByName(snapshots []Snapshot, name string) *Snapshot

func (ResourceDeployment) IsClient added in v0.8.2

func (r ResourceDeployment) IsClient(nodeName string) bool

IsClient determines if resource is running as a client on nodeName.

func (ResourceDeployment) ListResourceDefinitions added in v0.11.0

func (r ResourceDeployment) ListResourceDefinitions() ([]ResDef, error)

func (ResourceDeployment) NewResourceFromResource added in v0.13.0

func (r ResourceDeployment) NewResourceFromResource(sourceRes ResourceDeployment) error

func (ResourceDeployment) NewResourceFromSnapshot added in v0.13.0

func (r ResourceDeployment) NewResourceFromSnapshot(snapshotID string) error

func (ResourceDeployment) OnNode added in v0.8.2

func (r ResourceDeployment) OnNode(nodeName string) (bool, error)

OnNode determines if a resource is present on a particular node.

func (ResourceDeployment) SetAuxProp added in v0.13.0

func (r ResourceDeployment) SetAuxProp(key, value string) error

SetAuxProp adds an aux prop to the resource.

func (ResourceDeployment) SnapshotCreate added in v0.13.0

func (r ResourceDeployment) SnapshotCreate(name string) (*Snapshot, error)

SnapshotCreate makes a snapshot of the ResourceDeployment on all nodes where it is deployed. If the snapshot already exsits, return it as is.

func (ResourceDeployment) SnapshotDelete added in v0.13.0

func (r ResourceDeployment) SnapshotDelete(id string) error

SnapshotDelete deletes a snapshot with the given ID.

func (ResourceDeployment) SnapshotList added in v0.13.0

func (r ResourceDeployment) SnapshotList() ([]Snapshot, error)

SnapshotList returns a list of all snapshots known to LINSTOR.

func (ResourceDeployment) Unassign added in v0.8.2

func (r ResourceDeployment) Unassign(nodeName string) error

Unassign unassigns a resource from a particular node.

func (ResourceDeployment) WaitForDevPath added in v0.11.0

func (r ResourceDeployment) WaitForDevPath(node string, maxRetries int) (string, error)

WaitForDevPath polls until the resourse path appears on the system.

type ResourceDeploymentConfig added in v0.8.2

type ResourceDeploymentConfig struct {
	Name                string
	NodeList            []string
	ClientList          []string
	ReplicasOnSame      []string
	ReplicasOnDifferent []string
	DRSites             []string
	DRSiteKey           string
	AutoPlace           uint64
	DisklessOnRemaining bool
	DoNotPlaceWithRegex string
	SizeKiB             uint64
	StoragePool         string
	DisklessStoragePool string
	Encryption          bool
	MigrateOnAttach     bool
	Controllers         string
	LayerList           []string
	Annotations         map[string]string
	LogOut              io.Writer
	LogFmt              log.Formatter
}

ResourceDeploymentConfig is a configuration object for ResourceDeployment. If you're deploying a resource, AutoPlace is required. If you're assigning a resource to particular nodes, NodeList is required.

type Snapshot added in v0.13.0

type Snapshot struct {
	SnapshotDfnFlags []string `json:"snapshot_dfn_flags"`
	UUID             string   `json:"uuid"`
	RscName          string   `json:"rsc_name"`
	Nodes            []struct {
		NodeName string `json:"node_name"`
	} `json:"snapshots"`
	SnapshotName    string `json:"snapshot_name"`
	SnapshotVlmDfns []struct {
		VlmNr   int `json:"vlm_nr"`
		VlmSize int `json:"vlm_size"`
	} `json:"snapshot_vlm_dfns"`
	RscDfnUUID string `json:"rsc_dfn_uuid"`
}

type SnapshotInfo added in v0.13.0

type SnapshotInfo []struct {
	SnapshotDfns []Snapshot `json:"snapshot_dfns"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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