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