blob: 45e8f36949af0d5e2d6acdc03214a61b75668341 [file] [log] [blame]
khenaidoobf6e7bb2018-08-14 22:27:29 -04001/*
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 */
16package grpc
17
18import (
19 "context"
20 "errors"
21 "github.com/golang/protobuf/ptypes/empty"
22 "github.com/opencord/voltha-go/common/log"
23 "github.com/opencord/voltha-go/protos/common"
24 "github.com/opencord/voltha-go/protos/openflow_13"
25 "github.com/opencord/voltha-go/protos/voltha"
26)
27
28type DefaultAPIHandler struct {
29}
30
khenaidoob9203542018-09-17 22:56:37 -040031func init() {
32 log.AddPackage(log.JSON, log.WarnLevel, nil)
33}
34
khenaidoobf6e7bb2018-08-14 22:27:29 -040035func NewDefaultAPIHandler() *DefaultAPIHandler {
36 handler := &DefaultAPIHandler{}
37 return handler
38}
39
40func (handler *DefaultAPIHandler) UpdateLogLevel(ctx context.Context, logging *voltha.Logging) (*empty.Empty, error) {
41 log.Debugw("UpdateLogLevel-request", log.Fields{"newloglevel": logging.Level, "intval": int(logging.Level)})
42 return nil, errors.New("UnImplemented")
43}
44
45func (handler *DefaultAPIHandler) GetVoltha(ctx context.Context, empty *empty.Empty) (*voltha.Voltha, error) {
46 log.Debug("GetVoltha-request")
47 return nil, errors.New("UnImplemented")
48}
49
50func (handler *DefaultAPIHandler) ListCoreInstances(ctx context.Context, empty *empty.Empty) (*voltha.CoreInstances, error) {
51 log.Debug("ListCoreInstances-request")
52 return nil, errors.New("UnImplemented")
53}
54
55func (handler *DefaultAPIHandler) GetCoreInstance(ctx context.Context, id *voltha.ID) (*voltha.CoreInstance, error) {
56 log.Debugw("GetCoreInstance-request", log.Fields{"id": *id})
57 return nil, errors.New("UnImplemented")
58}
59
60func (handler *DefaultAPIHandler) ListAdapters(ctx context.Context, empty *empty.Empty) (*voltha.Adapters, error) {
61 log.Debug("ListAdapters-request")
62 return nil, errors.New("UnImplemented")
63}
64
65func (handler *DefaultAPIHandler) ListLogicalDevices(ctx context.Context, empty *empty.Empty) (*voltha.LogicalDevices, error) {
66 log.Debug("ListLogicalDevices-request")
67 return nil, errors.New("UnImplemented")
68}
69
70func (handler *DefaultAPIHandler) GetLogicalDevice(ctx context.Context, id *voltha.ID) (*voltha.LogicalDevice, error) {
71 log.Debugw("GetLogicalDevice-request", log.Fields{"id": *id})
72 return nil, errors.New("UnImplemented")
73}
74
75func (handler *DefaultAPIHandler) ListLogicalDevicePorts(ctx context.Context, id *voltha.ID) (*voltha.LogicalPorts, error) {
76 log.Debugw("ListLogicalDevicePorts-request", log.Fields{"id": *id})
77 return nil, errors.New("UnImplemented")
78}
79
80func (handler *DefaultAPIHandler) GetLogicalDevicePort(ctx context.Context, id *voltha.LogicalPortId) (*voltha.LogicalPort, error) {
81 log.Debugw("GetLogicalDevicePort-request", log.Fields{"id": *id})
82 return nil, errors.New("UnImplemented")
83}
84
85func (handler *DefaultAPIHandler) EnableLogicalDevicePort(ctx context.Context, id *voltha.LogicalPortId) (*empty.Empty, error) {
86 log.Debugw("EnableLogicalDevicePort-request", log.Fields{"id": *id})
87 return nil, errors.New("UnImplemented")
88}
89
90func (handler *DefaultAPIHandler) DisableLogicalDevicePort(ctx context.Context, id *voltha.LogicalPortId) (*empty.Empty, error) {
91 log.Debugw("DisableLogicalDevicePort-request", log.Fields{"id": *id})
92 return nil, errors.New("UnImplemented")
93}
94
95func (handler *DefaultAPIHandler) ListLogicalDeviceFlows(ctx context.Context, id *voltha.ID) (*openflow_13.Flows, error) {
96 log.Debugw("ListLogicalDeviceFlows-request", log.Fields{"id": *id})
97 return nil, errors.New("UnImplemented")
98}
99
100func (handler *DefaultAPIHandler) UpdateLogicalDeviceFlowTable(ctx context.Context, flow *openflow_13.FlowTableUpdate) (*empty.Empty, error) {
101 log.Debugw("UpdateLogicalDeviceFlowTable-request", log.Fields{"flow": *flow})
102 return nil, errors.New("UnImplemented")
103}
104
105func (handler *DefaultAPIHandler) UpdateLogicalDeviceFlowGroupTable(ctx context.Context, flow *openflow_13.FlowGroupTableUpdate) (*empty.Empty, error) {
106 log.Debugw("UpdateLogicalDeviceFlowGroupTable-request", log.Fields{"flow": *flow})
107 return nil, errors.New("UnImplemented")
108}
109
110func (handler *DefaultAPIHandler) ListLogicalDeviceFlowGroups(ctx context.Context, id *voltha.ID) (*openflow_13.FlowGroups, error) {
111 log.Debugw("ListLogicalDeviceFlowGroups-request", log.Fields{"id": *id})
112 return nil, errors.New("UnImplemented")
113}
114
115func (handler *DefaultAPIHandler) ListDevices(ctx context.Context, empty *empty.Empty) (*voltha.Devices, error) {
116 log.Debug("ListDevices-request")
117 return nil, errors.New("UnImplemented")
118}
119
120func (handler *DefaultAPIHandler) GetDevice(ctx context.Context, id *voltha.ID) (*voltha.Device, error) {
121 log.Debugw("GetDevice-request", log.Fields{"id": id})
122 return nil, errors.New("UnImplemented")
123}
124
125func (handler *DefaultAPIHandler) CreateDevice(ctx context.Context, device *voltha.Device) (*voltha.Device, error) {
126 log.Debugw("CreateDevice-request", log.Fields{"device": *device})
127 return nil, errors.New("UnImplemented")
128}
129
130func (handler *DefaultAPIHandler) EnableDevice(ctx context.Context, id *voltha.ID) (*empty.Empty, error) {
131 log.Debugw("EnableDevice-request", log.Fields{"id": *id})
132 return nil, errors.New("UnImplemented")
133}
134
135func (handler *DefaultAPIHandler) DisableDevice(ctx context.Context, id *voltha.ID) (*empty.Empty, error) {
136 log.Debugw("DisableDevice-request", log.Fields{"id": *id})
137 return nil, errors.New("UnImplemented")
138}
139
140func (handler *DefaultAPIHandler) RebootDevice(ctx context.Context, id *voltha.ID) (*empty.Empty, error) {
141 log.Debugw("RebootDevice-request", log.Fields{"id": *id})
142 return nil, errors.New("UnImplemented")
143}
144
145func (handler *DefaultAPIHandler) DeleteDevice(ctx context.Context, id *voltha.ID) (*empty.Empty, error) {
146 log.Debugw("DeleteDevice-request", log.Fields{"id": *id})
147 return nil, errors.New("UnImplemented")
148}
149
150func (handler *DefaultAPIHandler) DownloadImage(ctx context.Context, img *voltha.ImageDownload) (*common.OperationResp, error) {
151 log.Debugw("DownloadImage-request", log.Fields{"img": *img})
152 return nil, errors.New("UnImplemented")
153}
154
155func (handler *DefaultAPIHandler) GetImageDownloadStatus(ctx context.Context, img *voltha.ImageDownload) (*voltha.ImageDownload, error) {
156 log.Debugw("GetImageDownloadStatus-request", log.Fields{"img": *img})
157 return nil, errors.New("UnImplemented")
158}
159
160func (handler *DefaultAPIHandler) GetImageDownload(ctx context.Context, img *voltha.ImageDownload) (*voltha.ImageDownload, error) {
161 log.Debugw("getdevice-request", log.Fields{"img": *img})
162 return nil, errors.New("UnImplemented")
163}
164
165func (handler *DefaultAPIHandler) ListImageDownloads(ctx context.Context, id *voltha.ID) (*voltha.ImageDownloads, error) {
166 log.Debugw("ListImageDownloads-request", log.Fields{"id": *id})
167 return nil, errors.New("UnImplemented")
168}
169
170func (handler *DefaultAPIHandler) CancelImageDownload(ctx context.Context, img *voltha.ImageDownload) (*common.OperationResp, error) {
171 log.Debugw("CancelImageDownload-request", log.Fields{"img": *img})
172 return nil, errors.New("UnImplemented")
173}
174
175func (handler *DefaultAPIHandler) ActivateImageUpdate(ctx context.Context, img *voltha.ImageDownload) (*common.OperationResp, error) {
176 log.Debugw("ActivateImageUpdate-request", log.Fields{"img": *img})
177 return nil, errors.New("UnImplemented")
178}
179
180func (handler *DefaultAPIHandler) RevertImageUpdate(ctx context.Context, img *voltha.ImageDownload) (*common.OperationResp, error) {
181 log.Debugw("RevertImageUpdate-request", log.Fields{"img": *img})
182 return nil, errors.New("UnImplemented")
183}
184
185func (handler *DefaultAPIHandler) ListDevicePorts(ctx context.Context, id *voltha.ID) (*voltha.Ports, error) {
186 log.Debugw("ListDevicePorts-request", log.Fields{"id": *id})
187 return nil, errors.New("UnImplemented")
188}
189
190func (handler *DefaultAPIHandler) ListDevicePmConfigs(ctx context.Context, id *voltha.ID) (*voltha.PmConfigs, error) {
191 log.Debugw("ListDevicePmConfigs-request", log.Fields{"id": *id})
192 return nil, errors.New("UnImplemented")
193}
194
195func (handler *DefaultAPIHandler) UpdateDevicePmConfigs(ctx context.Context, configs *voltha.PmConfigs) (*empty.Empty, error) {
196 log.Debugw("UpdateDevicePmConfigs-request", log.Fields{"configs": *configs})
197 return nil, errors.New("UnImplemented")
198}
199
200func (handler *DefaultAPIHandler) ListDeviceFlows(ctx context.Context, id *voltha.ID) (*openflow_13.Flows, error) {
201 log.Debugw("ListDeviceFlows-request", log.Fields{"id": *id})
202 return nil, errors.New("UnImplemented")
203}
204
205func (handler *DefaultAPIHandler) ListDeviceFlowGroups(ctx context.Context, id *voltha.ID) (*openflow_13.FlowGroups, error) {
206 log.Debugw("ListDeviceFlowGroups-request", log.Fields{"id": *id})
207 return nil, errors.New("UnImplemented")
208}
209
210func (handler *DefaultAPIHandler) ListDeviceTypes(ctx context.Context, empty *empty.Empty) (*voltha.DeviceTypes, error) {
211 log.Debug("ListDeviceTypes-request")
212 return nil, errors.New("UnImplemented")
213}
214
215func (handler *DefaultAPIHandler) GetDeviceType(ctx context.Context, id *voltha.ID) (*voltha.DeviceType, error) {
216 log.Debugw("GetDeviceType-request", log.Fields{"id": *id})
217 return nil, errors.New("UnImplemented")
218}
219
220func (handler *DefaultAPIHandler) ListDeviceGroups(ctx context.Context, empty *empty.Empty) (*voltha.DeviceGroups, error) {
221 log.Debug("ListDeviceGroups-request")
222 return nil, errors.New("UnImplemented")
223}
224
225func (handler *DefaultAPIHandler) GetDeviceGroup(ctx context.Context, id *voltha.ID) (*voltha.DeviceGroup, error) {
226 log.Debugw("GetDeviceGroup-request", log.Fields{"id": *id})
227 return nil, errors.New("UnImplemented")
228}
229
230func (handler *DefaultAPIHandler) CreateAlarmFilter(ctx context.Context, filter *voltha.AlarmFilter) (*voltha.AlarmFilter, error) {
231 log.Debugw("CreateAlarmFilter-request", log.Fields{"filter": *filter})
232 return nil, errors.New("UnImplemented")
233}
234
235func (handler *DefaultAPIHandler) GetAlarmFilter(ctx context.Context, id *voltha.ID) (*voltha.AlarmFilter, error) {
236 log.Debugw("GetAlarmFilter-request", log.Fields{"id": id})
237 return nil, errors.New("UnImplemented")
238}
239
240func (handler *DefaultAPIHandler) UpdateAlarmFilter(ctx context.Context, filter *voltha.AlarmFilter) (*voltha.AlarmFilter, error) {
241 log.Debugw("UpdateAlarmFilter-request", log.Fields{"filter": *filter})
242 return nil, errors.New("UnImplemented")
243}
244
245func (handler *DefaultAPIHandler) DeleteAlarmFilter(ctx context.Context, id *voltha.ID) (*empty.Empty, error) {
246 log.Debugw("DeleteAlarmFilter-request", log.Fields{"id": *id})
247 return nil, errors.New("UnImplemented")
248}
249
250func (handler *DefaultAPIHandler) ListAlarmFilters(ctx context.Context, empty *empty.Empty) (*voltha.AlarmFilters, error) {
251 log.Debug("ListAlarmFilters-request")
252 return nil, errors.New("UnImplemented")
253}
254
255func (handler *DefaultAPIHandler) GetImages(ctx context.Context, id *voltha.ID) (*voltha.Images, error) {
256 log.Debugw("GetImages-request", log.Fields{"id": id})
257 return nil, errors.New("UnImplemented")
258}
259
260func (handler *DefaultAPIHandler) SelfTest(ctx context.Context, id *voltha.ID) (*voltha.SelfTestResponse, error) {
261 log.Debugw("SelfTest-request", log.Fields{"id": id})
262 return nil, errors.New("UnImplemented")
263}