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

Method tasks

src/master/http.cpp:2910–2942  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2908
2909
2910Future<Response> Master::Http::tasks(
2911 const Request& request,
2912 const Option<Principal>& principal) const
2913{
2914 // TODO(greggomann): Remove this check once the `Principal` type is used in
2915 // `ReservationInfo`, `DiskInfo`, and within the master's `principals` map.
2916 // See MESOS-7202.
2917 if (principal.isSome() && principal->value.isNone()) {
2918 return Forbidden(
2919 "The request's authenticated principal contains claims, but no value "
2920 "string. The master currently requires that principals have a value");
2921 }
2922
2923 // When current master is not the leader, redirect to the leading master.
2924 if (!master->elected()) {
2925 return redirect(request);
2926 }
2927
2928 return ObjectApprovers::create(
2929 master->authorizer,
2930 principal,
2931 {VIEW_FRAMEWORK, VIEW_TASK})
2932 .then(defer(
2933 master->self(),
2934 [this, request, principal](const Owned<ObjectApprovers>& approvers) {
2935 return deferBatchedRequest(
2936 &Master::ReadOnlyHandler::tasks,
2937 principal,
2938 ContentType::JSON,
2939 request.url.query,
2940 approvers);
2941 }));
2942}
2943
2944
2945Future<Response> Master::Http::getTasks(

Callers 15

updateMethod · 0.45
__launchGroupMethod · 0.45
foreachMethod · 0.45
TEST_PFunction · 0.45
TEST_FFunction · 0.45
TEST_PFunction · 0.45
TEST_FFunction · 0.45
TEST_FFunction · 0.45
TEST_FFunction · 0.45
TESTFunction · 0.45
runMethod · 0.45
runTaskGroupMethod · 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 7

TEST_PFunction · 0.36
TEST_FFunction · 0.36
TEST_PFunction · 0.36
TEST_FFunction · 0.36
TEST_FFunction · 0.36
TEST_FFunction · 0.36
TESTFunction · 0.36