// GetDomainRecords gets all the doamin records according to input subdomain key
GetDomainRecords gets all the doamin records according to input subdomain key
// GetDomainRecords gets all the doamin records according to input subdomain key
func (d *AliDNS) GetDomainRecords(domain, rr string) []DomainRecord {
	resp := &domainRecordsResp{}
	parms := map[string]string{
		"Action":    "DescribeSubDomainRecords",
		"SubDomain": fmt.Sprintf("%s.%s", rr, domain),
	}
	if d.IPType == "" || strings.ToUpper(d.IPType) == godns.IPV4 {
		parms["Type"] = godns.IPTypeA
	} else if strings.ToUpper(d.IPType) == godns.IPV6 {
		parms["Type"] = godns.IPTypeAAAA
	}
	urlPath := d.genRequestURL(parms)
	body, err := getHTTPBody(urlPath)
	if err != nil {
		fmt.Printf("GetDomainRecords error.%+v\n", err)
	} else {
		if err := json.Unmarshal(body, resp); err != nil {
			fmt.Printf("GetDomainRecords error. %+v\n", err)
			return nil
		}
		return resp.DomainRecords.Record
	}
	return nil
}
func ( d * AliDNS ) GetDomainRecords ( domain , rr string ) [ ] DomainRecord { resp := & domainRecordsResp { } parms := map [ string ] string { " " : " " , " " : fmt . Sprintf ( " " , rr , domain ) , } if d . IPType == " " || strings . ToUpper ( d . IPType ) == godns . IPV4 { parms [ " " ] = godns . IPTypeA } else if strings . ToUpper ( d . IPType ) == godns . IPV6 { parms [ " " ] = godns . IPTypeAAAA } urlPath := d . genRequestURL ( parms ) body , err := getHTTPBody ( urlPath ) if err != nil { fmt . Printf ( " \n " , err ) } else { if err := json . Unmarshal ( body , resp ) ; err != nil { fmt . Printf ( " \n " , err ) return nil } return resp . DomainRecords . Record } return nil }
GetDomainRecords gets all the doamin records according to input subdomain key
GetDomainRecords gets all the doamin records according to input subdomain key