telemetry

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

Documentation

Overview

Package telemetry ...

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetEncryptedKey

func GetEncryptedKey(t *testing.T, key []byte) []byte

GetEncryptedKey is used to encrypt device password using odimra public key for unit test

func MockContactClient

func MockContactClient(ctx context.Context, url, method, token string, odataID string, body interface{}, loginCredential map[string]string) (*http.Response, error)

MockContactClient mocks ContactClient function

func MockGetAllKeysFromTable

func MockGetAllKeysFromTable(ctx context.Context, table string, dbType common.DbType) ([]string, error)

MockGetAllKeysFromTable mocks GetAllKeysFromTable function

func MockGetPluginData

func MockGetPluginData(pluginID string) (tmodel.Plugin, *errors.Error)

MockGetPluginData mocks GetPluginData function

func MockGetResource

func MockGetResource(ctx context.Context, table, key string, dbType common.DbType) (string, *errors.Error)

MockGetResource mocks GetResource function

func MockIsAuthorized

func MockIsAuthorized(ctx context.Context, sessionToken string, privileges, oemPrivileges []string) (response.RPC, error)

MockIsAuthorized mocks IsAuthorized function

Types

type DB

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

DB struct holds the function pointers to database operations

type External

type External struct {
	ContactClient      func(context.Context, string, string, string, string, interface{}, map[string]string) (*http.Response, error)
	Auth               func(context.Context, string, []string, []string) (response.RPC, error)
	DevicePassword     func([]byte) ([]byte, error)
	GetPluginData      func(string) (tmodel.Plugin, *errors.Error)
	ContactPlugin      func(context.Context, tcommon.PluginContactRequest, string) ([]byte, string, tcommon.ResponseStatus, error)
	GetTarget          func(context.Context, string) (*tmodel.Target, *errors.Error)
	GetSessionUserName func(context.Context, string) (string, error)
	GenericSave        func(context.Context, []byte, string, string) error
	GetPluginStatus    func(context.Context, tmodel.Plugin) bool
}

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 MockGetExternalInterface

func MockGetExternalInterface() *ExternalInterface

MockGetExternalInterface mocks ExternalInterface for unit test

func (*ExternalInterface) GetMetricDefinition

func (e *ExternalInterface) GetMetricDefinition(ctx context.Context, req *teleproto.TelemetryRequest) response.RPC

GetMetricDefinition ...

func (*ExternalInterface) GetMetricDefinitionCollection

func (e *ExternalInterface) GetMetricDefinitionCollection(ctx context.Context, req *teleproto.TelemetryRequest) response.RPC

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

func (*ExternalInterface) GetMetricReport

func (e *ExternalInterface) GetMetricReport(ctx context.Context, req *teleproto.TelemetryRequest) response.RPC

GetMetricReport is for to get metric report from southbound resource

func (*ExternalInterface) GetMetricReportCollection

func (e *ExternalInterface) GetMetricReportCollection(ctx context.Context, req *teleproto.TelemetryRequest) response.RPC

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

func (*ExternalInterface) GetMetricReportDefinition

func (e *ExternalInterface) GetMetricReportDefinition(ctx context.Context, req *teleproto.TelemetryRequest) response.RPC

GetMetricReportDefinition ...

func (*ExternalInterface) GetMetricReportDefinitionCollection

func (e *ExternalInterface) GetMetricReportDefinitionCollection(ctx context.Context, req *teleproto.TelemetryRequest) response.RPC

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

func (*ExternalInterface) GetTelemetryService

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

GetTelemetryService defines the functionality for knowing whether the telemetry 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) GetTrigger

GetTrigger ...

func (*ExternalInterface) GetTriggerCollection

func (e *ExternalInterface) GetTriggerCollection(ctx context.Context, req *teleproto.TelemetryRequest) response.RPC

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

func (*ExternalInterface) UpdateTrigger

func (e *ExternalInterface) UpdateTrigger(req *teleproto.TelemetryRequest) response.RPC

UpdateTrigger ...

Jump to

Keyboard shortcuts

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