// retrieve the current member, i.e. the current endpoint in use
975535
func (c *cluster) getMember() (string, error) {
	c.RLock()
	defer c.RUnlock()
	for _, n := range c.members {
		if n.status == memberStatusUp {
			return n.endpoint, nil
		}
	}

	return "", ErrMarathonDown
}
203505
func GetOperEndpoint(obj *EndpointInspect) error {
	// Check if we handle this object
	if objCallbackHandler.EndpointCb == nil {
		log.Errorf("No callback registered for endpoint object")
		return errors.New("Invalid object type")
	}

	// Perform callback
	err := objCallbackHandler.EndpointCb.EndpointGetOper(obj)
	if err != nil {
		log.Errorf("EndpointDelete retruned error for: %+v. Err: %v", obj, err)
		return err
	}

	return nil
}
331037
func GetRestEndPoint(url string) string {
	root := route.RestV1GroupEndPoint

	var buffer bytes.Buffer
	buffer.WriteString(root)
	buffer.WriteString(url)
	return buffer.String()
}
166335
func (b *BigIP) GetPoolMember(pool string, member string) (*PoolMember, error) {
	var poolMember PoolMember
	err, ok := b.getForEntity(&poolMember, uriLtm, uriPool, pool, uriPoolMember, member)

	if err != nil {
		return nil, err
	}
	if !ok {
		return nil, nil
	}

	return &poolMember, nil
}
1277966
func (o *Organization) GetPublicMembersURL() string {
	if o == nil || o.PublicMembersURL == nil {
		return ""
	}
	return *o.PublicMembersURL
}
689099
func (a *Application) Endpoint(relationName string) (Endpoint, error) {
	eps, err := a.Endpoints()
	if err != nil {
		return Endpoint{}, err
	}
	for _, ep := range eps {
		if ep.Name == relationName {
			return ep, nil
		}
	}
	return Endpoint{}, errors.Errorf("application %q has no %q relation", a, relationName)
}
136327
func Get(provider common.Provider, creds *common.Credentials, endpoint string) (objx.Map, error) {

	client, clientErr := provider.GetClient(creds)

	if clientErr != nil {
		return nil, clientErr
	}

	response, responseErr := client.Get(endpoint)

	if responseErr != nil {
		return nil, responseErr
	}

	body, bodyErr := ioutil.ReadAll(response.Body)

	if bodyErr != nil {
		return nil, bodyErr
	}

	defer response.Body.Close()

	codecs := services.NewWebCodecService()
	codec, getCodecErr := codecs.GetCodec(response.Header.Get("Content-Type"))

	if getCodecErr != nil {
		return nil, getCodecErr
	}

	var data objx.Map
	unmarshalErr := codec.Unmarshal(body, &data)

	if unmarshalErr != nil {
		return nil, unmarshalErr
	}

	return data, nil

}
1264954
func getEndpointsAndPort(endpoints []string) (endpointsR []string, portR int, err error) {
	var resultEndpoints []string
	var resultPort int

	if len(endpoints) > 1 {
		return nil, 0, ErrInvalidEndpointConfig
	}

	if len(endpoints[0]) > 0 {
		v := endpoints[0]

		if !strings.Contains(v, ":") {
			return nil, 0, ErrInvalidEndpointConfig
		}

		if strings.Contains(v, ",") {
			endpointsAndPort := strings.Split(v, ",")
			for _, val := range endpointsAndPort {
				endpointAndPort := strings.Split(val, ":")
				resultEndpoints = append(resultEndpoints, endpointAndPort[0])
				resultPort, err = strconv.Atoi(endpointAndPort[1])
				if err != nil {
					return nil, 0, err
				}
			}

		} else {
			endpointAndPort := strings.Split(v, ":")
			resultEndpoints = append(resultEndpoints, endpointAndPort[0])
			resultPort, err = strconv.Atoi(endpointAndPort[1])
			if err != nil {
				return nil, 0, err
			}
		}
	} else {
		return nil, 0, ErrInvalidEndpointConfig
	}

	return resultEndpoints, resultPort, nil
}
443609
func (o *Organization) GetMembersURL() string {
	if o == nil || o.MembersURL == nil {
		return ""
	}
	return *o.MembersURL
}
1363496
func (o *Organization) GetMembers(args Arguments) (members []*Member, err error) {
	path := fmt.Sprintf("organizations/%s/members", o.ID)
	err = o.client.Get(path, args, &members)
	for i := range members {
		members[i].client = o.client
	}
	return
}
511834
func (c *Client) Get(endpoint string, resp interface{}) error {
	return c.Result(c.NewJsonRequest(GET, endpoint, nil), resp)
}
925578
func (e *Endpoint) GetModel() *models.Endpoint {
	if e == nil {
		return nil
	}
	// NOTE: Using rlock on mutex directly because GetModelRLocked handles removed endpoint properly
	e.mutex.RLock()
	defer e.mutex.RUnlock()

	return e.GetModelRLocked()
}
1306930
func GetCurrentUser(req *http.Request) *users.User {
	if currentUser, ok := auth.Auth.GetCurrentUser(req).(*users.User); ok {
		return currentUser
	}
	return nil
}
687310
func (client *Client) getEndpointByLocation() string {
	locationClient := NewLocationClient(client.AccessKeyId, client.AccessKeySecret, client.securityToken)
	locationClient.SetDebug(true)
	return locationClient.DescribeOpenAPIEndpoint(client.regionID, client.serviceCode)
}
762590
func (el *EndpointsLock) Get() (*LeaderElectionRecord, error) {
	var record LeaderElectionRecord
	var err error
	el.e, err = el.Client.Endpoints(el.EndpointsMeta.Namespace).Get(el.EndpointsMeta.Name, metav1.GetOptions{})
	if err != nil {
		return nil, err
	}
	if el.e.Annotations == nil {
		el.e.Annotations = make(map[string]string)
	}
	if recordBytes, found := el.e.Annotations[LeaderElectionRecordAnnotationKey]; found {
		if err := json.Unmarshal([]byte(recordBytes), &record); err != nil {
			return nil, err
		}
	}
	return &record, nil
}
835136
func (p *Provider) Endpoint() oauth2.Endpoint {
	return oauth2.Endpoint{AuthURL: p.AuthURL, TokenURL: p.TokenURL}
}
1065292
func (s *GroupsService) GetGroupMember(groupID, accountID string) (*AccountInfo, *Response, error) {
	u := fmt.Sprintf("groups/%s/members/%s", groupID, accountID)

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

	v := new(AccountInfo)
	resp, err := s.client.Do(req, v)
	if err != nil {
		return nil, resp, err
	}

	return v, resp, err
}