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

Method stateSummary

src/master/http.cpp:2548–2580  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2546
2547
2548Future<Response> Master::Http::stateSummary(
2549 const Request& request,
2550 const Option<Principal>& principal) const
2551{
2552 // TODO(greggomann): Remove this check once the `Principal` type is used in
2553 // `ReservationInfo`, `DiskInfo`, and within the master's `principals` map.
2554 // See MESOS-7202.
2555 if (principal.isSome() && principal->value.isNone()) {
2556 return Forbidden(
2557 "The request's authenticated principal contains claims, but no value "
2558 "string. The master currently requires that principals have a value");
2559 }
2560
2561 // When current master is not the leader, redirect to the leading master.
2562 if (!master->elected()) {
2563 return redirect(request);
2564 }
2565
2566 return ObjectApprovers::create(
2567 master->authorizer,
2568 principal,
2569 {VIEW_ROLE, VIEW_FRAMEWORK})
2570 .then(defer(
2571 master->self(),
2572 [this, request, principal](const Owned<ObjectApprovers>& approvers) {
2573 return deferBatchedRequest(
2574 &Master::ReadOnlyHandler::stateSummary,
2575 principal,
2576 ContentType::JSON,
2577 request.url.query,
2578 approvers);
2579 }));
2580}
2581
2582
2583string Master::Http::ROLES_HELP()

Callers 2

foreachpairFunction · 0.45
initializeMethod · 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 1

foreachpairFunction · 0.36