Zack Williams | 41513bf | 2018-07-07 20:08:35 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2017-present Open Networking Foundation |
| 3 | |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
Stephane Barbarie | 3559506 | 2018-02-08 08:34:39 -0500 | [diff] [blame] | 16 | package nbi |
| 17 | |
| 18 | import ( |
| 19 | "context" |
| 20 | "github.com/opencord/voltha/ponsim/v2/common" |
| 21 | "github.com/opencord/voltha/protos/go/bal" |
| 22 | ) |
| 23 | |
| 24 | // TODO: fix BAL function parameters and returns |
| 25 | |
| 26 | type BalHandler struct { |
| 27 | } |
| 28 | |
| 29 | func NewBalHandler() *BalHandler { |
| 30 | var handler *BalHandler |
| 31 | handler = &BalHandler{} |
| 32 | return handler |
| 33 | } |
| 34 | |
| 35 | func (handler *BalHandler) BalApiInit( |
| 36 | ctx context.Context, |
| 37 | request *bal.BalInit, |
| 38 | ) (*bal.BalErr, error) { |
| 39 | common.Logger().Info("BalApiInit Called", ctx, request) |
| 40 | return &bal.BalErr{Err: bal.BalErrno_BAL_ERR_OK}, nil |
| 41 | } |
| 42 | |
| 43 | func (handler *BalHandler) BalApiFinish( |
| 44 | ctx context.Context, |
| 45 | request *bal.BalCfg, |
| 46 | ) (*bal.BalErr, error) { |
| 47 | common.Logger().Info("BalApiFinish Called", ctx, request) |
| 48 | return &bal.BalErr{Err: bal.BalErrno_BAL_ERR_OK}, nil |
| 49 | } |
| 50 | |
| 51 | func (handler *BalHandler) BalCfgSet( |
| 52 | ctx context.Context, |
| 53 | request *bal.BalCfg, |
| 54 | ) (*bal.BalErr, error) { |
| 55 | common.Logger().Info("BalCfgSet Called", ctx, request) |
| 56 | return &bal.BalErr{Err: bal.BalErrno_BAL_ERR_OK}, nil |
| 57 | } |
| 58 | |
| 59 | func (handler *BalHandler) BalCfgClear( |
| 60 | ctx context.Context, |
| 61 | request *bal.BalKey, |
| 62 | ) (*bal.BalErr, error) { |
| 63 | common.Logger().Info("BalCfgClear Called", ctx, request) |
| 64 | return &bal.BalErr{Err: bal.BalErrno_BAL_ERR_OK}, nil |
| 65 | } |
| 66 | |
| 67 | func (handler *BalHandler) BalCfgGet( |
| 68 | ctx context.Context, |
| 69 | request *bal.BalKey, |
| 70 | ) (*bal.BalCfg, error) { |
| 71 | common.Logger().Info("BalCfgGet Called", ctx, request) |
| 72 | return &bal.BalCfg{}, nil |
| 73 | } |
| 74 | |
| 75 | func (handler *BalHandler) BalApiReboot( |
| 76 | ctx context.Context, |
| 77 | request *bal.BalReboot, |
| 78 | ) (*bal.BalErr, error) { |
| 79 | common.Logger().Info("BalApiReboot Called", ctx, request) |
| 80 | return &bal.BalErr{Err: bal.BalErrno_BAL_ERR_OK}, nil |
| 81 | } |
| 82 | |
| 83 | func (handler *BalHandler) BalApiHeartbeat( |
| 84 | ctx context.Context, |
| 85 | request *bal.BalHeartbeat, |
| 86 | ) (*bal.BalRebootState, error) { |
| 87 | common.Logger().Info("BalApiHeartbeat Called", ctx, request) |
| 88 | return &bal.BalRebootState{}, nil |
| 89 | } |
| 90 | |
| 91 | func (handler *BalHandler) BalCfgStatGet( |
| 92 | ctx context.Context, |
| 93 | request *bal.BalInterfaceKey, |
| 94 | ) (*bal.BalInterfaceStat, error) { |
| 95 | common.Logger().Info("BalCfgStatGet Called", ctx, request) |
| 96 | return &bal.BalInterfaceStat{}, nil |
| 97 | } |