// EndpointGet returns endpoint by ID
2831
func (c *Client) EndpointGet(id string) (*models.Endpoint, error) {
	params := endpoint.NewGetEndpointIDParams().WithID(id).WithTimeout(api.ClientTimeout)
	resp, err := c.Endpoint.GetEndpointID(params)
	if err != nil {
		/* Since plugins rely on checking the error type, we don't wrap this
		 * with Hint(...)
		 */
		return nil, err
	}
	return resp.Payload, nil
}
215515
func (shopify *Shopify) Get(endpoint string) ([]byte, []error) {

	targetUrl := shopify.createTargetURL(endpoint)

	request := gorequest.New()
	_, body, errs := request.Get(targetUrl).End()

	return []byte(body), errs
}
582180
func GetEndpointByName(endpointName string) (*HostComputeEndpoint, error) {
	hcnQuery := defaultQuery()
	mapA := map[string]string{"Name": endpointName}
	filter, err := json.Marshal(mapA)
	if err != nil {
		return nil, err
	}
	hcnQuery.Filter = string(filter)

	endpoints, err := ListEndpointsQuery(hcnQuery)
	if err != nil {
		return nil, err
	}
	if len(endpoints) == 0 {
		return nil, EndpointNotFoundError{EndpointName: endpointName}
	}
	return &endpoints[0], err
}
716046
func (a *Client) GetEndpointIDConfig(params *GetEndpointIDConfigParams) (*GetEndpointIDConfigOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewGetEndpointIDConfigParams()
	}

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

}
1155100
func httpInspectEndpointGroup(w http.ResponseWriter, r *http.Request, vars map[string]string) (interface{}, error) {
	var obj EndpointGroupInspect
	log.Debugf("Received httpInspectEndpointGroup: %+v", vars)

	key := vars["key"]

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

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

	// Return the obj
	return &obj, nil
}
739979
func NewGetEndpointIDConfig(ctx *middleware.Context, handler GetEndpointIDConfigHandler) *GetEndpointIDConfig {
	return &GetEndpointIDConfig{Context: ctx, Handler: handler}
}
774265
func (c *EndpointCache) get(endpointKey string) (Endpoint, bool) {
	endpoint, ok := c.endpoints.Load(endpointKey)
	if !ok {
		return Endpoint{}, false
	}

	c.endpoints.Store(endpointKey, endpoint)
	return endpoint.(Endpoint), true
}
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)
}
936350
func (c *endpoints) Get(name string) (result *api.Endpoints, err error) {
	result = &api.Endpoints{}
	err = c.r.Get().Namespace(c.ns).Resource("endpoints").Name(name).Do().Into(result)
	return
}
781788
func (c *Client) Get(endpoint string) (tumblr.Response, error) {
	return c.GetWithParams(endpoint, url.Values{})
}
310390
func (c *FakeEndpoints) Get(name string, options v1.GetOptions) (result *corev1.Endpoints, err error) {
	obj, err := c.Fake.
		Invokes(testing.NewGetAction(endpointsResource, c.ns, name), &corev1.Endpoints{})

	if obj == nil {
		return nil, err
	}
	return obj.(*corev1.Endpoints), err
}
1021931
func (c *Client) Get(endpoint string) (*RawResponse, error) {
	return c.getCancelable(endpoint, nil)
}
1207074
func (ipvsc *ipvsControllerController) getEndpoints(
	s *api.Service, servicePort *api.ServicePort) []service {
	ep, err := ipvsc.epLister.GetServiceEndpoints(s)
	if err != nil {
		glog.Warningf("unexpected error getting service endpoints: %v", err)
		return []service{}
	}

	var endpoints []service

	// The intent here is to create a union of all subsets that match a targetPort.
	// We know the endpoint already matches the service, so all pod ips that have
	// the target port are capable of service traffic for it.
	for _, ss := range ep.Subsets {
		for _, epPort := range ss.Ports {
			var targetPort int
			switch servicePort.TargetPort.Type {
			case intstr.Int:
				if int(epPort.Port) == servicePort.TargetPort.IntValue() {
					targetPort = int(epPort.Port)
				}
			case intstr.String:
				if epPort.Name == servicePort.TargetPort.StrVal {
					targetPort = int(epPort.Port)
				}
			}
			if targetPort == 0 {
				continue
			}
			for _, epAddress := range ss.Addresses {
				endpoints = append(endpoints, service{IP: epAddress.IP, Port: targetPort})
			}
		}
	}

	return endpoints
}
1030249
func (c *Client) EndpointDelete(id string) error {
	params := endpoint.NewDeleteEndpointIDParams().WithID(id).WithTimeout(api.ClientTimeout)
	_, _, err := c.Endpoint.DeleteEndpointID(params)
	return Hint(err)
}
745081
func (ed *CoreinfoEndpoint) Get(ctx context.Context, in *pb.CoreinfoRequest) (*pb.CoreinfoReply, error) {
	key, err := ed.getKey(in, ctx)
	if err != nil {
		return nil, err
	}
	data, err := ed.wch.Get(key)
	if err != nil {
		return nil, err
	}
	obj, _, err := ed.make(key, data)
	if err != nil {
		return nil, err
	}
	return obj, nil
}
1075291
func httpGetEndpointGroup(w http.ResponseWriter, r *http.Request, vars map[string]string) (interface{}, error) {
	log.Debugf("Received httpGetEndpointGroup: %+v", vars)

	key := vars["key"]

	collections.endpointGroupMutex.Lock()
	defer collections.endpointGroupMutex.Unlock()
	obj := collections.endpointGroups[key]
	if obj == nil {
		log.Infof("endpointGroup %s not found", key)
		return nil, errors.New("endpointGroup not found")
	}

	// Return the obj
	return obj, nil
}
1048644
func (r *Relation) Endpoint(applicationname string) (Endpoint, error) {
	for _, ep := range r.doc.Endpoints {
		if ep.ApplicationName == applicationname {
			return ep, nil
		}
	}
	msg := fmt.Sprintf("application %q is not a member of %q", applicationname, r)
	return Endpoint{}, errors.NewNotFound(nil, msg)
}