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

Method killContainer

src/csi/service_manager.cpp:541–564  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

539
540
541Future<Nothing> ServiceManagerProcess::killContainer(
542 const ContainerID& containerId)
543{
544 agent::Call call;
545 call.set_type(agent::Call::KILL_CONTAINER);
546 call.mutable_kill_container()->mutable_container_id()->CopyFrom(containerId);
547
548 return http::post(
549 agentUrl,
550 headers,
551 internal::serialize(contentType, internal::evolve(call)),
552 stringify(contentType))
553 .then([containerId](const http::Response& response) -> Future<Nothing> {
554 if (response.status != http::OK().status &&
555 response.status != http::NotFound().status) {
556 return Failure(
557 "Failed to kill container '" + stringify(containerId) +
558 "': Unexpected response '" + response.status + "' (" + response.body
559 + ")");
560 }
561
562 return Nothing();
563 });
564}
565
566
567Future<Nothing> ServiceManagerProcess::waitEndpoint(const string& endpoint)

Callers

nothing calls this directly

Calls 10

OKClass · 0.85
NotFoundClass · 0.85
FailureClass · 0.85
NothingClass · 0.85
CopyFromMethod · 0.80
evolveFunction · 0.70
postFunction · 0.50
serializeFunction · 0.50
stringifyFunction · 0.50
thenMethod · 0.45

Tested by

no test coverage detected