systems

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: 25 Imported by: 0

Documentation

Overview

Package systems ...

Package systems ...

Package systems ...

Package systems ...

Package systems ...

Index

Constants

This section is empty.

Variables

View Source
var (
	// GetSystemResetInfoFunc function pointer for the smodel.GetSystemResetInfo
	GetSystemResetInfoFunc = smodel.GetSystemResetInfo
	// GetResourceInfoFromDeviceFunc function pointer for the scommon.GetResourceInfoFromDevice
	GetResourceInfoFromDeviceFunc = scommon.GetResourceInfoFromDevice
	// GetAllKeysFromTableFunc function pointer for the smodel.GetAllKeysFromTable
	GetAllKeysFromTableFunc = smodel.GetAllKeysFromTable
	// GetDeviceLoadInfoFunc function pointer for the getDeviceLoadInfo
	GetDeviceLoadInfoFunc = getDeviceLoadInfo
	// GetStringFunc function pointer for the smodel.GetString
	GetStringFunc = smodel.GetString
)
View Source
var (
	// StringContain function pointer for the strings.Contains
	StringContain = strings.Contains
	// RequestParamsCaseValidatorFunc function pointer for the common.RequestParamsCaseValidator
	RequestParamsCaseValidatorFunc = common.RequestParamsCaseValidator
	// StringsEqualFold function pointer for the strings.EqualFold
	StringsEqualFold = strings.EqualFold
	// ContactPluginFunc  function pointer for the  scommon.ContactPlugin
	ContactPluginFunc = scommon.ContactPlugin
	// JSONUnmarshalFunc function pointer for the json.Unmarshal
	JSONUnmarshalFunc = json.Unmarshal
	// StringTrimSpace function pointer for the  strings.TrimSpace
	StringTrimSpace = strings.TrimSpace
)
View Source
var (
	// JSONUnMarshal  function pointer for the json.Unmarshal
	JSONUnMarshal = json.Unmarshal
)

Functions

func GetMembers

func GetMembers(ctx context.Context, allowed map[string]map[string]bool, expression []string, resp response.RPC) ([]dmtf.Link, response.RPC, error)

GetMembers will fetch the resource members based on the filter expression

func GetSystemsCollection

func GetSystemsCollection(ctx context.Context, req *systemsproto.GetSystemsRequest) response.RPC

GetSystemsCollection is to fetch all the Systems uri's and retruns with created collection of systems data from odimra

func LogicalOperation

func LogicalOperation(interm [][]dmtf.Link, lo string) []dmtf.Link

LogicalOperation will take slice of slices of member collection and logical operation to perform return 1 slice of member collection with logical operation performed on them

func SearchAndFilter

func SearchAndFilter(ctx context.Context, paramStr []string, resp response.RPC) (response.RPC, error)

SearchAndFilter take the url as input and return the search result based on the filter expression

func UpdateTaskData

func UpdateTaskData(ctx context.Context, taskData common.TaskData) error

UpdateTaskData update the task with the given data

Types

type BiosSetting

type BiosSetting struct {
	OdataContext      string      `json:"@odata.context"`
	OdataID           string      `json:"@odata.id"`
	Odatatype         string      `json:"@odata.type"`
	ID                string      `json:"Id"`
	Name              string      `json:"Name"`
	AttributeRegistry string      `json:"AttributeRegistry"`
	Attributes        interface{} `json:"Attributes"`
}

BiosSetting structure for checking request body case

type Boot

type Boot struct {
	BootOrder                    []string `json:"BootOrder"`
	BootSourceOverrideEnabled    string   `json:"BootSourceOverrideEnabled"`
	BootSourceOverrideMode       string   `json:"BootSourceOverrideMode"`
	BootSourceOverrideTarget     string   `json:"BootSourceOverrideTarget"`
	UefiTargetBootSourceOverride string   `json:"UefiTargetBootSourceOverride"`
}

