// GET Oper REST call
9122
func httpInspectServiceLB(w http.ResponseWriter, r *http.Request, vars map[string]string) (interface{}, error) {
	var obj ServiceLBInspect
	log.Debugf("Received httpInspectServiceLB: %+v", vars)

	key := vars["key"]

	collections.serviceLBMutex.Lock()
	defer collections.serviceLBMutex.Unlock()
	objConfig := collections.serviceLBs[key]
	if objConfig == nil {
		log.Errorf("serviceLB %s not found", key)
		return nil, errors.New("serviceLB not found")
	}
	obj.Config = *objConfig

	if err := GetOperServiceLB(&obj); err != nil {
		log.Errorf("GetServiceLB error for: %+v. Err: %v", obj, err)
		return nil, err
	}

	// Return the obj
	return &obj, nil
}
356855
func (api *API) RestAPIURL() *gocf.StringExpr {
	return gocf.Join("",
		gocf.String("https://"),
		gocf.Ref(api.LogicalResourceName()),
		gocf.String(".execute-api."),
		gocf.Ref("AWS::Region"),
		gocf.String(".amazonaws.com"))
}
73218
func (a *Client) GetService(params *GetServiceParams) (*GetServiceOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewGetServiceParams()
	}

	result, err := a.transport.Submit(&runtime.ClientOperation{
		ID:                 "GetService",
		Method:             "GET",
		PathPattern:        "/service",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json"},
		Schemes:            []string{"http"},
		Params:             params,
		Reader:             &GetServiceReader{formats: a.formats},
		Context:            params.Context,
		Client:             params.HTTPClient,
	})
	if err != nil {
		return nil, err
	}
	return result.(*GetServiceOK), nil

}
356651
func (a *AlertsService) Get(id uint) (*Alert, *http.Response, error) {
	urlStr := fmt.Sprintf("alerts/%d", id)

	req, err := a.client.NewRequest("GET", urlStr, nil)
	if err != nil {
		return nil, nil, err
	}

	alert := new(Alert)
	resp, err := a.client.Do(req, alert)
	if err != nil {
		return nil, resp, err
	}

	return alert, resp, err
}
324404
func (h *modelRestHandler) ServeGet(w http.ResponseWriter, r *http.Request) error {
	if r.Method != "GET" {
		return errors.Trace(emitUnsupportedMethodErr(r.Method))
	}

	st, _, err := h.ctxt.stateForRequestAuthenticated(r)
	if err != nil {
		return errors.Trace(err)
	}
	defer st.Release()

	return errors.Trace(h.processGet(r, w, st.State))
}
1093181
func (oc *openShiftAPIClient) getResource(path string, allowMissing bool) (map[string]interface{}, error) {

	url, err := oc.config.GetAPIURL()
	if err != nil {
		return nil, err
	}
	var body []byte
	fullURL := strings.TrimSuffix(*url, "/") + path
	req, err := http.NewRequest("GET", fullURL, bytes.NewReader(body))
	if err != nil {
		log.Error(nil, map[string]interface{}{
			"err": err,
			"url": fullURL,
		}, "error creating HTTP GET request")
		return nil, errs.WithStack(err)
	}

	token, err := oc.config.GetAPIToken()
	if err != nil {
		return nil, err
	}

	req.Header.Set("Accept", "application/json")
	req.Header.Set("Authorization", "Bearer "+*token)

	resp, err := oc.httpClient.Do(req)
	if err != nil {
		log.Error(nil, map[string]interface{}{
			"err": err,
			"url": fullURL,
		}, "error during HTTP request")
		return nil, errs.WithStack(err)
	}

	defer resp.Body.Close()

	buf := new(bytes.Buffer)
	buf.ReadFrom(resp.Body)
	b := buf.Bytes()

	status := resp.StatusCode
	if status == http.StatusNotFound && allowMissing {
		return nil, nil
	} else if status < http.StatusOK || status > http.StatusPartialContent {
		log.Error(nil, map[string]interface{}{
			"url":           fullURL,
			"response_body": buf,
			"http_status":   status,
		}, "error returned from HTTP request")

		// If response contains a Kubernetes Status object, create a StatusError
		err = parseErrorFromStatus(b)
		if err != nil {
			return nil, convertError(errs.WithStack(err), "failed to GET url %s due to status code %d", fullURL, status)
		}
		return nil, errs.Errorf("failed to GET url %s due to status code %d", fullURL, status)
	}
	var respType map[string]interface{}
	err = json.Unmarshal(b, &respType)
	if err != nil {
		log.Error(nil, map[string]interface{}{
			"err":           err,
			"url":           fullURL,
			"response_body": buf,
			"http_status":   status,
		}, "error unmarshalling JSON response")
		return nil, errs.WithStack(err)
	}
	return respType, nil
}
956247
func callGet(apiMethod string, params *apiParams, args map[string]interface{}, result interface{}, rules P) (err error) {
	urlParams := url.Values{}
	urlParams.Add("method", apiMethod)
	urlParams.Add("api_key", params.apikey)

	formated, err := formatArgs(args, rules)
	if err != nil {
		return
	}
	for k, v := range formated {
		urlParams.Add(k, v)
	}

	uri := constructUrl(UriApiSecBase, urlParams)

	client := &http.Client{}
	req, err := http.NewRequest("GET", uri, nil)
	if err != nil {
		return
	}
	if params.useragent != "" {
		req.Header.Set("User-Agent", params.useragent)
	}

	res, err := client.Do(req)
	if err != nil {
		return
	}
	if res.StatusCode/100 == 5 { // only 5xx class errors
		err = newLibError(res.StatusCode, res.Status)
		return
	}
	body, err := ioutil.ReadAll(res.Body)
	if err != nil {
		return
	}
	err = parseResponse(body, result)
	return
}
39976
func (_m *API) GetService(_a0 string) (*service.Service, error) {
	ret := _m.Called(_a0)

	var r0 *service.Service
	if rf, ok := ret.Get(0).(func(string) *service.Service); ok {
		r0 = rf(_a0)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*service.Service)
		}
	}

	var r1 error
	if rf, ok := ret.Get(1).(func(string) error); ok {
		r1 = rf(_a0)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}
