rfputilities

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

Documentation

Overview

Package rfputilities ...

Package rfputilities ...

Index

Constants

This section is empty.

Variables

View Source
var PluginStartTime time.Time

PluginStartTime hold the time from which plugin started

Status holds the Status of plugin it will be intizaied during startup time

Functions

func GetPlainText

func GetPlainText(password []byte) ([]byte, error)

GetPlainText ...

func TrackConfigFileChanges

func TrackConfigFileChanges(configFilePath string)

TrackConfigFileChanges monitors the odim config changes using fsnotfiy

Types

type Identifier

type Identifier struct {
	UUID uuid.UUID
	URI  string
}

Identifier struct definition

type RedfishClient

type RedfishClient struct {
	// contains filtered or unexported fields
}

RedfishClient struct definition

func GetRedfishClient

func GetRedfishClient() (*RedfishClient, error)

GetRedfishClient : Returns a new RedfishClient with insecure flag set.

func (*RedfishClient) AuthWithDevice

func (client *RedfishClient) AuthWithDevice(device *RedfishDevice) error

AuthWithDevice : Performs authentication with the given device and saves the token

func (*RedfishClient) BasicAuthWithDevice

func (client *RedfishClient) BasicAuthWithDevice(device *RedfishDevice, requestURI string) (*http.Response, error)

BasicAuthWithDevice : Performs authentication with the given device and saves the token

func (*RedfishClient) DeleteSubscriptionDetail

func (client *RedfishClient) DeleteSubscriptionDetail(device *RedfishDevice) (*http.Response, error)

DeleteSubscriptionDetail will accepts device struct and it will delete the subscription detail

func (*RedfishClient) DeviceCall

func (client *RedfishClient) DeviceCall(device *RedfishDevice, url, method string) (*http.Response, error)

DeviceCall will call device with the given device details on the url given TODO: use same method to all other calls in this file

func (*RedfishClient) Get

func (client *RedfishClient) Get(device *RedfishDevice, requestURI string) (*http.Response, error)

Get : Executes the REST call with the specified host and URI, then returns the response object.

func (*RedfishClient) GetRootService

func (client *RedfishClient) GetRootService(device *RedfishDevice) error

GetRootService : Retrieves the ServiceRoot endpoint for the device and saves the return in the device object

func (*RedfishClient) GetSubscriptionDetail

func (client *RedfishClient) GetSubscriptionDetail(device *RedfishDevice) (*http.Response, error)

GetSubscriptionDetail will accepts device struct and it will get the subscription detail

func (*RedfishClient) GetWithBasicAuth

func (client *RedfishClient) GetWithBasicAuth(device *RedfishDevice, requestURI string) (*http.Response, error)

GetWithBasicAuth : Performs authentication with the given device and saves the token

func (*RedfishClient) ResetComputerSystem

func (client *RedfishClient) ResetComputerSystem(device *RedfishDevice, uri string) (*http.Response, error)

ResetComputerSystem :Reset the computer system with given ResetType

func (*RedfishClient) SetDefaultBootOrder

func (client *RedfishClient) SetDefaultBootOrder(device *RedfishDevice, uri string) (*http.Response, error)

SetDefaultBootOrder : sets default boot order

func (*RedfishClient) SubscribeForEvents

func (client *RedfishClient) SubscribeForEvents(device *RedfishDevice) (*http.Response, error)

SubscribeForEvents :Subscribes for events with Basic Auth

type RedfishDevice

type RedfishDevice struct {
	Host            string            `json:"hostAddress"`
	Username        string            `json:"username,omitempty"`
	Password        string            `json:"password,omitempty"`
	Token           string            `json:"token,omitempty"`
	Tags            []string          `json:"Tags"`
	RootNode        *dmtf.ServiceRoot `json:"rootNode,omitempty"`
	ComputerSystems []*Identifier
	PostBody        []byte `json:"PostBody,omitempty"`
	Location        string `json:"Location"`
}

RedfishDevice struct definition

func (RedfishDevice) MarshalJSON

func (rfd RedfishDevice) MarshalJSON() ([]byte, error)

MarshalJSON Custom marshalling code used to prevent the display of password or authtoken

type RedfishDeviceCollection

type RedfishDeviceCollection struct {
	RedfishDevices            []*RedfishDevice           `json:"targetHosts"`
	UnreachableRedfishDevices []UnreachableRedfishDevice `json:"failedHosts,omitempty"`
}

RedfishDeviceCollection struct definition

type UnreachableRedfishDevice

type UnreachableRedfishDevice struct {
	Host         string `json:"hostAddress"`
	ErrorMessage string `json:"errorMessage"`
}

UnreachableRedfishDevice struct definition

Jump to

Keyboard shortcuts

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