model

package
v4.6.0 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package model package for backend model

Package model for storage pool model

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend struct {
	Name                string
	ContentName         string
	Storage             string
	Available           bool
	Plugin              plugin.StoragePlugin
	Pools               []*StoragePool
	Parameters          map[string]interface{}
	SupportedTopologies []map[string]string
	AccountName         string

	MetroDomain       string
	MetrovStorePairID string
	MetroBackendName  string
	MetroBackend      *Backend

	ReplicaBackendName string
	ReplicaBackend     *Backend
}

Backend for storage

func (*Backend) NeedRebuild

func (b *Backend) NeedRebuild(contentName string) bool

NeedRebuild checks whether the backend needs rebuild

func (*Backend) SetAvailable

func (b *Backend) SetAvailable(ctx context.Context, available bool)

SetAvailable set Backend available

func (*Backend) UpdatePools

func (b *Backend) UpdatePools(ctx context.Context, sbct *xuanwuV1.StorageBackendContent)

UpdatePools update Backend pools

type SelectPoolPair

type SelectPoolPair struct {
	Local  *StoragePool
	Remote *StoragePool
}

SelectPoolPair for pool pair

type StorageBackendTuple

type StorageBackendTuple struct {
	Claim   *xuanwuV1.StorageBackendClaim
	Content *xuanwuV1.StorageBackendContent
}

StorageBackendTuple contains sbc and sbct

type StoragePool

type StoragePool struct {
	Name         string
	Storage      string
	Parent       string
	Capabilities map[string]bool
	Capacities   map[string]string
	Plugin       plugin.StoragePlugin
}

StoragePool field and method of storage pool

func (*StoragePool) GetCapabilities

func (p *StoragePool) GetCapabilities() map[string]bool

GetCapabilities used to get capabilities

func (*StoragePool) GetCapacities

func (p *StoragePool) GetCapacities() map[string]string

GetCapacities used to get capacities

func (*StoragePool) GetName

func (p *StoragePool) GetName() string

GetName used to get pool name

func (*StoragePool) GetParent

func (p *StoragePool) GetParent() string

GetParent used to get parent

func (*StoragePool) GetStorage

func (p *StoragePool) GetStorage() string

GetStorage used to get storage

func (*StoragePool) UpdateCapabilities

func (p *StoragePool) UpdateCapabilities(ctx context.Context, capabilities map[string]bool)

UpdateCapabilities update pool capabilities

func (*StoragePool) UpdateCapacities

func (p *StoragePool) UpdateCapacities(ctx context.Context, capacities map[string]string)

UpdateCapacities update pool capacities

func (*StoragePool) UpdatePoolBySBCT

func (p *StoragePool) UpdatePoolBySBCT(ctx context.Context, content *xuanwuV1.StorageBackendContent)

UpdatePoolBySBCT update capabilities and capacities by sbct step 1: update pool Capabilities step 2: update pool Capacities

Jump to

Keyboard shortcuts

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