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" )
func IsApiCallError(err error, mask uint64) bool
IsApiCallError checks if an error is a specific type of LINSTOR error.
type ApiCallError []ApiCallRc
func (e ApiCallError) Error() string
func (e ApiCallError) Is(mask uint64) bool
Is is a shorthand for checking all ApiCallRcs of an ApiCallError against a given mask.
ApiCallRc represents the struct returned by LINSTOR, when accessing its REST API.
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"` }
func (r ApiCallRc) Is(mask uint64) bool
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.
func (rc *ApiCallRc) String() string
AutoPlaceRequest is a struct to store the paramters for the linstor auto-place command
type AutoPlaceRequest struct { DisklessOnRemaining bool `json:"diskless_on_remaining,omitempty"` SelectFilter AutoSelectFilter `json:"select_filter,omitempty"` LayerList []devicelayerkind.DeviceLayerKind `json:"layer_list,omitempty"` }
AutoSelectFilter is a struct used to have information about the auto-select function
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"` }
type BCacheResource struct { BCacheVolumes []BCacheVolume `json:"bcache_volumes,omitempty"` }
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 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 struct { RscName string `json:"rsc_name"` Restore *bool `json:"restore,omitempty"` Create *bool `json:"create,omitempty"` }
type BackupCreate struct { RscName string `json:"rsc_name"` SnapName string `json:"snap_name,omitempty"` NodeName string `json:"node_name,omitempty"` Incremental bool `json:"incremental,omitempty"` }
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 struct { Rsc string `json:"rsc"` Snap string `json:"snap"` Full string `json:"full"` Latest string `json:"latest"` Count int32 `json:"count,omitempty"` DlSizeKib int64 `json:"dl_size_kib"` AllocSizeKib int64 `json:"alloc_size_kib"` Storpools []BackupInfoStorPool `json:"storpools"` }
type BackupInfoRequest 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"` NodeName string `json:"node_name,omitempty"` }
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 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 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 struct { Files *[]string `json:"files,omitempty"` }
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 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 struct { MetaName string `json:"meta_name,omitempty"` }
type BackupService struct {
// contains filtered or unexported fields
}
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 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 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 struct { Key *string `json:"key,omitempty"` }
type BasicAuthCfg struct { Username, Password string }
type CacheResource struct { CacheVolumes []CacheVolume `json:"cache_volumes,omitempty"` }
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"` }
Candidate struct for Candidate
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"` }
Client is a struct representing a LINSTOR REST 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 }
func NewClient(options ...Option) (*Client, error)
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.
func (c *Client) BaseURL() *url.URL
type Connection struct { NodeA string `json:"node_a,omitempty"` NodeB string `json:"node_b,omitempty"` Props map[string]string `json:"props,omitempty"` Flags []string `json:"flags,omitempty"` Port *int32 `json:"port,omitempty"` }
ConnectionProvider acts as an abstraction for a ConnectionService. It can be swapped out for another ConnectionService implementation, for example for testing.
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 }
ConnectionService is the service that deals with connection related tasks.
type ConnectionService struct {
// contains filtered or unexported fields
}
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 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 struct { Dir string `json:"dir,omitempty"` }
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 struct { OperationsPerTransaction int32 `json:"operations_per_transaction,omitempty"` Prefix string `json:"prefix,omitempty"` }
type ControllerConfigDebug struct { ConsoleEnabled bool `json:"console_enabled,omitempty"` }
type ControllerConfigHttp struct { Enabled bool `json:"enabled,omitempty"` ListenAddress string `json:"listen_address,omitempty"` Port int32 `json:"port,omitempty"` }
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 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 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 map[string]string
ControllerProvider acts as an abstraction for a ControllerService. It can be swapped out for another ControllerService implementation, for example for testing.
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 }
ControllerService is the service that deals with the LINSTOR controller.
type ControllerService struct {
// contains filtered or unexported fields
}
func (s *ControllerService) CreateSOSReport(ctx context.Context, opts ...*ListOpts) error
CreateSOSReport creates an SOS report in the log directory of the controller
func (s *ControllerService) DeleteErrorReports(ctx context.Context, del ErrorReportDelete) error
DeleteErrorReports deletes error reports as specified by the ErrorReportDelete struct.
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 (s *ControllerService) DeleteProp(ctx context.Context, prop string) error
DeleteProp deletes the given property/key from the controller object.
func (s *ControllerService) DownloadSOSReport(ctx context.Context, opts ...*ListOpts) error
DownloadSOSReport request sos report to download
func (s *ControllerService) GetConfig(ctx context.Context, opts ...*ListOpts) (ControllerConfig, error)
GetConfig queries the configuration of a controller
func (s *ControllerService) GetErrorReport(ctx context.Context, id string, opts ...*ListOpts) (ErrorReport, error)
GetErrorReport returns a specific error report, including its text.
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 (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 (s *ControllerService) GetExternalFile(ctx context.Context, name string) (ExternalFile, error)
GetExternalFile gets the requested external file including its content
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 (s *ControllerService) GetProps(ctx context.Context, opts ...*ListOpts) (ControllerProps, error)
GetProps gets all properties of a controller
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 (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 (s *ControllerService) GetSatelliteConfig(ctx context.Context, node string) (SatelliteConfig, error)
func (s *ControllerService) GetVersion(ctx context.Context, opts ...*ListOpts) (ControllerVersion, error)
GetVersion queries version information for the controller.
func (s *ControllerService) Modify(ctx context.Context, props GenericPropsModify) error
Modify modifies the controller node and sets/deletes the given properties.
func (s *ControllerService) ModifyExternalFile(ctx context.Context, name string, file ExternalFile) error
ModifyExternalFile registers or modifies a previously registered external file
func (s *ControllerService) ModifySatelliteConfig(ctx context.Context, node string, cfg SatelliteConfig) error
ControllerVersion represents version information of the LINSTOR controller
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"` }
DRBDMayPromoteStream is a struct that contains a channel of EventMayPromoteChange events It has a Close() method that needs to be called/defered.
type DRBDMayPromoteStream struct { Events chan EventMayPromoteChange // contains filtered or unexported fields }
func (dmp *DRBDMayPromoteStream) Close()
Close is used to close the underlying stream and all Go routines
Namespaces to delete
type DeleteNamespaces []string
DeleteProps is a slice of properties to delete.
type DeleteProps []string
DrbdConnection is a struct representing the DRBD connection status
type DrbdConnection struct { Connected bool `json:"connected,omitempty"` // DRBD connection status Message string `json:"message,omitempty"` }
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 }
DrbdResource is a struct used to give linstor drbd properties for a resource
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"` }
DrbdResourceDefinitionLayer is a struct which contains the information about the layertype of a resource-definition on drbd level
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"` }
DrbdVolume is a struct for linstor to get inormation about a drbd-volume
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"` }
DrbdVolumeDefinition is a struct containing volume-definition on drbd level
type DrbdVolumeDefinition struct { ResourceNameSuffix string `json:"resource_name_suffix,omitempty"` VolumeNumber int32 `json:"volume_number,omitempty"` MinorNumber int32 `json:"minor_number,omitempty"` }
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"` }
EncryptionProvider acts as an abstraction for an EncryptionService. It can be swapped out for another EncryptionService implementation, for example for testing.
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 }
EncryptionService is the service that deals with encyrption related tasks.
type EncryptionService struct {
// contains filtered or unexported fields
}
func (n *EncryptionService) Create(ctx context.Context, passphrase Passphrase) error
Create creates an encryption with the given passphrase
func (n *EncryptionService) Enter(ctx context.Context, password string) error
Enter is used to enter a password so that content can be decrypted
func (n *EncryptionService) Modify(ctx context.Context, passphrase Passphrase) error
Modify modifies an existing passphrase
ErrorReport struct for ErrorReport
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"` }
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 struct { ResourceName string `json:"resource_name,omitempty"` NodeName string `json:"node_name,omitempty"` MayPromote bool `json:"may_promote,omitempty"` }
EventProvider acts as an abstraction for an EventService. It can be swapped out for another EventService implementation, for example for testing.
type EventProvider interface { // DRBDPromotion is used to subscribe to LINSTOR DRBD Promotion events DRBDPromotion(ctx context.Context, lastEventId string) (*DRBDMayPromoteStream, error) }
EventService is the service that deals with LINSTOR server side event streams.
type EventService struct {
// contains filtered or unexported fields
}
func (e *EventService) DRBDPromotion(ctx context.Context, lastEventId string) (*DRBDMayPromoteStream, error)
DRBDPromotion is used to subscribe to LINSTOR DRBD Promotion events
ExosConnectionMap struct for ExosConnectionMap
type ExosConnectionMap struct { NodeName string `json:"node_name,omitempty"` EnclosureName string `json:"enclosure_name,omitempty"` Connections []string `json:"connections,omitempty"` }
ExosDefaults Default settings for EXOS enclosures
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"` }
ExosDefaultsModify struct for ExosDefaultsModify
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"` }
ExosDefaultsModifyAllOf struct for ExosDefaultsModifyAllOf
type ExosDefaultsModifyAllOf struct { // A list of keys to unset. The keys have to exist in ExosDefaults UnsetKeys []string `json:"unset_keys,omitempty"` }
ExosEnclosure EXOS enclosure
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"` }
ExosEnclosureEvent EXOS event
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"` }
ExosEnclosureHealth EXOS enclosure name, controller IPs and health status
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"` }
ExternalFile is an external file which can be configured to be deployed by Linstor
type ExternalFile struct { Path string Content []byte }
func (e *ExternalFile) MarshalJSON() ([]byte, error)
func (e *ExternalFile) UnmarshalJSON(text []byte) error
GenericPropsModify is a struct combining DeleteProps and OverrideProps
type GenericPropsModify struct { DeleteProps DeleteProps `json:"delete_props,omitempty"` OverrideProps OverrideProps `json:"override_props,omitempty"` DeleteNamespaces DeleteNamespaces `json:"delete_namespaces,omitempty"` }
type KV struct { Name string `json:"name"` Props map[string]string `json:"props"` }
type KeyValueStoreProvider interface { List(ctx context.Context) ([]KV, error) Get(ctx context.Context, kv string) (*KV, error) CreateOrModify(ctx context.Context, kv string, modify GenericPropsModify) error Delete(ctx context.Context, kv string) error }
type KeyValueStoreService struct {
// contains filtered or unexported fields
}
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)
List returns the name of key-value stores and their values
LeveledLogger interface implements the basic methods that a logger library needs
type LeveledLogger interface { Errorf(string, ...interface{}) Infof(string, ...interface{}) Debugf(string, ...interface{}) Warnf(string, ...interface{}) }
type LinstorRemote struct { RemoteName string `json:"remote_name,omitempty"` Url string `json:"url,omitempty"` Passphrase string `json:"passphrase,omitempty"` ClusterId string `json:"cluster_id,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 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"` }
type LogLevel string
List of LogLevel
const ( ERROR LogLevel = "ERROR" WARN LogLevel = "WARN" INFO LogLevel = "INFO" DEBUG LogLevel = "DEBUG" TRACE LogLevel = "TRACE" )
Logger represents a standard logger interface
type Logger interface { Printf(string, ...interface{}) }
LuksResource is a struct to store storage-volumes for a luks-resource
type LuksResource struct { StorageVolumes []LuksVolume `json:"storage_volumes,omitempty"` }
LuksVolume is a struct used for information about a luks-volume
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"` }
MaxVolumeSizes struct for MaxVolumeSizes
type MaxVolumeSizes struct { Candidates []Candidate `json:"candidates,omitempty"` DefaultMaxOversubscriptionRatio float64 `json:"default_max_oversubscription_ratio,omitempty"` }
NetInterface represents a node's network interface.
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"` }
Node represents a node in LINSTOR
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"` }
type NodeModify struct { NodeType string `json:"node_type,omitempty"` // A string to string property map. GenericPropsModify }
NodeProvider acts as an abstraction for a NodeService. It can be swapped out for another NodeService implementation, for example for testing.
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 }
type NodeRestore struct { DeleteResources *bool `json:"delete_resources,omitempty"` DeleteSnapshots *bool `json:"delete_snapshots,omitempty"` }
NodeService is the service that deals with node related tasks.
type NodeService struct {
// contains filtered or unexported fields
}
func (n *NodeService) Create(ctx context.Context, node Node) error
Create creates a new node object.
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 (n *NodeService) CreateEbsNode(ctx context.Context, name, remoteName string) error
func (n *NodeService) CreateNetInterface(ctx context.Context, nodeName string, nif NetInterface) error
CreateNetInterface creates the given network interface on a given node.
func (n *NodeService) CreateStoragePool(ctx context.Context, nodeName string, sp StoragePool) error
CreateStoragePool creates a storage pool on a given node.
func (n *NodeService) Delete(ctx context.Context, nodeName string) error
Delete deletes the given node.
func (n *NodeService) DeleteNetinterface(ctx context.Context, nodeName, nifName string) error
DeleteNetinterface deletes the given network interface on a given node.
func (n *NodeService) DeleteStoragePool(ctx context.Context, nodeName, spName string) error
DeleteStoragePool deletes a storage pool on a given node.
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 (n NodeService) Evict(ctx context.Context, nodeName string) error
Evict the given node, migrating resources to the remaining nodes, if possible.
func (n *NodeService) Get(ctx context.Context, nodeName string, opts ...*ListOpts) (Node, error)
Get gets information for a particular node.
func (n *NodeService) GetAll(ctx context.Context, opts ...*ListOpts) ([]Node, error)
GetAll gets information for all registered nodes.
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 (n *NodeService) GetNetInterfaces(ctx context.Context, nodeName string, opts ...*ListOpts) ([]NetInterface, error)
GetNetInterfaces gets information about all network interfaces of a given node.
func (n *NodeService) GetPhysicalStorage(ctx context.Context, nodeName string) ([]PhysicalStorageNode, error)
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 (n *NodeService) GetPropsInfos(ctx context.Context, opts ...*ListOpts) ([]PropsInfo, error)
GetPropsInfos gets meta information about the properties that can be set on a node.
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 (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 (n *NodeService) GetStoragePoolView(ctx context.Context, opts ...*ListOpts) ([]StoragePool, error)
GetStoragePoolView gets information about all storage pools in the cluster.
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 (n *NodeService) Lost(ctx context.Context, nodeName string) error
Lost marks the given node as lost to delete an unrecoverable node.
func (n *NodeService) Modify(ctx context.Context, nodeName string, props NodeModify) error
Modify modifies the given node and sets/deletes the given properties.
func (n *NodeService) ModifyNetInterface(ctx context.Context, nodeName, nifName string, nif NetInterface) error
ModifyNetInterface modifies the given network interface on a given node.
func (n *NodeService) ModifyStoragePool(ctx context.Context, nodeName, spName string, genericProps GenericPropsModify) error
ModifyStoragePool modifies a storage pool on a given node.
func (n *NodeService) Reconnect(ctx context.Context, nodeName string) error
Reconnect reconnects a node to the controller.
func (n *NodeService) Restore(ctx context.Context, nodeName string, restore NodeRestore) error
Restore an evicted node, optionally keeping existing resources.
type NvmeResource struct { NvmeVolumes []NvmeVolume `json:"nvme_volumes,omitempty"` }
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"` }
OneOfDrbdVolumeDefinition is used to prevent other layertypes than drbd-volume-defintion
type OneOfDrbdVolumeDefinition 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 OneOfDrbdVolumeLuksVolumeStorageVolumeNvmeVolumeWritecacheVolumeCacheVolumeBCacheVolume interface {
// contains filtered or unexported methods
}
Option configures a LINSTOR Client
type Option func(*Client) error
func BaseURL(URL *url.URL) Option
BaseURL is a client's option to set the baseURL of the REST client.
func BasicAuth(basicauth *BasicAuthCfg) Option
BasicAuth is a client's option to set username and password for the REST client.
func BearerToken(token string) Option
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(controllers []string) Option
func HTTPClient(httpClient *http.Client) Option
HTTPClient is a client's option to set a specific http.Client.
func Limit(r rate.Limit, b int) Option
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.
func Limiter(limiter *rate.Limiter) Option
Limiter to use when making queries. Mutually exclusive with Limit, last applied option wins.
func Log(logger interface{}) Option
Log is a client's option to set a Logger
func UserAgent(ua string) Option
UserAgent sets the User-Agent header for every request to the given string.
OverrideProps is a map of properties to modify (key/value pairs)
type OverrideProps map[string]string
Passphrase represents a LINSTOR passphrase
type Passphrase struct { NewPassphrase string `json:"new_passphrase,omitempty"` OldPassphrase string `json:"old_passphrase,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 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"` }
PhysicalStorageDevice represents a physical storage device on a a node.
type PhysicalStorageDevice struct { Device string `json:"device,omitempty"` Model string `json:"model,omitempty"` Serial string `json:"serial,omitempty"` Wwn string `json:"wwn,omitempty"` }
type PhysicalStorageNode struct { PhysicalStorageDevice Size int64 `json:"size,omitempty"` Rotational bool `json:"rotational,omitempty"` }
PhysicalStorageStoragePoolCreate is used for create physical-storage
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"` // Name of the shared space SharedSpace string `json:"shared_space,omitempty"` // true if a shared storage pool uses linstor-external locking, like cLVM ExternalLocking bool `json:"external_locking,omitempty"` }
PhysicalStorageViewItem is a view on a physical storage on multiple nodes.
type PhysicalStorageViewItem struct { Size int64 `json:"size,omitempty"` Rotational bool `json:"rotational,omitempty"` Nodes map[string][]PhysicalStorageDevice `json:"nodes,omitempty"` }
type PropsInfo struct { Info string `json:"info,omitempty"` PropType string `json:"prop_type,omitempty"` Value string `json:"value,omitempty"` Dflt string `json:"dflt,omitempty"` Unit string `json:"unit,omitempty"` }
ProviderKind is a type that represents various types of storage.
type ProviderKind string
List of ProviderKind
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" )
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 struct { S3Remotes []S3Remote `json:"s3_remotes,omitempty"` LinstorRemotes []LinstorRemote `json:"linstor_remotes,omitempty"` EbsRemotes []EbsRemote `json:"ebs_remotes,omitempty"` }
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 struct {
// contains filtered or unexported fields
}
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
Resource is a struct which holds the information of a 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"` }
ResourceConnection is a struct which holds information about a connection between to nodes
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"` }
ResourceCreate is a struct where the properties of a resource are stored to create it
type ResourceCreate struct { Resource Resource `json:"resource,omitempty"` LayerList []devicelayerkind.DeviceLayerKind `json:"layer_list,omitempty"` DrbdNodeId int32 `json:"drbd_node_id,omitempty"` }
ResourceDefinition is a struct to store the information about a resource-definition
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"` }
type ResourceDefinitionCloneRequest struct { Name string `json:"name,omitempty"` ExternalName string `json:"external_name,omitempty"` }
type ResourceDefinitionCloneStarted struct { // Path for clone status Location string `json:"location"` // name of the source resource SourceName string `json:"source_name"` // name of the clone resource CloneName string `json:"clone_name"` Messages *[]ApiCallRc `json:"messages,omitempty"` }
type ResourceDefinitionCloneStatus struct { Status clonestatus.CloneStatus `json:"status"` }
ResourceDefinitionCreate is a struct for holding the data needed to create a resource-defintion
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"` }
ResourceDefinitionLayer is a struct for the storing the layertype of a resource-defintion
type ResourceDefinitionLayer struct { Type devicelayerkind.DeviceLayerKind `json:"type,omitempty"` Data *DrbdResourceDefinitionLayer `json:"data,omitempty"` }
func (rd *ResourceDefinitionLayer) UnmarshalJSON(b []byte) error
UnmarshalJSON is needed for the unmarshal interface for ResourceDefinitionLayer types
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 }
ResourceDefinitionProvider acts as an abstraction for a ResourceDefinitionService. It can be swapped out for another ResourceDefinitionService implementation, for example for testing.
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) }
ResourceDefinitionService is a struct for the client pointer
type ResourceDefinitionService struct {
// contains filtered or unexported fields
}
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 (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 (n *ResourceDefinitionService) CloneStatus(ctx context.Context, srcResDef, targetResDef string) (ResourceDefinitionCloneStatus, error)
CloneStatus fetches the current status of a clone operation started by Clone.
func (n *ResourceDefinitionService) Create(ctx context.Context, resDef ResourceDefinitionCreate) error
Create adds a new resource-definition
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 (n *ResourceDefinitionService) Delete(ctx context.Context, resDefName string) error
Delete completely deletes a resource-definition
func (n *ResourceDefinitionService) DeleteVolumeDefinition(ctx context.Context, resDefName string, volNr int) error
DeleteVolumeDefinition deletes a specific volume-definition
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 (n *ResourceDefinitionService) Get(ctx context.Context, resDefName string, opts ...*ListOpts) (ResourceDefinition, error)
Get return information about a resource-defintion
func (n *ResourceDefinitionService) GetAll(ctx context.Context, request RDGetAllRequest) ([]ResourceDefinitionWithVolumeDefinition, error)
GetAll lists all resource-definitions
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 (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 (n *ResourceDefinitionService) GetVolumeDefinition(ctx context.Context, resDefName string, volNr int, opts ...*ListOpts) (VolumeDefinition, error)
GetVolumeDefinition shows the properties of a specific volume-definition
func (n *ResourceDefinitionService) GetVolumeDefinitions(ctx context.Context, resDefName string, opts ...*ListOpts) ([]VolumeDefinition, error)
GetVolumeDefinitions returns all volume-definitions of a resource-definition
func (n *ResourceDefinitionService) Modify(ctx context.Context, resDefName string, props GenericPropsModify) error
Modify allows to modify a resource-definition
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 (n *ResourceDefinitionService) SyncStatus(ctx context.Context, resDef string) (ResourceDefinitionSyncStatus, error)
SyncStatus checks if a resource is currently in sync on all nodes
type ResourceDefinitionSyncStatus struct { SyncedOnAll bool `json:"synced_on_all"` }
type ResourceDefinitionWithVolumeDefinition struct { ResourceDefinition VolumeDefinitions []VolumeDefinition `json:"volume_definitions,omitempty"` }
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 struct { SelectFilter *AutoSelectFilter `json:"select_filter,omitempty"` }
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"` }
ResourceGroupProvider acts as an abstraction for a ResourceGroupService. It can be swapped out for another ResourceGroupService implementation, for example for testing.
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 }
ResourceGroupService is the service that deals with resource group related tasks.
type ResourceGroupService struct {
// contains filtered or unexported fields
}
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 (n *ResourceGroupService) AdjustAll(ctx context.Context, adjust ResourceGroupAdjust) error
AdjustAll adjusts all resource-definitions (calls autoplace) according to their associated resource group.
func (n *ResourceGroupService) Create(ctx context.Context, resGrp ResourceGroup) error
Create adds a new resource-group
func (n *ResourceGroupService) CreateVolumeGroup(ctx context.Context, resGrpName string, volGrp VolumeGroup) error
Create adds a new volume-group to a resource-group
func (n *ResourceGroupService) Delete(ctx context.Context, resGrpName string) error
Delete deletes a resource-group
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)
Get return information about a resource-defintion
func (n *ResourceGroupService) GetAll(ctx context.Context, opts ...*ListOpts) ([]ResourceGroup, error)
GetAll lists all resource-groups
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 (n *ResourceGroupService) GetVolumeGroup(ctx context.Context, resGrpName string, volNr int, opts ...*ListOpts) (VolumeGroup, error)
GetVolumeGroup lists a volume-group for a resource-group
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 (n *ResourceGroupService) GetVolumeGroups(ctx context.Context, resGrpName string, opts ...*ListOpts) ([]VolumeGroup, error)
GetVolumeGroups lists all volume-groups for a resource-group
func (n *ResourceGroupService) Modify(ctx context.Context, resGrpName string, props ResourceGroupModify) error
Modify allows to modify a resource-group
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 (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 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"` }
ResourceLayer is a struct to store layer-information abour a resource
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"` }
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"` }
ResourceProvider acts as an abstraction for an ResourceService. It can be swapped out for another ResourceService implementation, for example for testing.
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 }
ResourceService is a struct which contains the pointer of the client
type ResourceService struct {
// contains filtered or unexported fields
}
func (n *ResourceService) Activate(ctx context.Context, resName, nodeName string) error
func (n *ResourceService) Autoplace(ctx context.Context, resName string, apr AutoPlaceRequest) error
Autoplace places a resource on your nodes autmatically
func (n *ResourceService) Create(ctx context.Context, res ResourceCreate) error
Create is used to create a resource on a node
func (n *ResourceService) CreateSnapshot(ctx context.Context, snapshot Snapshot) error
CreateSnapshot creates a snapshot of a resource
func (n *ResourceService) Deactivate(ctx context.Context, resName, nodeName string) error
func (n *ResourceService) Delete(ctx context.Context, resName, nodeName string) error
Delete deletes a resource on a specific node
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 (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 (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 (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 (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 (n *ResourceService) EnableSnapshotShipping(ctx context.Context, resName string, ship SnapshotShipping) error
EnableSnapshotShipping enables snapshot shipping for a resource
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 (n *ResourceService) GetAll(ctx context.Context, resName string, opts ...*ListOpts) ([]Resource, error)
GetAll returns all resources for a resource-definition
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 (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 (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 (n *ResourceService) GetResourceView(ctx context.Context, opts ...*ListOpts) ([]ResourceWithVolumes, error)
GetResourceView returns all resources in the cluster. Filters can be set via ListOpts.
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 (n *ResourceService) GetSnapshotShippings(ctx context.Context, opts ...*ListOpts) ([]SnapshotShippingStatus, error)
GetSnapshotShippings gets a view of all snapshot shippings
func (r *ResourceService) GetSnapshotView(ctx context.Context, opts ...*ListOpts) ([]Snapshot, error)
GetSnapshotView gets information about all snapshots
func (n *ResourceService) GetSnapshots(ctx context.Context, resName string, opts ...*ListOpts) ([]Snapshot, error)
GetSnapshots lists all snapshots of a resource
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 (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 (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 (n *ResourceService) GetVolumes(ctx context.Context, resName, nodeName string, opts ...*ListOpts) ([]Volume, error)
GetVolumes lists als volumes of a resource
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 (n *ResourceService) Migrate(ctx context.Context, resName, fromNodeName, toNodeName, storagePoolName string) error
Migrate mirgates a resource from one node to another node
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 (n *ResourceService) ModifyConnection(ctx context.Context, resName, nodeAName, nodeBName string, props GenericPropsModify) error
ModifyConnection allows to modify the connection between two nodes
func (n *ResourceService) ModifyDRBDProxy(ctx context.Context, resName string, props DrbdProxyModify) error
ModifyDRBDProxy is used to modify drbd-proxy properties
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 (n *ResourceService) QueryMaxVolumeSize(ctx context.Context, filter AutoSelectFilter) (MaxVolumeSizes, error)
QueryMaxVolumeSize finds the maximum size of a volume for a given filter
func (n *ResourceService) RestoreSnapshot(ctx context.Context, origResName, snapName string, snapRestoreConf SnapshotRestore) error
RestoreSnapshot restores a snapshot on a resource
func (n *ResourceService) RestoreVolumeDefinitionSnapshot(ctx context.Context, origResName, snapName string, snapRestoreConf SnapshotRestore) error
RestoreVolumeDefinitionSnapshot restores a volume-definition-snapshot on a resource
func (n *ResourceService) RollbackSnapshot(ctx context.Context, resName, snapName string) error
RollbackSnapshot rolls back a snapshot from a specific resource
ResourceState is a struct for getting the status of a resource
type ResourceState struct { InUse *bool `json:"in_use,omitempty"` }
type ResourceWithVolumes struct { Resource // milliseconds since unix epoch in UTC CreateTimestamp *TimeStampMs `json:"create_timestamp,omitempty"` Volumes []Volume `json:"volumes,omitempty"` // shared space name of the data storage pool of the first volume of // the resource or empty if data storage pool is not shared SharedName string `json:"shared_name,omitempty"` }
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"` }
SatelliteConfig struct for SatelliteConfig
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"` }
SatelliteConfigLog struct for SatelliteConfigLog
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"` }
SatelliteConfigNet struct for SatelliteConfigNet
type SatelliteConfigNet struct { BindAddress string `json:"bind_address,omitempty"` Port int32 `json:"port,omitempty"` ComType string `json:"com_type,omitempty"` }
Snapshot is a struct for information about a 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"` }
SnapshotNode Actual snapshot data from a node
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"` }
SnapshotRestore is a struct used to hold the information about where a Snapshot has to be restored
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"` }
SnapshotShipping struct for SnapshotShipping
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"` }
SnapshotShippingStatus struct for SnapshotShippingStatus
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"` }
SnapshotVolumeDefinition is a struct to store the properties of a volume from a snapshot
type SnapshotVolumeDefinition struct { VolumeNumber int32 `json:"volume_number,omitempty"` // Volume size in KiB SizeKib uint64 `json:"size_kib,omitempty"` }
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"` }
StoragePool represents a nodes storage pool as defined in LINSTOR.
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"` // name of the shared space or null if none given SharedSpace string `json:"shared_space,omitempty"` // true if a shared storage pool uses linstor-external locking, like cLVM ExternalLocking bool `json:"external_locking,omitempty"` }
StoragePoolDefinition represents a storage pool definition in LINSTOR
type StoragePoolDefinition struct { StoragePoolName string `json:"storage_pool_name,omitempty"` // A string to string property map. Props map[string]string `json:"props,omitempty"` }
StoragePoolDefinitionModify holds properties of a storage pool definition to modify such a definition.
type StoragePoolDefinitionModify struct { GenericPropsModify }
StoragePoolDefinitionProvider acts as an abstraction for a StoragePoolDefinitionService. It can be swapped out for another StoragePoolDefinitionService implementation, for example for testing.
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) }
StoragePoolDefinitionService is the service that deals with storage pool definition related tasks.
type StoragePoolDefinitionService struct {
// contains filtered or unexported fields
}
func (s *StoragePoolDefinitionService) Create(ctx context.Context, spd StoragePoolDefinition) error
Create creates a new storage pool definition
func (s *StoragePoolDefinitionService) Delete(ctx context.Context, spdName string) error
Delete deletes the given storage pool definition.
func (s *StoragePoolDefinitionService) Get(ctx context.Context, spdName string, opts ...*ListOpts) (StoragePoolDefinition, error)
Get gets information for a particular storage pool definition.
func (s *StoragePoolDefinitionService) GetAll(ctx context.Context, opts ...*ListOpts) ([]StoragePoolDefinition, error)
GetAll gets information for all existing storage pool definitions.
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 (s *StoragePoolDefinitionService) Modify(ctx context.Context, spdName string, props StoragePoolDefinitionModify) error
Modify modifies the given storage pool definition and sets/deletes the given properties.
StorageResource is a struct which contains the storage-volumes for a storage-resource
type StorageResource struct { StorageVolumes []StorageVolume `json:"storage_volumes,omitempty"` }
StorageVolume is a struct to store standard poperties of a Volume
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"` }
type TimeStampMs struct { time.Time }
func (t TimeStampMs) EncodeValues(key string, v *url.Values) error
func (t TimeStampMs) MarshalJSON() ([]byte, error)
func (t *TimeStampMs) UnmarshalJSON(s []byte) (err error)
type ToggleDiskDiskfulProps struct { LayerList []devicelayerkind.DeviceLayerKind `json:"layer_list,omitempty"` }
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 struct {
// contains filtered or unexported fields
}
func (s *VendorService) CreateExosEnclosure(ctx context.Context, enclosure ExosEnclosure) error
CreateExosEnclosure creates a new enclosure unless it already exists
func (s *VendorService) DeleteExosEnclosure(ctx context.Context, name string) error
DeleteExosEnclosure deletes an existing enclosure
func (s *VendorService) GetExosConnectionMap(ctx context.Context) (ExosConnectionMap, error)
GetExosConnectionMap lists the connection-mesh of EXOS Ports to LINSTOR Nodes
func (s *VendorService) GetExosDefaults(ctx context.Context) (ExosDefaults, error)
GetExosDefaults lists default settings for all EXOS enclosures
func (s *VendorService) GetExosEnclosures(ctx context.Context, noCache bool) ([]ExosEnclosure, error)
GetExosEnclosures lists EXOS enclosures including controller IP and health status
func (s *VendorService) GetExosEvents(ctx context.Context, name string, count int32) ([]ExosEnclosureEvent, error)
GetExosEvents lists the most current "count" events
func (s *VendorService) ModifyExosDefaults(ctx context.Context, defaults ExosDefaultsModify) error
ModifyExosDefaults sets or modifies default username / password for EXOS enclosures
func (s *VendorService) ModifyExosEnclosure(ctx context.Context, name string, enclosure ExosEnclosure) error
ModifyExosEnclosure modifies an existing enclosure
Volume is a struct which holds the information about a linstor-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"` }
VolumeDefinition is a struct which is used to store volume-definition properties
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"` }
VolumeDefinitionCreate is a struct used for creating volume-definitions
type VolumeDefinitionCreate struct { VolumeDefinition VolumeDefinition `json:"volume_definition"` DrbdMinorNumber int32 `json:"drbd_minor_number,omitempty"` }
VolumeDefinitionLayer is a struct for the layer-type of a volume-definition
type VolumeDefinitionLayer struct { Type devicelayerkind.DeviceLayerKind `json:"type"` Data OneOfDrbdVolumeDefinition `json:"data,omitempty"` }
func (vd *VolumeDefinitionLayer) UnmarshalJSON(b []byte) error
UnmarshalJSON is needed for the unmarshal interface for VolumeDefinitionLayer types
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 struct { VolumeNumber int32 `json:"volume_number,omitempty"` // A string to string property map. Props map[string]string `json:"props,omitempty"` // unique object id Uuid string `json:"uuid,omitempty"` Flags []string `json:"flags,omitempty"` }
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"` }
VolumeLayer is a struct for storing the layer-properties of a linstor-volume
type VolumeLayer struct { Type devicelayerkind.DeviceLayerKind `json:"type,omitempty"` Data OneOfDrbdVolumeLuksVolumeStorageVolumeNvmeVolumeWritecacheVolumeCacheVolumeBCacheVolume `json:"data,omitempty"` }
func (v *VolumeLayer) UnmarshalJSON(b []byte) error
UnmarshalJSON fulfills the unmarshal interface for the VolumeLayer type
VolumeState is a struct which contains the disk-state for volume
type VolumeState struct { DiskState string `json:"disk_state,omitempty"` }
type WritecacheResource struct { WritecacheVolumes []WritecacheVolume `json:"writecache_volumes,omitempty"` }
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"` }