// BgpGet gets the Bgp object
333663
func (c *ContivClient) BgpGet(hostname string) (*Bgp, error) {
	// build key and URL
	keyStr := hostname
	url := c.baseURL + "/api/v1/Bgps/" + keyStr + "/"

	// http get the object
	var obj Bgp
	err := c.httpGet(url, &obj)
	if err != nil {
		log.Debugf("Error getting Bgp %+v. Err: %v", keyStr, err)
		return nil, err
	}

	return &obj, nil
}
1182896
func (g *HttpGetter) Get(href string) (*bytes.Buffer, error) {
	return g.get(href)
}
904811
func requestToMsgGet(req *http.Request) (*dns.Msg, error) {
	values := req.URL.Query()
	b64, ok := values["dns"]
	if !ok {
		return nil, fmt.Errorf("no 'dns' query parameter found")
	}
	if len(b64) != 1 {
		return nil, fmt.Errorf("multiple 'dns' query values found")
	}
	return base64ToMsg(b64[0])
}
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
}
915196
func (c *Client) SimpleGet(target string) (*http.Response, error) {
	// We parse the URL and then convert it right back to a string
	// later; this just acts as a check that Fastly isn't sending
	// us nonsense.
	url, err := url.Parse(target)
	if err != nil {
		return nil, err
	}

	request, err := http.NewRequest("GET", url.String(), nil)
	if err != nil {
		return nil, err
	}

	if len(c.apiKey) > 0 {
		request.Header.Set(APIKeyHeader, c.apiKey)
	}
	request.Header.Set("User-Agent", UserAgent)

	resp, err := checkResp(c.HTTPClient.Do(request))
	if err != nil {
		return resp, err
	}
	return resp, nil
}
271997
func httpDeleteBgp(w http.ResponseWriter, r *http.Request, vars map[string]string) (interface{}, error) {
	log.Debugf("Received httpDeleteBgp: %+v", vars)

	key := vars["key"]

	// Delete the object
	err := DeleteBgp(key)
	if err != nil {
		log.Errorf("DeleteBgp error for: %s. Err: %v", key, err)
		return nil, err
	}

	// Return the obj
	return key, nil
}
1244615
func deleteBgp(ctx *cli.Context) {
	if len(ctx.Args()) != 1 {
		errExit(ctx, exitHelp, "Host name required", true)
	}

	hostname := ctx.Args()[0]
	fmt.Printf("Deleting Bgp router config: %s\n", hostname)

	errCheck(ctx, getClient(ctx).BgpDelete(hostname))
}
521792
func (b *BigIP) GetBGPInstance(name string) (*BGPInstance, error) {
	var bgpInstance BGPInstance
	err, ok := b.getForEntity(&bgpInstance, uriNet, uriRouting, uriBGP, name)
	if err != nil {
		return nil, err
	}
	if !ok {
		return nil, nil
	}

	return &bgpInstance, nil
}
874557
func (ed *StreamrouterStreamprocsEndpoint) Get(ctx context.Context, in *pb.StreamrouterStreamprocsRequest) (*pb.StreamrouterStreamprocsReply, 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
}
1263832
func (s *MerkleStoreImpl) dbGet(m libkb.MetaContext, hash keybase1.MerkleStoreKitHash) *keybase1.MerkleStoreKit {
	db := m.G().LocalDb
	if db == nil {
		return nil
	}
	var entry dbKit
	if found, err := db.GetInto(&entry, s.dbKey()); err != nil {
		m.Debug("MerkleStore: error reading from db: %s", err)
		return nil
	} else if !found {
		return nil
	}
	if entry.DBVersion != dbVersion {
		return nil
	}
	if entry.Hash == hash {
		return &entry.Kit
	}
	return nil
}
1303944
func (c *EzClient) FileGet(url, path string) (int, error) {
	resp, err := c.Client.Get(url)
	if err != nil {
		return 0, err
	}

	return writeToPath(resp, path)
}
800537
func (p *Peer) PushGetBlocksMsg(locator blockchain.BlockLocator, stopHash *chainhash.Hash) error {
	// Extract the begin hash from the block locator, if one was specified,
	// to use for filtering duplicate getblocks requests.
	var beginHash *chainhash.Hash
	if len(locator) > 0 {
		beginHash = locator[0]
	}

	// Filter duplicate getblocks requests.
	p.prevGetBlocksMtx.Lock()
	isDuplicate := p.prevGetBlocksStop != nil && p.prevGetBlocksBegin != nil &&
		beginHash != nil && stopHash.IsEqual(p.prevGetBlocksStop) &&
		beginHash.IsEqual(p.prevGetBlocksBegin)
	p.prevGetBlocksMtx.Unlock()

	if isDuplicate {
		log.Tracef("Filtering duplicate [getblocks] with begin "+
			"hash %v, stop hash %v", beginHash, stopHash)
		return nil
	}

	// Construct the getblocks request and queue it to be sent.
	msg := wire.NewMsgGetBlocks(stopHash)
	for _, hash := range locator {
		err := msg.AddBlockLocatorHash(hash)
		if err != nil {
			return err
		}
	}
	p.QueueMessage(msg, nil)

	// Update the previous getblocks request information for filtering
	// duplicates.
	p.prevGetBlocksMtx.Lock()
	p.prevGetBlocksBegin = beginHash
	p.prevGetBlocksStop = stopHash
	p.prevGetBlocksMtx.Unlock()
	return nil
}
1079253
func (f *Fibre) Get(p string, h HandlerFunc) {
	f.router.Add(GET, p, h)
}
109869
func (cli *Client) ContainersGet(nodename string) (*pb.ContainersReply, error) {
	req := &pb.ContainersRequest{Nodename: nodename}
	ctx, cancel := context.WithTimeout(context.Background(), cli.timeout)
	defer cancel()
	rpl, err := cli.containersClient.Get(ctx, req)
	return rpl, err
}
247271
func (l *LoadBalancerStatusResult) Get(vip string) *LoadBalancerStatus {
	for _, v := range *l {
		if v.VirtualIPAddress == vip {
			return v
		}
	}
	return nil
}
867294
func (c *FCGIClient) Get(p map[string]string) (resp *http.Response, err error) {

	p["REQUEST_METHOD"] = "GET"
	p["CONTENT_LENGTH"] = "0"

	return c.Request(p, nil)
}
601386
func (h *LangHandler) cacheGet(ctx context.Context, conn jsonrpc2.JSONRPC2, key string, v interface{}) bool {
	if !h.init.Capabilities.XCacheProvider {
		return false
	}

	var r json.RawMessage
	err := conn.Call(ctx, "xcache/get", lspext.CacheGetParams{Key: key}, &r)
	if err != nil {
		return false
	}
	b := []byte(r)
	if bytes.Equal(b, []byte("null")) {
		return false
	}
	err = json.Unmarshal(b, &v)
	return err == nil
}