Stephane Barbarie | 3559506 | 2018-02-08 08:34:39 -0500 | [diff] [blame] | 1 | package nbi |
| 2 | |
| 3 | import ( |
| 4 | "context" |
| 5 | "github.com/opencord/voltha/ponsim/v2/common" |
| 6 | "github.com/opencord/voltha/protos/go/bal" |
| 7 | ) |
| 8 | |
| 9 | // TODO: fix BAL function parameters and returns |
| 10 | |
| 11 | type BalHandler struct { |
| 12 | } |
| 13 | |
| 14 | func NewBalHandler() *BalHandler { |
| 15 | var handler *BalHandler |
| 16 | handler = &BalHandler{} |
| 17 | return handler |
| 18 | } |
| 19 | |
| 20 | func (handler *BalHandler) BalApiInit( |
| 21 | ctx context.Context, |
| 22 | request *bal.BalInit, |
| 23 | ) (*bal.BalErr, error) { |
| 24 | common.Logger().Info("BalApiInit Called", ctx, request) |
| 25 | return &bal.BalErr{Err: bal.BalErrno_BAL_ERR_OK}, nil |
| 26 | } |
| 27 | |
| 28 | func (handler *BalHandler) BalApiFinish( |
| 29 | ctx context.Context, |
| 30 | request *bal.BalCfg, |
| 31 | ) (*bal.BalErr, error) { |
| 32 | common.Logger().Info("BalApiFinish Called", ctx, request) |
| 33 | return &bal.BalErr{Err: bal.BalErrno_BAL_ERR_OK}, nil |
| 34 | } |
| 35 | |
| 36 | func (handler *BalHandler) BalCfgSet( |
| 37 | ctx context.Context, |
| 38 | request *bal.BalCfg, |
| 39 | ) (*bal.BalErr, error) { |
| 40 | common.Logger().Info("BalCfgSet Called", ctx, request) |
| 41 | return &bal.BalErr{Err: bal.BalErrno_BAL_ERR_OK}, nil |
| 42 | } |
| 43 | |
| 44 | func (handler *BalHandler) BalCfgClear( |
| 45 | ctx context.Context, |
| 46 | request *bal.BalKey, |
| 47 | ) (*bal.BalErr, error) { |
| 48 | common.Logger().Info("BalCfgClear Called", ctx, request) |
| 49 | return &bal.BalErr{Err: bal.BalErrno_BAL_ERR_OK}, nil |
| 50 | } |
| 51 | |
| 52 | func (handler *BalHandler) BalCfgGet( |
| 53 | ctx context.Context, |
| 54 | request *bal.BalKey, |
| 55 | ) (*bal.BalCfg, error) { |
| 56 | common.Logger().Info("BalCfgGet Called", ctx, request) |
| 57 | return &bal.BalCfg{}, nil |
| 58 | } |
| 59 | |
| 60 | func (handler *BalHandler) BalApiReboot( |
| 61 | ctx context.Context, |
| 62 | request *bal.BalReboot, |
| 63 | ) (*bal.BalErr, error) { |
| 64 | common.Logger().Info("BalApiReboot Called", ctx, request) |
| 65 | return &bal.BalErr{Err: bal.BalErrno_BAL_ERR_OK}, nil |
| 66 | } |
| 67 | |
| 68 | func (handler *BalHandler) BalApiHeartbeat( |
| 69 | ctx context.Context, |
| 70 | request *bal.BalHeartbeat, |
| 71 | ) (*bal.BalRebootState, error) { |
| 72 | common.Logger().Info("BalApiHeartbeat Called", ctx, request) |
| 73 | return &bal.BalRebootState{}, nil |
| 74 | } |
| 75 | |
| 76 | func (handler *BalHandler) BalCfgStatGet( |
| 77 | ctx context.Context, |
| 78 | request *bal.BalInterfaceKey, |
| 79 | ) (*bal.BalInterfaceStat, error) { |
| 80 | common.Logger().Info("BalCfgStatGet Called", ctx, request) |
| 81 | return &bal.BalInterfaceStat{}, nil |
| 82 | } |