Example #1
0
func storeContainerInfo(cId string) {
	var resData map[string]interface{}
	var request mongo.Container
	request.BizId = cId
	docker, _ := dockerClient.InspectContainer(cId)
	request.BizName = docker.Name
	request.State = mongo.CONTAINER_STATE_STARTED
	fasthttp.JsonReqAndResHandler(PATH_CONTAINER, request, &resData, "POST")
	if int(resData["status"].(float64)) != http.StatusOK {
		log.Println("[CHAOSWHISPER] store container info fail... CID: " + cId)
	}
}
Example #2
0
func saveAndReturnIp(container model.Container, ip string) interface{} {
	container.ContainerIp = ip
	mongo.UpdateContainerById(container.BizId, container)
	return webUtils.ProcessResponseFully(http.StatusOK, ip, false)
}