Beerappa S M | 7af96e5 | 2021-04-20 18:57:54 +0000 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright 2021-present Open Networking Foundation |
| 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | * you may not use this file except in compliance with the License. |
| 5 | * You may obtain a copy of the License at |
| 6 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 7 | * Unless required by applicable law or agreed to in writing, software |
| 8 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 10 | * See the License for the specific language governing permissions and |
| 11 | * limitations under the License. |
| 12 | */ |
| 13 | |
| 14 | #ifndef DMI_HW_MGMT_H_ |
| 15 | #define DMI_HH_MGMT_H_ |
| 16 | |
| 17 | #include "hw_metrics_mgmt_service.grpc.pb.h" |
| 18 | #include "hw_metrics_mgmt_service.pb.h" |
| 19 | #include "dmi_common.h" |
| 20 | |
| 21 | using grpc::ServerWriter; |
| 22 | |
| 23 | |
| 24 | class HWMetricsMgmtService final : public dmi::NativeMetricsManagementService::Service |
| 25 | { |
| 26 | public: |
| 27 | static HWMetricsMgmtService& getHwMetricMgmtInstance() |
| 28 | { |
| 29 | static HWMetricsMgmtService HwMetrictInstance; |
| 30 | return HwMetrictInstance; |
| 31 | } |
| 32 | |
| 33 | grpc::Status ListMetrics( |
| 34 | ServerContext* context, |
| 35 | const dmi::HardwareID* request, |
| 36 | dmi::ListMetricsResponse* response ) |
| 37 | { |
| 38 | //TODO write an internal API to handle the request |
| 39 | return Status(grpc::StatusCode::UNIMPLEMENTED, "RPC not implemented"); |
| 40 | } |
| 41 | |
| 42 | grpc::Status UpdateMetricsConfiguration( |
| 43 | ServerContext* context, |
| 44 | const dmi::MetricsConfigurationRequest* request, |
| 45 | dmi::MetricsConfigurationResponse* response ) |
| 46 | { |
| 47 | //TODO write an internal API to handle the request |
| 48 | return Status(grpc::StatusCode::UNIMPLEMENTED, "RPC not implemented"); |
| 49 | } |
| 50 | |
| 51 | grpc::Status GetMetric( |
| 52 | ServerContext* context, |
| 53 | const dmi::GetMetricRequest* request, |
| 54 | dmi::GetMetricResponse* response ) |
| 55 | { |
| 56 | //TODO write an internal API to handle the request |
| 57 | return Status(grpc::StatusCode::UNIMPLEMENTED, "RPC not implemented"); |
| 58 | } |
| 59 | |
| 60 | private: |
| 61 | HWMetricsMgmtService() |
| 62 | { |
| 63 | } |
| 64 | |
| 65 | ~HWMetricsMgmtService() |
| 66 | { |
| 67 | } |
| 68 | }; |
| 69 | |
| 70 | #endif |