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

Method containerizerDebug

src/slave/http.cpp:3082–3114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3080
3081
3082Future<Response> Http::containerizerDebug(
3083 const Request& request,
3084 const Option<Principal>& principal) const
3085{
3086 // TODO(a10gupta): Remove check for enabled
3087 // authorization as part of MESOS-5346.
3088 if (request.method != "GET" && slave->authorizer.isSome()) {
3089 return MethodNotAllowed({"GET"}, request.method);
3090 }
3091
3092 Try<string> endpoint = extractEndpoint(request.url);
3093 if (endpoint.isError()) {
3094 return Failure("Failed to extract endpoint: " + endpoint.error());
3095 }
3096
3097 return authorizeEndpoint(
3098 endpoint.get(),
3099 request.method,
3100 slave->authorizer,
3101 principal)
3102 .then(defer(
3103 slave->self(),
3104 [this, request](bool authorized) -> Future<Response> {
3105 if (!authorized) {
3106 return Forbidden();
3107 }
3108
3109 return _containerizerDebug()
3110 .then([request](const JSON::Object& result) -> Response {
3111 return process::http::OK(result, request.url.query.get("jsonp"));
3112 });
3113 }));
3114}
3115
3116
3117Future<JSON::Object> Http::_containerizerDebug() const

Callers 1

initializeMethod · 0.80

Calls 12

MethodNotAllowedClass · 0.85
FailureClass · 0.85
authorizeEndpointFunction · 0.85
deferFunction · 0.85
ForbiddenClass · 0.85
OKClass · 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