David Reiss | ea2cba8 | 2009-03-30 21:35:00 +0000 | [diff] [blame] | 1 | /* |
| 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 | |
pwyckoff | 99b000b | 2008-04-03 19:30:55 +0000 | [diff] [blame] | 20 | /** |
| 21 | * fb303.thrift |
pwyckoff | 99b000b | 2008-04-03 19:30:55 +0000 | [diff] [blame] | 22 | */ |
| 23 | |
pwyckoff | 99b000b | 2008-04-03 19:30:55 +0000 | [diff] [blame] | 24 | namespace java com.facebook.fb303 |
| 25 | namespace cpp facebook.fb303 |
David Reiss | 62a3fba | 2009-04-29 04:54:24 +0000 | [diff] [blame] | 26 | namespace perl Facebook.FB303 |
Volodymyr Gotra | b587a12 | 2016-09-14 19:18:48 -0500 | [diff] [blame] | 27 | namespace netcore Facebook.FB303.Test |
pwyckoff | 99b000b | 2008-04-03 19:30:55 +0000 | [diff] [blame] | 28 | |
| 29 | /** |
| 30 | * Common status reporting mechanism across all services |
| 31 | */ |
| 32 | enum 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 | */ |
| 44 | service 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 | /** |
pwyckoff | 99b000b | 2008-04-03 19:30:55 +0000 | [diff] [blame] | 104 | * Tell the server to reload its configuration, reopen log files, etc |
| 105 | */ |
David Reiss | cecbed8 | 2009-03-24 20:02:22 +0000 | [diff] [blame] | 106 | oneway void reinitialize(), |
pwyckoff | 99b000b | 2008-04-03 19:30:55 +0000 | [diff] [blame] | 107 | |
| 108 | /** |
| 109 | * Suggest a shutdown to the server |
| 110 | */ |
David Reiss | cecbed8 | 2009-03-24 20:02:22 +0000 | [diff] [blame] | 111 | oneway void shutdown(), |
pwyckoff | 99b000b | 2008-04-03 19:30:55 +0000 | [diff] [blame] | 112 | |
| 113 | } |