blob: 51b5dccf77b969246fc73f65a61cd9ac947e5b97 [file] [log] [blame]
amit.ghosh258d14c2020-10-02 15:13:38 +02001/*
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 */
16
17package dmiserver
18
19import (
20 "context"
21
22 dmi "github.com/opencord/device-management-interface/go/dmi"
23)
24
25//ListMetrics lists the supported metrics for the passed device.
26func (dms *DmiAPIServer) ListMetrics(ctx context.Context, req *dmi.HardwareID) (*dmi.ListMetricsResponse, error) {
27 logger.Debugf("ListMetrics invoked with request %+v", req)
28 //return empty list of metrics for now
29 metrics := []*dmi.MetricConfig{{}}
30 return &dmi.ListMetricsResponse{
31 Status: dmi.Status_OK,
32 Reason: 0,
33 Metrics: &dmi.MetricsConfig{
34 Metrics: metrics,
35 },
36 }, nil
37}
38
39//UpdateMetricsConfiguration updates the configuration of the list of metrics in the request
40func (dms *DmiAPIServer) UpdateMetricsConfiguration(ctx context.Context, req *dmi.MetricsConfigurationRequest) (*dmi.MetricsConfigurationResponse, error) {
41 logger.Debugf("UpdateMetricConfiguration invoked with request %+v", req)
42 return &dmi.MetricsConfigurationResponse{
43 Status: dmi.Status_OK,
44 }, nil
45}
46
47//GetMetric gets the instantenous value of a metric
48func (dms *DmiAPIServer) GetMetric(ctx context.Context, req *dmi.GetMetricRequest) (*dmi.GetMetricResponse, error) {
49 logger.Debugf("GetMetric invoked with request %+v", req)
50 return &dmi.GetMetricResponse{
51 Status: dmi.Status_OK,
52 Reason: dmi.Reason_UNDEFINED_REASON,
53 Metric: &dmi.Metric{},
54 }, nil
55
56}