func IsValidDomain(cli bce.Client, domain string) (*DomainValidInfo, error) {
	urlPath := fmt.Sprintf("/v2/domain/%s/valid", domain)
	respObj := &DomainValidInfo{}
	err := httpRequest(cli, "GET", urlPath, nil, nil, respObj)
	if err != nil {
		return nil, err
	}
	respObj.Domain = domain
	return respObj, nil
}
IsValidDomain - check the specified domain whether it can be added to CDN service or not
For details, please refer https://cloud.baidu.com/doc/CDN/s/qjwvyexh6

PARAMS:
- cli: the client agent which can perform sending request
- domain: the specified domain
RETURNS:
- *DomainValidInfo: available information about the specified domain
- error: nil if success otherwise the specific error
package api
import (
	"errors"
	"fmt"
	"github.com/baidubce/bce-sdk-go/bce"
)
type DomainStatus struct {
	Domain string `json:"domain"`
	Status string `json:"status"`
}
type DomainValidInfo struct {
	Domain  string
	IsValid bool   `json:"isValid"`
	Message string `json:"message"`
}
type OriginPeer struct {
	Peer      string `json:"peer"`
	Host      string `json:"host,omitempty"`
	Backup    bool   `json:"backup"`
	Follow302 bool   `json:"follow302"`
}
type OriginInit struct {
	Origin      []OriginPeer `json:"origin"`
	DefaultHost string       `json:"defaultHost,omitempty"`
	Form        string       `json:"form,omitempty"`
}
type DomainCreatedInfo struct {
	Domain string `json:"domain"`
	Status string `json:"status"`
	Cname  string `json:"cname"`
}
func ListDomains(cli bce.Client, marker string) ([]string, string, error) {
	type domainInfo struct {
		Name string `json:"name"`
	}
	respObj := &struct {
		IsTruncated bool         `json:"isTruncated"`
		Domains     []domainInfo `json:"domains"`
		NextMarker  string       `json:"nextMarker"`
	}{}
	params := map[string]string{}
	if marker != "" {
		params["marker"] = marker
	}
	err := httpRequest(cli, "GET", "/v2/domain", params, nil, respObj)
	if err != nil {
		return nil, "", err
	}
	domains := make([]string, len(respObj.Domains))
	for i, domain := range respObj.Domains {
		domains[i] = domain.Name
	}
	return domains, respObj.NextMarker, nil
}
func GetDomainStatus(cli bce.Client, status string, rule string) ([]DomainStatus, error) {
	if status == "" {
		return nil, errors.New("domain status parameter could not be empty")
	}
	params := map[string]string{
		"status": status,
	}
	if rule != "" {
		params["rule"] = rule
	}
	respObj := &struct {
		Domains []DomainStatus `json:"domains"`
	}{}
	err := httpRequest(cli, "GET", "/v2/user/domains", params, nil, respObj)
	if err != nil {
		return nil, err
	}
	return respObj.Domains, nil
}