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