blob: 288b8a06ec6929fab4c380bd080c6e036786e34a [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
26
27/**
28 * Common status reporting mechanism across all services
29 */
30enum fb_status {
31 DEAD = 0,
32 STARTING = 1,
33 ALIVE = 2,
34 STOPPING = 3,
35 STOPPED = 4,
36 WARNING = 5,
37}
38
39/**
40 * Standard base service
41 */
42service FacebookService {
43
44 /**
45 * Returns a descriptive name of the service
46 */
47 string getName(),
48
49 /**
50 * Returns the version of the service
51 */
52 string getVersion(),
53
54 /**
55 * Gets the status of this service
56 */
57 fb_status getStatus(),
58
59 /**
60 * User friendly description of status, such as why the service is in
61 * the dead or warning state, or what is being started or stopped.
62 */
63 string getStatusDetails(),
64
65 /**
66 * Gets the counters for this service
67 */
68 map<string, i64> getCounters(),
69
70 /**
71 * Gets the value of a single counter
72 */
73 i64 getCounter(1: string key),
74
75 /**
76 * Sets an option
77 */
78 void setOption(1: string key, 2: string value),
79
80 /**
81 * Gets an option
82 */
83 string getOption(1: string key),
84
85 /**
86 * Gets all options
87 */
88 map<string, string> getOptions(),
89
90 /**
91 * Returns a CPU profile over the given time interval (client and server
92 * must agree on the profile format).
93 */
94 string getCpuProfile(1: i32 profileDurationInSec),
95
96 /**
97 * Returns the unix time that the server has been running since
98 */
99 i64 aliveSince(),
100
101 /**
pwyckoff99b000b2008-04-03 19:30:55 +0000102 * Tell the server to reload its configuration, reopen log files, etc
103 */
David Reisscecbed82009-03-24 20:02:22 +0000104 oneway void reinitialize(),
pwyckoff99b000b2008-04-03 19:30:55 +0000105
106 /**
107 * Suggest a shutdown to the server
108 */
David Reisscecbed82009-03-24 20:02:22 +0000109 oneway void shutdown(),
pwyckoff99b000b2008-04-03 19:30:55 +0000110
111}