1 // 2 // 3 // Copyright 2018 gRPC authors. 4 // 5 // Licensed under the Apache License, Version 2.0 (the "License"); 6 // you may not use this file except in compliance with the License. 7 // You may obtain a copy of the License at 8 // 9 // http://www.apache.org/licenses/LICENSE-2.0 10 // 11 // Unless required by applicable law or agreed to in writing, software 12 // distributed under the License is distributed on an "AS IS" BASIS, 13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 // See the License for the specific language governing permissions and 15 // limitations under the License. 16 // 17 // 18 19 #ifndef GRPC_SRC_CPP_SERVER_CHANNELZ_CHANNELZ_SERVICE_H 20 #define GRPC_SRC_CPP_SERVER_CHANNELZ_CHANNELZ_SERVICE_H 21 22 #include <grpc/support/port_platform.h> 23 #include <grpcpp/grpcpp.h> 24 #include <grpcpp/support/status.h> 25 26 #include "src/proto/grpc/channelz/channelz.grpc.pb.h" 27 28 namespace grpc { 29 30 class ChannelzService final : public channelz::v1::Channelz::Service { 31 private: 32 // implementation of GetTopChannels rpc 33 Status GetTopChannels( 34 ServerContext* unused, const channelz::v1::GetTopChannelsRequest* request, 35 channelz::v1::GetTopChannelsResponse* response) override; 36 // implementation of GetServers rpc 37 Status GetServers(ServerContext* unused, 38 const channelz::v1::GetServersRequest* request, 39 channelz::v1::GetServersResponse* response) override; 40 // implementation of GetServer rpc 41 Status GetServer(ServerContext* unused, 42 const channelz::v1::GetServerRequest* request, 43 channelz::v1::GetServerResponse* response) override; 44 // implementation of GetServerSockets rpc 45 Status GetServerSockets( 46 ServerContext* unused, 47 const channelz::v1::GetServerSocketsRequest* request, 48 channelz::v1::GetServerSocketsResponse* response) override; 49 // implementation of GetChannel rpc 50 Status GetChannel(ServerContext* unused, 51 const channelz::v1::GetChannelRequest* request, 52 channelz::v1::GetChannelResponse* response) override; 53 // implementation of GetSubchannel rpc 54 Status GetSubchannel(ServerContext* unused, 55 const channelz::v1::GetSubchannelRequest* request, 56 channelz::v1::GetSubchannelResponse* response) override; 57 // implementation of GetSocket rpc 58 Status GetSocket(ServerContext* unused, 59 const channelz::v1::GetSocketRequest* request, 60 channelz::v1::GetSocketResponse* response) override; 61 }; 62 63 } // namespace grpc 64 65 #endif // GRPC_SRC_CPP_SERVER_CHANNELZ_CHANNELZ_SERVICE_H 66