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

Method waitContainer

src/csi/service_manager.cpp:515–538  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

513
514
515Future<Nothing> ServiceManagerProcess::waitContainer(
516 const ContainerID& containerId)
517{
518 agent::Call call;
519 call.set_type(agent::Call::WAIT_CONTAINER);
520 call.mutable_wait_container()->mutable_container_id()->CopyFrom(containerId);
521
522 return http::post(
523 agentUrl,
524 headers,
525 internal::serialize(contentType, internal::evolve(call)),
526 stringify(contentType))
527 .then([containerId](const http::Response& response) -> Future<Nothing> {
528 if (response.status != http::OK().status &&
529 response.status != http::NotFound().status) {
530 return Failure(
531 "Failed to wait for container '" + stringify(containerId) +
532 "': Unexpected response '" + response.status + "' (" + response.body
533 + ")");
534 }
535
536 return Nothing();
537 });
538}
539
540
541Future<Nothing> ServiceManagerProcess::killContainer(

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