898656
func (c *Contract) GetOp(n uint64) OpCode {
	return OpCode(c.GetByte(n))
}
511834
func (c *Client) Get(endpoint string, resp interface{}) error {
	return c.Result(c.NewJsonRequest(GET, endpoint, nil), resp)
}
17515
func GetRecall(class string, c ConfusionMatrix) float64 {
	// Fraction of relevant instances that are retrieved
	truePositives := GetTruePositives(class, c)
	falseNegatives := GetFalseNegatives(class, c)
	return truePositives / (truePositives + falseNegatives)
}
520726
func (mr *MockServiceDiscoveryMockRecorder) GetServer(id interface{}) *gomock.Call {
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetServer", reflect.TypeOf((*MockServiceDiscovery)(nil).GetServer), id)
}
621277
func (c *Client) GetStatus() (result Status, err error) {
	call := c.object.Call(dbusInterface+".GetStatus", 0)
	err = call.Err
	if err != nil {
		return
	}

	result = NewStatus(call.Body)

	return
}
564212
func (mr *MockSubscriptionMockRecorder) Get(arg0 interface{}) *gomock.Call {
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockSubscription)(nil).Get), arg0)
}
968326
func (self *Notifications) Get(request *gottp.Request) {
	var args struct {
		Organization string `json:"org"`
		AppName      string `json:"app_name"`
		User         string `json:"user" required:"true"`
	}

	request.ConvertArguments(&args)
	paginator := request.GetPaginator()

	all, err := sentApi.GetAll(paginator, args.User, args.AppName, args.Organization)

	if err != nil {
		if err != mgo.ErrNotFound {
			log.Println(err)
			request.Raise(gottp.HttpError{
				http.StatusInternalServerError,
				"Unable to fetch data, Please try again later.",
			})

		} else {
			request.Raise(gottp.HttpError{
				http.StatusNotFound,
				"Not Found.",
			})
		}
		return
	}

	request.Write(all)
	return
}
1078781
func callGetUserEmailService(userId uint) (rest.ResponseDTOUserInfo, apihelper.ApiErrors, int) {

	// call api
	req, err := http.NewRequest("GET", userBaseUrl+"/id/"+strconv.Itoa(int(userId)), nil)

	client := &http.Client{}
	resp, err := client.Do(req)
	if err != nil {
		panic(err)
	}
	defer resp.Body.Close()

	// read response
	body, _ := ioutil.ReadAll(resp.Body)

	userInfo := rest.ResponseDTOUserInfo{}
	apiErrors := apihelper.ApiErrors{}
	json.Unmarshal(body, &userInfo)
	json.Unmarshal(body, &apiErrors)

	return userInfo, apiErrors, resp.StatusCode
}
578671
func (cli *OpsGenieClient) OpsGenieAPIUrl() string {
	if cli.opsGenieAPIURL == "" {
		cli.opsGenieAPIURL = endpointURL
	}
	return cli.opsGenieAPIURL
}