smodel

package
v0.0.0-...-8d2fcc7 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package smodel ....

Index

Constants

This section is empty.

Variables

View Source
var (
	// GetDBConnectionFunc  function pointer for the common.GetDBConnection
	GetDBConnectionFunc = common.GetDBConnection
	// JSONUnmarshalFunc  function pointer for the json.Unmarshal
	JSONUnmarshalFunc = json.Unmarshal
)
View Source
var (
	// GetPluginDataFunc function pointer for the GetPluginData
	GetPluginDataFunc = GetPluginData
)

Functions

func AddSystemResetInfo

func AddSystemResetInfo(ctx context.Context, systemID, resetType string) *errors.Error

AddSystemResetInfo connects to the persistencemgr and Add the system reset info to db

Inputs:

1.systemURI: computer system uri for which system operation is maintained 2.resetType : reset type which is performed

func DeleteVolume

func DeleteVolume(ctx context.Context, key string) *errors.Error

DeleteVolume will delete the volume from InMemory

func Find

func Find(table, key string, r interface{}) *errors.Error

Find fetches a resource from database using table and key and store the data to an interface

func FindAll

func FindAll(table, key string) ([][]byte, error)

FindAll ...

func GenericSave

func GenericSave(ctx context.Context, body []byte, table string, key string) error

GenericSave will save any resource data into the database

func GetAllKeysFromTable

func GetAllKeysFromTable(table string) ([]string, error)

GetAllKeysFromTable fetches all keys in a given table

func GetRange

func GetRange(index string, min, max int, regexFlag bool) ([]string, error)

GetRange is used to retrive index values of type string

Inputs:

1. index is the index name to search with 2. min is the minimum value passed 3. max is the max value passed

func GetResource

func GetResource(ctx context.Context, Table, key string) (string, *errors.Error)

GetResource fetches a resource from database using table and key

func GetStorageList

func GetStorageList(index, condition string, match float64, regexFlag bool) ([]string, error)

GetStorageList is used to storage list of capacity

1.index name to search with 2. condition is the value for condition operation 3. match is the search for list float type

func GetString

func GetString(index, match string, regexFlag bool) ([]string, error)

GetString is used to retrive index values of type string

Inputs:

1. index is the index name to search with 2. match is the value to match with

func GetSystemByUUID

func GetSystemByUUID(ctx context.Context, systemUUID string) (string, *errors.Error)

GetSystemByUUID fetches computer system details by UUID from database

func GetSystemResetInfo

func GetSystemResetInfo(ctx context.Context, systemURI string) (map[string]string, *errors.Error)

GetSystemResetInfo fetches the system reset info for the given systemURI

Inputs:

1.systemURI: computer system uri for which system operation is maintained

Types

type Fabric

type Fabric struct {
	PluginID string
}

Fabric is the model to collect fabric plugin id from DB

type Links struct {
	Drives               []OdataIDLink `json:"Drives"`
	DedicatedSpareDrives []OdataIDLink `json:"DedicatedSpareDrives,omitempty"`
}

Links contains Drives resoruces info

type OdataIDLink struct {
	OdataID string `json:"@odata.id"`
}

OdataIDLink contains link to a resource

type Plugin

type Plugin struct {
	IP                string
	Port              string
	Username          string
	Password          []byte
	ID                string
	PluginType        string
	PreferredAuthType string
	ManagerUUID       string
}

Plugin is the model for plugin information

func GetFabricManagers

func GetFabricManagers(ctx context.Context) ([]Plugin, error)

GetFabricManagers fetches all the fabrics details from DB

func GetPluginData

func GetPluginData(pluginID string) (Plugin, *errors.Error)

GetPluginData will fetch plugin details

type Target

type Target struct {
	ManagerAddress string `json:"ManagerAddress"`
	Password       []byte `json:"Password"`
	UserName       string `json:"UserName"`
	PostBody       []byte `json:"PostBody"`
	DeviceUUID     string `json:"DeviceUUID"`
	PluginID       string `json:"PluginID"`
}

Target is for sending the requst to south bound/plugin

func GetTarget

func GetTarget(deviceUUID string) (*Target, *errors.Error)

GetTarget fetches the System(Target Device Credentials) table details

type Volume

type Volume struct {
	RAIDType           string `json:"RAIDType"`
	Links              *Links `json:"Links"`
	OperationApplyTime string `json:"@Redfish.OperationApplyTime"`
	DisplayName        string `json:"DisplayName,omitempty"`
	WriteCachePolicy   string `json:"WriteCachePolicy,omitempty"`
	ReadCachePolicy    string `json:"ReadCachePolicy,omitempty"`
	IOPerfModeEnabled  bool   `json:"IOPerfModeEnabled,omitempty"`
}

Volume is for sending a volume's request to south bound

Jump to

Keyboard shortcuts

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