func GetItemJSONHandler(w http.ResponseWriter, req *http.Request) {
	if bbpd_runinfo.BBPDAbortIfClosed(w) {
		return
	}
	start := time.Now()
	bodybytes, read_err := ioutil.ReadAll(req.Body)
	req.Body.Close()
	if read_err != nil && read_err != io.EOF {
		e := fmt.Sprintf("get_item_route.GetItemJSONHandler err reading req body: %s", read_err.Error())
		log.Printf(e)
		http.Error(w, e, http.StatusInternalServerError)
		return
	}

	resp_body, code, resp_err := authreq.RetryReqJSON_V4(bodybytes, get.GETITEM_ENDPOINT)

	if resp_err != nil {
		e := fmt.Sprintf("get_item_route.GetItemJSONHandler: resp err calling %s err %s (input json: %s)",
			get.GETITEM_ENDPOINT, resp_err.Error(), string(bodybytes))
		log.Printf(e)
		http.Error(w, e, http.StatusInternalServerError)
		return
	}

	if ep.HttpErr(code) {
		e := fmt.Sprintf("get_item_route.GetItemJSONHandler: http err %d calling %s (input json: %s)",
			code, get.GETITEM_ENDPOINT, string(bodybytes))
		route_response.WriteError(w, code, e, resp_body)
		return
	}

	// translate the Response to a ResponseItemJSON
	resp := get.NewResponse()
	um_err := json.Unmarshal([]byte(resp_body), resp)
	if um_err != nil {
		e := fmt.Sprintf("get_item_route.GetItemJSONHandler:err %s",
			um_err.Error())
		log.Printf(e)
		http.Error(w, e, http.StatusInternalServerError)
		return
	}
	resp_json, rerr := resp.ToResponseItemJSON()
	if rerr != nil {
		e := fmt.Sprintf("get_item_route.GetItemJSONHandler:err %s",
			rerr.Error())
		log.Printf(e)
		http.Error(w, e, http.StatusInternalServerError)
		return
	}
	json_body, jerr := json.Marshal(resp_json)
	if jerr != nil {
		e := fmt.Sprintf("get_item_route.GetItemJSONHandler:err %s",
			jerr.Error())
		log.Printf(e)
		http.Error(w, e, http.StatusInternalServerError)
		return
	}
	mr_err := route_response.MakeRouteResponse(
		w,
		req,
		json_body,
		http.StatusOK,
		start,
		get.ENDPOINT_NAME)
	if mr_err != nil {
		e := fmt.Sprintf("get_item_route.GetItemJSONHandler %s",
			mr_err.Error())
		log.Printf(e)
		http.Error(w, e, http.StatusInternalServerError)
		return
	}
}
// BBPD-only endpoint.
// GetItemJSONHandler issues a GetItem request to aws and then transforms the Response into
// a ResponseItemJSON.
BBPD-only endpoint.
GetItemJSONHandler issues a GetItem request to aws and then transforms the Response into
a ResponseItemJSON.
// BBPD - only endpoint . // GetItemJSONHandler issues a GetItem request to aws and then transforms the Response into // a ResponseItemJSON .
func GetItemJSONHandler(w http.ResponseWriter, req *http.Request) {
	if bbpd_runinfo.BBPDAbortIfClosed(w) {
		return
	}
	start := time.Now()
	bodybytes, read_err := ioutil.ReadAll(req.Body)
	req.Body.Close()
	if read_err != nil && read_err != io.EOF {
		e := fmt.Sprintf("get_item_route.GetItemJSONHandler err reading req body: %s", read_err.Error())
		log.Printf(e)
		http.Error(w, e, http.StatusInternalServerError)
		return
	}
	resp_body, code, resp_err := authreq.RetryReqJSON_V4(bodybytes, get.GETITEM_ENDPOINT)
	if resp_err != nil {
		e := fmt.Sprintf("get_item_route.GetItemJSONHandler: resp err calling %s err %s (input json: %s)",
			get.GETITEM_ENDPOINT, resp_err.Error(), string(bodybytes))
		log.Printf(e)
		http.Error(w, e, http.StatusInternalServerError)
		return
	}
	if ep.HttpErr(code) {
		e := fmt.Sprintf("get_item_route.GetItemJSONHandler: http err %d calling %s (input json: %s)",
			code, get.GETITEM_ENDPOINT, string(bodybytes))
		route_response.WriteError(w, code, e, resp_body)
		return
	}
	resp := get.NewResponse()
	um_err := json.Unmarshal([]byte(resp_body), resp)
	if um_err != nil {
		e := fmt.Sprintf("get_item_route.GetItemJSONHandler:err %s",
			um_err.Error())
		log.Printf(e)
		http.Error(w, e, http.StatusInternalServerError)
		return
	}
	resp_json, rerr := resp.ToResponseItemJSON()
	if rerr != nil {
		e := fmt.Sprintf("get_item_route.GetItemJSONHandler:err %s",
			rerr.Error())
		log.Printf(e)
		http.Error(w, e, http.StatusInternalServerError)
		return
	}
	json_body, jerr := json.Marshal(resp_json)
	if jerr != nil {
		e := fmt.Sprintf("get_item_route.GetItemJSONHandler:err %s",
			jerr.Error())
		log.Printf(e)
		http.Error(w, e, http.StatusInternalServerError)
		return
	}
	mr_err := route_response.MakeRouteResponse(
		w,
		req,
		json_body,
		http.StatusOK,
		start,
		get.ENDPOINT_NAME)
	if mr_err != nil {
		e := fmt.Sprintf("get_item_route.GetItemJSONHandler %s",
			mr_err.Error())
		log.Printf(e)
		http.Error(w, e, http.StatusInternalServerError)
		return
	}
}
func GetItemJSONHandler ( w http . ResponseWriter , req * http . Request ) { if bbpd_runinfo . BBPDAbortIfClosed ( w ) { return } start := time . Now ( ) bodybytes , read_err := ioutil . ReadAll ( req . Body ) req . Body . Close ( ) if read_err != nil && read_err != io . EOF { e := fmt . Sprintf ( " " , read_err . Error ( ) ) log . Printf ( e ) http . Error ( w , e , http . StatusInternalServerError ) return } resp_body , code , resp_err := authreq . RetryReqJSON_V4 ( bodybytes , get . GETITEM_ENDPOINT ) if resp_err != nil { e := fmt . Sprintf ( " " , get . GETITEM_ENDPOINT , resp_err . Error ( ) , string ( bodybytes ) ) log . Printf ( e ) http . Error ( w , e , http . StatusInternalServerError ) return } if ep . HttpErr ( code ) { e := fmt . Sprintf ( " " , code , get . GETITEM_ENDPOINT , string ( bodybytes ) ) route_response . WriteError ( w , code , e , resp_body ) return } resp := get . NewResponse ( ) um_err := json . Unmarshal ( [ ] byte ( resp_body ) , resp ) if um_err != nil { e := fmt . Sprintf ( " " , um_err . Error ( ) ) log . Printf ( e ) http . Error ( w , e , http . StatusInternalServerError ) return } resp_json , rerr := resp . ToResponseItemJSON ( ) if rerr != nil { e := fmt . Sprintf ( " " , rerr . Error ( ) ) log . Printf ( e ) http . Error ( w , e , http . StatusInternalServerError ) return } json_body , jerr := json . Marshal ( resp_json ) if jerr != nil { e := fmt . Sprintf ( " " , jerr . Error ( ) ) log . Printf ( e ) http . Error ( w , e , http . StatusInternalServerError ) return } mr_err := route_response . MakeRouteResponse ( w , req , json_body , http . StatusOK , start , get . ENDPOINT_NAME ) if mr_err != nil { e := fmt . Sprintf ( " " , mr_err . Error ( ) ) log . Printf ( e ) http . Error ( w , e , http . StatusInternalServerError ) return } }
BBPD-only endpoint.
BBPD - only endpoint .
// translate the Response to a ResponseItemJSON