内容分发网络CDN

    高级设置接口

    设置HttpHeader

      public void setHttpHeader(){
            String domain="vd3.bdstatic.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");
            List<HttpHeader> httpHeaders=new ArrayList<HttpHeader>();
            httpHeaders.add(header1);httpHeaders.add(header2);
            SetHttpHeaderResponse response = cdnClient.setHttpHeader(domain, httpHeaders);
            System.out.println(response);
        }

    查询HttpHeader

     public void getHttpHeader(){
            String domain="vd3.bdstatic.com";
            GetHttpHeaderResponse response = cdnClient.getHttpHeader(domain);
            System.out.println(response);
        }

    设置SEO开关属性

    public void setSeoSwitch(){
            String domain="vd3.bdstatic.com";
            SeoSwitch seoSwitch=new SeoSwitch().withDiretlyOrigin("ON").withPushRecord("OFF");
            SetSeoSwitchResponse response = cdnClient.setSeoSwitch(domain, seoSwitch);
            System.out.println(response);
        }

    查询SEO开关属性

     public void getSeoSwitch(){
            String domain="vd3.bdstatic.com";
            GetSeoSwitchResponse response = cdnClient.getSeoSwitch(domain);
            System.out.println(response);
        }

    设置页面优化

     public void setFileTrim(){
            String domain="vd3.bdstatic.com";
            SetFileTrimResponse response = cdnClient.setFileTrim(domain, false);
            System.out.println(response);
        }

    查询页面优化

     public void getFileTrim(){
            String domain="vd3.bdstatic.com";
            GetFileTrimResponse response = cdnClient.getFileTrim(domain);
            System.out.println(response);
        }

    设置视频拖拽

    public void setMediaDrag(){
            String domain="vd3.bdstatic.com";
            MediaDrag mp4=new MediaDrag().withDragMode("second").withStartArgName("startIndex")
                    .withFileSuffix(Arrays.asList("mp4","m4a"));
            MediaDrag flv=new MediaDrag().withDragMode("byteAV");
            MediaDragConf mediaDragConf=new MediaDragConf().withFlv(flv).withMp4(mp4);
            SetMediaDragResponse setMediaDragResponse = cdnClient.setMediaDrag(domain, mediaDragConf);
            System.out.println(setMediaDragResponse);
        }

    查询视频拖拽

     public void getMediaGrag(){
            String domain="vd3.bdstatic.com";
            GetMediaDragResponse response = cdnClient.getMediaDrag(domain);
            System.out.println(response);
        }

    设置页面压缩

    public void setCompress(){
            String domain="vd3.bdstatic.com";
            Compress compress=new Compress().withAllow(true).withType("br");
            SetCompressResponse setCompressResponse = cdnClient.setCompress(domain, compress);
            System.out.println(setCompressResponse);
        }

    查询页面压缩

    public void getCompress(){
            String domain="vd3.bdstatic.com";
            GetCompressResponse response = cdnClient.getCompress(domain);
            System.out.println(response);
        }
    上一篇
    证书关联操作
    下一篇
    统计与日志接口