agent/handlers/v1/task_container_metadata_handler.go
func createTaskResponse(task *apitask.Task, found bool, resourceID string, state dockerstate.TaskEngineState) ([]byte, int) {
	var responseJSON []byte
	status := http.StatusOK
	if found {
		containerMap, _ := state.ContainerMapByArn(task.Arn)
		responseJSON, _ = json.Marshal(NewTaskResponse(task, containerMap))
	} else {
		seelog.Warn("Could not find requested resource: " + resourceID)
		responseJSON, _ = json.Marshal(&TaskResponse{})
		status = http.StatusNotFound
	}
	return responseJSON, status
}
func createTaskResponse(task *apitask.Task, found bool, resourceID string, state dockerstate.TaskEngineState) ([]byte, int) {
	var responseJSON []byte
	status := http.StatusOK
	if found {
		containerMap, _ := state.ContainerMapByArn(task.Arn)
		responseJSON, _ = json.Marshal(NewTaskResponse(task, containerMap))
	} else {
		seelog.Warn("Could not find requested resource: " + resourceID)
		responseJSON, _ = json.Marshal(&TaskResponse{})
		status = http.StatusNotFound
	}
	return responseJSON, status
}
// createTaskResponse creates JSON response and sets the http status code for the task queried.