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 24 #include <grpcpp/grpcpp.h> 25 #include <grpcpp/support/status.h> 26 27 #include "src/proto/grpc/channelz/channelz.grpc.pb.h" 28 29 namespace grpc { 30 31 class ChannelzService final : public channelz::v1::Channelz::Service { 32 private: 33 // implementation of GetTopChannels rpc 34 Status GetTopChannels( 35 ServerContext* unused, const channelz::v1::GetTopChannelsRequest* request, 36 channelz::v1::GetTopChannelsResponse* response) override; 37 // implementation of GetServers rpc 38 Status GetServers(ServerContext* unused, 39 const channelz::v1::GetServersRequest* request, 40 channelz::v1::GetServersResponse* response) override; 41 // implementation of GetServer rpc 42 Status GetServer(ServerContext* unused, 43 const channelz::v1::GetServerRequest* request, 44 channelz::v1::GetServerResponse* response) override; 45 // implementation of GetServerSockets rpc 46 Status GetServerSockets( 47 ServerContext* unused, 48 const channelz::v1::GetServerSocketsRequest* request, 49 channelz::v1::GetServerSocketsResponse* response) override; 50 // implementation of GetChannel rpc 51 Status GetChannel(ServerContext* unused, 52 const channelz::v1::GetChannelRequest* request, 53 channelz::v1::GetChannelResponse* response) override; 54 // implementation of GetSubchannel rpc 55 Status GetSubchannel(ServerContext* unused, 56 const channelz::v1::GetSubchannelRequest* request, 57 channelz::v1::GetSubchannelResponse* response) override; 58 // implementation of GetSocket rpc 59 Status GetSocket(ServerContext* unused, 60 const channelz::v1::GetSocketRequest* request, 61 channelz::v1::GetSocketResponse* response) override; 62 }; 63 64 } // namespace grpc 65 66 #endif // GRPC_SRC_CPP_SERVER_CHANNELZ_CHANNELZ_SERVICE_H 67