예제 #1
0
파일: apps.go 프로젝트: zufangzi/chaos
func CreateAppsHandler(pathParams map[string]string, data []byte) interface{} {
	var request entity.DeployAppsRequest
	webUtils.ParseOuterRequest(data, &request)
	deployInfo := webUtils.BuildAppsRequest(request)
	var resData map[string]interface{}
	resCode := fasthttp.JsonReqAndResHandler(common.Path.MarathonAppsUrl, deployInfo, &resData, "POST")
	return webUtils.ProcessResponse(resCode, resData)
}
예제 #2
0
파일: apps.go 프로젝트: zufangzi/chaos
func createOrUpdateAppsService(request entity.DeployAppsBatchRequest) (interface{}, int) {
	finalRequest := make([]marathon.MarathonAppsRequest, len(request.Batch))
	for i, v := range request.Batch {
		deployInfo := webUtils.BuildAppsRequest(v)
		finalRequest[i] = *deployInfo
	}
	var response map[string]interface{}
	code := fasthttp.JsonReqAndResHandler(common.Path.MarathonAppsUrl, finalRequest, &response, "PUT")
	return response, code
}