// List records of a version of a DNS zone
328885
func (self *Record) List(zoneId, version int64) ([]*RecordInfo, error) {
	opts := &struct {
		Page int `xmlrpc:"page"`
	}{0}
	const perPage = 100
	params := []interface{}{self.Key, zoneId, version, opts}
	records := make([]*RecordInfo, 0)
	for {
		var res []interface{}
		if err := self.Call("domain.zone.record.list", params, &res); err != nil {
			return nil, err
		}
		for _, r := range res {
			record := ToRecordInfo(r.(map[string]interface{}))
			records = append(records, record)
		}
		if len(res) < perPage {
			break
		}
		opts.Page++
	}
	return records, nil
}
925475
func (_class VMSSClass) GetAllRecords(sessionID SessionRef) (_retval map[VMSSRef]VMSSRecord, _err error) {
	_method := "VMSS.get_all_records"
	_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
	if _err != nil {
		return
	}
	_result, _err := _class.client.APICall(_method, _sessionIDArg)
	if _err != nil {
		return
	}
	_retval, _err = convertVMSSRefToVMSSRecordMapToGo(_method + " -> ", _result.Value)
	return
}
19431
func (c *Client) GetDNSRecords(domain string) (records []DNSRecord, err error) {
	if err := c.get(`dns/records?domain=`+domain, &records); err != nil {
		return nil, err
	}
	sort.Sort(dnsrecords(records))
	return records, nil
}
812227
func (client *Client) AddZoneRecord(args *AddZoneRecordArgs) (response *AddZoneRecordResponse, err error) {
	response = &AddZoneRecordResponse{}

	err = client.Invoke("AddZoneRecord", args, &response)

	return response, err
}
577452
func (_class NetworkClass) GetAllRecords(sessionID SessionRef) (_retval map[NetworkRef]NetworkRecord, _err error) {
	_method := "network.get_all_records"
	_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
	if _err != nil {
		return
	}
	_result, _err := _class.client.APICall(_method, _sessionIDArg)
	if _err != nil {
		return
	}
	_retval, _err = convertNetworkRefToNetworkRecordMapToGo(_method + " -> ", _result.Value)
	return
}
1176740
func (s *DNSViewSnapshot) RecordsForZoneAndName(zoneInfo DNSZoneInfo, name string) []DNSRecord {
	var records []DNSRecord

	zone := s.zoneMap[zoneInfo.Name]
	if zone != nil {
		for k := range zone.Records {
			if zone.Records[k].Name != name {
				continue
			}

			records = append(records, zone.Records[k])
		}
	}

	return records
}
976167
func (c *openstackCloud) ListDNSRecordsets(zoneID string, opt recordsets.ListOptsBuilder) ([]recordsets.RecordSet, error) {
	var rrs []recordsets.RecordSet

	done, err := vfs.RetryWithBackoff(readBackoff, func() (bool, error) {
		allPages, err := recordsets.ListByZone(c.dnsClient, zoneID, opt).AllPages()
		if err != nil {
			return false, fmt.Errorf("failed to list dns recordsets: %s", err)
		}
		r, err := recordsets.ExtractRecordSets(allPages)
		if err != nil {
			return false, fmt.Errorf("failed to extract dns recordsets pages: %s", err)
		}
		rrs = r
		return true, nil
	})
	if err != nil {
		return rrs, err
	} else if done {
		return rrs, nil
	} else {
		return rrs, wait.ErrWaitTimeout
	}
}
1025203
func (s *DomainsService) ListRecords(domainID string, recordName string) ([]Record, *Response, error) {
	path := recordAction("List")

	payload := newPayLoad(s.client.CommonParams)

	payload.Add("domain_id", domainID)

	if recordName != "" {
		payload.Add("sub_domain", recordName)
	}

	wrappedRecords := recordsWrapper{}

	res, err := s.client.post(path, payload, &wrappedRecords)
	if err != nil {
		return []Record{}, res, err
	}

	if wrappedRecords.Status.Code != "1" {
		return wrappedRecords.Records, nil, fmt.Errorf("Could not get domains: %s", wrappedRecords.Status.Message)
	}

	records := []Record{}
	for _, record := range wrappedRecords.Records {
		records = append(records, record)
	}

	return records, res, nil
}
1333851
func (self *Domain) List() ([]*DomainInfoBase, error) {
	opts := &struct {
		Page int `xmlrpc:"page"`
	}{0}
	const perPage = 100
	params := []interface{}{self.Key, opts}
	domains := make([]*DomainInfoBase, 0)
	for {
		var res []interface{}
		if err := self.Call("domain.list", params, &res); err != nil {
			return nil, err
		}
		for _, r := range res {
			domain := ToDomainInfoBase(r.(map[string]interface{}))
			domains = append(domains, domain)
		}
		if len(res) < perPage {
			break
		}
		opts.Page++
	}
	return domains, nil
}
755968
func (s *DomainsService) ListDomains(accountID string, options *DomainListOptions) (*domainsResponse, error) {
	path := versioned(domainPath(accountID, ""))
	domainsResponse := &domainsResponse{}

	path, err := addURLQueryOptions(path, options)
	if err != nil {
		return nil, err
	}

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

	domainsResponse.HttpResponse = resp
	return domainsResponse, nil
}
1158969
func (c *Connect) ListDomains() ([]uint32, error) {
	var cDomainsIds [512](uint32)
	cDomainsPointer := unsafe.Pointer(&cDomainsIds)
	var err C.virError
	numDomains := C.virConnectListDomainsWrapper(c.ptr, (*C.int)(cDomainsPointer), 512, &err)
	if numDomains == -1 {
		return nil, makeError(&err)
	}

	return cDomainsIds[:numDomains], nil
}
663311
func (firewalls *Firewalls) List(ctx context.Context, zone string) ([]*Firewall, error) {
	return firewalls.listPages(ctx, zone, 1)
}
810219
func (c *Client) ListRecords(domainID int) ([]*Record, error) {
	uri := fmt.Sprintf("/%d/records/", domainID)
	req, err := c.newRequest(http.MethodGet, uri, nil)
	if err != nil {
		return nil, err
	}

	var records []*Record
	_, err = c.do(req, &records)
	if err != nil {
		return nil, err
	}
	return records, nil
}
1290808
func (z *zone) ResourceRecordSets() (dnsprovider.ResourceRecordSets, bool) {
	return &resourceRecordSets{
		zone: z,
	}, true
}
511805
func (c *openstackCloud) ListDNSZones(opt zones.ListOptsBuilder) ([]zones.Zone, error) {
	var zs []zones.Zone

	done, err := vfs.RetryWithBackoff(readBackoff, func() (bool, error) {
		allPages, err := zones.List(c.dnsClient, opt).AllPages()
		if err != nil {
			return false, fmt.Errorf("failed to list dns zones: %s", err)
		}
		r, err := zones.ExtractZones(allPages)
		if err != nil {
			return false, fmt.Errorf("failed to extract dns zone pages: %s", err)
		}
		zs = r
		return true, nil
	})
	if err != nil {
		return zs, err
	} else if done {
		return zs, nil
	} else {
		return zs, wait.ErrWaitTimeout
	}
}
976084
func (z *zones) List() ([]dnsprovider.Zone, error) {
	snapshot := z.dnsView.Snapshot()

	var zones []dnsprovider.Zone
	zoneInfos := snapshot.ListZones()
	for i := range zoneInfos {
		zones = append(zones, &zone{dnsView: z.dnsView, zoneInfo: zoneInfos[i]})
	}
	return zones, nil
}
154436
func (s *DomainService) ListDomains(p *ListDomainsParams) (*ListDomainsResponse, error) {
	resp, err := s.cs.newRequest("listDomains", p.toURLValues())
	if err != nil {
		return nil, err
	}

	var r ListDomainsResponse
	if err := json.Unmarshal(resp, &r); err != nil {
		return nil, err
	}

	return &r, nil
}