update

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

Documentation

Overview

Package update ...

Package update ...

Package update ...

Index

Constants

This section is empty.

Variables

View Source
var (
	//RequestParamsCaseValidatorFunc ...
	RequestParamsCaseValidatorFunc = common.RequestParamsCaseValidator
	//JSONMarshalFunc ...
	JSONMarshalFunc = json.Marshal
	//StringsEqualFoldFunc ...
	StringsEqualFoldFunc = strings.EqualFold
)
View Source
var (
	//GetAllKeysFromTableFunc ...
	GetAllKeysFromTableFunc = umodel.GetAllKeysFromTable
)
View Source
var (
	//ServicesUpdateTaskFunc ...
	ServicesUpdateTaskFunc = services.UpdateTask
)

Functions

func TaskData

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

TaskData update the task with the given data

Types

type DB

type DB struct {
	GetAllKeysFromTable func(string, common.DbType) ([]string, error)
	GetResource         func(string, string, common.DbType) (string, *errors.Error)
}

DB struct holds the function pointers to database operations

type Device

type Device struct {
	ServerIP   string `json:"ServerIP"`
	Username   string `json:"Username"`
	DeviceUUID string `json:"device_UUID"`
}

Device struct to define the response from plugin for UUID

type External

type External struct {
	ContactClient      func(context.Context, string, string, string, string, interface{}, map[string]string) (*http.Response, error)
	Auth               func(string, []string, []string) (response.RPC, error)
	DevicePassword     func([]byte) ([]byte, error)
	GetPluginData      func(string) (umodel.Plugin, *errors.Error)
	ContactPlugin      func(context.Context, ucommon.PluginContactRequest, string) ([]byte, string, ucommon.ResponseStatus, error)
	GetTarget          func(string) (*umodel.Target, *errors.Error)
	CreateChildTask    func(context.Context, string, string) (string, error)
	CreateTask         func(context.Context, string) (string, error)
	UpdateTask         func(context.Context, common.TaskData) error
	GetSessionUserName func(string) (string, error)
	GenericSave        func(context.Context, []byte, string, string) error
}

External struct holds the function pointers all outboud services

type ExternalInterface

type ExternalInterface struct {
	External External
	DB       DB
}

ExternalInterface struct holds the structs to which hold function pointers to outboud calls

func GetExternalInterface

func GetExternalInterface() *ExternalInterface

GetExternalInterface retrieves all the external connections update package functions uses

func (*ExternalInterface) GetAllFirmwareInventory

func (e *ExternalInterface) GetAllFirmwareInventory(ctx context.Context, req *updateproto.UpdateRequest) response.RPC

GetAllFirmwareInventory is a functioanlity to retrive all the available inventory resources from the added BMC's

func (*ExternalInterface) GetAllSoftwareInventory

func (e *ExternalInterface) GetAllSoftwareInventory(ctx context.Context, req *updateproto.UpdateRequest) response.RPC

GetAllSoftwareInventory is a functioanlity to retrive all the available inventory resources from the added BMC's

func (*ExternalInterface) GetFirmwareInventory

func (e *ExternalInterface) GetFirmwareInventory(ctx context.Context, req *updateproto.UpdateRequest) response.RPC

GetFirmwareInventory is used to fetch resource data. The function is supposed to be used as part of RPC For getting firmware inventory resource information, parameters need to be passed Request . Request holds the Uuid and Url , 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 (*ExternalInterface) GetSoftwareInventory

func (e *ExternalInterface) GetSoftwareInventory(ctx context.Context, req *updateproto.UpdateRequest) response.RPC

GetSoftwareInventory is used to fetch resource data. The function is supposed to be used as part of RPC For getting software inventory resource information, parameters need to be passed Request . Request holds the Uuid and Url , 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 (*ExternalInterface) GetUpdateService

func (e *ExternalInterface) GetUpdateService(ctx context.Context) response.RPC

GetUpdateService defines the functionality for knowing whether the update service is enabled or not

As return parameters RPC response, which contains status code, message, headers and data, error will be passed back.

func (*ExternalInterface) SimpleUpdate

func (e *ExternalInterface) SimpleUpdate(ctx context.Context, taskID string, sessionUserName string, req *updateproto.UpdateRequest) response.RPC

SimpleUpdate function handler for simpe update process

func (*ExternalInterface) StartUpdate

func (e *ExternalInterface) StartUpdate(ctx context.Context, taskID string, sessionUserName string, req *updateproto.UpdateRequest) response.RPC

StartUpdate function handler for on start update process

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

type SimpleUpdateRequest

type SimpleUpdateRequest struct {
	ImageURI                  string   `json:"ImageURI"`
	Password                  string   `json:"Password,omitempty"`
	Targets                   []string `json:"Targets"`
	TransferProtocol          string   `json:"TransferProtocol,omitempty"`
	Username                  string   `json:"Username,omitempty"`
	RedfishOperationApplyTime string   `json:"@Redfish.OperationApplyTime,omitempty"`
}

SimpleUpdateRequest struct defines the request body for update action

Jump to

Keyboard shortcuts

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