// GetDNSVersion is a handy function that returns the DNS version by DNS type
8803
func GetDNSVersion(dnsType kubeadmapi.DNSAddOnType) string {
	switch dnsType {
	case kubeadmapi.KubeDNS:
		return KubeDNSVersion
	default:
		return CoreDNSVersion
	}
}
782878
func (a *API) GetDomain(domain int) (*Domain, error) {
	dst := new(Domain)
	url := a.BuildURL("/v2/domain/%d", domain)
	err := a.Get(url, Params{}, dst)
	return dst, err
}
123176
func (s *DomainsService) GetDnssec(accountID string, domainIdentifier string) (*dnssecResponse, error) {
	path := versioned(dnssecPath(accountID, domainIdentifier))
	dnssecResponse := &dnssecResponse{}

	resp, err := s.client.get(path, dnssecResponse)
	if err != nil {
		return nil, err
	}

	dnssecResponse.HttpResponse = resp
	return dnssecResponse, nil
}
836868
func (vdb *versionedDB) GetVersion(namespace string, key string) (*version.Height, error) {
	versionedValue, err := vdb.GetState(namespace, key)
	if err != nil {
		return nil, err
	}
	if versionedValue == nil {
		return nil, nil
	}
	return versionedValue.Version, nil
}
1136416
func GetDNSServers(o dhcp6.Options) (IPs, error) {
	v, err := o.GetOne(dhcp6.OptionDNSServers)
	if err != nil {
		return nil, err
	}

	var ips IPs
	err = ips.UnmarshalBinary(v)
	return ips, err
}
638910
func (ds *dockerService) getDockerVersion() (*dockertypes.Version, error) {
	v, err := ds.client.Version()
	if err != nil {
		return nil, fmt.Errorf("failed to get docker version: %v", err)
	}
	// Docker API version (e.g., 1.23) is not semver compatible. Add a ".0"
	// suffix to remedy this.
	v.APIVersion = fmt.Sprintf("%s.0", v.APIVersion)
	return v, nil
}
1169961
func (g *GistCommit) GetVersion() string {
	if g == nil || g.Version == nil {
		return ""
	}
	return *g.Version
}
782010
func GetVersion(client *tuf.Client, name string) (string, error) {
	targets, err := client.Targets()
	if err != nil {
		return "", err
	}
	target, ok := targets[name]
	if !ok {
		return "", fmt.Errorf("missing %q in tuf targets", name)
	}
	if target.Custom == nil || len(*target.Custom) == 0 {
		return "", errors.New("missing custom metadata in tuf target")
	}
	var data struct {
		Version string
	}
	json.Unmarshal(*target.Custom, &data)
	if data.Version == "" {
		return "", errors.New("missing version in tuf target")
	}
	return data.Version, nil
}
774122
func getVersion(job *api.Job) uint64 {
	if job.Version != nil {
		return *job.Version
	}

	return 0
}
816390
func (c *Client) GetMetricVersions(ns string) *GetMetricsResult {
	r := &GetMetricsResult{}
	q := fmt.Sprintf("/metrics?ns=%s", ns)
	resp, err := c.do("GET", q, ContentTypeJSON)
	if err != nil {
		return &GetMetricsResult{Err: err}
	}

	switch resp.Meta.Type {
	case rbody.MetricsReturnedType:
		mc := resp.Body.(*rbody.MetricsReturned)
		r.Catalog = convertCatalog(mc)
	case rbody.ErrorType:
		r.Err = resp.Body.(*rbody.Error)
	default:
		r.Err = ErrAPIResponseMetaType
	}
	return r
}
361338
func GetKernelVersion() (*VersionInfo, error) {

	KVI := &VersionInfo{"Unknown", 0, 0, 0}

	k, err := registry.OpenKey(registry.LOCAL_MACHINE, `SOFTWARE\Microsoft\Windows NT\CurrentVersion`, registry.QUERY_VALUE)
	if err != nil {
		return KVI, err
	}
	defer k.Close()

	blex, _, err := k.GetStringValue("BuildLabEx")
	if err != nil {
		return KVI, err
	}
	KVI.kvi = blex

	// Important - docker.exe MUST be manifested for this API to return
	// the correct information.
	dwVersion, err := windows.GetVersion()
	if err != nil {
		return KVI, err
	}

	KVI.major = int(dwVersion & 0xFF)
	KVI.minor = int((dwVersion & 0XFF00) >> 8)
	KVI.build = int((dwVersion & 0xFFFF0000) >> 16)

	return KVI, nil
}
228617
func (c *Changelog) GetVersion(versionNum string) *Version {
	for _, v := range c.Versions {
		if v.Version == versionNum {
			return v
		}
	}
	return nil
}
373321
func (c *Adb) ServerVersion() (int, error) {
	resp, err := roundTripSingleResponse(c.server, "host:version")
	if err != nil {
		return 0, wrapClientError(err, c, "GetServerVersion")
	}

	version, err := c.parseServerVersion(resp)
	if err != nil {
		return 0, wrapClientError(err, c, "GetServerVersion")
	}
	return version, nil
}
182485
func GetVersion() string {
	if currentGitHead == "" {
		b, err := ioutil.ReadFile(".git/HEAD")

		if err != nil {
			currentGitHead = "unknown"
			return currentGitHead
		}

		p := refRE.FindStringSubmatch(string(b))

		if len(p) < 2 {
			currentGitHead = string(b)
			return currentGitHead
		}

		b, err = ioutil.ReadFile(".git/" + p[1])
		if err != nil {
			currentGitHead = p[1]
			return currentGitHead
		}

		currentGitHead = string(b)
	}
	return currentGitHead
}
1358155
func (ch *CredHub) GetNVersions(name string, numberOfVersions int) ([]credentials.Credential, error) {
	creds, err := ch.getNVersionsOfCredential(name, numberOfVersions)
	return creds, err
}
261485
func (i *Interpreter) GetVersion(c context.Context) (v Version, err error) {
	i.cachedVersionMu.Lock()
	defer i.cachedVersionMu.Unlock()

	// Check again, under write-lock.
	if i.cachedVersion != nil {
		v = *i.cachedVersion
		return
	}

	cmd := i.IsolatedCommand(c, CommandTarget{
		"import platform, sys; sys.stdout.write(platform.python_version())",
	})

	out, err := cmd.Output()
	if err != nil {
		err = errors.Annotate(err, "").Err()
		return
	}

	if v, err = ParseVersion(string(out)); err != nil {
		return
	}
	if v.IsZero() {
		err = errors.Reason("unknown version output").Err()
		return
	}

	i.cachedVersion = &v
	return
}
1328358
func (n *NetworkServerAPI) GetVersion(ctx context.Context, req *empty.Empty) (*ns.GetVersionResponse, error) {
	region, ok := map[string]common.Region{
		common.Region_AS923.String(): common.Region_AS923,
		common.Region_AU915.String(): common.Region_AU915,
		common.Region_CN470.String(): common.Region_CN470,
		common.Region_CN779.String(): common.Region_CN779,
		common.Region_EU433.String(): common.Region_EU433,
		common.Region_EU868.String(): common.Region_EU868,
		common.Region_IN865.String(): common.Region_IN865,
		common.Region_KR920.String(): common.Region_KR920,
		common.Region_RU864.String(): common.Region_RU864,
		common.Region_US915.String(): common.Region_US915,
	}[band.Band().Name()]

	if !ok {
		log.WithFields(log.Fields{
			"band_name": band.Band().Name(),
		}).Warning("unknown band to common name mapping")
	}

	return &ns.GetVersionResponse{
		Region:  region,
		Version: config.Version,
	}, nil
}