blob: 89bd6eb7b417b95920c01ed12f09668d2903908b [file] [log] [blame]
David Reissea2cba82009-03-30 21:35:00 +00001/*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19
pwyckoff99b000b2008-04-03 19:30:55 +000020/**
21 * fb303.thrift
pwyckoff99b000b2008-04-03 19:30:55 +000022 */
23
pwyckoff99b000b2008-04-03 19:30:55 +000024namespace java com.facebook.fb303
25namespace cpp facebook.fb303
David Reiss62a3fba2009-04-29 04:54:24 +000026namespace perl Facebook.FB303
Volodymyr Gotrab587a122016-09-14 19:18:48 -050027namespace netcore Facebook.FB303.Test
pwyckoff99b000b2008-04-03 19:30:55 +000028
29/**
30 * Common status reporting mechanism across all services
31 */
32enum fb_status {
33 DEAD = 0,
34 STARTING = 1,
35 ALIVE = 2,
36 STOPPING = 3,
37 STOPPED = 4,
38 WARNING = 5,
39}
40
41/**
42 * Standard base service
43 */
44service FacebookService {
45
46 /**
47 * Returns a descriptive name of the service
48 */
49 string getName(),
50
51 /**
52 * Returns the version of the service
53 */
54 string getVersion(),
55
56 /**
57 * Gets the status of this service
58 */
59 fb_status getStatus(),
60
61 /**
62 * User friendly description of status, such as why the service is in
63 * the dead or warning state, or what is being started or stopped.
64 */
65 string getStatusDetails(),
66
67 /**
68 * Gets the counters for this service
69 */
70 map<string, i64> getCounters(),
71
72 /**
73 * Gets the value of a single counter
74 */
75 i64 getCounter(1: string key),
76
77 /**
78 * Sets an option
79 */
80 void setOption(1: string key, 2: string value),
81
82 /**
83 * Gets an option
84 */
85 string getOption(1: string key),
86
87 /**
88 * Gets all options
89 */
90 map<string, string> getOptions(),
91
92 /**
93 * Returns a CPU profile over the given time interval (client and server
94 * must agree on the profile format).
95 */
96 string getCpuProfile(1: i32 profileDurationInSec),
97
98 /**
99 * Returns the unix time that the server has been running since
100 */
101 i64 aliveSince(),
102
103 /**
pwyckoff99b000b2008-04-03 19:30:55 +0000104 * Tell the server to reload its configuration, reopen log files, etc
105 */
David Reisscecbed82009-03-24 20:02:22 +0000106 oneway void reinitialize(),
pwyckoff99b000b2008-04-03 19:30:55 +0000107
108 /**
109 * Suggest a shutdown to the server
110 */
David Reisscecbed82009-03-24 20:02:22 +0000111 oneway void shutdown(),
pwyckoff99b000b2008-04-03 19:30:55 +0000112
113}