khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2018-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 | */ |
npujar | 9b959eb | 2019-11-14 16:57:46 +0530 | [diff] [blame] | 16 | |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 17 | package grpc |
| 18 | |
| 19 | import ( |
| 20 | "context" |
| 21 | "errors" |
npujar | 9b959eb | 2019-11-14 16:57:46 +0530 | [diff] [blame] | 22 | |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 23 | "github.com/golang/protobuf/ptypes/empty" |
serkant.uluderya | 2ae470f | 2020-01-21 11:13:09 -0800 | [diff] [blame] | 24 | "github.com/opencord/voltha-lib-go/v3/pkg/log" |
| 25 | "github.com/opencord/voltha-protos/v3/go/common" |
| 26 | "github.com/opencord/voltha-protos/v3/go/openflow_13" |
| 27 | "github.com/opencord/voltha-protos/v3/go/voltha" |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 28 | ) |
| 29 | |
npujar | 9b959eb | 2019-11-14 16:57:46 +0530 | [diff] [blame] | 30 | // DefaultAPIHandler represent default API handler |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 31 | type DefaultAPIHandler struct { |
| 32 | } |
| 33 | |
npujar | 9b959eb | 2019-11-14 16:57:46 +0530 | [diff] [blame] | 34 | // NewDefaultAPIHandler creates default API handler instance |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 35 | func NewDefaultAPIHandler() *DefaultAPIHandler { |
| 36 | handler := &DefaultAPIHandler{} |
| 37 | return handler |
| 38 | } |
| 39 | |
npujar | 9b959eb | 2019-11-14 16:57:46 +0530 | [diff] [blame] | 40 | // GetMembership returns membership |
khenaidoo | 6417b6c | 2019-03-01 18:18:01 -0500 | [diff] [blame] | 41 | func (handler *DefaultAPIHandler) GetMembership(ctx context.Context, empty *empty.Empty) (*voltha.Membership, error) { |
Girish Kumar | f56a468 | 2020-03-20 20:07:46 +0000 | [diff] [blame] | 42 | logger.Debug("GetMembership-request") |
khenaidoo | 6417b6c | 2019-03-01 18:18:01 -0500 | [diff] [blame] | 43 | return nil, errors.New("UnImplemented") |
| 44 | } |
| 45 | |
npujar | 9b959eb | 2019-11-14 16:57:46 +0530 | [diff] [blame] | 46 | // UpdateMembership updates membership |
khenaidoo | 54e0ddf | 2019-02-27 16:21:33 -0500 | [diff] [blame] | 47 | func (handler *DefaultAPIHandler) UpdateMembership(ctx context.Context, membership *voltha.Membership) (*empty.Empty, error) { |
Girish Kumar | f56a468 | 2020-03-20 20:07:46 +0000 | [diff] [blame] | 48 | logger.Debugw("UpdateMembership-request", log.Fields{"membership": membership}) |
khenaidoo | 54e0ddf | 2019-02-27 16:21:33 -0500 | [diff] [blame] | 49 | return nil, errors.New("UnImplemented") |
| 50 | } |
| 51 | |
npujar | 9b959eb | 2019-11-14 16:57:46 +0530 | [diff] [blame] | 52 | // GetVoltha returns voltha details |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 53 | func (handler *DefaultAPIHandler) GetVoltha(ctx context.Context, empty *empty.Empty) (*voltha.Voltha, error) { |
Girish Kumar | f56a468 | 2020-03-20 20:07:46 +0000 | [diff] [blame] | 54 | logger.Debug("GetVoltha-request") |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 55 | return nil, errors.New("UnImplemented") |
| 56 | } |
| 57 | |
npujar | 9b959eb | 2019-11-14 16:57:46 +0530 | [diff] [blame] | 58 | // ListCoreInstances returns core instances |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 59 | func (handler *DefaultAPIHandler) ListCoreInstances(ctx context.Context, empty *empty.Empty) (*voltha.CoreInstances, error) { |
Girish Kumar | f56a468 | 2020-03-20 20:07:46 +0000 | [diff] [blame] | 60 | logger.Debug("ListCoreInstances-request") |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 61 | return nil, errors.New("UnImplemented") |
| 62 | } |
| 63 | |
npujar | 9b959eb | 2019-11-14 16:57:46 +0530 | [diff] [blame] | 64 | // GetCoreInstance returns core instance |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 65 | func (handler *DefaultAPIHandler) GetCoreInstance(ctx context.Context, id *voltha.ID) (*voltha.CoreInstance, error) { |
Girish Kumar | f56a468 | 2020-03-20 20:07:46 +0000 | [diff] [blame] | 66 | logger.Debugw("GetCoreInstance-request", log.Fields{"id": *id}) |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 67 | return nil, errors.New("UnImplemented") |
| 68 | } |
| 69 | |
npujar | 9b959eb | 2019-11-14 16:57:46 +0530 | [diff] [blame] | 70 | // ListAdapters returns core adapters |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 71 | func (handler *DefaultAPIHandler) ListAdapters(ctx context.Context, empty *empty.Empty) (*voltha.Adapters, error) { |
Girish Kumar | f56a468 | 2020-03-20 20:07:46 +0000 | [diff] [blame] | 72 | logger.Debug("ListAdapters-request") |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 73 | return nil, errors.New("UnImplemented") |
| 74 | } |
| 75 | |
npujar | 9b959eb | 2019-11-14 16:57:46 +0530 | [diff] [blame] | 76 | // ListLogicalDevices returns all logical devices |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 77 | func (handler *DefaultAPIHandler) ListLogicalDevices(ctx context.Context, empty *empty.Empty) (*voltha.LogicalDevices, error) { |
Girish Kumar | f56a468 | 2020-03-20 20:07:46 +0000 | [diff] [blame] | 78 | logger.Debug("ListLogicalDevices-request") |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 79 | return nil, errors.New("UnImplemented") |
| 80 | } |
| 81 | |
npujar | 9b959eb | 2019-11-14 16:57:46 +0530 | [diff] [blame] | 82 | // GetLogicalDevice returns logical device |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 83 | func (handler *DefaultAPIHandler) GetLogicalDevice(ctx context.Context, id *voltha.ID) (*voltha.LogicalDevice, error) { |
Girish Kumar | f56a468 | 2020-03-20 20:07:46 +0000 | [diff] [blame] | 84 | logger.Debugw("GetLogicalDevice-request", log.Fields{"id": *id}) |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 85 | return nil, errors.New("UnImplemented") |
| 86 | } |
| 87 | |
npujar | 9b959eb | 2019-11-14 16:57:46 +0530 | [diff] [blame] | 88 | // ListLogicalDevicePorts returns logical device ports |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 89 | func (handler *DefaultAPIHandler) ListLogicalDevicePorts(ctx context.Context, id *voltha.ID) (*voltha.LogicalPorts, error) { |
Girish Kumar | f56a468 | 2020-03-20 20:07:46 +0000 | [diff] [blame] | 90 | logger.Debugw("ListLogicalDevicePorts-request", log.Fields{"id": *id}) |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 91 | return nil, errors.New("UnImplemented") |
| 92 | } |
| 93 | |
npujar | 9b959eb | 2019-11-14 16:57:46 +0530 | [diff] [blame] | 94 | // GetLogicalDevicePort returns logical device port |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 95 | func (handler *DefaultAPIHandler) GetLogicalDevicePort(ctx context.Context, id *voltha.LogicalPortId) (*voltha.LogicalPort, error) { |
Girish Kumar | f56a468 | 2020-03-20 20:07:46 +0000 | [diff] [blame] | 96 | logger.Debugw("GetLogicalDevicePort-request", log.Fields{"id": *id}) |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 97 | return nil, errors.New("UnImplemented") |
| 98 | } |
| 99 | |
npujar | 9b959eb | 2019-11-14 16:57:46 +0530 | [diff] [blame] | 100 | // EnableLogicalDevicePort enables logical device port |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 101 | func (handler *DefaultAPIHandler) EnableLogicalDevicePort(ctx context.Context, id *voltha.LogicalPortId) (*empty.Empty, error) { |
Girish Kumar | f56a468 | 2020-03-20 20:07:46 +0000 | [diff] [blame] | 102 | logger.Debugw("EnableLogicalDevicePort-request", log.Fields{"id": *id}) |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 103 | return nil, errors.New("UnImplemented") |
| 104 | } |
| 105 | |
npujar | 9b959eb | 2019-11-14 16:57:46 +0530 | [diff] [blame] | 106 | // DisableLogicalDevicePort -disables logical device port |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 107 | func (handler *DefaultAPIHandler) DisableLogicalDevicePort(ctx context.Context, id *voltha.LogicalPortId) (*empty.Empty, error) { |
Girish Kumar | f56a468 | 2020-03-20 20:07:46 +0000 | [diff] [blame] | 108 | logger.Debugw("DisableLogicalDevicePort-request", log.Fields{"id": *id}) |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 109 | return nil, errors.New("UnImplemented") |
| 110 | } |
| 111 | |
npujar | 9b959eb | 2019-11-14 16:57:46 +0530 | [diff] [blame] | 112 | // ListLogicalDeviceFlows returns logical device flows |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 113 | func (handler *DefaultAPIHandler) ListLogicalDeviceFlows(ctx context.Context, id *voltha.ID) (*openflow_13.Flows, error) { |
Girish Kumar | f56a468 | 2020-03-20 20:07:46 +0000 | [diff] [blame] | 114 | logger.Debugw("ListLogicalDeviceFlows-request", log.Fields{"id": *id}) |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 115 | return nil, errors.New("UnImplemented") |
| 116 | } |
| 117 | |
npujar | 9b959eb | 2019-11-14 16:57:46 +0530 | [diff] [blame] | 118 | // UpdateLogicalDeviceFlowTable updates logical device flow table |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 119 | func (handler *DefaultAPIHandler) UpdateLogicalDeviceFlowTable(ctx context.Context, flow *openflow_13.FlowTableUpdate) (*empty.Empty, error) { |
Girish Kumar | f56a468 | 2020-03-20 20:07:46 +0000 | [diff] [blame] | 120 | logger.Debugw("UpdateLogicalDeviceFlowTable-request", log.Fields{"flow": *flow}) |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 121 | return nil, errors.New("UnImplemented") |
| 122 | } |
| 123 | |
npujar | 9b959eb | 2019-11-14 16:57:46 +0530 | [diff] [blame] | 124 | // UpdateLogicalDeviceFlowGroupTable updates logical device flow group table |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 125 | func (handler *DefaultAPIHandler) UpdateLogicalDeviceFlowGroupTable(ctx context.Context, flow *openflow_13.FlowGroupTableUpdate) (*empty.Empty, error) { |
Girish Kumar | f56a468 | 2020-03-20 20:07:46 +0000 | [diff] [blame] | 126 | logger.Debugw("UpdateLogicalDeviceFlowGroupTable-request", log.Fields{"flow": *flow}) |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 127 | return nil, errors.New("UnImplemented") |
| 128 | } |
| 129 | |
npujar | 9b959eb | 2019-11-14 16:57:46 +0530 | [diff] [blame] | 130 | // ListLogicalDeviceFlowGroups returns logical device flow groups |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 131 | func (handler *DefaultAPIHandler) ListLogicalDeviceFlowGroups(ctx context.Context, id *voltha.ID) (*openflow_13.FlowGroups, error) { |
Girish Kumar | f56a468 | 2020-03-20 20:07:46 +0000 | [diff] [blame] | 132 | logger.Debugw("ListLogicalDeviceFlowGroups-request", log.Fields{"id": *id}) |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 133 | return nil, errors.New("UnImplemented") |
| 134 | } |
| 135 | |
npujar | 9b959eb | 2019-11-14 16:57:46 +0530 | [diff] [blame] | 136 | // ListDevices returns devices |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 137 | func (handler *DefaultAPIHandler) ListDevices(ctx context.Context, empty *empty.Empty) (*voltha.Devices, error) { |
Girish Kumar | f56a468 | 2020-03-20 20:07:46 +0000 | [diff] [blame] | 138 | logger.Debug("ListDevices-request") |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 139 | return nil, errors.New("UnImplemented") |
| 140 | } |
| 141 | |
npujar | 9b959eb | 2019-11-14 16:57:46 +0530 | [diff] [blame] | 142 | // ListDeviceIDs returns device ids |
| 143 | func (handler *DefaultAPIHandler) ListDeviceIDs(ctx context.Context, empty *empty.Empty) (*voltha.IDs, error) { |
Girish Kumar | f56a468 | 2020-03-20 20:07:46 +0000 | [diff] [blame] | 144 | logger.Debug("ListDeviceIDs-request") |
khenaidoo | 7ccedd5 | 2018-12-14 16:48:54 -0500 | [diff] [blame] | 145 | return nil, errors.New("UnImplemented") |
| 146 | } |
| 147 | |
npujar | 9b959eb | 2019-11-14 16:57:46 +0530 | [diff] [blame] | 148 | // ReconcileDevices reconciles devices |
khenaidoo | 7ccedd5 | 2018-12-14 16:48:54 -0500 | [diff] [blame] | 149 | func (handler *DefaultAPIHandler) ReconcileDevices(ctx context.Context, ids *voltha.IDs) (*empty.Empty, error) { |
| 150 | if ids != nil { |
Girish Kumar | f56a468 | 2020-03-20 20:07:46 +0000 | [diff] [blame] | 151 | logger.Debugw("ReconcileDevices-request", log.Fields{"length": len(ids.Items)}) |
khenaidoo | 7ccedd5 | 2018-12-14 16:48:54 -0500 | [diff] [blame] | 152 | return nil, errors.New("UnImplemented") |
| 153 | } |
| 154 | return nil, errors.New("ids-null") |
| 155 | } |
| 156 | |
npujar | 9b959eb | 2019-11-14 16:57:46 +0530 | [diff] [blame] | 157 | // GetDevice returns device |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 158 | func (handler *DefaultAPIHandler) GetDevice(ctx context.Context, id *voltha.ID) (*voltha.Device, error) { |
Girish Kumar | f56a468 | 2020-03-20 20:07:46 +0000 | [diff] [blame] | 159 | logger.Debugw("GetDevice-request", log.Fields{"id": id}) |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 160 | return nil, errors.New("UnImplemented") |
| 161 | } |
| 162 | |
npujar | 9b959eb | 2019-11-14 16:57:46 +0530 | [diff] [blame] | 163 | // CreateDevice creates device |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 164 | func (handler *DefaultAPIHandler) CreateDevice(ctx context.Context, device *voltha.Device) (*voltha.Device, error) { |
Girish Kumar | f56a468 | 2020-03-20 20:07:46 +0000 | [diff] [blame] | 165 | logger.Debugw("CreateDevice-request", log.Fields{"device": *device}) |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 166 | return nil, errors.New("UnImplemented") |
| 167 | } |
| 168 | |
npujar | 9b959eb | 2019-11-14 16:57:46 +0530 | [diff] [blame] | 169 | // EnableDevice enables device |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 170 | func (handler *DefaultAPIHandler) EnableDevice(ctx context.Context, id *voltha.ID) (*empty.Empty, error) { |
Girish Kumar | f56a468 | 2020-03-20 20:07:46 +0000 | [diff] [blame] | 171 | logger.Debugw("EnableDevice-request", log.Fields{"id": *id}) |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 172 | return nil, errors.New("UnImplemented") |
| 173 | } |
| 174 | |
npujar | 9b959eb | 2019-11-14 16:57:46 +0530 | [diff] [blame] | 175 | // DisableDevice disables device |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 176 | func (handler *DefaultAPIHandler) DisableDevice(ctx context.Context, id *voltha.ID) (*empty.Empty, error) { |
Girish Kumar | f56a468 | 2020-03-20 20:07:46 +0000 | [diff] [blame] | 177 | logger.Debugw("DisableDevice-request", log.Fields{"id": *id}) |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 178 | return nil, errors.New("UnImplemented") |
| 179 | } |
| 180 | |
npujar | 9b959eb | 2019-11-14 16:57:46 +0530 | [diff] [blame] | 181 | // RebootDevice reboots device |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 182 | func (handler *DefaultAPIHandler) RebootDevice(ctx context.Context, id *voltha.ID) (*empty.Empty, error) { |
Girish Kumar | f56a468 | 2020-03-20 20:07:46 +0000 | [diff] [blame] | 183 | logger.Debugw("RebootDevice-request", log.Fields{"id": *id}) |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 184 | return nil, errors.New("UnImplemented") |
| 185 | } |
| 186 | |
npujar | 9b959eb | 2019-11-14 16:57:46 +0530 | [diff] [blame] | 187 | // DeleteDevice deletes device |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 188 | func (handler *DefaultAPIHandler) DeleteDevice(ctx context.Context, id *voltha.ID) (*empty.Empty, error) { |
Girish Kumar | f56a468 | 2020-03-20 20:07:46 +0000 | [diff] [blame] | 189 | logger.Debugw("DeleteDevice-request", log.Fields{"id": *id}) |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 190 | return nil, errors.New("UnImplemented") |
| 191 | } |
| 192 | |
npujar | 9b959eb | 2019-11-14 16:57:46 +0530 | [diff] [blame] | 193 | // DownloadImage downloads image |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 194 | func (handler *DefaultAPIHandler) DownloadImage(ctx context.Context, img *voltha.ImageDownload) (*common.OperationResp, error) { |
Girish Kumar | f56a468 | 2020-03-20 20:07:46 +0000 | [diff] [blame] | 195 | logger.Debugw("DownloadImage-request", log.Fields{"img": *img}) |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 196 | return nil, errors.New("UnImplemented") |
| 197 | } |
| 198 | |
npujar | 9b959eb | 2019-11-14 16:57:46 +0530 | [diff] [blame] | 199 | // GetImageDownloadStatus returns status of image download |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 200 | func (handler *DefaultAPIHandler) GetImageDownloadStatus(ctx context.Context, img *voltha.ImageDownload) (*voltha.ImageDownload, error) { |
Girish Kumar | f56a468 | 2020-03-20 20:07:46 +0000 | [diff] [blame] | 201 | logger.Debugw("GetImageDownloadStatus-request", log.Fields{"img": *img}) |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 202 | return nil, errors.New("UnImplemented") |
| 203 | } |
| 204 | |
npujar | 9b959eb | 2019-11-14 16:57:46 +0530 | [diff] [blame] | 205 | // GetImageDownload returns image download |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 206 | func (handler *DefaultAPIHandler) GetImageDownload(ctx context.Context, img *voltha.ImageDownload) (*voltha.ImageDownload, error) { |
Girish Kumar | f56a468 | 2020-03-20 20:07:46 +0000 | [diff] [blame] | 207 | logger.Debugw("getdevice-request", log.Fields{"img": *img}) |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 208 | return nil, errors.New("UnImplemented") |
| 209 | } |
| 210 | |
npujar | 9b959eb | 2019-11-14 16:57:46 +0530 | [diff] [blame] | 211 | // ListImageDownloads returns image downloads |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 212 | func (handler *DefaultAPIHandler) ListImageDownloads(ctx context.Context, id *voltha.ID) (*voltha.ImageDownloads, error) { |
Girish Kumar | f56a468 | 2020-03-20 20:07:46 +0000 | [diff] [blame] | 213 | logger.Debugw("ListImageDownloads-request", log.Fields{"id": *id}) |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 214 | return nil, errors.New("UnImplemented") |
| 215 | } |
| 216 | |
npujar | 9b959eb | 2019-11-14 16:57:46 +0530 | [diff] [blame] | 217 | // CancelImageDownload cancels image download |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 218 | func (handler *DefaultAPIHandler) CancelImageDownload(ctx context.Context, img *voltha.ImageDownload) (*common.OperationResp, error) { |
Girish Kumar | f56a468 | 2020-03-20 20:07:46 +0000 | [diff] [blame] | 219 | logger.Debugw("CancelImageDownload-request", log.Fields{"img": *img}) |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 220 | return nil, errors.New("UnImplemented") |
| 221 | } |
| 222 | |
npujar | 9b959eb | 2019-11-14 16:57:46 +0530 | [diff] [blame] | 223 | // ActivateImageUpdate activates image update |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 224 | func (handler *DefaultAPIHandler) ActivateImageUpdate(ctx context.Context, img *voltha.ImageDownload) (*common.OperationResp, error) { |
Girish Kumar | f56a468 | 2020-03-20 20:07:46 +0000 | [diff] [blame] | 225 | logger.Debugw("ActivateImageUpdate-request", log.Fields{"img": *img}) |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 226 | return nil, errors.New("UnImplemented") |
| 227 | } |
| 228 | |
npujar | 9b959eb | 2019-11-14 16:57:46 +0530 | [diff] [blame] | 229 | // RevertImageUpdate reverts image update |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 230 | func (handler *DefaultAPIHandler) RevertImageUpdate(ctx context.Context, img *voltha.ImageDownload) (*common.OperationResp, error) { |
Girish Kumar | f56a468 | 2020-03-20 20:07:46 +0000 | [diff] [blame] | 231 | logger.Debugw("RevertImageUpdate-request", log.Fields{"img": *img}) |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 232 | return nil, errors.New("UnImplemented") |
| 233 | } |
| 234 | |
npujar | 9b959eb | 2019-11-14 16:57:46 +0530 | [diff] [blame] | 235 | // ListDevicePorts returns device ports |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 236 | func (handler *DefaultAPIHandler) ListDevicePorts(ctx context.Context, id *voltha.ID) (*voltha.Ports, error) { |
Girish Kumar | f56a468 | 2020-03-20 20:07:46 +0000 | [diff] [blame] | 237 | logger.Debugw("ListDevicePorts-request", log.Fields{"id": *id}) |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 238 | return nil, errors.New("UnImplemented") |
| 239 | } |
| 240 | |
npujar | 9b959eb | 2019-11-14 16:57:46 +0530 | [diff] [blame] | 241 | // ListDevicePmConfigs returns device pm configs |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 242 | func (handler *DefaultAPIHandler) ListDevicePmConfigs(ctx context.Context, id *voltha.ID) (*voltha.PmConfigs, error) { |
Girish Kumar | f56a468 | 2020-03-20 20:07:46 +0000 | [diff] [blame] | 243 | logger.Debugw("ListDevicePmConfigs-request", log.Fields{"id": *id}) |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 244 | return nil, errors.New("UnImplemented") |
| 245 | } |
| 246 | |
npujar | 9b959eb | 2019-11-14 16:57:46 +0530 | [diff] [blame] | 247 | // UpdateDevicePmConfigs updates device pm configs |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 248 | func (handler *DefaultAPIHandler) UpdateDevicePmConfigs(ctx context.Context, configs *voltha.PmConfigs) (*empty.Empty, error) { |
Girish Kumar | f56a468 | 2020-03-20 20:07:46 +0000 | [diff] [blame] | 249 | logger.Debugw("UpdateDevicePmConfigs-request", log.Fields{"configs": *configs}) |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 250 | return nil, errors.New("UnImplemented") |
| 251 | } |
| 252 | |
npujar | 9b959eb | 2019-11-14 16:57:46 +0530 | [diff] [blame] | 253 | // ListDeviceFlows returns device flows |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 254 | func (handler *DefaultAPIHandler) ListDeviceFlows(ctx context.Context, id *voltha.ID) (*openflow_13.Flows, error) { |
Girish Kumar | f56a468 | 2020-03-20 20:07:46 +0000 | [diff] [blame] | 255 | logger.Debugw("ListDeviceFlows-request", log.Fields{"id": *id}) |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 256 | return nil, errors.New("UnImplemented") |
| 257 | } |
| 258 | |
npujar | 9b959eb | 2019-11-14 16:57:46 +0530 | [diff] [blame] | 259 | // ListDeviceFlowGroups returns device flow groups |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 260 | func (handler *DefaultAPIHandler) ListDeviceFlowGroups(ctx context.Context, id *voltha.ID) (*openflow_13.FlowGroups, error) { |
Girish Kumar | f56a468 | 2020-03-20 20:07:46 +0000 | [diff] [blame] | 261 | logger.Debugw("ListDeviceFlowGroups-request", log.Fields{"id": *id}) |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 262 | return nil, errors.New("UnImplemented") |
| 263 | } |
| 264 | |
npujar | 9b959eb | 2019-11-14 16:57:46 +0530 | [diff] [blame] | 265 | // ListDeviceTypes returns device types |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 266 | func (handler *DefaultAPIHandler) ListDeviceTypes(ctx context.Context, empty *empty.Empty) (*voltha.DeviceTypes, error) { |
Girish Kumar | f56a468 | 2020-03-20 20:07:46 +0000 | [diff] [blame] | 267 | logger.Debug("ListDeviceTypes-request") |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 268 | return nil, errors.New("UnImplemented") |
| 269 | } |
| 270 | |
npujar | 9b959eb | 2019-11-14 16:57:46 +0530 | [diff] [blame] | 271 | // GetDeviceType returns device type |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 272 | func (handler *DefaultAPIHandler) GetDeviceType(ctx context.Context, id *voltha.ID) (*voltha.DeviceType, error) { |
Girish Kumar | f56a468 | 2020-03-20 20:07:46 +0000 | [diff] [blame] | 273 | logger.Debugw("GetDeviceType-request", log.Fields{"id": *id}) |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 274 | return nil, errors.New("UnImplemented") |
| 275 | } |
| 276 | |
npujar | 9b959eb | 2019-11-14 16:57:46 +0530 | [diff] [blame] | 277 | // ListDeviceGroups returns device groups |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 278 | func (handler *DefaultAPIHandler) ListDeviceGroups(ctx context.Context, empty *empty.Empty) (*voltha.DeviceGroups, error) { |
Girish Kumar | f56a468 | 2020-03-20 20:07:46 +0000 | [diff] [blame] | 279 | logger.Debug("ListDeviceGroups-request") |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 280 | return nil, errors.New("UnImplemented") |
| 281 | } |
| 282 | |
npujar | 9b959eb | 2019-11-14 16:57:46 +0530 | [diff] [blame] | 283 | // GetDeviceGroup returns device group |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 284 | func (handler *DefaultAPIHandler) GetDeviceGroup(ctx context.Context, id *voltha.ID) (*voltha.DeviceGroup, error) { |
Girish Kumar | f56a468 | 2020-03-20 20:07:46 +0000 | [diff] [blame] | 285 | logger.Debugw("GetDeviceGroup-request", log.Fields{"id": *id}) |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 286 | return nil, errors.New("UnImplemented") |
| 287 | } |
| 288 | |
npujar | 9b959eb | 2019-11-14 16:57:46 +0530 | [diff] [blame] | 289 | // CreateEventFilter creates event filter |
Devmalya Paul | c594bb3 | 2019-11-06 07:34:27 +0000 | [diff] [blame] | 290 | func (handler *DefaultAPIHandler) CreateEventFilter(ctx context.Context, filter *voltha.EventFilter) (*voltha.EventFilter, error) { |
Girish Kumar | f56a468 | 2020-03-20 20:07:46 +0000 | [diff] [blame] | 291 | logger.Debugw("CreateEventFilter-request", log.Fields{"filter": *filter}) |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 292 | return nil, errors.New("UnImplemented") |
| 293 | } |
| 294 | |
npujar | 9b959eb | 2019-11-14 16:57:46 +0530 | [diff] [blame] | 295 | // GetEventFilter returns event filter |
Devmalya Paul | c594bb3 | 2019-11-06 07:34:27 +0000 | [diff] [blame] | 296 | func (handler *DefaultAPIHandler) GetEventFilter(ctx context.Context, id *voltha.ID) (*voltha.EventFilter, error) { |
Girish Kumar | f56a468 | 2020-03-20 20:07:46 +0000 | [diff] [blame] | 297 | logger.Debugw("GetEventFilter-request", log.Fields{"id": id}) |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 298 | return nil, errors.New("UnImplemented") |
| 299 | } |
| 300 | |
npujar | 9b959eb | 2019-11-14 16:57:46 +0530 | [diff] [blame] | 301 | // UpdateEventFilter updates event filter |
Devmalya Paul | c594bb3 | 2019-11-06 07:34:27 +0000 | [diff] [blame] | 302 | func (handler *DefaultAPIHandler) UpdateEventFilter(ctx context.Context, filter *voltha.EventFilter) (*voltha.EventFilter, error) { |
Girish Kumar | f56a468 | 2020-03-20 20:07:46 +0000 | [diff] [blame] | 303 | logger.Debugw("UpdateEventFilter-request", log.Fields{"filter": *filter}) |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 304 | return nil, errors.New("UnImplemented") |
| 305 | } |
| 306 | |
npujar | 9b959eb | 2019-11-14 16:57:46 +0530 | [diff] [blame] | 307 | // DeleteEventFilter deletes event filter |
Devmalya Paul | c594bb3 | 2019-11-06 07:34:27 +0000 | [diff] [blame] | 308 | func (handler *DefaultAPIHandler) DeleteEventFilter(ctx context.Context, filterInfo *voltha.EventFilter) (*empty.Empty, error) { |
Girish Kumar | f56a468 | 2020-03-20 20:07:46 +0000 | [diff] [blame] | 309 | logger.Debugw("DeleteEventFilter-request", log.Fields{"filter-details": *filterInfo}) |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 310 | return nil, errors.New("UnImplemented") |
| 311 | } |
| 312 | |
npujar | 9b959eb | 2019-11-14 16:57:46 +0530 | [diff] [blame] | 313 | // ListEventFilters returns event filters |
Devmalya Paul | c594bb3 | 2019-11-06 07:34:27 +0000 | [diff] [blame] | 314 | func (handler *DefaultAPIHandler) ListEventFilters(ctx context.Context, empty *empty.Empty) (*voltha.EventFilters, error) { |
Girish Kumar | f56a468 | 2020-03-20 20:07:46 +0000 | [diff] [blame] | 315 | logger.Debug("ListEventFilters-request") |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 316 | return nil, errors.New("UnImplemented") |
| 317 | } |
| 318 | |
npujar | 9b959eb | 2019-11-14 16:57:46 +0530 | [diff] [blame] | 319 | // GetImages returns images |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 320 | func (handler *DefaultAPIHandler) GetImages(ctx context.Context, id *voltha.ID) (*voltha.Images, error) { |
Girish Kumar | f56a468 | 2020-03-20 20:07:46 +0000 | [diff] [blame] | 321 | logger.Debugw("GetImages-request", log.Fields{"id": id}) |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 322 | return nil, errors.New("UnImplemented") |
| 323 | } |
| 324 | |
npujar | 9b959eb | 2019-11-14 16:57:46 +0530 | [diff] [blame] | 325 | // SelfTest requests self test |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 326 | func (handler *DefaultAPIHandler) SelfTest(ctx context.Context, id *voltha.ID) (*voltha.SelfTestResponse, error) { |
Girish Kumar | f56a468 | 2020-03-20 20:07:46 +0000 | [diff] [blame] | 327 | logger.Debugw("SelfTest-request", log.Fields{"id": id}) |
khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 328 | return nil, errors.New("UnImplemented") |
| 329 | } |
Stephane Barbarie | 6e1bd50 | 2018-11-05 22:44:45 -0500 | [diff] [blame] | 330 | |
npujar | 9b959eb | 2019-11-14 16:57:46 +0530 | [diff] [blame] | 331 | // StreamPacketsOut sends packet to adapter |
Stephane Barbarie | 6e1bd50 | 2018-11-05 22:44:45 -0500 | [diff] [blame] | 332 | func (handler *DefaultAPIHandler) StreamPacketsOut(packetsOut voltha.VolthaService_StreamPacketsOutServer) error { |
Girish Kumar | f56a468 | 2020-03-20 20:07:46 +0000 | [diff] [blame] | 333 | logger.Debugw("StreamPacketsOut-request", log.Fields{"packetsOut": packetsOut}) |
Stephane Barbarie | 6e1bd50 | 2018-11-05 22:44:45 -0500 | [diff] [blame] | 334 | return errors.New("UnImplemented") |
| 335 | } |
| 336 | |
npujar | 9b959eb | 2019-11-14 16:57:46 +0530 | [diff] [blame] | 337 | // ReceivePacketsIn receives packets from adapter |
Stephane Barbarie | 6e1bd50 | 2018-11-05 22:44:45 -0500 | [diff] [blame] | 338 | func (handler *DefaultAPIHandler) ReceivePacketsIn( |
| 339 | empty *empty.Empty, |
| 340 | packetsIn voltha.VolthaService_ReceivePacketsInServer, |
| 341 | ) error { |
Girish Kumar | f56a468 | 2020-03-20 20:07:46 +0000 | [diff] [blame] | 342 | logger.Debugw("ReceivePacketsIn-request", log.Fields{"packetsIn": packetsIn}) |
Stephane Barbarie | 6e1bd50 | 2018-11-05 22:44:45 -0500 | [diff] [blame] | 343 | return errors.New("UnImplemented") |
| 344 | } |
| 345 | |
npujar | 9b959eb | 2019-11-14 16:57:46 +0530 | [diff] [blame] | 346 | // ReceiveChangeEvents receives change events |
Stephane Barbarie | 6e1bd50 | 2018-11-05 22:44:45 -0500 | [diff] [blame] | 347 | func (handler *DefaultAPIHandler) ReceiveChangeEvents( |
| 348 | empty *empty.Empty, |
| 349 | changeEvents voltha.VolthaService_ReceiveChangeEventsServer, |
| 350 | ) error { |
Girish Kumar | f56a468 | 2020-03-20 20:07:46 +0000 | [diff] [blame] | 351 | logger.Debugw("ReceiveChangeEvents-request", log.Fields{"changeEvents": changeEvents}) |
Stephane Barbarie | 6e1bd50 | 2018-11-05 22:44:45 -0500 | [diff] [blame] | 352 | return errors.New("UnImplemented") |
| 353 | } |
| 354 | |
npujar | 9b959eb | 2019-11-14 16:57:46 +0530 | [diff] [blame] | 355 | // Subscribe requests for subscribe |
Stephane Barbarie | 6e1bd50 | 2018-11-05 22:44:45 -0500 | [diff] [blame] | 356 | func (handler *DefaultAPIHandler) Subscribe( |
| 357 | ctx context.Context, |
| 358 | ofAgent *voltha.OfAgentSubscriber, |
| 359 | ) (*voltha.OfAgentSubscriber, error) { |
Girish Kumar | f56a468 | 2020-03-20 20:07:46 +0000 | [diff] [blame] | 360 | logger.Debugw("Subscribe-request", log.Fields{"ofAgent": ofAgent}) |
Stephane Barbarie | 6e1bd50 | 2018-11-05 22:44:45 -0500 | [diff] [blame] | 361 | return nil, errors.New("UnImplemented") |
| 362 | } |
Manikkaraj k | b1a1092 | 2019-07-29 12:10:34 -0400 | [diff] [blame] | 363 | |
npujar | 9b959eb | 2019-11-14 16:57:46 +0530 | [diff] [blame] | 364 | // UpdateLogicalDeviceMeterTable updates logical device meter table |
Manikkaraj k | b1a1092 | 2019-07-29 12:10:34 -0400 | [diff] [blame] | 365 | func (handler *DefaultAPIHandler) UpdateLogicalDeviceMeterTable(ctx context.Context, mod *openflow_13.MeterModUpdate) (*empty.Empty, error) { |
Girish Kumar | f56a468 | 2020-03-20 20:07:46 +0000 | [diff] [blame] | 366 | logger.Debugw("UpdateLogicalDeviceMeterTable-request", log.Fields{"meter": mod}) |
Manikkaraj k | b1a1092 | 2019-07-29 12:10:34 -0400 | [diff] [blame] | 367 | return nil, errors.New("UnImplemented") |
| 368 | } |
| 369 | |
npujar | 9b959eb | 2019-11-14 16:57:46 +0530 | [diff] [blame] | 370 | // ListLogicalDeviceMeters returns logical device meters |
Manikkaraj k | b1a1092 | 2019-07-29 12:10:34 -0400 | [diff] [blame] | 371 | func (handler *DefaultAPIHandler) ListLogicalDeviceMeters(ctx context.Context, id *voltha.ID) (*openflow_13.Meters, error) { |
Girish Kumar | f56a468 | 2020-03-20 20:07:46 +0000 | [diff] [blame] | 372 | logger.Debugw("ListLogicalDeviceMeters-unimplemented", log.Fields{"id": id}) |
Manikkaraj k | b1a1092 | 2019-07-29 12:10:34 -0400 | [diff] [blame] | 373 | return nil, nil |
| 374 | } |
kesavand | bc2d162 | 2020-01-21 00:42:01 -0500 | [diff] [blame] | 375 | |
| 376 | func (handler *DefaultAPIHandler) EnablePort(ctx context.Context, port *voltha.Port) (*empty.Empty, error) { |
Girish Kumar | f56a468 | 2020-03-20 20:07:46 +0000 | [diff] [blame] | 377 | logger.Debugw("EnablePort-unimplemented", log.Fields{"id": port.DeviceId}) |
kesavand | bc2d162 | 2020-01-21 00:42:01 -0500 | [diff] [blame] | 378 | return nil, nil |
| 379 | } |
| 380 | func (handler *DefaultAPIHandler) DisablePort(ctx context.Context, port *voltha.Port) (*empty.Empty, error) { |
Girish Kumar | f56a468 | 2020-03-20 20:07:46 +0000 | [diff] [blame] | 381 | logger.Debugw("DisablePort-unimplemented", log.Fields{"id": port.DeviceId}) |
kesavand | bc2d162 | 2020-01-21 00:42:01 -0500 | [diff] [blame] | 382 | return nil, nil |
| 383 | } |
onkarkundargi | 8728525 | 2020-01-27 11:34:52 +0530 | [diff] [blame] | 384 | |
| 385 | // on demand api for test action |
| 386 | func (handler *DefaultAPIHandler) StartOmciTestAction(ctx context.Context, omcitestrequest *voltha.OmciTestRequest) (*voltha.TestResponse, error) { |
| 387 | return nil, errors.New("StartOmciTestAction-unimplemented") |
| 388 | } |