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

Method containers

src/slave/http.cpp:2789–2818  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2787
2788
2789Future<Response> Http::containers(
2790 const Request& request,
2791 const Option<Principal>& principal) const
2792{
2793 // TODO(a10gupta): Remove check for enabled
2794 // authorization as part of MESOS-5346.
2795 if (request.method != "GET" && slave->authorizer.isSome()) {
2796 return MethodNotAllowed({"GET"}, request.method);
2797 }
2798
2799 Try<string> endpoint = extractEndpoint(request.url);
2800 if (endpoint.isError()) {
2801 return Failure("Failed to extract endpoint: " + endpoint.error());
2802 }
2803
2804 return authorizeEndpoint(
2805 endpoint.get(),
2806 request.method,
2807 slave->authorizer,
2808 principal)
2809 .then(defer(
2810 slave->self(),
2811 [this, request, principal](bool authorized) -> Future<Response> {
2812 if (!authorized) {
2813 return Forbidden();
2814 }
2815
2816 return _containers(request, principal);
2817 }));
2818}
2819
2820
2821Future<Response> Http::getContainers(

Callers 4

__containersMethod · 0.45
initializeMethod · 0.45
operator==Function · 0.45
operator==Function · 0.45

Calls 11

MethodNotAllowedClass · 0.85
FailureClass · 0.85
authorizeEndpointFunction · 0.85
deferFunction · 0.85
ForbiddenClass · 0.85
errorMethod · 0.65
isSomeMethod · 0.45
isErrorMethod · 0.45
thenMethod · 0.45
getMethod · 0.45
selfMethod · 0.45

Tested by

no test coverage detected