manila

package
v0.0.0-...-ddb491b Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2025 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const TriggerManilaStoragePoolsSynced = "triggers/sync/openstack/manila/types/storage_pools"

Trigger executed when new storage pools are available.

Variables

This section is empty.

Functions

This section is empty.

Types

type ManilaAPI

type ManilaAPI interface {
	// Init the manila API.
	Init(ctx context.Context)
	// Get all manila storage pools.
	GetAllStoragePools(ctx context.Context) ([]StoragePool, error)
}

func NewManilaAPI

func NewManilaAPI(mon sync.Monitor, k keystone.KeystoneAPI, conf ManilaConf) ManilaAPI

Create a new OpenStack Manila api.

type ManilaConf

type ManilaConf = conf.SyncOpenStackManilaConfig

Type alias for the OpenStack Manila configuration.

type ManilaSyncer

type ManilaSyncer struct {
	// Database to store the manila objects in.
	DB db.DB
	// Monitor to track the syncer.
	Mon sync.Monitor
	// Configuration for the manila syncer.
	Conf ManilaConf
	// Manila API client to fetch the data.
	API ManilaAPI
	// MQTT client to publish mqtt data.
	MqttClient mqtt.Client
}

Syncer for OpenStack manila.

func (*ManilaSyncer) Init

func (s *ManilaSyncer) Init(ctx context.Context)

Init the OpenStack manila syncer.

func (*ManilaSyncer) Sync

func (s *ManilaSyncer) Sync(ctx context.Context) error

Sync the OpenStack manila objects and publish triggers.

func (*ManilaSyncer) SyncAllStoragePools

func (s *ManilaSyncer) SyncAllStoragePools(ctx context.Context) ([]StoragePool, error)

Sync the OpenStack resource providers into the database.

type StoragePool

type StoragePool struct {
	Name    string `json:"name" db:"name,primarykey"`
	Host    string `json:"host" db:"host"`
	Backend string `json:"backend" db:"backend"`
	Pool    string `json:"pool" db:"pool"`

	CapabilitiesTotalCapacityGB             float64 `json:"-" db:"capabilities_total_capacity_gb"`
	CapabilitiesFreeCapacityGB              float64 `json:"-" db:"capabilities_free_capacity_gb"`
	CapabilitiesReservedPercentage          int     `json:"-" db:"capabilities_reserved_percentage"`
	CapabilitiesPoolName                    string  `json:"-" db:"capabilities_pool_name"`
	CapabilitiesShareBackendName            string  `json:"-" db:"capabilities_share_backend_name"`
	CapabilitiesStorageProtocol             string  `json:"-" db:"capabilities_storage_protocol"`
	CapabilitiesVendorName                  string  `json:"-" db:"capabilities_vendor_name"`
	CapabilitiesReplicationDomain           *string `json:"-" db:"capabilities_replication_domain"`
	CapabilitiesSGConsistentSnapshotSupport string  `json:"-" db:"capabilities_sg_consistent_snapshot_support"`
	CapabilitiesTimestamp                   string  `json:"-" db:"capabilities_timestamp"`

	CapabilitiesDriverVersion                  *string `json:"-" db:"capabilities_driver_version"`
	CapabilitiesReplicationType                *string `json:"-" db:"capabilities_replication_type"`
	CapabilitiesDriverHandlesShareServers      *string `json:"-" db:"capabilities_driver_handles_share_servers"`
	CapabilitiesSnapshotSupport                *string `json:"-" db:"capabilities_snapshot_support"`
	CapabilitiesCreateShareFromSnapshotSupport *string `json:"-" db:"capabilities_create_share_from_snapshot_support"`
	CapabilitiesRevertToSnapshotSupport        *string `json:"-" db:"capabilities_revert_to_snapshot_support"`
	CapabilitiesMountSnapshotSupport           *string `json:"-" db:"capabilities_mount_snapshot_support"`
	CapabilitiesDedupe                         *string `json:"-" db:"capabilities_dedupe"`
	CapabilitiesCompression                    *string `json:"-" db:"capabilities_compression"`
	CapabilitiesIPv4Support                    *string `json:"-" db:"capabilities_ipv4_support"`
	CapabilitiesIPv6Support                    *string `json:"-" db:"capabilities_ipv6_support"`
}

OpenStack Manila storage pool. See: https://docs.openstack.org/api-ref/shared-file-system/#list-back-end-storage-pools-with-details

func (StoragePool) Indexes

func (StoragePool) Indexes() []db.Index

Index for the openstack model.

func (*StoragePool) MarshalJSON

func (sp *StoragePool) MarshalJSON() ([]byte, error)

Custom marshaler for StoragePool to handle nested JSON.

func (StoragePool) TableName

func (StoragePool) TableName() string

Table in which the openstack model is stored.

func (*StoragePool) UnmarshalJSON

func (sp *StoragePool) UnmarshalJSON(data []byte) error

Custom unmarshaler for StoragePool to handle nested JSON.

Jump to

Keyboard shortcuts

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