| 1 |
package cdn |
| 2 |
|
| 3 |
type DomainConfigRequest struct { |
| 4 |
DomainName string |
| 5 |
|
| 6 |
ConfigList string |
| 7 |
} |
| 8 |
|
| 9 |
type DomainConfigResponse struct { |
| 10 |
CdnCommonResponse |
| 11 |
DomainConfigs DomainConfigs |
| 12 |
} |
| 13 |
|
| 14 |
type DomainConfigs struct { |
| 15 |
PageCompressConfig struct { |
| 16 |
Enable string |
| 17 |
ConfigId string |
| 18 |
Status string |
| 19 |
} |
| 20 |
WafConfig struct { |
| 21 |
Enable string |
| 22 |
} |
| 23 |
IgnoreQueryStringConfig struct { |
| 24 |
Enable string |
| 25 |
ConfigId string |
| 26 |
Status string |
| 27 |
HashKeyArgs string |
| 28 |
} |
| 29 |
VideoSeekConfig struct { |
| 30 |
Enable string |
| 31 |
ConfigId string |
| 32 |
Status string |
| 33 |
} |
| 34 |
ReqAuthConfig struct { |
| 35 |
Key1 string |
| 36 |
Key2 string |
| 37 |
AuthType string |
| 38 |
TimeOut string |
| 39 |
} |
| 40 |
RangeConfig struct { |
| 41 |
Enable string |
| 42 |
ConfigId string |
| 43 |
Status string |
| 44 |
} |
| 45 |
SrcHostConfig struct { |
| 46 |
DomainName string |
| 47 |
} |
| 48 |
OptimizeConfig struct { |
| 49 |
Enable string |
| 50 |
ConfigId string |
| 51 |
Status string |
| 52 |
} |
| 53 |
ErrorPageConfig struct { |
| 54 |
PageType string |
| 55 |
CustomPageUrl string |
| 56 |
ErrorCode string |
| 57 |
} |
| 58 |
RefererConfig struct { |
| 59 |
AllowEmpty string |
| 60 |
ReferType string |
| 61 |
ReferList string |
| 62 |
} |
| 63 |
CcConfig struct { |
| 64 |
Enable string |
| 65 |
AllowIps string |
| 66 |
BlockIps string |
| 67 |
ConfigId string |
| 68 |
Status string |
| 69 |
} |
| 70 |
HttpHeaderConfigs struct { |
| 71 |
HttpHeaderConfig []HttpHeaderConfig |
| 72 |
} |
| 73 |
CacheExpiredConfigs struct { |
| 74 |
CacheExpiredConfig []CacheExpiredConfig |
| 75 |
} |
| 76 |
NotifyUrlConfig struct { |
| 77 |
Enable string |
| 78 |
NotifyUrl string |
| 79 |
} |
| 80 |
RedirectTypeConfig struct { |
| 81 |
RedirectType string |
| 82 |
} |
| 83 |
} |
| 84 |
|
| 85 |
type HttpHeaderConfig struct { |
| 86 |
Status string |
| 87 |
HeaderKey string |
| 88 |
HeaderValue string |
| 89 |
ConfigId string |
| 90 |
} |
| 91 |
|
| 92 |
type CacheExpiredConfig struct { |
| 93 |
Status string |
| 94 |
TTL string |
| 95 |
CacheType string |
| 96 |
Weight string |
| 97 |
CacheContent string |
| 98 |
ConfigId string |
| 99 |
} |
| 100 |
|
| 101 |
type ConfigRequest struct { |
| 102 |
DomainName string |
| 103 |
Enable string |
| 104 |
} |
| 105 |
|
| 106 |
type QueryStringConfigRequest struct { |
| 107 |
DomainName string |
| 108 |
Enable string |
| 109 |
|
| 110 |
HashKeyArgs string |
| 111 |
} |
| 112 |
|
| 113 |
type HostConfigRequest struct { |
| 114 |
DomainName string |
| 115 |
BackSrcDomain string |
| 116 |
} |
| 117 |
|
| 118 |
type ErrorPageConfigRequest struct { |
| 119 |
DomainName string |
| 120 |
PageType string |
| 121 |
|
| 122 |
CustomPageUrl string |
| 123 |
} |
| 124 |
|
| 125 |
type RedirectConfigRequest struct { |
| 126 |
DomainName string |
| 127 |
RedirectType string |
| 128 |
} |
| 129 |
|
| 130 |
type ReferConfigRequest struct { |
| 131 |
DomainName string |
| 132 |
ReferType string |
| 133 |
|
| 134 |
ReferList string |
| 135 |
AllowEmpty string |
| 136 |
} |
| 137 |
|
| 138 |
type CacheConfigRequest struct { |
| 139 |
DomainName string |
| 140 |
CacheContent string |
| 141 |
TTL string |
| 142 |
|
| 143 |
Weight string |
| 144 |
} |
| 145 |
|
| 146 |
type ModifyCacheConfigRequest struct { |
| 147 |
CacheConfigRequest |
| 148 |
ConfigID string |
| 149 |
} |
| 150 |
|
| 151 |
type DeleteCacheConfigRequest struct { |
| 152 |
DomainName string |
| 153 |
CacheType string |
| 154 |
ConfigID string |
| 155 |
} |
| 156 |
|
| 157 |
type ReqAuthConfigRequest struct { |
| 158 |
DomainName string |
| 159 |
AuthType string |
| 160 |
|
| 161 |
Key1 string |
| 162 |
Key2 string |
| 163 |
Timeout string |
| 164 |
} |
| 165 |
|
| 166 |
type HttpHeaderConfigRequest struct { |
| 167 |
DomainName string |
| 168 |
HeaderKey string |
| 169 |
HeaderValue string |
| 170 |
} |
| 171 |
|
| 172 |
type ModifyHttpHeaderConfigRequest struct { |
| 173 |
HttpHeaderConfigRequest |
| 174 |
ConfigID string |
| 175 |
} |
| 176 |
|
| 177 |
type DeleteHttpHeaderConfigRequest struct { |
| 178 |
DomainName string |
| 179 |
ConfigID string |
| 180 |
} |
| 181 |
|
| 182 |
type CertificateRequest struct { |
| 183 |
DomainName string |
| 184 |
CertName string |
| 185 |
ServerCertificateStatus string |
| 186 |
|
| 187 |
ServerCertificate string |
| 188 |
PrivateKey string |
| 189 |
} |
| 190 |
|
| 191 |
type IpBlackRequest struct { |
| 192 |
DomainName string |
| 193 |
|
| 194 |
Enable string |
| 195 |
BlockIps string |
| 196 |
} |
| 197 |
|
| 198 |
func (client *CdnClient) DescribeDomainConfigs(req DomainConfigRequest) (DomainConfigResponse, error) { |
| 199 |
var resp DomainConfigResponse |
| 200 |
err := client.Invoke("DescribeDomainConfigs", req, &resp) |
| 201 |
if err != nil { |
| 202 |
return DomainConfigResponse{}, err |
| 203 |
} |
| 204 |
return resp, nil |
| 205 |
} |
| 206 |
|
| 207 |
func (client *CdnClient) SetOptimizeConfig(req ConfigRequest) (CdnCommonResponse, error) { |
| 208 |
var resp CdnCommonResponse |
| 209 |
err := client.Invoke("SetOptimizeConfig", req, &resp) |
| 210 |
if err != nil { |
| 211 |
return CdnCommonResponse{}, err |
| 212 |
} |
| 213 |
return resp, nil |
| 214 |
} |
| 215 |
|
| 216 |
func (client *CdnClient) SetPageCompressConfig(req ConfigRequest) (CdnCommonResponse, error) { |
| 217 |
var resp CdnCommonResponse |
| 218 |
err := client.Invoke("SetPageCompressConfig", req, &resp) |
| 219 |
if err != nil { |
| 220 |
return CdnCommonResponse{}, err |
| 221 |
} |
| 222 |
return resp, nil |
| 223 |
} |
| 224 |
|
| 225 |
func (client *CdnClient) SetIgnoreQueryStringConfig(req QueryStringConfigRequest) (CdnCommonResponse, error) { |
| 226 |
var resp CdnCommonResponse |
| 227 |
err := client.Invoke("SetIgnoreQueryStringConfig", req, &resp) |
| 228 |
if err != nil { |
| 229 |
return CdnCommonResponse{}, err |
| 230 |
} |
| 231 |
return resp, nil |
| 232 |
} |
| 233 |
|
| 234 |
func (client *CdnClient) SetRangeConfig(req ConfigRequest) (CdnCommonResponse, error) { |
| 235 |
var resp CdnCommonResponse |
| 236 |
err := client.Invoke("SetRangeConfig", req, &resp) |
| 237 |
if err != nil { |
| 238 |
return CdnCommonResponse{}, err |
| 239 |
} |
| 240 |
return resp, nil |
| 241 |
} |
| 242 |
|
| 243 |
func (client *CdnClient) SetVideoSeekConfig(req ConfigRequest) (CdnCommonResponse, error) { |
| 244 |
var resp CdnCommonResponse |
| 245 |
err := client.Invoke("SetVideoSeekConfig", req, &resp) |
| 246 |
if err != nil { |
| 247 |
return CdnCommonResponse{}, err |
| 248 |
} |
| 249 |
return resp, nil |
| 250 |
} |
| 251 |
|
| 252 |
func (client *CdnClient) SetSourceHostConfig(req HostConfigRequest) (CdnCommonResponse, error) { |
| 253 |
var resp CdnCommonResponse |
| 254 |
err := client.Invoke("SetSourceHostConfig", req, &resp) |
| 255 |
if err != nil { |
| 256 |
return CdnCommonResponse{}, err |
| 257 |
} |
| 258 |
return resp, nil |
| 259 |
} |
| 260 |
|
| 261 |
func (client *CdnClient) SetErrorPageConfig(req ErrorPageConfigRequest) (CdnCommonResponse, error) { |
| 262 |
var resp CdnCommonResponse |
| 263 |
err := client.Invoke("SetErrorPageConfig", req, &resp) |
| 264 |
if err != nil { |
| 265 |
return CdnCommonResponse{}, err |
| 266 |
} |
| 267 |
return resp, nil |
| 268 |
} |
| 269 |
|
| 270 |
func (client *CdnClient) SetForceRedirectConfig(req RedirectConfigRequest) (CdnCommonResponse, error) { |
| 271 |
var resp CdnCommonResponse |
| 272 |
err := client.Invoke("SetForceRedirectConfig", req, &resp) |
| 273 |
if err != nil { |
| 274 |
return CdnCommonResponse{}, err |
| 275 |
} |
| 276 |
return resp, nil |
| 277 |
} |
| 278 |
|
| 279 |
func (client *CdnClient) SetRefererConfig(req ReferConfigRequest) (CdnCommonResponse, error) { |
| 280 |
var resp CdnCommonResponse |
| 281 |
err := client.Invoke("SetRefererConfig", req, &resp) |
| 282 |
if err != nil { |
| 283 |
return CdnCommonResponse{}, err |
| 284 |
} |
| 285 |
return resp, nil |
| 286 |
} |
| 287 |
|
| 288 |
func (client *CdnClient) SetFileCacheExpiredConfig(req CacheConfigRequest) (CdnCommonResponse, error) { |
| 289 |
var resp CdnCommonResponse |
| 290 |
err := client.Invoke("SetFileCacheExpiredConfig", req, &resp) |
| 291 |
if err != nil { |
| 292 |
return CdnCommonResponse{}, err |
| 293 |
} |
| 294 |
return resp, nil |
| 295 |
} |
| 296 |
|
| 297 |
func (client *CdnClient) SetPathCacheExpiredConfig(req CacheConfigRequest) (CdnCommonResponse, error) { |
| 298 |
var resp CdnCommonResponse |
| 299 |
err := client.Invoke("SetPathCacheExpiredConfig", req, &resp) |
| 300 |
if err != nil { |
| 301 |
return CdnCommonResponse{}, err |
| 302 |
} |
| 303 |
return resp, nil |
| 304 |
} |
| 305 |
|
| 306 |
func (client *CdnClient) ModifyFileCacheExpiredConfig(req ModifyCacheConfigRequest) (CdnCommonResponse, error) { |
| 307 |
var resp CdnCommonResponse |
| 308 |
err := client.Invoke("ModifyFileCacheExpiredConfig", req, &resp) |
| 309 |
if err != nil { |
| 310 |
return CdnCommonResponse{}, err |
| 311 |
} |
| 312 |
return resp, nil |
| 313 |
} |
| 314 |
|
| 315 |
func (client *CdnClient) ModifyPathCacheExpiredConfig(req ModifyCacheConfigRequest) (CdnCommonResponse, error) { |
| 316 |
var resp CdnCommonResponse |
| 317 |
err := client.Invoke("ModifyPathCacheExpiredConfig", req, &resp) |
| 318 |
if err != nil { |
| 319 |
return CdnCommonResponse{}, err |
| 320 |
} |
| 321 |
return resp, nil |
| 322 |
} |
| 323 |
|
| 324 |
func (client *CdnClient) DeleteCacheExpiredConfig(req DeleteCacheConfigRequest) (CdnCommonResponse, error) { |
| 325 |
var resp CdnCommonResponse |
| 326 |
err := client.Invoke("DeleteCacheExpiredConfig", req, &resp) |
| 327 |
if err != nil { |
| 328 |
return CdnCommonResponse{}, err |
| 329 |
} |
| 330 |
return resp, nil |
| 331 |
} |
| 332 |
|
| 333 |
func (client *CdnClient) SetReqAuthConfig(req ReqAuthConfigRequest) (CdnCommonResponse, error) { |
| 334 |
var resp CdnCommonResponse |
| 335 |
err := client.Invoke("SetReqAuthConfig", req, &resp) |
| 336 |
if err != nil { |
| 337 |
return CdnCommonResponse{}, err |
| 338 |
} |
| 339 |
return resp, nil |
| 340 |
} |
| 341 |
|
| 342 |
func (client *CdnClient) SetHttpHeaderConfig(req HttpHeaderConfigRequest) (CdnCommonResponse, error) { |
| 343 |
var resp CdnCommonResponse |
| 344 |
err := client.Invoke("SetHttpHeaderConfig", req, &resp) |
| 345 |
if err != nil { |
| 346 |
return CdnCommonResponse{}, err |
| 347 |
} |
| 348 |
return resp, nil |
| 349 |
} |
| 350 |
|
| 351 |
func (client *CdnClient) ModifyHttpHeaderConfig(req ModifyHttpHeaderConfigRequest) (CdnCommonResponse, error) { |
| 352 |
var resp CdnCommonResponse |
| 353 |
err := client.Invoke("ModifyHttpHeaderConfig", req, &resp) |
| 354 |
if err != nil { |
| 355 |
return CdnCommonResponse{}, err |
| 356 |
} |
| 357 |
return resp, nil |
| 358 |
} |
| 359 |
|
| 360 |
func (client *CdnClient) DeleteHttpHeaderConfig(req DeleteHttpHeaderConfigRequest) (CdnCommonResponse, error) { |
| 361 |
var resp CdnCommonResponse |
| 362 |
err := client.Invoke("DeleteHttpHeaderConfig", req, &resp) |
| 363 |
if err != nil { |
| 364 |
return CdnCommonResponse{}, err |
| 365 |
} |
| 366 |
return resp, nil |
| 367 |
} |
| 368 |
|
| 369 |
func (client *CdnClient) SetDomainServerCertificate(req CertificateRequest) (CdnCommonResponse, error) { |
| 370 |
var resp CdnCommonResponse |
| 371 |
err := client.Invoke("SetDomainServerCertificate", req, &resp) |
| 372 |
if err != nil { |
| 373 |
return CdnCommonResponse{}, err |
| 374 |
} |
| 375 |
return resp, nil |
| 376 |
} |
| 377 |
|
| 378 |
func (client *CdnClient) SetIpBlackListConfig(req IpBlackRequest) (CdnCommonResponse, error) { |
| 379 |
var resp CdnCommonResponse |
| 380 |
err := client.Invoke("SetCcConfig", req, &resp) |
| 381 |
if err != nil { |
| 382 |
return CdnCommonResponse{}, err |
| 383 |
} |
| 384 |
return resp, nil |
| 385 |
} |