cinder

package
v0.0.0-...-f330bf7 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const TriggerCinderStoragePoolsSynced = "triggers/sync/openstack/cinder/types/storage_pools"

Trigger executed when new storage pools are available.

Variables

This section is empty.

Functions

This section is empty.

Types

type CinderAPI

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

func NewCinderAPI

func NewCinderAPI(mon sync.Monitor, k keystone.KeystoneAPI, conf CinderConf) CinderAPI

type CinderConf

type CinderConf = conf.SyncOpenStackCinderConfig

Type alias for the OpenStack Cinder configuration.

type CinderSyncer

type CinderSyncer struct {
	// Database to store the manila objects in.
	DB db.DB
	// Monitor to track the syncer.
	Mon sync.Monitor
	// Configuration for the cinder syncer.
	Conf CinderConf
	// Cinder API client to fetch the data.
	API CinderAPI
	// MQTT client to publish mqtt data.
	MqttClient mqtt.Client
}

func (*CinderSyncer) Init

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

Init the OpenStack cinder syncer.

func (*CinderSyncer) Sync

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

Sync the OpenStack cinder objects and publish triggers.

func (*CinderSyncer) SyncAllStoragePools

func (s *CinderSyncer) 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"`

	// Shared capabilities
	CapabilitiesAllocatedCapacityGB      float64 `json:"-" db:"capabilities_allocated_capacity_gb"`
	CapabilitiesDriverVersion            string  `json:"-" db:"capabilities_driver_version"`
	CapabilitiesFreeCapacityGB           float64 `json:"-" db:"capabilities_free_capacity_gb"`
	CapabilitiesMultiattach              bool    `json:"-" db:"capabilities_multiattach"`
	CapabilitiesPoolName                 string  `json:"-" db:"capabilities_pool_name"`
	CapabilitiesReservedPercentage       float64 `json:"-" db:"capabilities_reserved_percentage"`
	CapabilitiesStorageProtocol          string  `json:"-" db:"capabilities_storage_protocol"`
	CapabilitiesThickProvisioningSupport bool    `json:"-" db:"capabilities_thick_provisioning_support"`
	CapabilitiesThinProvisioningSupport  bool    `json:"-" db:"capabilities_thin_provisioning_support"`
	CapabilitiesTimestamp                string  `json:"-" db:"capabilities_timestamp"`
	CapabilitiesTotalCapacityGB          float64 `json:"-" db:"capabilities_total_capacity_gb"`
	CapabilitiesVendorName               string  `json:"-" db:"capabilities_vendor_name"`
	CapabilitiesVolumeBackendName        string  `json:"-" db:"capabilities_volume_backend_name"`

	// VMware specific fields
	CapabilitiesBackendState                     *string `json:"-" db:"capabilities_backend_state"`
	CapabilitiesCustomAttributeCinderState       *string `json:"-" db:"capabilities_custom_attribute_cinder_state"`
	CapabilitiesCustomAttributeCinderAggregateID *string `json:"-" db:"capabilities_custom_attribute_cinder_aggregate_id"`
	CapabilitiesCustomAttributeNetAppFQDN        *string `json:"-" db:"capabilities_custom_attribute_netapp_fqdn"`
	CapabilitiesPoolDownReason                   *string `json:"-" db:"capabilities_pool_down_reason"`
	CapabilitiesPoolState                        *string `json:"-" db:"capabilities_pool_state"`

	// NetApp-specific fields for native NetApp pools
	CapabilitiesNetAppAggregate            *string  `json:"-" db:"capabilities_netapp_aggregate"`
	CapabilitiesNetAppAggregateUsedPercent *float64 `json:"-" db:"capabilities_netapp_aggregate_used_percent"`
	CapabilitiesUtilization                *float64 `json:"-" db:"capabilities_utilization"`
}

See https://docs.openstack.org/api-ref/block-storage/v3/#list-all-back-end-storage-pools Some fields are omitted.

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

The table name for the storage pool model.

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