Documentation ¶
Overview ¶
Package services ...
Package services ...
Package services ...
Package services ...
Index ¶
- Constants
- Variables
- func CreateChildTask(ctx context.Context, sessionUserName string, parentTaskID string) (string, error)
- func CreateTask(ctx context.Context, sessionUserName string) (string, error)
- func DeleteSubscription(ctx context.Context, uuid string) (*eventsproto.EventSubResponse, error)
- func GeneralError(statusCode int32, statusMsg, errMsg string, msgArgs []interface{}) response.RPC
- func GetEnabledServiceList() map[string]bool
- func GetSessionUserName(ctx context.Context, sessionToken string) (string, error)
- func GetSessionUserRoleID(ctx context.Context, sessionToken string) (string, error)
- func InitializeClient(serviceName string) error
- func InitializeService(serviceName string, errChan chan<- error) error
- func IsAuthorized(ctx context.Context, sessionToken string, privileges, oemPrivileges []string) (errResponse.RPC, error)
- func SavePluginTaskInfo(ctx context.Context, ...) error
- func SubscribeToEMB(ctx context.Context, pluginID string, queueList []string) error
- func UpdateTask(ctx context.Context, taskID string, taskState string, taskStatus string, ...) error
Constants ¶
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 ¶
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 ¶
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 ¶
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 ¶
GetEnabledServiceList checks etcd registry for enabled services
func GetSessionUserName ¶
GetSessionUserName will get user name from the session token by rpc call to account-session service
func GetSessionUserRoleID ¶
GetSessionUserRoleID will get user name from the session token by rpc call to account-session service
func InitializeClient ¶
InitializeClient will initialize a client for micro service communication.
func InitializeService ¶
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 ¶
SubscribeToEMB method will subscribe to respective event queue of the plugin
Types ¶
This section is empty.