高级设置接口
更新时间:2023-05-16
设置HttpHeader
public void setDomainHttpHeader(CdnClient client) {
String domain = "my.test.com";
HttpHeader header1 = new HttpHeader().withType("origin").withHeader("x-auth-cn")
.withValue("xxxxxxxxx").withAction("add");
HttpHeader header2 = new HttpHeader().withType("response").withHeader("content-type")
.withValue("application/octet-stream").withAction("add");
client.setDomainHttpHeader(new SetDomainHttpHeaderRequest().withDomain(domain)
.addHttpHeader(header1).addHttpHeader(header2));
}
查询HttpHeader
public void getDomainHttpHeader(CdnClient client) {
String domain = "my.test.com";
GetDomainHttpHeaderResponse response = client.getDomainHttpHeader(domain);
}
设置SEO开关属性
public void setDomainSeoSwitch(CdnClient client) {
String domain = "my.test.com";
SeoSwitch seoSwitch = new SeoSwitch()
.withDiretlyOrigin("ON").withPushRecord("OFF");
client.setDomainSeoSwitch(new SetDomainSeoSwitchRequest()
.withDomain(domain).withSeoSwitch(seoSwitch));
}
查询SEO开关属性
public void getDomainSeoSwitch(CdnClient client) {
String domain = "my.test.com";
GetDomainSeoSwitchResponse response = client.getDomainSeoSwitch(domain);
}
设置视频拖拽
public void setDomainMediaDrag(CdnClient client) {
String domain = "my.test.com";
MediaDragConf mediaDragConf = new MediaDragConf();
MediaDrag mp4 = new MediaDrag().addFileSuffix("mp4").addFileSuffix("m4a")
.withStartArgName("startIndex").withDragMode("second");
MediaDrag flv = new MediaDrag().withDragMode("byteAV");
client.setDomainMediaDrag(new SetDomainMediaDragRequest()
.withDomain(domain)
.withMediaDragConf(mediaDragConf.withMp4(mp4).withFlv(flv)));
}
查询视频拖拽
public void getDomainMediaGrag(CdnClient client) {
String domain = "my.test.com";
GetDomainMediaDragResponse response = client.getDomainMediaDrag(domainName);
}
设置页面优化
public void setDomainFileTrim(CdnClient client) {
String domain = "my.test.com";
client.setDomainFileTrim(domain, true);
}
查询页面优化
public void getDomainFileTrim(CdnClient client) {
String domain = "my.test.com";
GetDomainFileTrimResponse response = client.getDomainFileTrim(domain);
}
设置页面压缩
public void setDomainCompress(CdnClient client) {
String domain = "my.test.com";
Compress compress = new Compress().withAllow(true).withType("br");
client.setDomainCompress(new SetDomainCompressRequest()
.withDomain(domain).withCompress(compress));
}
查询页面压缩
public void getDomainCompress(CdnClient client){
String domain = "my.test.com";
GetDomainCompressResponse response = client.getDomainCompress(domain);
}
设置QUIC开关
public void setDomainQUIC(CdnClient client) {
String domain = "my.test.com";
client.setDomainQUICSwitch(domain, true);
}
查询QUIC开关
public void getDomainQUICSwitch(CdnClient client) {
String domain = "my.test.com";
GetDomainQUICSwitchResponse response = client.getDomainQUICSwitch(domain);
}
设置IPv6开关
public void setDomainIPv6Dispatch(CdnClient client) {
String domain = "my.test.com";
Enable enable = new Enable().withEnable(true);
client.setDomainIPv6Dispatch(new SetDomainIPv6DispatchRequest()
.withDomain(domain)
.withIPv6Dispatch(enable));
}
查询IPv6开关
public void getDomainIPv6Dispatch(CdnClient client) {
String domain = "my.test.com";
GetDomainIPv6DispatchResponse response = client.getDomainIPv6Dispatch(domain);
}
设置离线模式
public void setDomainOfflineMode(CdnClient client) {
String domain = "my.test.com";
client.setDomainOfflineModeSwitch(domain, true);
}
查询离线模式
public void getDomainOfflineMode(CdnClient client) {
String domain = "my.test.com";
GetDomainOfflineModeSwitchResponse response = client.getDomainOfflineModeSwitch(domain);
}
设置带宽封顶
public void setDomainLimitBandwidth(CdnClient client) {
String domain = "my.test.com";
LimitBandwidth limitBandwidth = new LimitBandwidth()
.withEnabled(true)
.withActived(true)
.withThreshold("2G")
.withAction("deny");
client.setDomainLimitBandwidth(new SetDomainLimitBandwidthRequest()
.withDomain(domain).withLimitBandwidth(limitBandwidth));
}
查询带宽封顶
public void getDomainLimitBandwidth(CdnClient client) {
String domain = "my.test.com";
GetDomainLimitBandwidthResponse response = client.getDomainLimitBandwidth(domain);
}