回源配置接口
所有文档

          内容分发网络 CDN

          回源配置接口

          更新加速域名回源地址

           public void setDomainOrigin(CdnClient client, String domainName) {
                  SetDomainOriginRequest request = new SetDomainOriginRequest().withDomain(domainName).withFollow302(true);
                  ArrayList<OriginPeer> origin = new ArrayList<OriginPeer>();
                  origin.add(new OriginPeer().withPeer("3.4.5.6").withHost("a.com").withWeight(50));
                  origin.add(new OriginPeer().withPeer("5.4.3.2").withHost("a.com").withWeight(50));
                  request.setOrigin(origin);
                  client.setDomainOrigin(request);
              }

          设置Range回源

          public void setDomainRangeSwitch(CdnClient client, String domainName){
                  client.setDomainRangeSwitch(domainName, true);
              }

          查询Range回源

           public void getRangeSwitch(CdnClient client, String domainName){
                  GetDomainRangeSwitchResponse response = client.getDomainRangeSwitch(domainName);
              }

          设置回源协议

          public void setDomainOriginProtocol(CdnClient client, String domainName){
                  OriginProtocol originProtocol = new OriginProtocol().withValue("http");
                  client.setDomainOriginProtocol(new SetDomainOriginProtocolRequest().
                          withDomain(domainName)
                          .withOriginProtocol(originProtocol));
              }

          查询回源协议

          public void getOriginProtocol(CdnClient client, String domainName){
                  GetDomainOriginProtocolResponse response = client.getDomainOriginProtocol(domainName);
              }

          设置移动访问控制

           public void setDomainMobileAccess(CdnClient client, String domainName){
                  MobileAccess mobileAccess = new MobileAccess().withDistinguishClient(true);
                  client.setDomainMobileAccess(new SetDomainMobileAccessRequest()
                          .withDomain(domainName).withMobileAccess(mobileAccess));
              }

          查询移动访问控制

           public void getDomainMobileAccess(CdnClient client, String domainName){
                  GetDomainMobileAccessResponse response = client.getDomainMobileAccess(domainName);
              }

          设置回源错误重试条件

           public void setDomainRetryOrigin(CdnClient client, String domainName){
                  RetryOrigin retryOrigin = new RetryOrigin().addCode(500).addCode(504);
                  SetDomainRetryOriginRequest request = new SetDomainRetryOriginRequest().withRetryOrigin(retryOrigin);
                  client.setDomainRetryOrigin(domainName, request);
              }

          查询回源错误重试条件

          public void getDomainRetryOrigin(CdnClient client, String domainName) {
                  GetDomainRetryOriginResponse response = client.getDomainRetryOrigin(domainName);
              }
              
          上一篇
          访问配置接口
          下一篇
          高级设置接口