// getLinks does a GET on a particular URL and try to deserialise it into
// a HAL links collection.
320739
func (n navigator) getLinks(uri string) (Links, error) {
	req, err := newHalRequest("GET", uri, nil)
	if err != nil {
		return Links{}, err
	}

	res, err := n.HttpClient.Do(req)
	if err != nil {
		return Links{}, err
	}
	defer res.Body.Close()

	body, err := ioutil.ReadAll(res.Body)
	if err != nil {
		return Links{}, err
	}

	var m Links

	if err := json.Unmarshal(body, &m); err != nil {
		return Links{}, fmt.Errorf("Unable to unmarshal '%s': %v", string(body), err)
	}

	return m, nil
}
1233892
func (ctx *Context) GETKeys() []string {
	var res []string
	ctx.Request.URI().QueryArgs().VisitAll(func(key, value []byte) {
		res = append(res, string(key))
	})
	return res
}
863047
func (s *Snapshot) GetResources(typ string) map[string]Resource {
	if s == nil {
		return nil
	}
	switch typ {
	case EndpointType:
		return s.Endpoints.Items
	case ClusterType:
		return s.Clusters.Items
	case RouteType:
		return s.Routes.Items
	case ListenerType:
		return s.Listeners.Items
	case SecretType:
		return s.Secrets.Items
	}
	return nil
}
1144610
func (g *gatewayCfg) getURLsAsStrings() []string {
	g.RLock()
	a := make([]string, 0, len(g.urls))
	for _, u := range g.urls {
		a = append(a, u.Host)
	}
	g.RUnlock()
	return a
}
666617
func (o *NSRedundantGatewayGroup) ShuntLinks(info *bambou.FetchingInfo) (ShuntLinksList, *bambou.Error) {

	var list ShuntLinksList
	err := bambou.CurrentSession().FetchChildren(o, ShuntLinkIdentity, &list, info)
	return list, err
}
957986
func (s *Service) GetRefs(projectId string) *GetRefsCall {
	c := &GetRefsCall{s: s, urlParams_: make(gensupport.URLParams)}
	c.projectId = projectId
	return c
}
26024
func serviceLinks(serviceID string) []link {
	serviceURI := fmt.Sprintf("/services/%s", serviceID)
	return []link{
		link{retrievelink, "GET", serviceURI},
		link{"ServiceLogs", "GET", serviceURI + "/logs"},
		link{updatelink, "PUT", serviceURI},
		link{deletelink, "DELETE", serviceURI},
	}
}
515713
func getLink(ifname string) (netlink.Link, error) {
	// find the link
	link, err := netlink.LinkByName(ifname)
	if err != nil {
		if !strings.Contains(err.Error(), "Link not found") {
			log.Errorf("unable to find link %q. Error: %q", ifname, err)
			return link, err
		}
		// try once more as sometimes (somehow) link creation is taking
		// sometime, causing link not found error
		time.Sleep(1 * time.Second)
		link, err = netlink.LinkByName(ifname)
		if err != nil {
			log.Errorf("unable to find link %q. Error %q", ifname, err)
		}
		return link, err
	}
	return link, err
}
310216
func (d *Driver) getLinks(netID string) (*intLinks, error) {
	docker := d.docker
	net, err := docker.NetworkInspect(context.Background(), netID)
	if err != nil {
		log.Errorf("Error inspecting network: %v", err)
		return nil, err
	}

	if net.Driver != "vxlan" {
		log.Errorf("Network %v is not a vxlan network", netID)
		return nil, errors.New("Not a vxlan network")
	}

	names, err := getIntNames(netID, docker)
	if err != nil {
		log.Errorf("Error getting interface names: %v", err)
		return nil, err
	}

	// get or create links
	var vxlan *netlink.Vxlan
	vxlanlink, err := netlink.LinkByName(names.VxlanName)
	if err == nil {
		vxlan = &netlink.Vxlan{
			LinkAttrs: *vxlanlink.Attrs(),
		}
	} else {
		vxlan, err = d.createVxLan(names.VxlanName, &net)
		if err != nil {
			log.Errorf("Error creating vxlan: %v", err)
			return nil, err
		}
	}

	links := &intLinks{
		Vxlan: vxlan,
	}

	return links, nil
}
75099
func (db *DB) fetchAllLinkNodes(tx *bbolt.Tx) ([]*LinkNode, error) {
	nodeMetaBucket := tx.Bucket(nodeInfoBucket)
	if nodeMetaBucket == nil {
		return nil, ErrLinkNodesNotFound
	}

	var linkNodes []*LinkNode
	err := nodeMetaBucket.ForEach(func(k, v []byte) error {
		if v == nil {
			return nil
		}

		nodeReader := bytes.NewReader(v)
		linkNode, err := deserializeLinkNode(nodeReader)
		if err != nil {
			return err
		}

		linkNodes = append(linkNodes, linkNode)
		return nil
	})
	if err != nil {
		return nil, err
	}

	return linkNodes, nil
}
862816
func (sw *OvsSwitch) GetUplinkInterfaces(uplinkID string) []string {
	uplink, _ := sw.uplinkDb.Get(uplinkID)
	if uplink == nil {
		return nil
	}
	return uplink.([]string)
}
327564
func (s *BatchReadSuccessfulResponse) SetGetLinkAttributes(v *BatchGetLinkAttributesResponse) *BatchReadSuccessfulResponse {
	s.GetLinkAttributes = v
	return s
}
990097
func (o *Domain) UplinkRDs(info *bambou.FetchingInfo) (UplinkRDsList, *bambou.Error) {

	var list UplinkRDsList
	err := bambou.CurrentSession().FetchChildren(o, UplinkRDIdentity, &list, info)
	return list, err
}
113445
func (mbs maybeSources) getURL() string {
	strslice := make([]string, 0, len(mbs))
	for _, mb := range mbs {
		strslice = append(strslice, mb.getURL())
	}
	return strings.Join(strslice, "\n")
}
114033
func (c *Client) GetHosts() ([]host.Host, error) {
	response := make([]host.Host, 0)
	if err := c.call("GetHosts", empty, &response); err != nil {
		return []host.Host{}, err
	}
	return response, nil
}
920512
func NewGetSharedLinksResult(Links []IsLinkMetadata) *GetSharedLinksResult {
	s := new(GetSharedLinksResult)
	s.Links = Links
	return s
}
361074
func (o *Domain) Links(info *bambou.FetchingInfo) (LinksList, *bambou.Error) {

	var list LinksList
	err := bambou.CurrentSession().FetchChildren(o, LinkIdentity, &list, info)
	return list, err
}