| 976 | |
| 977 | |
| 978 | Future<Response> Http::getFlags( |
| 979 | const mesos::agent::Call& call, |
| 980 | ContentType acceptType, |
| 981 | const Option<Principal>& principal) const |
| 982 | { |
| 983 | CHECK_EQ(mesos::agent::Call::GET_FLAGS, call.type()); |
| 984 | |
| 985 | LOG(INFO) << "Processing GET_FLAGS call"; |
| 986 | |
| 987 | return ObjectApprovers::create(slave->authorizer, principal, {VIEW_FLAGS}) |
| 988 | .then(defer( |
| 989 | slave->self(), |
| 990 | [this, acceptType]( |
| 991 | const Owned<ObjectApprovers>& approvers) -> Response { |
| 992 | if (!approvers->approved<VIEW_FLAGS>()) { |
| 993 | return Forbidden(); |
| 994 | } |
| 995 | |
| 996 | return OK( |
| 997 | serialize( |
| 998 | acceptType, evolve<v1::agent::Response::GET_FLAGS>(_flags())), |
| 999 | stringify(acceptType)); |
| 1000 | })); |
| 1001 | } |
| 1002 | |
| 1003 | |
| 1004 | string Http::HEALTH_HELP() |