agent/handlers/v2/task_container_metadata_handler.go
func WriteContainerMetadataResponse(w http.ResponseWriter, containerID string, state dockerstate.TaskEngineState) {
	containerResponse, err := NewContainerResponse(containerID, state)
	if err != nil {
		errResponseJSON, _ := json.Marshal("Unable to generate metadata for container '" + containerID + "'")
		utils.WriteJSONToResponse(w, http.StatusBadRequest, errResponseJSON, utils.RequestTypeContainerMetadata)
		return
	}

	responseJSON, _ := json.Marshal(containerResponse)
	utils.WriteJSONToResponse(w, http.StatusOK, responseJSON, utils.RequestTypeContainerMetadata)
}
func WriteContainerMetadataResponse(w http.ResponseWriter, containerID string, state dockerstate.TaskEngineState) {
	containerResponse, err := NewContainerResponse(containerID, state)
	if err != nil {
		errResponseJSON, _ := json.Marshal("Unable to generate metadata for container '" + containerID + "'")
		utils.WriteJSONToResponse(w, http.StatusBadRequest, errResponseJSON, utils.RequestTypeContainerMetadata)
		return
	}

	responseJSON, _ := json.Marshal(containerResponse)
	utils.WriteJSONToResponse(w, http.StatusOK, responseJSON, utils.RequestTypeContainerMetadata)
}
// WriteContainerMetadataResponse writes the container metadata to response writer.