mgrmodel

package
v0.0.0-...-81c02da Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package mgrmodel ....

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddManagertoDB

func AddManagertoDB(mgr RAManager) error

AddManagertoDB will add odimra Manager details to DB

func AddTempPassword

func AddTempPassword(uuid string, device *DeviceTarget) *errors.Error

UpdateSystem fetches the System(Target Device Credentials) table details

func DeleteTempPassword

func DeleteTempPassword(deviceUUID string) *errors.Error

func GenericSave

func GenericSave(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 GetManagerByURL

func GetManagerByURL(url string) (string, *errors.Error)

GetManagerByURL fetches computer manager details by URL from database

func GetResource

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

GetResource fetches a resource from database using table and key

func GetSystemByUUID

func GetSystemByUUID(systemUUID string) (string, *errors.Error)

GetSystemByUUID fetches computer system details by UUID from database

func UpdateData

func UpdateData(key string, updateData map[string]interface{}, table string) error

UpdateData will modify the current details to given changes

func UpdateSystem

func UpdateSystem(deviceUUID string, device *DeviceTarget) *errors.Error

UpdateSystem fetches the System(Target Device Credentials) table details

Types

type Actions

type Actions struct {
	Reset Target `json:"#Manager.Reset"`
}

Actions struct for Actions to perform

type CommandShell

type CommandShell struct {
	ConnectTypesSupported []string `json:"ConnectTypesSupported"`
	MaxConcurrentSessions int      `json:"MaxConcurrentSessions"`
	ServiceEnabled        bool     `json:"ServiceEnabled"`
}

CommandShell service that manager provides.

type CreateBMCAccount

type CreateBMCAccount struct {
	UserName string `json:"UserName" validate:"required"`
	Password string `json:"Password" validate:"required"`
	RoleID   string `json:"RoleId" validate:"required"`
}

CreateBMCAccount struct is to store the create BMC account request payload

type DeviceTarget

type DeviceTarget 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"`
}

DeviceTarget is for sending the requst to south bound/plugin

func GetTarget

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

GetTarget fetches the System(Target Device Credentials) table details

func GetTempPassword

func GetTempPassword(deviceUUID string) (*DeviceTarget, *errors.Error)

type GraphicalConsole

type GraphicalConsole struct {
	ConnectTypesSupported []string `json:"ConnectTypesSupported"`
	MaxConcurrentSessions int      `json:"MaxConcurrentSessions"`
	ServiceEnabled        bool     `json:"ServiceEnabled"`
}

GraphicalConsole is the information about the graphical console (KVM-IP)service of the manager.

type Links struct {
	ActiveSoftwareImage *dmtf.Link   `json:"ActiveSoftwareImage,omitempty"`
	ManagerForChassis   []*dmtf.Link `json:"ManagerForChassis,omitempty"`
	ManagerForServers   []*dmtf.Link `json:"ManagerForServers,omitempty"`
	ManagerForSwitches  []*dmtf.Link `json:"ManagerForSwitches,omitempty"`
	ManagerForManagers  []*dmtf.Link `json:"ManagerForManagers,omitempty"`
	ManagerInChassis    *dmtf.Link   `json:"ManagerInChassis,omitempty"`
}

Links to other Resources that are related to this Resource.

type Manager

