| 1 |
package cdn |
| 2 |
|
| 3 |
import "github.com/denverdino/aliyungo/common" |
| 4 |
|
| 5 |
type AddDomainRequest struct { |
| 6 |
DomainName string |
| 7 |
CdnType string |
| 8 |
|
| 9 |
SourceType string |
| 10 |
SourcePort int |
| 11 |
Sources string |
| 12 |
Scope string |
| 13 |
} |
| 14 |
|
| 15 |
type DescribeDomainsRequest struct { |
| 16 |
|
| 17 |
common.Pagination |
| 18 |
DomainName string |
| 19 |
DomainStatus string |
| 20 |
DomainSearchType string |
| 21 |
} |
| 22 |
|
| 23 |
type DomainsResponse struct { |
| 24 |
CdnCommonResponse |
| 25 |
common.PaginationResult |
| 26 |
Domains struct { |
| 27 |
PageData []Domains |
| 28 |
} |
| 29 |
} |
| 30 |
|
| 31 |
type DescribeDomainRequest struct { |
| 32 |
DomainName string |
| 33 |
} |
| 34 |
|
| 35 |
type DomainResponse struct { |
| 36 |
CdnCommonResponse |
| 37 |
GetDomainDetailModel DomainDetail |
| 38 |
} |
| 39 |
|
| 40 |
type DomainDetail struct { |
| 41 |
DomainName string |
| 42 |
Cname string |
| 43 |
HttpsCname string |
| 44 |
Scope string |
| 45 |
CdnType string |
| 46 |
SourceType string |
| 47 |
GmtCreated string |
| 48 |
GmtModified string |
| 49 |
DomainStatus string |
| 50 |
CertificateName string |
| 51 |
ServerCertificate string |
| 52 |
ServerCertificateStatus string |
| 53 |
Sources struct { |
| 54 |
Source []string |
| 55 |
} |
| 56 |
} |
| 57 |
|
| 58 |
type ModifyDomainRequest struct { |
| 59 |
DomainName string |
| 60 |
SourceType string |
| 61 |
SourcePort int |
| 62 |
Sources string |
| 63 |
} |
| 64 |
|
| 65 |
type DescribeDomainsBySourceRequest struct { |
| 66 |
Sources string |
| 67 |
} |
| 68 |
|
| 69 |
type DomainInfo struct { |
| 70 |
DomainName string |
| 71 |
Status string |
| 72 |
CreateTime string |
| 73 |
UpdateTime string |
| 74 |
DomainCname string |
| 75 |
} |
| 76 |
|
| 77 |
type DomainsData struct { |
| 78 |
Source string |
| 79 |
Domains struct { |
| 80 |
domainNames []string |
| 81 |
} |
| 82 |
DomainInfos struct { |
| 83 |
domainInfo []DomainInfo |
| 84 |
} |
| 85 |
} |
| 86 |
|
| 87 |
type DomainBySourceResponse struct { |
| 88 |
CdnCommonResponse |
| 89 |
Sources string |
| 90 |
DomainsList struct { |
| 91 |
DomainsData []DomainsData |
| 92 |
} |
| 93 |
} |
| 94 |
|
| 95 |
func (client *CdnClient) AddCdnDomain(req AddDomainRequest) (CdnCommonResponse, error) { |
| 96 |
var resp CdnCommonResponse |
| 97 |
err := client.Invoke("AddCdnDomain", req, &resp) |
| 98 |
if err != nil { |
| 99 |
return CdnCommonResponse{}, err |
| 100 |
} |
| 101 |
return resp, nil |
| 102 |
} |
| 103 |
|
| 104 |
func (client *CdnClient) DescribeUserDomains(req DescribeDomainsRequest) (DomainsResponse, error) { |
| 105 |
var resp DomainsResponse |
| 106 |
err := client.Invoke("DescribeUserDomains", req, &resp) |
| 107 |
if err != nil { |
| 108 |
return DomainsResponse{}, err |
| 109 |
} |
| 110 |
return resp, nil |
| 111 |
} |
| 112 |
|
| 113 |
func (client *CdnClient) DescribeCdnDomainDetail(req DescribeDomainRequest) (DomainResponse, error) { |
| 114 |
var resp DomainResponse |
| 115 |
err := client.Invoke("DescribeCdnDomainDetail", req, &resp) |
| 116 |
if err != nil { |
| 117 |
return DomainResponse{}, err |
| 118 |
} |
| 119 |
return resp, nil |
| 120 |
} |
| 121 |
|
| 122 |
func (client *CdnClient) ModifyCdnDomain(req ModifyDomainRequest) (CdnCommonResponse, error) { |
| 123 |
var resp CdnCommonResponse |
| 124 |
err := client.Invoke("ModifyCdnDomain", req, &resp) |
| 125 |
if err != nil { |
| 126 |
return CdnCommonResponse{}, err |
| 127 |
} |
| 128 |
return resp, nil |
| 129 |
} |
| 130 |
|
| 131 |
func (client *CdnClient) StartCdnDomain(req DescribeDomainRequest) (CdnCommonResponse, error) { |
| 132 |
var resp CdnCommonResponse |
| 133 |
err := client.Invoke("StartCdnDomain", req, &resp) |
| 134 |
if err != nil { |
| 135 |
return CdnCommonResponse{}, err |
| 136 |
} |
| 137 |
return resp, nil |
| 138 |
} |
| 139 |
|
| 140 |
func (client *CdnClient) StopCdnDomain(req DescribeDomainRequest) (CdnCommonResponse, error) { |
| 141 |
var resp CdnCommonResponse |
| 142 |
err := client.Invoke("StopCdnDomain", req, &resp) |
| 143 |
if err != nil { |
| 144 |
return CdnCommonResponse{}, err |
| 145 |
} |
| 146 |
return resp, nil |
| 147 |
} |
| 148 |
|
| 149 |
func (client *CdnClient) DeleteCdnDomain(req DescribeDomainRequest) (CdnCommonResponse, error) { |
| 150 |
var resp CdnCommonResponse |
| 151 |
err := client.Invoke("DeleteCdnDomain", req, &resp) |
| 152 |
if err != nil { |
| 153 |
return CdnCommonResponse{}, err |
| 154 |
} |
| 155 |
return resp, nil |
| 156 |
} |
| 157 |
|
| 158 |
func (client *CdnClient) DescribeDomainsBySource(req DescribeDomainsBySourceRequest) (DomainBySourceResponse, error) { |
| 159 |
var resp DomainBySourceResponse |
| 160 |
err := client.Invoke("DescribeDomainsBySource", req, &resp) |
| 161 |
if err != nil { |
| 162 |
return DomainBySourceResponse{}, err |
| 163 |
} |
| 164 |
return resp, nil |
| 165 |
} |