Пример #1
0
func (ch *controlHandler) handle(req xfer.Request) xfer.Response {
	var res xfer.Response
	if err := ch.client.Call("control.Handle", req, &res); err != nil {
		return xfer.ResponseError(err)
	}
	return res
}
Пример #2
0
func (r *registry) unpauseContainer(req xfer.Request) xfer.Response {
	log.Printf("Unpausing container %s", req.NodeID)

	_, containerID, ok := report.ParseContainerNodeID(req.NodeID)
	if !ok {
		return xfer.ResponseErrorf("Invalid ID: %s", req.NodeID)
	}

	return xfer.ResponseError(r.client.UnpauseContainer(containerID))
}
Пример #3
0
func (r *registry) stopContainer(req xfer.Request) xfer.Response {
	log.Printf("Stopping container %s", req.NodeID)

	_, containerID, ok := report.ParseContainerNodeID(req.NodeID)
	if !ok {
		return xfer.ResponseErrorf("Invalid ID: %s", req.NodeID)
	}

	return xfer.ResponseError(r.client.StopContainer(containerID, waitTime))
}