type Manager struct {
	OdataContext            string             `json:"@odata.context"`
	Etag                    string             `json:"@odata.etag,omitempty"`
	OdataID                 string             `json:"@odata.id"`
	OdataType               string             `json:"@odata.type"`
	Name                    string             `json:"Name"`
	ManagerType             string             `json:"ManagerType"`
	ID                      string             `json:"Id"`
	UUID                    string             `json:"UUID"`
	FirmwareVersion         string             `json:"FirmwareVersion"`
	Status                  *Status            `json:"Status,omitempty"`
	HostInterfaces          *OdataID           `json:"HostInterfaces,omitempty"`
	SerialInterfaces        *OdataID           `json:"SerialInterfaces,omitempty"`
	EthernetInterfaces      *OdataID           `json:"EthernetInterfaces,omitempty"`
	LogServices             *dmtf.Link         `json:"LogServices,omitempty"`
	NetworkProtocol         *OdataID           `json:"NetworkProtocol,omitempty"`
	VirtualMedia            *OdataID           `json:"VirtualMedia,omitempty"`
	CommandShell            *CommandShell      `json:"CommandShell,omitempty"`
	GraphicalConsole        *GraphicalConsole  `json:"GraphicalConsole,omitempty"`
	Links                   *Links             `json:"Links,omitempty"`
	Actions                 *Actions           `json:"Actions,omitempty"`
	AutoDSTEnabled          bool               `json:"AutoDSTEnabled,omitempty"`
	DateTime                string             `json:"DateTime,omitempty"`
	LastResetTime           string             `json:"LastResetTime,omitempty"`
	Manufacturer            string             `json:"Manufacturer,omitempty"`
	Model                   string             `json:"Model,omitempty"`
	PartNumber              string             `json:"PartNumber,omitempty"`
	PowerState              string             `json:"PowerState,omitempty"`
	Redundancy              []dmtf.Redundancy  `json:"Redundancy,omitempty"`
	RemoteAccountService    *dmtf.Link         `json:"RemoteAccountService,omitempty"`
	RemoteRedfishServiceURI string             `json:"RemoteRedfishServiceUri,omitempty"`
	SerialNumber            string             `json:"SerialNumber,omitempty"`
	ServiceEntryPointUUID   string             `json:"ServiceEntryPointUUID,omitempty"`
	TimeZoneName            string             `json:"TimeZoneName,omitempty"`
	Measurements            []*dmtf.Link       `json:"Measurements,omitempty"`
	Location                *dmtf.Link         `json:"Location,omitempty"`
	LocationIndicatorActive bool               `json:"LocationIndicatorActive,omitempty"`
	RedundancyCount         int                `json:"Redundancy@odata.count,omitempty"`
	SerialConsole           dmtf.SerialConsole `json:"SerialConsole,omitempty"`
	SparePartNumber         string             `json:"SparePartNumber,omitempty"`
	Description             string             `json:"Description,omitempty"`
	DateTimeLocalOffset     string             `json:"DateTimeLocalOffset,omitempty"`
}

Manager struct for manager deta

type OdataID

type OdataID struct {
	OdataID []dmtf.Link `json:"OdataID"`
}

OdataID is link

type Plugin

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

Plugin is the model for plugin information

func GetPluginData

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

GetPluginData will fetch plugin details

type RAManager

type RAManager struct {
	ID              string     `json:"ManagerID"`
	Name            string     `json:"Name"`
	ManagerType     string     `json:"ManagerType"`
	FirmwareVersion string     `json:"FirmwareVersion"`
	UUID            string     `json:"UUID"`
	State           string     `json:"State"`
	Description     string     `json:"Description"`
	LogServices     *dmtf.Link `json:"LogServices"`
	Links           *Links     `json:"Links,omitempty"`
	Health          string     `json:"Health"`
	Model           string     `json:"Model"`
	PowerState      string     `json:"PowerState"`
}

RAManager struct is to store odimra details into DB

type Status

type Status struct {
	State  string `json:"State"`
	Health string `json:"Health"`
}

Status struct is to define the status of the manager

type Target

type Target struct {
	Target string `json:"target"`
}

Target ...

type UpdateBMCAccount

type UpdateBMCAccount struct {
	Password string `json:"Password,omitempty"`
	RoleID   string `json:"RoleId,omitempty"`
}

UpdateBMCAccount struct is to store the update BMC account request payload

type VirtualMediaInsert

type VirtualMediaInsert struct {
	Image                string `json:"Image" validate:"required"`
	Inserted             bool   `json:"Inserted"`
	WriteProtected       bool   `json:"WriteProtected"`
	Password             string `json:"Password,omitempty"`
	TransferMethod       string `json:"TransferMethod,omitempty"`
	TransferProtocolType string `json:"TransferProtocolType,omitempty"`
	UserName             string `json:"UserName,omitempty"`
}

VirtualMediaInsert struct is to store the insert virtual media request payload

Jump to

Keyboard shortcuts

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