services

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

Documentation

Overview

Package services ...

Package services ...

Package services ...

Package services ...

Index

Constants

View Source
const (
	// AccountSession holds the name for the Account and Session micro service
	AccountSession = "svc.account.session"
	// Tasks holds the name for the Task micro service
	Tasks = "svc.task"
	// APIClient holds the name for the API client micro service
	APIClient = "svc.api.gateway.client"
	// Aggregator holds the name for the Aggregator micro service
	Aggregator = "svc.aggregator"
	// Systems holds the name for the System Micro Service
	Systems = "svc.systems"
	// Events holds the name for the Events Micro Service
	Events = "svc.events"
	// Fabrics holds the name for the Fabrics Micro Service
	Fabrics = "svc.fabrics"
	// Managers holds the name for the Managers Micro Service
	Managers = "svc.managers"
	// Update holds the name for the Update Micro Service
	Update = "svc.update"
	// Telemetry holds the name for the Telemetry Micro Service
	Telemetry = "svc.telemetry"
	// CompositionService holds the name for the CompositionService Micro Service
	CompositionService = "svc.composition.service"
	// Licenses holds the name for the Licenses Micro Service
	Licenses = "svc.licenses"
)

Variables

View Source
var ODIMService odimService

ODIMService holds the initialized instance of odimService

Functions

func CreateChildTask

func CreateChildTask(ctx context.Context, sessionUserName string, parentTaskID string) (string, error)

CreateChildTask function is to contact the svc-task through the rpc call

func CreateTask

func CreateTask(ctx context.Context, sessionUserName string) (string, error)

CreateTask function is to contact the svc-task through the rpc call

func DeleteSubscription

func DeleteSubscription(ctx context.Context, uuid string) (*eventsproto.EventSubResponse, error)

DeleteSubscription calls the event service and delete all subscription realated to that server

func GeneralError

func GeneralError(statusCode int32, statusMsg, errMsg string, msgArgs []interface{}) response.RPC

GeneralError will create the error response This function can be used only if the expected response have only one extended info object. Error code for the response will be GeneralError

func GetEnabledServiceList

func GetEnabledServiceList() map[string]bool

GetEnabledServiceList checks etcd registry for enabled services

func GetSessionUserName

func GetSessionUserName(ctx context.Context, sessionToken string) (string, error)

GetSessionUserName will get user name from the session token by rpc call to account-session service

func GetSessionUserRoleID

func GetSessionUserRoleID(ctx context.Context, sessionToken string) (string, error)

GetSessionUserRoleID will get user name from the session token by rpc call to account-session service

func InitializeClient

func InitializeClient(serviceName string) error

InitializeClient will initialize a client for micro service communication.

func InitializeService

func InitializeService(serviceName string, errChan chan<- error) error

InitializeService will initialize a new micro service with the selected framework.

func IsAuthorized

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

IsAuthorized is used to authorize the services using svc-account-session. As parameters session token, privileges and oem privileges are passed. A RPC call is made with these parameters to the Account-Session service to check whether the session is valid and have all the privileges which are passed to it.

func SavePluginTaskInfo

func SavePluginTaskInfo(ctx context.Context, pluginIP, pluginServerName,
	odimTaskID, pluginTaskMonURL string) error

SavePluginTaskInfo saves the ip of plugin instance that handle the task, task id of task which created in odim, and the taskmon URL returned from plugin in DB

func SubscribeToEMB

func SubscribeToEMB(ctx context.Context, pluginID string, queueList []string) error

SubscribeToEMB method will subscribe to respective event queue of the plugin

func UpdateTask

func UpdateTask(ctx context.Context, taskID string, taskState string, taskStatus string,
	percentComplete int32, payLoad *taskproto.Payload, endTime time.Time) error

UpdateTask function is to contact the svc-task through the rpc call

Types

This section is empty.

Jump to

Keyboard shortcuts

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