MCPcopy Create free account
hub / github.com/apache/mesos / state

Method state

src/master/http.cpp:2289–2321  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2287
2288
2289Future<Response> Master::Http::state(
2290 const Request& request,
2291 const Option<Principal>& principal) const
2292{
2293 // TODO(greggomann): Remove this check once the `Principal` type is used in
2294 // `ReservationInfo`, `DiskInfo`, and within the master's `principals` map.
2295 // See MESOS-7202.
2296 if (principal.isSome() && principal->value.isNone()) {
2297 return Forbidden(
2298 "The request's authenticated principal contains claims, but no value "
2299 "string. The master currently requires that principals have a value");
2300 }
2301
2302 // When current master is not the leader, redirect to the leading master.
2303 if (!master->elected()) {
2304 return redirect(request);
2305 }
2306
2307 return ObjectApprovers::create(
2308 master->authorizer,
2309 principal,
2310 {VIEW_ROLE, VIEW_FRAMEWORK, VIEW_TASK, VIEW_EXECUTOR, VIEW_FLAGS})
2311 .then(defer(
2312 master->self(),
2313 [this, request, principal](const Owned<ObjectApprovers>& approvers) {
2314 return deferBatchedRequest(
2315 &Master::ReadOnlyHandler::state,
2316 principal,
2317 ContentType::JSON,
2318 request.url.query,
2319 approvers);
2320 }));
2321}
2322
2323
2324Future<Response> Master::Http::deferBatchedRequest(

Callers 15

messages.cppFile · 0.45
performMethod · 0.45
foreachFunction · 0.45
_reactivateAgentMethod · 0.45
initializeMethod · 0.45
_reregisterSlaveMethod · 0.45
__reregisterSlaveMethod · 0.45
foreachFunction · 0.45
foreachpairFunction · 0.45
forwardMethod · 0.45

Calls 9

ForbiddenClass · 0.85
redirectFunction · 0.85
deferFunction · 0.85
electedMethod · 0.80
createFunction · 0.50
isSomeMethod · 0.45
isNoneMethod · 0.45
thenMethod · 0.45
selfMethod · 0.45

Tested by

no test coverage detected