Boot structure for checking request body case in BootOrderSettings

type BootOrderSettings

type BootOrderSettings struct {
	Boot Boot `json:"Boot"`
}

BootOrderSettings structure for checking request body case

type DB

type DB struct {
	GetResource        func(context.Context, string, string) (string, *errors.Error)
	DeleteVolume       func(context.Context, string) *errors.Error
	AddSystemResetInfo func(context.Context, string, string) *errors.Error
	GetPluginData      func(string) (smodel.Plugin, *errors.Error)
	GetTarget          func(string) (*smodel.Target, *errors.Error)
}

DB struct to inject the contact DB function into the handlers

type ExternalInterface

type ExternalInterface struct {
	ContactClient   func(context.Context, string, string, string, string, interface{}, map[string]string) (*http.Response, error)
	DevicePassword  func([]byte) ([]byte, error)
	DB              DB
	GetPluginStatus func(context.Context, smodel.Plugin) bool
}

ExternalInterface holds all the external connections managers package functions uses

func GetExternalInterface

func GetExternalInterface() *ExternalInterface

GetExternalInterface retrieves all the external connections managers package functions uses

func (*ExternalInterface) CreateVolume

CreateVolume defines the logic for creating a volume under storage

func (*ExternalInterface) DeleteVolume

DeleteVolume defines the logic for deleting a volume under storage

type PluginContact

type PluginContact struct {
	ContactClient   func(context.Context, string, string, string, string, interface{}, map[string]string) (*http.Response, error)
	DevicePassword  func([]byte) ([]byte, error)
	GetPluginStatus func(context.Context, smodel.Plugin) bool
	UpdateTask      func(context.Context, common.TaskData) error
}

PluginContact struct to inject the pmb client function into the handlers

func (*PluginContact) ChangeBiosSettings

func (p *PluginContact) ChangeBiosSettings(ctx context.Context, req *systemsproto.BiosSettingsRequest) response.RPC

ChangeBiosSettings defines the logic for change bios settings

func (*PluginContact) ChangeBootOrderSettings

func (p *PluginContact) ChangeBootOrderSettings(ctx context.Context, req *systemsproto.BootOrderSettingsRequest) response.RPC

ChangeBootOrderSettings defines the logic for change boot order settings

func (*PluginContact) ComputerSystemReset

func (p *PluginContact) ComputerSystemReset(ctx context.Context, req *systemsproto.ComputerSystemResetRequest, taskID, sessionUserName string) response.RPC

ComputerSystemReset performs a reset action on the requeseted computer system with the specified ResetType

func (*PluginContact) GetSystemResource

func (p *PluginContact) GetSystemResource(ctx context.Context, req *systemsproto.GetSystemsRequest) response.RPC

GetSystemResource is used to fetch resource data. The function is supposed to be used as part of RPC For getting system resource information, parameters need to be passed GetSystemsRequest . GetSystemsRequest holds the Uuid,Url and Resourceid , Url will be parsed from that search key will created There will be two return values for the fuction. One is the RPC response, which contains the status code, status message, headers and body and the second value is error.

func (*PluginContact) GetSystems

GetSystems is used to fetch resource data. The function is supposed to be used as part of RPC For getting system resource information, parameters need to be passed GetSystemsRequest . GetSystemsRequest holds the Uuid,Url, Url will be parsed from that search key will created There will be two return values for the function. One is the RPC response, which contains the status code, status message, headers and body and the second value is error.

func (*PluginContact) SetDefaultBootOrder

func (p *PluginContact) SetDefaultBootOrder(ctx context.Context, systemID string) response.RPC

SetDefaultBootOrder defines the logic for setting the boot order to the default

type ResetComputerSystem

type ResetComputerSystem struct {
	ResetType string `json:"ResetType"`
}

ResetComputerSystem structure for checking request body case

Jump to

Keyboard shortcuts

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