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