blob: 7d14db7ce47eea108ec1dd3b7eeb27d419360507 [file] [log] [blame]
Scott Baker2c1c4822019-10-16 11:02:41 -07001/*
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 common
17
18import (
Neha Sharma94f16a92020-06-26 04:17:55 +000019 "context"
Scott Baker2c1c4822019-10-16 11:02:41 -070020 "errors"
serkant.uluderyab38671c2019-11-01 09:35:38 -070021
Scott Baker2c1c4822019-10-16 11:02:41 -070022 "github.com/golang/protobuf/ptypes"
23 "github.com/golang/protobuf/ptypes/empty"
Girish Gowdra89c985b2020-10-14 15:02:09 -070024 "github.com/opencord/voltha-lib-go/v4/pkg/adapters"
25 "github.com/opencord/voltha-lib-go/v4/pkg/adapters/adapterif"
26 "github.com/opencord/voltha-lib-go/v4/pkg/kafka"
27 "github.com/opencord/voltha-lib-go/v4/pkg/log"
kesavand46a9f012021-01-04 16:40:36 +053028 "github.com/opencord/voltha-protos/v4/go/extension"
Girish Gowdra89c985b2020-10-14 15:02:09 -070029 ic "github.com/opencord/voltha-protos/v4/go/inter_container"
30 "github.com/opencord/voltha-protos/v4/go/openflow_13"
31 "github.com/opencord/voltha-protos/v4/go/voltha"
Scott Baker2c1c4822019-10-16 11:02:41 -070032 "google.golang.org/grpc/codes"
33 "google.golang.org/grpc/status"
34)
35
36type RequestHandlerProxy struct {
37 TestMode bool
38 coreInstanceId string
39 adapter adapters.IAdapter
40 coreProxy adapterif.CoreProxy
41}
42
43func NewRequestHandlerProxy(coreInstanceId string, iadapter adapters.IAdapter, cProxy adapterif.CoreProxy) *RequestHandlerProxy {
44 var proxy RequestHandlerProxy
45 proxy.coreInstanceId = coreInstanceId
46 proxy.adapter = iadapter
47 proxy.coreProxy = cProxy
48 return &proxy
49}
50
51func (rhp *RequestHandlerProxy) Adapter_descriptor() (*empty.Empty, error) {
52 return new(empty.Empty), nil
53}
54
55func (rhp *RequestHandlerProxy) Device_types() (*voltha.DeviceTypes, error) {
56 return nil, nil
57}
58
59func (rhp *RequestHandlerProxy) Health() (*voltha.HealthStatus, error) {
60 return nil, nil
61}
62
Neha Sharma94f16a92020-06-26 04:17:55 +000063func (rhp *RequestHandlerProxy) Adopt_device(ctx context.Context, args []*ic.Argument) (*empty.Empty, error) {
Scott Baker2c1c4822019-10-16 11:02:41 -070064 if len(args) < 3 {
Neha Sharma94f16a92020-06-26 04:17:55 +000065 logger.Warn(ctx, "invalid-number-of-args", log.Fields{"args": args})
Scott Baker2c1c4822019-10-16 11:02:41 -070066 err := errors.New("invalid-number-of-args")
67 return nil, err
68 }
69 device := &voltha.Device{}
70 transactionID := &ic.StrType{}
71 fromTopic := &ic.StrType{}
72 for _, arg := range args {
73 switch arg.Key {
74 case "device":
75 if err := ptypes.UnmarshalAny(arg.Value, device); err != nil {
Neha Sharma94f16a92020-06-26 04:17:55 +000076 logger.Warnw(ctx, "cannot-unmarshal-device", log.Fields{"error": err})
Scott Baker2c1c4822019-10-16 11:02:41 -070077 return nil, err
78 }
79 case kafka.TransactionKey:
80 if err := ptypes.UnmarshalAny(arg.Value, transactionID); err != nil {
Neha Sharma94f16a92020-06-26 04:17:55 +000081 logger.Warnw(ctx, "cannot-unmarshal-transaction-ID", log.Fields{"error": err})
Scott Baker2c1c4822019-10-16 11:02:41 -070082 return nil, err
83 }
84 case kafka.FromTopic:
85 if err := ptypes.UnmarshalAny(arg.Value, fromTopic); err != nil {
Neha Sharma94f16a92020-06-26 04:17:55 +000086 logger.Warnw(ctx, "cannot-unmarshal-from-topic", log.Fields{"error": err})
Scott Baker2c1c4822019-10-16 11:02:41 -070087 return nil, err
88 }
89 }
90 }
91
Neha Sharma94f16a92020-06-26 04:17:55 +000092 logger.Debugw(ctx, "Adopt_device", log.Fields{"deviceId": device.Id})
Scott Baker2c1c4822019-10-16 11:02:41 -070093
94 //Update the core reference for that device
95 rhp.coreProxy.UpdateCoreReference(device.Id, fromTopic.Val)
96
97 //Invoke the adopt device on the adapter
Neha Sharma94f16a92020-06-26 04:17:55 +000098 if err := rhp.adapter.Adopt_device(ctx, device); err != nil {
Scott Baker2c1c4822019-10-16 11:02:41 -070099 return nil, status.Errorf(codes.NotFound, "%s", err.Error())
100 }
101
102 return new(empty.Empty), nil
103}
104
Neha Sharma94f16a92020-06-26 04:17:55 +0000105func (rhp *RequestHandlerProxy) Reconcile_device(ctx context.Context, args []*ic.Argument) (*empty.Empty, error) {
Scott Baker2c1c4822019-10-16 11:02:41 -0700106 if len(args) < 3 {
Neha Sharma94f16a92020-06-26 04:17:55 +0000107 logger.Warn(ctx, "invalid-number-of-args", log.Fields{"args": args})
Scott Baker2c1c4822019-10-16 11:02:41 -0700108 err := errors.New("invalid-number-of-args")
109 return nil, err
110 }
111
112 device := &voltha.Device{}
113 transactionID := &ic.StrType{}
114 fromTopic := &ic.StrType{}
115 for _, arg := range args {
116 switch arg.Key {
117 case "device":
118 if err := ptypes.UnmarshalAny(arg.Value, device); err != nil {
Neha Sharma94f16a92020-06-26 04:17:55 +0000119 logger.Warnw(ctx, "cannot-unmarshal-device", log.Fields{"error": err})
Scott Baker2c1c4822019-10-16 11:02:41 -0700120 return nil, err
121 }
122 case kafka.TransactionKey:
123 if err := ptypes.UnmarshalAny(arg.Value, transactionID); err != nil {
Neha Sharma94f16a92020-06-26 04:17:55 +0000124 logger.Warnw(ctx, "cannot-unmarshal-transaction-ID", log.Fields{"error": err})
Scott Baker2c1c4822019-10-16 11:02:41 -0700125 return nil, err
126 }
127 case kafka.FromTopic:
128 if err := ptypes.UnmarshalAny(arg.Value, fromTopic); err != nil {
Neha Sharma94f16a92020-06-26 04:17:55 +0000129 logger.Warnw(ctx, "cannot-unmarshal-from-topic", log.Fields{"error": err})
Scott Baker2c1c4822019-10-16 11:02:41 -0700130 return nil, err
131 }
132 }
133 }
134 //Update the core reference for that device
135 rhp.coreProxy.UpdateCoreReference(device.Id, fromTopic.Val)
136
137 //Invoke the reconcile device API on the adapter
Neha Sharma94f16a92020-06-26 04:17:55 +0000138 if err := rhp.adapter.Reconcile_device(ctx, device); err != nil {
Scott Baker2c1c4822019-10-16 11:02:41 -0700139 return nil, status.Errorf(codes.NotFound, "%s", err.Error())
140 }
141 return new(empty.Empty), nil
142}
143
144func (rhp *RequestHandlerProxy) Abandon_device(args []*ic.Argument) (*empty.Empty, error) {
145 return new(empty.Empty), nil
146}
147
Neha Sharma94f16a92020-06-26 04:17:55 +0000148func (rhp *RequestHandlerProxy) Disable_device(ctx context.Context, args []*ic.Argument) (*empty.Empty, error) {
Scott Baker2c1c4822019-10-16 11:02:41 -0700149 if len(args) < 3 {
Neha Sharma94f16a92020-06-26 04:17:55 +0000150 logger.Warn(ctx, "invalid-number-of-args", log.Fields{"args": args})
Scott Baker2c1c4822019-10-16 11:02:41 -0700151 err := errors.New("invalid-number-of-args")
152 return nil, err
153 }
154
155 device := &voltha.Device{}
156 transactionID := &ic.StrType{}
157 fromTopic := &ic.StrType{}
158 for _, arg := range args {
159 switch arg.Key {
160 case "device":
161 if err := ptypes.UnmarshalAny(arg.Value, device); err != nil {
Neha Sharma94f16a92020-06-26 04:17:55 +0000162 logger.Warnw(ctx, "cannot-unmarshal-device", log.Fields{"error": err})
Scott Baker2c1c4822019-10-16 11:02:41 -0700163 return nil, err
164 }
165 case kafka.TransactionKey:
166 if err := ptypes.UnmarshalAny(arg.Value, transactionID); err != nil {
Neha Sharma94f16a92020-06-26 04:17:55 +0000167 logger.Warnw(ctx, "cannot-unmarshal-transaction-ID", log.Fields{"error": err})
Scott Baker2c1c4822019-10-16 11:02:41 -0700168 return nil, err
169 }
170 case kafka.FromTopic:
171 if err := ptypes.UnmarshalAny(arg.Value, fromTopic); err != nil {
Neha Sharma94f16a92020-06-26 04:17:55 +0000172 logger.Warnw(ctx, "cannot-unmarshal-from-topic", log.Fields{"error": err})
Scott Baker2c1c4822019-10-16 11:02:41 -0700173 return nil, err
174 }
175 }
176 }
177 //Update the core reference for that device
178 rhp.coreProxy.UpdateCoreReference(device.Id, fromTopic.Val)
179 //Invoke the Disable_device API on the adapter
Neha Sharma94f16a92020-06-26 04:17:55 +0000180 if err := rhp.adapter.Disable_device(ctx, device); err != nil {
Scott Baker2c1c4822019-10-16 11:02:41 -0700181 return nil, status.Errorf(codes.NotFound, "%s", err.Error())
182 }
183 return new(empty.Empty), nil
184}
185
Neha Sharma94f16a92020-06-26 04:17:55 +0000186func (rhp *RequestHandlerProxy) Reenable_device(ctx context.Context, args []*ic.Argument) (*empty.Empty, error) {
Scott Baker2c1c4822019-10-16 11:02:41 -0700187 if len(args) < 3 {
Neha Sharma94f16a92020-06-26 04:17:55 +0000188 logger.Warn(ctx, "invalid-number-of-args", log.Fields{"args": args})
Scott Baker2c1c4822019-10-16 11:02:41 -0700189 err := errors.New("invalid-number-of-args")
190 return nil, err
191 }
192
193 device := &voltha.Device{}
194 transactionID := &ic.StrType{}
195 fromTopic := &ic.StrType{}
196 for _, arg := range args {
197 switch arg.Key {
198 case "device":
199 if err := ptypes.UnmarshalAny(arg.Value, device); err != nil {
Neha Sharma94f16a92020-06-26 04:17:55 +0000200 logger.Warnw(ctx, "cannot-unmarshal-device", log.Fields{"error": err})
Scott Baker2c1c4822019-10-16 11:02:41 -0700201 return nil, err
202 }
203 case kafka.TransactionKey:
204 if err := ptypes.UnmarshalAny(arg.Value, transactionID); err != nil {
Neha Sharma94f16a92020-06-26 04:17:55 +0000205 logger.Warnw(ctx, "cannot-unmarshal-transaction-ID", log.Fields{"error": err})
Scott Baker2c1c4822019-10-16 11:02:41 -0700206 return nil, err
207 }
208 case kafka.FromTopic:
209 if err := ptypes.UnmarshalAny(arg.Value, fromTopic); err != nil {
Neha Sharma94f16a92020-06-26 04:17:55 +0000210 logger.Warnw(ctx, "cannot-unmarshal-from-topic", log.Fields{"error": err})
Scott Baker2c1c4822019-10-16 11:02:41 -0700211 return nil, err
212 }
213 }
214 }
215 //Update the core reference for that device
216 rhp.coreProxy.UpdateCoreReference(device.Id, fromTopic.Val)
217 //Invoke the Reenable_device API on the adapter
Neha Sharma94f16a92020-06-26 04:17:55 +0000218 if err := rhp.adapter.Reenable_device(ctx, device); err != nil {
Scott Baker2c1c4822019-10-16 11:02:41 -0700219 return nil, status.Errorf(codes.NotFound, "%s", err.Error())
220 }
221 return new(empty.Empty), nil
222}
223
Neha Sharma94f16a92020-06-26 04:17:55 +0000224func (rhp *RequestHandlerProxy) Reboot_device(ctx context.Context, args []*ic.Argument) (*empty.Empty, error) {
Scott Baker2c1c4822019-10-16 11:02:41 -0700225 if len(args) < 3 {
Neha Sharma94f16a92020-06-26 04:17:55 +0000226 logger.Warn(ctx, "invalid-number-of-args", log.Fields{"args": args})
Scott Baker2c1c4822019-10-16 11:02:41 -0700227 err := errors.New("invalid-number-of-args")
228 return nil, err
229 }
230
231 device := &voltha.Device{}
232 transactionID := &ic.StrType{}
233 fromTopic := &ic.StrType{}
234 for _, arg := range args {
235 switch arg.Key {
236 case "device":
237 if err := ptypes.UnmarshalAny(arg.Value, device); err != nil {
Neha Sharma94f16a92020-06-26 04:17:55 +0000238 logger.Warnw(ctx, "cannot-unmarshal-device", log.Fields{"error": err})
Scott Baker2c1c4822019-10-16 11:02:41 -0700239 return nil, err
240 }
241 case kafka.TransactionKey:
242 if err := ptypes.UnmarshalAny(arg.Value, transactionID); err != nil {
Neha Sharma94f16a92020-06-26 04:17:55 +0000243 logger.Warnw(ctx, "cannot-unmarshal-transaction-ID", log.Fields{"error": err})
Scott Baker2c1c4822019-10-16 11:02:41 -0700244 return nil, err
245 }
246 case kafka.FromTopic:
247 if err := ptypes.UnmarshalAny(arg.Value, fromTopic); err != nil {
Neha Sharma94f16a92020-06-26 04:17:55 +0000248 logger.Warnw(ctx, "cannot-unmarshal-from-topic", log.Fields{"error": err})
Scott Baker2c1c4822019-10-16 11:02:41 -0700249 return nil, err
250 }
251 }
252 }
253 //Update the core reference for that device
254 rhp.coreProxy.UpdateCoreReference(device.Id, fromTopic.Val)
255 //Invoke the Reboot_device API on the adapter
Neha Sharma94f16a92020-06-26 04:17:55 +0000256 if err := rhp.adapter.Reboot_device(ctx, device); err != nil {
Scott Baker2c1c4822019-10-16 11:02:41 -0700257 return nil, status.Errorf(codes.NotFound, "%s", err.Error())
258 }
259 return new(empty.Empty), nil
260
261}
262
263func (rhp *RequestHandlerProxy) Self_test_device(args []*ic.Argument) (*empty.Empty, error) {
264 return new(empty.Empty), nil
265}
266
Neha Sharma94f16a92020-06-26 04:17:55 +0000267func (rhp *RequestHandlerProxy) Delete_device(ctx context.Context, args []*ic.Argument) (*empty.Empty, error) {
Scott Baker2c1c4822019-10-16 11:02:41 -0700268 if len(args) < 3 {
Neha Sharma94f16a92020-06-26 04:17:55 +0000269 logger.Warn(ctx, "invalid-number-of-args", log.Fields{"args": args})
Scott Baker2c1c4822019-10-16 11:02:41 -0700270 err := errors.New("invalid-number-of-args")
271 return nil, err
272 }
273
274 device := &voltha.Device{}
275 transactionID := &ic.StrType{}
276 fromTopic := &ic.StrType{}
277 for _, arg := range args {
278 switch arg.Key {
279 case "device":
280 if err := ptypes.UnmarshalAny(arg.Value, device); err != nil {
Neha Sharma94f16a92020-06-26 04:17:55 +0000281 logger.Warnw(ctx, "cannot-unmarshal-device", log.Fields{"error": err})
Scott Baker2c1c4822019-10-16 11:02:41 -0700282 return nil, err
283 }
284 case kafka.TransactionKey:
285 if err := ptypes.UnmarshalAny(arg.Value, transactionID); err != nil {
Neha Sharma94f16a92020-06-26 04:17:55 +0000286 logger.Warnw(ctx, "cannot-unmarshal-transaction-ID", log.Fields{"error": err})
Scott Baker2c1c4822019-10-16 11:02:41 -0700287 return nil, err
288 }
289 case kafka.FromTopic:
290 if err := ptypes.UnmarshalAny(arg.Value, fromTopic); err != nil {
Neha Sharma94f16a92020-06-26 04:17:55 +0000291 logger.Warnw(ctx, "cannot-unmarshal-from-topic", log.Fields{"error": err})
Scott Baker2c1c4822019-10-16 11:02:41 -0700292 return nil, err
293 }
294 }
295 }
296 //Update the core reference for that device
297 rhp.coreProxy.UpdateCoreReference(device.Id, fromTopic.Val)
298 //Invoke the delete_device API on the adapter
Neha Sharma94f16a92020-06-26 04:17:55 +0000299 if err := rhp.adapter.Delete_device(ctx, device); err != nil {
Scott Baker2c1c4822019-10-16 11:02:41 -0700300 return nil, status.Errorf(codes.NotFound, "%s", err.Error())
301 }
302 return new(empty.Empty), nil
303}
304
305func (rhp *RequestHandlerProxy) Get_device_details(args []*ic.Argument) (*empty.Empty, error) {
306 return new(empty.Empty), nil
307}
308
Neha Sharma94f16a92020-06-26 04:17:55 +0000309func (rhp *RequestHandlerProxy) Update_flows_bulk(ctx context.Context, args []*ic.Argument) (*empty.Empty, error) {
310 logger.Debug(ctx, "Update_flows_bulk")
Scott Baker2c1c4822019-10-16 11:02:41 -0700311 if len(args) < 5 {
Neha Sharma94f16a92020-06-26 04:17:55 +0000312 logger.Warn(ctx, "Update_flows_bulk-invalid-number-of-args", log.Fields{"args": args})
Scott Baker2c1c4822019-10-16 11:02:41 -0700313 err := errors.New("invalid-number-of-args")
314 return nil, err
315 }
316 device := &voltha.Device{}
317 transactionID := &ic.StrType{}
318 flows := &voltha.Flows{}
319 flowMetadata := &voltha.FlowMetadata{}
320 groups := &voltha.FlowGroups{}
321 for _, arg := range args {
322 switch arg.Key {
323 case "device":
324 if err := ptypes.UnmarshalAny(arg.Value, device); err != nil {
Neha Sharma94f16a92020-06-26 04:17:55 +0000325 logger.Warnw(ctx, "cannot-unmarshal-device", log.Fields{"error": err})
Scott Baker2c1c4822019-10-16 11:02:41 -0700326 return nil, err
327 }
328 case "flows":
329 if err := ptypes.UnmarshalAny(arg.Value, flows); err != nil {
Neha Sharma94f16a92020-06-26 04:17:55 +0000330 logger.Warnw(ctx, "cannot-unmarshal-flows", log.Fields{"error": err})
Scott Baker2c1c4822019-10-16 11:02:41 -0700331 return nil, err
332 }
333 case "groups":
334 if err := ptypes.UnmarshalAny(arg.Value, groups); err != nil {
Neha Sharma94f16a92020-06-26 04:17:55 +0000335 logger.Warnw(ctx, "cannot-unmarshal-groups", log.Fields{"error": err})
Scott Baker2c1c4822019-10-16 11:02:41 -0700336 return nil, err
337 }
338 case "flow_metadata":
339 if err := ptypes.UnmarshalAny(arg.Value, flowMetadata); err != nil {
Neha Sharma94f16a92020-06-26 04:17:55 +0000340 logger.Warnw(ctx, "cannot-unmarshal-metadata", log.Fields{"error": err})
Scott Baker2c1c4822019-10-16 11:02:41 -0700341 return nil, err
342 }
343 case kafka.TransactionKey:
344 if err := ptypes.UnmarshalAny(arg.Value, transactionID); err != nil {
Neha Sharma94f16a92020-06-26 04:17:55 +0000345 logger.Warnw(ctx, "cannot-unmarshal-transaction-ID", log.Fields{"error": err})
Scott Baker2c1c4822019-10-16 11:02:41 -0700346 return nil, err
347 }
348 }
349 }
Neha Sharma94f16a92020-06-26 04:17:55 +0000350 logger.Debugw(ctx, "Update_flows_bulk", log.Fields{"flows": flows, "groups": groups})
Scott Baker2c1c4822019-10-16 11:02:41 -0700351 //Invoke the bulk flow update API of the adapter
Neha Sharma94f16a92020-06-26 04:17:55 +0000352 if err := rhp.adapter.Update_flows_bulk(ctx, device, flows, groups, flowMetadata); err != nil {
Scott Baker2c1c4822019-10-16 11:02:41 -0700353 return nil, status.Errorf(codes.NotFound, "%s", err.Error())
354 }
355 return new(empty.Empty), nil
356}
357
Neha Sharma94f16a92020-06-26 04:17:55 +0000358func (rhp *RequestHandlerProxy) Update_flows_incrementally(ctx context.Context, args []*ic.Argument) (*empty.Empty, error) {
359 logger.Debug(ctx, "Update_flows_incrementally")
Scott Baker2c1c4822019-10-16 11:02:41 -0700360 if len(args) < 5 {
Neha Sharma94f16a92020-06-26 04:17:55 +0000361 logger.Warn(ctx, "Update_flows_incrementally-invalid-number-of-args", log.Fields{"args": args})
Scott Baker2c1c4822019-10-16 11:02:41 -0700362 err := errors.New("invalid-number-of-args")
363 return nil, err
364 }
365 device := &voltha.Device{}
366 transactionID := &ic.StrType{}
367 flows := &openflow_13.FlowChanges{}
368 flowMetadata := &voltha.FlowMetadata{}
369 groups := &openflow_13.FlowGroupChanges{}
370 for _, arg := range args {
371 switch arg.Key {
372 case "device":
373 if err := ptypes.UnmarshalAny(arg.Value, device); err != nil {
Neha Sharma94f16a92020-06-26 04:17:55 +0000374 logger.Warnw(ctx, "cannot-unmarshal-device", log.Fields{"error": err})
Scott Baker2c1c4822019-10-16 11:02:41 -0700375 return nil, err
376 }
377 case "flow_changes":
378 if err := ptypes.UnmarshalAny(arg.Value, flows); err != nil {
Neha Sharma94f16a92020-06-26 04:17:55 +0000379 logger.Warnw(ctx, "cannot-unmarshal-flows", log.Fields{"error": err})
Scott Baker2c1c4822019-10-16 11:02:41 -0700380 return nil, err
381 }
382 case "group_changes":
383 if err := ptypes.UnmarshalAny(arg.Value, groups); err != nil {
Neha Sharma94f16a92020-06-26 04:17:55 +0000384 logger.Warnw(ctx, "cannot-unmarshal-groups", log.Fields{"error": err})
Scott Baker2c1c4822019-10-16 11:02:41 -0700385 return nil, err
386 }
387 case "flow_metadata":
388 if err := ptypes.UnmarshalAny(arg.Value, flowMetadata); err != nil {
Neha Sharma94f16a92020-06-26 04:17:55 +0000389 logger.Warnw(ctx, "cannot-unmarshal-metadata", log.Fields{"error": err})
Scott Baker2c1c4822019-10-16 11:02:41 -0700390 return nil, err
391 }
392 case kafka.TransactionKey:
393 if err := ptypes.UnmarshalAny(arg.Value, transactionID); err != nil {
Neha Sharma94f16a92020-06-26 04:17:55 +0000394 logger.Warnw(ctx, "cannot-unmarshal-transaction-ID", log.Fields{"error": err})
Scott Baker2c1c4822019-10-16 11:02:41 -0700395 return nil, err
396 }
397 }
398 }
Neha Sharma94f16a92020-06-26 04:17:55 +0000399 logger.Debugw(ctx, "Update_flows_incrementally", log.Fields{"flows": flows, "groups": groups})
Scott Baker2c1c4822019-10-16 11:02:41 -0700400 //Invoke the incremental flow update API of the adapter
Neha Sharma94f16a92020-06-26 04:17:55 +0000401 if err := rhp.adapter.Update_flows_incrementally(ctx, device, flows, groups, flowMetadata); err != nil {
Scott Baker2c1c4822019-10-16 11:02:41 -0700402 return nil, status.Errorf(codes.NotFound, "%s", err.Error())
403 }
404 return new(empty.Empty), nil
405}
406
Neha Sharma94f16a92020-06-26 04:17:55 +0000407func (rhp *RequestHandlerProxy) Update_pm_config(ctx context.Context, args []*ic.Argument) (*empty.Empty, error) {
408 logger.Debug(ctx, "Update_pm_config")
Scott Baker2c1c4822019-10-16 11:02:41 -0700409 if len(args) < 2 {
Neha Sharma94f16a92020-06-26 04:17:55 +0000410 logger.Warn(ctx, "Update_pm_config-invalid-number-of-args", log.Fields{"args": args})
Scott Baker2c1c4822019-10-16 11:02:41 -0700411 err := errors.New("invalid-number-of-args")
412 return nil, err
413 }
414 device := &voltha.Device{}
415 transactionID := &ic.StrType{}
416 pmConfigs := &voltha.PmConfigs{}
417 for _, arg := range args {
418 switch arg.Key {
419 case "device":
420 if err := ptypes.UnmarshalAny(arg.Value, device); err != nil {
Neha Sharma94f16a92020-06-26 04:17:55 +0000421 logger.Warnw(ctx, "cannot-unmarshal-device", log.Fields{"error": err})
Scott Baker2c1c4822019-10-16 11:02:41 -0700422 return nil, err
423 }
424 case "pm_configs":
425 if err := ptypes.UnmarshalAny(arg.Value, pmConfigs); err != nil {
Neha Sharma94f16a92020-06-26 04:17:55 +0000426 logger.Warnw(ctx, "cannot-unmarshal-pm-configs", log.Fields{"error": err})
Scott Baker2c1c4822019-10-16 11:02:41 -0700427 return nil, err
428 }
429 case kafka.TransactionKey:
430 if err := ptypes.UnmarshalAny(arg.Value, transactionID); err != nil {
Neha Sharma94f16a92020-06-26 04:17:55 +0000431 logger.Warnw(ctx, "cannot-unmarshal-transaction-ID", log.Fields{"error": err})
Scott Baker2c1c4822019-10-16 11:02:41 -0700432 return nil, err
433 }
434 }
435 }
divyadesai5d8836b2020-08-18 07:40:59 +0000436 logger.Debugw(ctx, "Update_pm_config", log.Fields{"device-id": device.Id, "pmConfigs": pmConfigs})
Scott Baker2c1c4822019-10-16 11:02:41 -0700437 //Invoke the pm config update API of the adapter
Neha Sharma94f16a92020-06-26 04:17:55 +0000438 if err := rhp.adapter.Update_pm_config(ctx, device, pmConfigs); err != nil {
Scott Baker2c1c4822019-10-16 11:02:41 -0700439 return nil, status.Errorf(codes.NotFound, "%s", err.Error())
440 }
441 return new(empty.Empty), nil
442}
443
Neha Sharma94f16a92020-06-26 04:17:55 +0000444func (rhp *RequestHandlerProxy) Receive_packet_out(ctx context.Context, args []*ic.Argument) (*empty.Empty, error) {
445 logger.Debugw(ctx, "Receive_packet_out", log.Fields{"args": args})
Scott Baker2c1c4822019-10-16 11:02:41 -0700446 if len(args) < 3 {
Neha Sharma94f16a92020-06-26 04:17:55 +0000447 logger.Warn(ctx, "Receive_packet_out-invalid-number-of-args", log.Fields{"args": args})
Scott Baker2c1c4822019-10-16 11:02:41 -0700448 err := errors.New("invalid-number-of-args")
449 return nil, err
450 }
451 deviceId := &ic.StrType{}
452 egressPort := &ic.IntType{}
453 packet := &openflow_13.OfpPacketOut{}
454 transactionID := &ic.StrType{}
455 for _, arg := range args {
456 switch arg.Key {
457 case "deviceId":
458 if err := ptypes.UnmarshalAny(arg.Value, deviceId); err != nil {
divyadesai5d8836b2020-08-18 07:40:59 +0000459 logger.Warnw(ctx, "cannot-unmarshal-device-id", log.Fields{"error": err})
Scott Baker2c1c4822019-10-16 11:02:41 -0700460 return nil, err
461 }
462 case "outPort":
463 if err := ptypes.UnmarshalAny(arg.Value, egressPort); err != nil {
Neha Sharma94f16a92020-06-26 04:17:55 +0000464 logger.Warnw(ctx, "cannot-unmarshal-egressPort", log.Fields{"error": err})
Scott Baker2c1c4822019-10-16 11:02:41 -0700465 return nil, err
466 }
467 case "packet":
468 if err := ptypes.UnmarshalAny(arg.Value, packet); err != nil {
Neha Sharma94f16a92020-06-26 04:17:55 +0000469 logger.Warnw(ctx, "cannot-unmarshal-packet", log.Fields{"error": err})
Scott Baker2c1c4822019-10-16 11:02:41 -0700470 return nil, err
471 }
472 case kafka.TransactionKey:
473 if err := ptypes.UnmarshalAny(arg.Value, transactionID); err != nil {
Neha Sharma94f16a92020-06-26 04:17:55 +0000474 logger.Warnw(ctx, "cannot-unmarshal-transaction-ID", log.Fields{"error": err})
Scott Baker2c1c4822019-10-16 11:02:41 -0700475 return nil, err
476 }
477 }
478 }
divyadesai5d8836b2020-08-18 07:40:59 +0000479 logger.Debugw(ctx, "Receive_packet_out", log.Fields{"device-id": deviceId.Val, "outPort": egressPort, "packet": packet})
Scott Baker2c1c4822019-10-16 11:02:41 -0700480 //Invoke the adopt device on the adapter
Neha Sharma94f16a92020-06-26 04:17:55 +0000481 if err := rhp.adapter.Receive_packet_out(ctx, deviceId.Val, int(egressPort.Val), packet); err != nil {
Scott Baker2c1c4822019-10-16 11:02:41 -0700482 return nil, status.Errorf(codes.NotFound, "%s", err.Error())
483 }
484 return new(empty.Empty), nil
485}
486
487func (rhp *RequestHandlerProxy) Suppress_alarm(args []*ic.Argument) (*empty.Empty, error) {
488 return new(empty.Empty), nil
489}
490
491func (rhp *RequestHandlerProxy) Unsuppress_alarm(args []*ic.Argument) (*empty.Empty, error) {
492 return new(empty.Empty), nil
493}
494
Neha Sharma94f16a92020-06-26 04:17:55 +0000495func (rhp *RequestHandlerProxy) Get_ofp_device_info(ctx context.Context, args []*ic.Argument) (*ic.SwitchCapability, error) {
Scott Baker2c1c4822019-10-16 11:02:41 -0700496 if len(args) < 2 {
Neha Sharma94f16a92020-06-26 04:17:55 +0000497 logger.Warn(ctx, "invalid-number-of-args", log.Fields{"args": args})
Scott Baker2c1c4822019-10-16 11:02:41 -0700498 err := errors.New("invalid-number-of-args")
499 return nil, err
500 }
501 device := &voltha.Device{}
502 transactionID := &ic.StrType{}
503 for _, arg := range args {
504 switch arg.Key {
505 case "device":
506 if err := ptypes.UnmarshalAny(arg.Value, device); err != nil {
Neha Sharma94f16a92020-06-26 04:17:55 +0000507 logger.Warnw(ctx, "cannot-unmarshal-device", log.Fields{"error": err})
Scott Baker2c1c4822019-10-16 11:02:41 -0700508 return nil, err
509 }
510 case kafka.TransactionKey:
511 if err := ptypes.UnmarshalAny(arg.Value, transactionID); err != nil {
Neha Sharma94f16a92020-06-26 04:17:55 +0000512 logger.Warnw(ctx, "cannot-unmarshal-transaction-ID", log.Fields{"error": err})
Scott Baker2c1c4822019-10-16 11:02:41 -0700513 return nil, err
514 }
515 }
516 }
517
divyadesai5d8836b2020-08-18 07:40:59 +0000518 logger.Debugw(ctx, "Get_ofp_device_info", log.Fields{"device-id": device.Id})
Scott Baker2c1c4822019-10-16 11:02:41 -0700519
520 var cap *ic.SwitchCapability
521 var err error
Neha Sharma94f16a92020-06-26 04:17:55 +0000522 if cap, err = rhp.adapter.Get_ofp_device_info(ctx, device); err != nil {
Scott Baker2c1c4822019-10-16 11:02:41 -0700523 return nil, status.Errorf(codes.NotFound, "%s", err.Error())
524 }
Neha Sharma94f16a92020-06-26 04:17:55 +0000525 logger.Debugw(ctx, "Get_ofp_device_info", log.Fields{"cap": cap})
Scott Baker2c1c4822019-10-16 11:02:41 -0700526 return cap, nil
527}
528
Neha Sharma94f16a92020-06-26 04:17:55 +0000529func (rhp *RequestHandlerProxy) Process_inter_adapter_message(ctx context.Context, args []*ic.Argument) (*empty.Empty, error) {
Scott Baker2c1c4822019-10-16 11:02:41 -0700530 if len(args) < 2 {
Neha Sharma94f16a92020-06-26 04:17:55 +0000531 logger.Warn(ctx, "invalid-number-of-args", log.Fields{"args": args})
Scott Baker2c1c4822019-10-16 11:02:41 -0700532 err := errors.New("invalid-number-of-args")
533 return nil, err
534 }
535 iaMsg := &ic.InterAdapterMessage{}
536 transactionID := &ic.StrType{}
537 for _, arg := range args {
538 switch arg.Key {
539 case "msg":
540 if err := ptypes.UnmarshalAny(arg.Value, iaMsg); err != nil {
Neha Sharma94f16a92020-06-26 04:17:55 +0000541 logger.Warnw(ctx, "cannot-unmarshal-device", log.Fields{"error": err})
Scott Baker2c1c4822019-10-16 11:02:41 -0700542 return nil, err
543 }
544 case kafka.TransactionKey:
545 if err := ptypes.UnmarshalAny(arg.Value, transactionID); err != nil {
Neha Sharma94f16a92020-06-26 04:17:55 +0000546 logger.Warnw(ctx, "cannot-unmarshal-transaction-ID", log.Fields{"error": err})
Scott Baker2c1c4822019-10-16 11:02:41 -0700547 return nil, err
548 }
549 }
550 }
551
Neha Sharma94f16a92020-06-26 04:17:55 +0000552 logger.Debugw(ctx, "Process_inter_adapter_message", log.Fields{"msgId": iaMsg.Header.Id})
Scott Baker2c1c4822019-10-16 11:02:41 -0700553
554 //Invoke the inter adapter API on the handler
Neha Sharma94f16a92020-06-26 04:17:55 +0000555 if err := rhp.adapter.Process_inter_adapter_message(ctx, iaMsg); err != nil {
Scott Baker2c1c4822019-10-16 11:02:41 -0700556 return nil, status.Errorf(codes.NotFound, "%s", err.Error())
557 }
558
559 return new(empty.Empty), nil
560}
561
562func (rhp *RequestHandlerProxy) Download_image(args []*ic.Argument) (*voltha.ImageDownload, error) {
563 return &voltha.ImageDownload{}, nil
564}
565
566func (rhp *RequestHandlerProxy) Get_image_download_status(args []*ic.Argument) (*voltha.ImageDownload, error) {
567 return &voltha.ImageDownload{}, nil
568}
569
570func (rhp *RequestHandlerProxy) Cancel_image_download(args []*ic.Argument) (*voltha.ImageDownload, error) {
571 return &voltha.ImageDownload{}, nil
572}
573
574func (rhp *RequestHandlerProxy) Activate_image_update(args []*ic.Argument) (*voltha.ImageDownload, error) {
575 return &voltha.ImageDownload{}, nil
576}
577
578func (rhp *RequestHandlerProxy) Revert_image_update(args []*ic.Argument) (*voltha.ImageDownload, error) {
579 return &voltha.ImageDownload{}, nil
580}
kesavandf17f7922020-02-03 17:00:27 -0500581
Neha Sharma94f16a92020-06-26 04:17:55 +0000582func (rhp *RequestHandlerProxy) Enable_port(ctx context.Context, args []*ic.Argument) error {
583 logger.Debugw(ctx, "enable_port", log.Fields{"args": args})
584 deviceId, port, err := rhp.getEnableDisableParams(ctx, args)
kesavandf17f7922020-02-03 17:00:27 -0500585 if err != nil {
divyadesai5d8836b2020-08-18 07:40:59 +0000586 logger.Warnw(ctx, "enable_port", log.Fields{"args": args, "device-id": deviceId, "port": port})
kesavandf17f7922020-02-03 17:00:27 -0500587 return err
588 }
Neha Sharma94f16a92020-06-26 04:17:55 +0000589 return rhp.adapter.Enable_port(ctx, deviceId, port)
kesavandf17f7922020-02-03 17:00:27 -0500590}
591
Neha Sharma94f16a92020-06-26 04:17:55 +0000592func (rhp *RequestHandlerProxy) Disable_port(ctx context.Context, args []*ic.Argument) error {
593 logger.Debugw(ctx, "disable_port", log.Fields{"args": args})
594 deviceId, port, err := rhp.getEnableDisableParams(ctx, args)
kesavandf17f7922020-02-03 17:00:27 -0500595 if err != nil {
divyadesai5d8836b2020-08-18 07:40:59 +0000596 logger.Warnw(ctx, "disable_port", log.Fields{"args": args, "device-id": deviceId, "port": port})
kesavandf17f7922020-02-03 17:00:27 -0500597 return err
598 }
Neha Sharma94f16a92020-06-26 04:17:55 +0000599 return rhp.adapter.Disable_port(ctx, deviceId, port)
kesavandf17f7922020-02-03 17:00:27 -0500600}
601
Neha Sharma94f16a92020-06-26 04:17:55 +0000602func (rhp *RequestHandlerProxy) getEnableDisableParams(ctx context.Context, args []*ic.Argument) (string, *voltha.Port, error) {
603 logger.Debugw(ctx, "getEnableDisableParams", log.Fields{"args": args})
kesavandf17f7922020-02-03 17:00:27 -0500604 if len(args) < 3 {
Neha Sharma94f16a92020-06-26 04:17:55 +0000605 logger.Warn(ctx, "invalid-number-of-args", log.Fields{"args": args})
kesavandf17f7922020-02-03 17:00:27 -0500606 return "", nil, errors.New("invalid-number-of-args")
607 }
608 deviceId := &ic.StrType{}
609 port := &voltha.Port{}
610 for _, arg := range args {
611 switch arg.Key {
612 case "deviceId":
613 if err := ptypes.UnmarshalAny(arg.Value, deviceId); err != nil {
Neha Sharma94f16a92020-06-26 04:17:55 +0000614 logger.Warnw(ctx, "cannot-unmarshal-device", log.Fields{"error": err})
kesavandf17f7922020-02-03 17:00:27 -0500615 return "", nil, err
616 }
617 case "port":
618 if err := ptypes.UnmarshalAny(arg.Value, port); err != nil {
Neha Sharma94f16a92020-06-26 04:17:55 +0000619 logger.Warnw(ctx, "cannot-unmarshal-port", log.Fields{"error": err})
kesavandf17f7922020-02-03 17:00:27 -0500620 return "", nil, err
621 }
622 }
623 }
624 return deviceId.Val, port, nil
625}
Chaitrashree G Sc4a5c072020-02-04 17:08:40 -0500626
Neha Sharma94f16a92020-06-26 04:17:55 +0000627func (rhp *RequestHandlerProxy) Child_device_lost(ctx context.Context, args []*ic.Argument) error {
Chaitrashree G Sc4a5c072020-02-04 17:08:40 -0500628 if len(args) < 4 {
Neha Sharma94f16a92020-06-26 04:17:55 +0000629 logger.Warn(ctx, "invalid-number-of-args", log.Fields{"args": args})
Chaitrashree G Sc4a5c072020-02-04 17:08:40 -0500630 return errors.New("invalid-number-of-args")
631 }
632
633 pDeviceId := &ic.StrType{}
634 pPortNo := &ic.IntType{}
635 onuID := &ic.IntType{}
636 fromTopic := &ic.StrType{}
637 for _, arg := range args {
638 switch arg.Key {
639 case "pDeviceId":
640 if err := ptypes.UnmarshalAny(arg.Value, pDeviceId); err != nil {
Neha Sharma94f16a92020-06-26 04:17:55 +0000641 logger.Warnw(ctx, "cannot-unmarshal-parent-deviceId", log.Fields{"error": err})
Chaitrashree G Sc4a5c072020-02-04 17:08:40 -0500642 return err
643 }
644 case "pPortNo":
645 if err := ptypes.UnmarshalAny(arg.Value, pPortNo); err != nil {
Neha Sharma94f16a92020-06-26 04:17:55 +0000646 logger.Warnw(ctx, "cannot-unmarshal-port", log.Fields{"error": err})
Chaitrashree G Sc4a5c072020-02-04 17:08:40 -0500647 return err
648 }
649 case "onuID":
650 if err := ptypes.UnmarshalAny(arg.Value, onuID); err != nil {
Neha Sharma94f16a92020-06-26 04:17:55 +0000651 logger.Warnw(ctx, "cannot-unmarshal-transaction-ID", log.Fields{"error": err})
Chaitrashree G Sc4a5c072020-02-04 17:08:40 -0500652 return err
653 }
654 case kafka.FromTopic:
655 if err := ptypes.UnmarshalAny(arg.Value, fromTopic); err != nil {
Neha Sharma94f16a92020-06-26 04:17:55 +0000656 logger.Warnw(ctx, "cannot-unmarshal-from-topic", log.Fields{"error": err})
Chaitrashree G Sc4a5c072020-02-04 17:08:40 -0500657 return err
658 }
659 }
660 }
661 //Update the core reference for that device
662 rhp.coreProxy.UpdateCoreReference(pDeviceId.Val, fromTopic.Val)
663 //Invoke the Child_device_lost API on the adapter
Neha Sharma94f16a92020-06-26 04:17:55 +0000664 if err := rhp.adapter.Child_device_lost(ctx, pDeviceId.Val, uint32(pPortNo.Val), uint32(onuID.Val)); err != nil {
Chaitrashree G Sc4a5c072020-02-04 17:08:40 -0500665 return status.Errorf(codes.NotFound, "%s", err.Error())
666 }
667 return nil
668}
Scott Baker04cb5da2020-03-26 15:52:22 -0700669
Neha Sharma94f16a92020-06-26 04:17:55 +0000670func (rhp *RequestHandlerProxy) Start_omci_test(ctx context.Context, args []*ic.Argument) (*ic.TestResponse, error) {
Scott Baker04cb5da2020-03-26 15:52:22 -0700671 if len(args) < 2 {
Neha Sharma94f16a92020-06-26 04:17:55 +0000672 logger.Warn(ctx, "invalid-number-of-args", log.Fields{"args": args})
Scott Baker04cb5da2020-03-26 15:52:22 -0700673 err := errors.New("invalid-number-of-args")
674 return nil, err
675 }
676
677 // TODO: See related comment in voltha-go:adapter_proxy_go:startOmciTest()
678 // Second argument should perhaps be uuid instead of omcitestrequest
679
680 device := &voltha.Device{}
681 request := &voltha.OmciTestRequest{}
682 for _, arg := range args {
683 switch arg.Key {
684 case "device":
685 if err := ptypes.UnmarshalAny(arg.Value, device); err != nil {
Neha Sharma94f16a92020-06-26 04:17:55 +0000686 logger.Warnw(ctx, "cannot-unmarshal-device", log.Fields{"error": err})
Scott Baker04cb5da2020-03-26 15:52:22 -0700687 return nil, err
688 }
689 case "omcitestrequest":
690 if err := ptypes.UnmarshalAny(arg.Value, request); err != nil {
Neha Sharma94f16a92020-06-26 04:17:55 +0000691 logger.Warnw(ctx, "cannot-unmarshal-omcitestrequest", log.Fields{"error": err})
Scott Baker04cb5da2020-03-26 15:52:22 -0700692 return nil, err
693 }
694 }
695 }
Neha Sharma94f16a92020-06-26 04:17:55 +0000696 logger.Debugw(ctx, "Start_omci_test", log.Fields{"device-id": device.Id, "req": request})
697 result, err := rhp.adapter.Start_omci_test(ctx, device, request)
Scott Baker04cb5da2020-03-26 15:52:22 -0700698 if err != nil {
699 return nil, status.Errorf(codes.NotFound, "%s", err.Error())
700 }
701 return result, nil
702}
Neha Sharma94f16a92020-06-26 04:17:55 +0000703func (rhp *RequestHandlerProxy) Get_ext_value(ctx context.Context, args []*ic.Argument) (*voltha.ReturnValues, error) {
Dinesh Belwalkar4c89a1d2020-02-28 16:05:32 -0800704 if len(args) < 3 {
Neha Sharma94f16a92020-06-26 04:17:55 +0000705 logger.Warn(ctx, "invalid-number-of-args", log.Fields{"args": args})
Dinesh Belwalkar4c89a1d2020-02-28 16:05:32 -0800706 return nil, errors.New("invalid-number-of-args")
707 }
708
709 pDeviceId := &ic.StrType{}
710 device := &voltha.Device{}
711 valuetype := &ic.IntType{}
712 for _, arg := range args {
713 switch arg.Key {
714 case "device":
715 if err := ptypes.UnmarshalAny(arg.Value, device); err != nil {
Neha Sharma94f16a92020-06-26 04:17:55 +0000716 logger.Warnw(ctx, "cannot-unmarshal-device", log.Fields{"error": err})
Dinesh Belwalkar4c89a1d2020-02-28 16:05:32 -0800717 return nil, err
718 }
719 case "pDeviceId":
720 if err := ptypes.UnmarshalAny(arg.Value, pDeviceId); err != nil {
divyadesai5d8836b2020-08-18 07:40:59 +0000721 logger.Warnw(ctx, "cannot-unmarshal-parent-device-id", log.Fields{"error": err})
Dinesh Belwalkar4c89a1d2020-02-28 16:05:32 -0800722 return nil, err
723 }
724 case "valuetype":
725 if err := ptypes.UnmarshalAny(arg.Value, valuetype); err != nil {
Neha Sharma94f16a92020-06-26 04:17:55 +0000726 logger.Warnw(ctx, "cannot-unmarshal-valuetype", log.Fields{"error": err})
Dinesh Belwalkar4c89a1d2020-02-28 16:05:32 -0800727 return nil, err
728 }
729 default:
Neha Sharma94f16a92020-06-26 04:17:55 +0000730 logger.Warnw(ctx, "key-not-found", log.Fields{"arg.Key": arg.Key})
Dinesh Belwalkar4c89a1d2020-02-28 16:05:32 -0800731 }
732 }
733
734 //Invoke the Get_value API on the adapter
Neha Sharma94f16a92020-06-26 04:17:55 +0000735 return rhp.adapter.Get_ext_value(ctx, pDeviceId.Val, device, voltha.ValueType_Type(valuetype.Val))
Dinesh Belwalkar4c89a1d2020-02-28 16:05:32 -0800736}
kesavand46a9f012021-01-04 16:40:36 +0530737
738func (rhp *RequestHandlerProxy) Single_get_value_request(ctx context.Context, args []*ic.Argument) (*extension.SingleGetValueResponse, error) {
739 logger.Debugw(ctx, "req handler Single_get_value_request", log.Fields{"no of args": len(args), "args": args})
740
741 if len(args) < 1 {
742 logger.Warn(ctx, "invalid-number-of-args", log.Fields{"args": args})
743 return nil, errors.New("invalid-number-of-args")
744 }
745 singleGetvalueReq := extension.SingleGetValueRequest{}
746 errResp := func(status extension.GetValueResponse_Status, reason extension.GetValueResponse_ErrorReason) *extension.SingleGetValueResponse {
747 return &extension.SingleGetValueResponse{
748 Response: &extension.GetValueResponse{
749 Status: status,
750 ErrReason: reason,
751 },
752 }
753 }
754 for _, arg := range args {
755 switch arg.Key {
756 case "request":
757 if err := ptypes.UnmarshalAny(arg.Value, &singleGetvalueReq); err != nil {
758 logger.Warnw(ctx, "cannot-unmarshal-singleGetvalueReq", log.Fields{"error": err})
759 return errResp(extension.GetValueResponse_ERROR, extension.GetValueResponse_REASON_UNDEFINED), nil
760 }
761 default:
762 logger.Warnw(ctx, "key-not-found", log.Fields{"arg.Key": arg.Key})
763 }
764 }
765 logger.Debugw(ctx, "invoke rhp.adapter.Single_get_value_request ", log.Fields{"singleGetvalueReq": singleGetvalueReq})
766 return rhp.adapter.Single_get_value_request(ctx, singleGetvalueReq)
767}