| 539 | |
| 540 | |
| 541 | Future<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 | |
| 567 | Future<Nothing> ServiceManagerProcess::waitEndpoint(const string& endpoint) |