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