blob: dc10e50f5258a65da188fc953ccf6262ebb2dc21 [file] [log] [blame]
pwyckoff99b000b2008-04-03 19:30:55 +00001/**
2 * fb303.thrift
3 *
4 * Copyright (c) 2006- Facebook
5 * Distributed under the Thrift Software License
6 *
7 * See accompanying file LICENSE or visit the Thrift site at:
8 * http://developers.facebook.com/thrift/
9 *
10 *
11 * Definition of common Facebook data types and status reporting mechanisms
12 * common to all Facebook services. In some cases, these methods are
13 * provided in the base implementation, and in other cases they simply define
14 * methods that inheriting applications should implement (i.e. status report)
15 *
16 * @author Mark Slee <mcslee@facebook.com>
17 */
18
pwyckoff99b000b2008-04-03 19:30:55 +000019namespace java com.facebook.fb303
20namespace cpp facebook.fb303
21
22/**
23 * Common status reporting mechanism across all services
24 */
25enum fb_status {
26 DEAD = 0,
27 STARTING = 1,
28 ALIVE = 2,
29 STOPPING = 3,
30 STOPPED = 4,
31 WARNING = 5,
32}
33
34/**
35 * Standard base service
36 */
37service FacebookService {
38
39 /**
40 * Returns a descriptive name of the service
41 */
42 string getName(),
43
44 /**
45 * Returns the version of the service
46 */
47 string getVersion(),
48
49 /**
50 * Gets the status of this service
51 */
52 fb_status getStatus(),
53
54 /**
55 * User friendly description of status, such as why the service is in
56 * the dead or warning state, or what is being started or stopped.
57 */
58 string getStatusDetails(),
59
60 /**
61 * Gets the counters for this service
62 */
63 map<string, i64> getCounters(),
64
65 /**
66 * Gets the value of a single counter
67 */
68 i64 getCounter(1: string key),
69
70 /**
71 * Sets an option
72 */
73 void setOption(1: string key, 2: string value),
74
75 /**
76 * Gets an option
77 */
78 string getOption(1: string key),
79
80 /**
81 * Gets all options
82 */
83 map<string, string> getOptions(),
84
85 /**
86 * Returns a CPU profile over the given time interval (client and server
87 * must agree on the profile format).
88 */
89 string getCpuProfile(1: i32 profileDurationInSec),
90
91 /**
92 * Returns the unix time that the server has been running since
93 */
94 i64 aliveSince(),
95
96 /**
pwyckoff99b000b2008-04-03 19:30:55 +000097 * Tell the server to reload its configuration, reopen log files, etc
98 */
99 async void reinitialize(),
100
101 /**
102 * Suggest a shutdown to the server
103 */
104 async void shutdown(),
105
106}