caputilities

package
v0.0.0-...-a12d4bf Latest Latest
Warning

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

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

Documentation

Overview

Package caputilities ...

Package caputilities ...

Package caputilities ...

Package caputilities ...

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 CheckValidityOfEthernet

func CheckValidityOfEthernet(reqURL string, odimUsername string, odimPassword string) (bool, error)

CheckValidityOfEthernet check if provided Ethernet is available in ODIM

func GetClient

func GetClient() *client.Client

GetClient returns a new connection client to APIC

func GetConnection

func GetConnection() *client.ServiceManager

GetConnection returns a new connection to APIC

func GetFabricHealth

func GetFabricHealth(podID string) (*capmodel.FabricHealth, error)

GetFabricHealth queries the fabric for it's Health from ACI

func GetFabricNodeData

func GetFabricNodeData() ([]*models.FabricNodeMember, error)

GetFabricNodeData collects the all switch and fabric details from the aci

func GetPortData

func GetPortData(podID, ACISwitchID string) (*capmodel.PortCollectionResponse, error)

GetPortData collects the all port data for the given switch

func GetPortHealth

func GetPortHealth(podID, ACISwitchID, portID string) (*capmodel.Health, error)

GetPortHealth collects the Health for given port

func GetPortInfo

func GetPortInfo(podID, ACISwitchID, portID string) (*capmodel.PortInfoResponse, error)

GetPortInfo collects the dat for given port

func GetPortPolicyGroup

func GetPortPolicyGroup(podID, switchPath string) ([]*models.FabricPathEndpoint, error)

GetPortPolicyGroup collects all policy group for given fabric and switch

func GetSwitchChassisInfo

func GetSwitchChassisInfo(podID, ACISwitchID string) (*capmodel.SwitchChassis, *capmodel.Health, error)

GetSwitchChassisInfo collects the given switch chassis data from the aci

func GetSwitchHealth

func GetSwitchHealth(podID, ACISwitchID string) (*capmodel.Health, error)

GetSwitchHealth queries the switch for it's Health from ACI

func GetSwitchInfo

func GetSwitchInfo(podID, ACISwitchID int) (*models.System, error)

GetSwitchInfo collects the given switch data from the aci

func TrackConfigFileChanges

func TrackConfigFileChanges(configFilePath string)

TrackConfigFileChanges monitors the config changes using fsnotfiy

Types

type ACIHTTPClient

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

ACIHTTPClient struct definition of HTTP wraper clinet used to communicate with ACI

type Enigma

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

Enigma offers encryption/decryption API which utilizes provided private/public key pair.

func CreateEnigma

func CreateEnigma(privateKeyBytes, publicKeyBytes []byte) *Enigma

CreateEnigma constructs Enigma using provided private/public key pair

func NewEnigma

func NewEnigma(privKeyPath string) (*Enigma, error)

NewEnigma function create enigma object and sets the private key path

func (*Enigma) Decrypt

func (e *Enigma) Decrypt(toBeDecrypted string) []byte

Decrypt decrypts provided toBeDecrypted string.

func (*Enigma) Encrypt

func (e *Enigma) Encrypt(toBeEncrypted []byte) string

Encrypt encrypts provided toBeEncrypted string.

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) 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) 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) 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        *dmtfmodel.ServiceRoot `json:"rootNode,omitempty"`
	ComputerSystems []*Identifier
	PostBody        []byte `json:"PostBody,omitempty"`
	Location        string `json:"Location"`
}

RedfishDevice struct definition

Jump to

Keyboard shortcuts

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