// DescribeDiskMonitorData describes disk monitoring data
//
// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/monitor&describediskmonitordata
2947
func (client *Client) DescribeDiskMonitorData(args *DescribeDiskMonitorDataArgs) (monitorData []DiskMonitorDataType, totalCount int, err error) {
	if args.Period == 0 {
		args.Period = 60
	}
	response := DescribeDiskMonitorDataResponse{}
	err = client.Invoke("DescribeDiskMonitorData", args, &response)
	if err != nil {
		return nil, 0, err
	}
	return response.MonitorData.DiskMonitorData, response.TotalCount, err
}
1092178
func (client *Client) DescribeDomainGroups(args *DescribeDomainGroupsArgs) (groups []DomainGroupType, err error) {
	action := "DescribeDomainGroups"
	response := &DescribeDomainGroupsResponse{}
	err = client.Invoke(action, args, response)

	if err != nil {
		log.Printf("%s error, %v", action, err)
		return nil, err
	}

	return response.DomainGroups.DomainGroup, nil
}
1225174
func (c *Client) DescribeDomain(request DescribeDomainRequest) (*DescribeDomainResponse, error) {
	resp := &DescribeDomainResponse{}
	err := c.swfReqWithResponse("DescribeDomain", request, resp)
	return resp, err
}
470260
func (m *Milestone) GetDescription() string {
	if m == nil || m.Description == nil {
		return ""
	}
	return *m.Description
}
1069474
func ReadDiskstat() ([]*DiskStatsProxy, error) {

	diskstatsproxies := []*DiskStatsProxy{}
	file, err := os.Open(diskStatFile)
	if err != nil {
		return nil, err
	}
	defer file.Close()
	scanner := bufio.NewScanner(file)

	for scanner.Scan() {
		line := strings.Fields(scanner.Text())
		if len(line) != 14 {
			err = fmt.Errorf("malformed diskstat line: %s", scanner.Text())
			return nil, err
		}

		// Each disk should only exist once in /proc/diskstat, error out if we find a dupe
		for _, proxy := range diskstatsproxies {
			if line[2] == proxy.Disk {
				return nil, fmt.Errorf("duplicate entry for disk %s found", line[2])
			}
		}

		major, err := strconv.ParseUint(line[0], 10, 8)
		if err != nil {
			return nil, fmt.Errorf("unable to convert major device number: %s", err)
		}
		minor, err := strconv.ParseUint(line[1], 10, 8)
		if err != nil {
			return nil, fmt.Errorf("unable to convert minor device number: %s", err)
		}
		stat := Diskstat{}
		for i := 3; i < len(line); i++ {
			switch i {
			case 3:
				err = parseInt64Line(line[i], &stat.NReads)
			case 4:
				err = parseInt64Line(line[i], &stat.NReadsMerged)
			case 5:
				err = parseInt64Line(line[i], &stat.NSectorsRead)
			case 6:
				err = parseInt64Line(line[i], &stat.NMsReading)
			case 7:
				err = parseInt64Line(line[i], &stat.NWrites)
			case 8:
				err = parseInt64Line(line[i], &stat.NWritesMerged)
			case 9:
				err = parseInt64Line(line[i], &stat.NSectorsWritten)
			case 10:
				err = parseInt64Line(line[i], &stat.NMsWriting)
			case 11:
				err = parseInt64Line(line[i], &stat.NIoInProgress)
			case 12:
				err = parseInt64Line(line[i], &stat.NMsIo)
			case 13:
				err = parseInt64Line(line[i], &stat.NMsIoWeighted)
			}

			if err != nil {
				return nil, err
			}
		}
		diskstatsproxies = append(diskstatsproxies, &DiskStatsProxy{Disk: line[2], Major: uint8(major), Minor: uint8(minor), Stats: &stat})
	}

	return diskstatsproxies, nil
}
111359
func (v *volumeSource) DescribeVolumes(ctx context.ProviderCallContext, volIds []string) ([]storage.DescribeVolumesResult, error) {
	pVolumes := v.client.client().CoreV1().PersistentVolumes()
	vols, err := pVolumes.List(v1.ListOptions{
		// TODO(caas) - filter on volumes for the current model
	})
	if err != nil {
		return nil, errors.Trace(err)
	}

	byId := make(map[string]core.PersistentVolume)
	for _, vol := range vols.Items {
		byId[vol.Name] = vol
	}
	results := make([]storage.DescribeVolumesResult, len(volIds))
	for i, volId := range volIds {
		vol, ok := byId[volId]
		if !ok {
			results[i].Error = errors.NotFoundf("%s", volId)
			continue
		}
		results[i].VolumeInfo = &storage.VolumeInfo{
			Size:       uint64(vol.Size()),
			VolumeId:   vol.Name,
			Persistent: vol.Spec.PersistentVolumeReclaimPolicy == core.PersistentVolumeReclaimRetain,
		}
	}
	return results, nil
}
590620
func (s *oracleVolumeSource) DescribeVolumes(ctx context.ProviderCallContext, volIds []string) ([]storage.DescribeVolumesResult, error) {
	if volIds == nil || len(volIds) == 0 {
		return []storage.DescribeVolumesResult{}, nil
	}

	tag := fmt.Sprintf("%s=%s", tags.JujuModel, s.modelUUID)
	filter := []oci.Filter{{
		Arg:   "tags",
		Value: tag,
	}}

	result := make([]storage.DescribeVolumesResult, len(volIds), len(volIds))
	volumes, err := s.api.AllStorageVolumes(filter)
	if err != nil {
		return nil, errors.Annotatef(err, "describe volumes")
	}
	asMap := map[string]ociResponse.StorageVolume{}
	for _, val := range volumes.Result {
		asMap[val.Name] = val
	}
	for i, volume := range volIds {
		if vol, ok := asMap[volume]; ok {
			volumeInfo := makeVolumeInfo(vol)
			result[i].VolumeInfo = &volumeInfo
		} else {
			result[i].Error = errors.NotFoundf("%s", volume)
		}
	}
	return result, nil
}
1184014
func (c *Client) Describe(ch chan<- *prometheus.Desc) {
	ch <- orgsDesc
	ch <- bucketsDesc
	ch <- usersDesc
	ch <- tokensDesc
	ch <- dashboardsDesc
	ch <- scrapersDesc
	ch <- telegrafsDesc
	ch <- boltWritesDesc
	ch <- boltReadsDesc
}
452139
func (s *VolumeSource) DescribeVolumes(ctx context.ProviderCallContext, volIds []string) ([]storage.DescribeVolumesResult, error) {
	s.MethodCall(s, "DescribeVolumes", ctx, volIds)
	if s.DescribeVolumesFunc != nil {
		return s.DescribeVolumesFunc(ctx, volIds)
	}
	return nil, errors.NotImplementedf("DescribeVolumes")
}
7452
func (client *Client) DescribeInstanceStatus(args *DescribeInstanceStatusArgs) (instanceStatuses []InstanceStatusItemType, pagination *common.PaginationResult, err error) {
	response, err := client.DescribeInstanceStatusWithRaw(args)

	if err == nil {
		return response.InstanceStatuses.InstanceStatus, &response.PaginationResult, nil
	}

	return nil, nil, err
}
68006
func getDockerDetailsData(path string, osOpen osOpenFunc) (resources.DockerImageDetails, error) {
	f, err := osOpen(path)
	if err == nil {
		defer f.Close()
		details, err := unMarshalDockerDetails(f)
		if err != nil {
			return details, errors.Trace(err)
		}
		return details, nil
	} else if err := resources.ValidateDockerRegistryPath(path); err == nil {
		return resources.DockerImageDetails{
			RegistryPath: path,
		}, nil
	}
	return resources.DockerImageDetails{}, errors.NotValidf("filepath or registry path: %s", path)

}
1359046
func parseDescription(data []byte) (*string, error) {
	base256Data, err := bech32.ConvertBits(data, 5, 8, false)
	if err != nil {
		return nil, err
	}

	description := string(base256Data)

	return &description, nil
}
309689
func (client *Client) DescribeEipMonitorData(args *DescribeEipMonitorDataArgs) (monitorData []EipMonitorDataType, err error) {
	if args.Period == 0 {
		args.Period = 60
	}
	response := DescribeEipMonitorDataResponse{}
	err = client.Invoke("DescribeEipMonitorData", args, &response)
	if err != nil {
		return nil, err
	}
	return response.EipMonitorDatas.EipMonitorData, err
}
1253671
func (dr *DescribeRequest) DescribedBlobStr(blobstr string) *DescribedBlob {
	if dr == nil {
		return nil
	}
	dr.mu.Lock()
	defer dr.mu.Unlock()
	return dr.m[blobstr]
}
1246232
func (m *ServerMetrics) Describe(ch chan<- *prom.Desc) {
	m.serverStartedCounter.Describe(ch)
	m.serverHandledCounter.Describe(ch)
	m.serverStreamMsgReceived.Describe(ch)
	m.serverStreamMsgSent.Describe(ch)
	if m.serverHandledHistogramEnabled {
		m.serverHandledHistogram.Describe(ch)
	}
}
591302
func (i *Interceptor) Describe(in chan<- *prometheus.Desc) {
	i.monitoring.dialer.Describe(in)
	i.monitoring.server.Describe(in)
	i.monitoring.client.Describe(in)
}
1076702
func (m *Machine) WatchInstanceData() NotifyWatcher {
	return newEntityWatcher(m.st, instanceDataC, m.doc.Id)
}