-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
92a51b3
commit 07de76c
Showing
21 changed files
with
2,114 additions
and
794 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
example/src/main/java/com/volcengine/example/cdn/AddCdnCertificate.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package com.volcengine.example.cdn; | ||
|
||
import com.alibaba.fastjson.JSON; | ||
import com.volcengine.model.beans.CDN; | ||
import com.volcengine.service.cdn.CDNService; | ||
import com.volcengine.service.cdn.impl.CDNServiceImpl; | ||
|
||
public class AddCdnCertificate { | ||
public static void main(String[] args) { | ||
CDNService service = CDNServiceImpl.getInstance(); | ||
service.setAccessKey(Utils.ak); | ||
service.setSecretKey(Utils.sk); | ||
try { | ||
CDN.AddCdnCertificateRequest req = new CDN.AddCdnCertificateRequest() | ||
.setCertificate(new CDN.Certificate() | ||
.setCertificate("-----BEGIN CERTIFICATE-----\\r\\nHmU2w=\\r\\n-----END CERTIFICATE-----\\r\\n-----BEGIN CERTIFICATE-----\\r\\nMIIElg==\\r\\n-----END CERTIFICATE-----\\r\\n-----BEGIN CERTIFICATE-----\\r\\nMIIDV5Adg\\r\\n06O/nVsJ8dWd4=\\r\\n-----END CERTIFICATE-----") | ||
.setPrivateKey("-----BEGIN RSA PRIVATE KEY-----\nMIIE6\nBNtw==\n-----END RSA PRIVATE KEY-----")) | ||
.setCertInfo(new CDN.AddCdnCertInfo() | ||
.setDesc("MyCert")) | ||
.setSource("volc_cert_center"); | ||
CDN.AddCdnCertificateResponse resp = service.addCdnCertificate(req); | ||
System.out.println(JSON.toJSONString(resp)); | ||
} catch (Exception e) { | ||
e.printStackTrace(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
example/src/main/java/com/volcengine/example/cdn/BatchDeployCert.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package com.volcengine.example.cdn; | ||
|
||
import com.alibaba.fastjson.JSON; | ||
import com.volcengine.model.beans.CDN; | ||
import com.volcengine.service.cdn.CDNService; | ||
import com.volcengine.service.cdn.impl.CDNServiceImpl; | ||
|
||
public class BatchDeployCert { | ||
public static void main(String[] args) { | ||
CDNService service = CDNServiceImpl.getInstance(); | ||
service.setAccessKey(Utils.ak); | ||
service.setSecretKey(Utils.sk); | ||
try { | ||
CDN.BatchDeployCertRequest req = new CDN.BatchDeployCertRequest() | ||
.setCertId("cert-c195f679cecb4fc5yjt3dd8c54e6c0a2") | ||
.setDomain("www.example.com,img.example.com"); | ||
CDN.BatchDeployCertResponse resp = service.batchDeployCert(req); | ||
System.out.println(JSON.toJSONString(resp)); | ||
} catch (Exception e) { | ||
e.printStackTrace(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
example/src/main/java/com/volcengine/example/cdn/DescribeCertConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.volcengine.example.cdn; | ||
|
||
import com.alibaba.fastjson.JSON; | ||
import com.volcengine.model.beans.CDN; | ||
import com.volcengine.service.cdn.CDNService; | ||
import com.volcengine.service.cdn.impl.CDNServiceImpl; | ||
|
||
public class DescribeCertConfig { | ||
public static void main(String[] args) { | ||
CDNService service = CDNServiceImpl.getInstance(); | ||
service.setAccessKey(Utils.ak); | ||
service.setSecretKey(Utils.sk); | ||
try { | ||
CDN.DescribeCertConfigRequest req = new CDN.DescribeCertConfigRequest() | ||
.setCertId("cert-2b12dd79c3ef441ea1e58a09248d0fd6"); | ||
CDN.DescribeCertConfigResponse resp = service.describeCertConfig(req); | ||
System.out.println(JSON.toJSONString(resp)); | ||
} catch (Exception e) { | ||
e.printStackTrace(); | ||
} | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
example/src/main/java/com/volcengine/example/cdn/DescribeEdgeTopStatusCode.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.volcengine.example.cdn; | ||
|
||
import com.alibaba.fastjson.JSON; | ||
import com.volcengine.model.beans.CDN; | ||
import com.volcengine.service.cdn.CDNService; | ||
import com.volcengine.service.cdn.impl.CDNServiceImpl; | ||
|
||
public class DescribeEdgeTopStatusCode { | ||
public static void main(String[] args) { | ||
CDNService service = CDNServiceImpl.getInstance(); | ||
service.setAccessKey(Utils.ak); | ||
service.setSecretKey(Utils.sk); | ||
try { | ||
CDN.DescribeEdgeTopStatusCodeRequest req = new CDN.DescribeEdgeTopStatusCodeRequest() | ||
.setMetric("status_5xx") | ||
.setItem("domain") | ||
.setDomain(Utils.exampleHost); | ||
CDN.DescribeEdgeTopStatusCodeResponse resp = service.describeEdgeTopStatusCode(req); | ||
System.out.println(JSON.toJSONString(resp)); | ||
} catch (Exception e) { | ||
e.printStackTrace(); | ||
} | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
example/src/main/java/com/volcengine/example/cdn/DescribeOriginTopNrtData.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.volcengine.example.cdn; | ||
|
||
import com.alibaba.fastjson.JSON; | ||
import com.volcengine.model.beans.CDN; | ||
import com.volcengine.service.cdn.CDNService; | ||
import com.volcengine.service.cdn.impl.CDNServiceImpl; | ||
|
||
public class DescribeOriginTopNrtData { | ||
public static void main(String[] args) { | ||
CDNService service = CDNServiceImpl.getInstance(); | ||
service.setAccessKey(Utils.ak); | ||
service.setSecretKey(Utils.sk); | ||
try { | ||
CDN.DescribeOriginTopNrtDataRequest req = new CDN.DescribeOriginTopNrtDataRequest() | ||
.setMetric("flux") | ||
.setItem("domain") | ||
.setDomain(Utils.exampleHost); | ||
CDN.DescribeOriginTopNrtDataResponse resp = service.describeOriginTopNrtData(req); | ||
System.out.println(JSON.toJSONString(resp)); | ||
} catch (Exception e) { | ||
e.printStackTrace(); | ||
} | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
example/src/main/java/com/volcengine/example/cdn/DescribeOriginTopStatusCode.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.volcengine.example.cdn; | ||
|
||
import com.alibaba.fastjson.JSON; | ||
import com.volcengine.model.beans.CDN; | ||
import com.volcengine.service.cdn.CDNService; | ||
import com.volcengine.service.cdn.impl.CDNServiceImpl; | ||
|
||
public class DescribeOriginTopStatusCode { | ||
public static void main(String[] args) { | ||
CDNService service = CDNServiceImpl.getInstance(); | ||
service.setAccessKey(Utils.ak); | ||
service.setSecretKey(Utils.sk); | ||
try { | ||
CDN.DescribeOriginTopStatusCodeRequest req = new CDN.DescribeOriginTopStatusCodeRequest() | ||
.setMetric("status_5xx") | ||
.setItem("domain") | ||
.setDomain(Utils.exampleHost);; | ||
CDN.DescribeOriginTopStatusCodeResponse resp = service.describeOriginTopStatusCode(req); | ||
System.out.println(JSON.toJSONString(resp)); | ||
} catch (Exception e) { | ||
e.printStackTrace(); | ||
} | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
example/src/main/java/com/volcengine/example/cdn/ListCdnCertInfo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.volcengine.example.cdn; | ||
|
||
import com.alibaba.fastjson.JSON; | ||
import com.volcengine.model.beans.CDN; | ||
import com.volcengine.service.cdn.CDNService; | ||
import com.volcengine.service.cdn.impl.CDNServiceImpl; | ||
|
||
public class ListCdnCertInfo { | ||
public static void main(String[] args) { | ||
CDNService service = CDNServiceImpl.getInstance(); | ||
service.setAccessKey(Utils.ak); | ||
service.setSecretKey(Utils.sk); | ||
try { | ||
CDN.ListCdnCertInfoRequest req = new CDN.ListCdnCertInfoRequest(); | ||
CDN.ListCdnCertInfoResponse resp = service.listCdnCertInfo(req); | ||
System.out.println(JSON.toJSONString(resp)); | ||
} catch (Exception e) { | ||
e.printStackTrace(); | ||
} | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
example/src/main/java/com/volcengine/example/cdn/ListCertInfo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.volcengine.example.cdn; | ||
|
||
import com.alibaba.fastjson.JSON; | ||
import com.volcengine.model.beans.CDN; | ||
import com.volcengine.service.cdn.CDNService; | ||
import com.volcengine.service.cdn.impl.CDNServiceImpl; | ||
|
||
public class ListCertInfo { | ||
public static void main(String[] args) { | ||
CDNService service = CDNServiceImpl.getInstance(); | ||
service.setAccessKey(Utils.ak); | ||
service.setSecretKey(Utils.sk); | ||
try { | ||
CDN.ListCertInfoRequest req = new CDN.ListCertInfoRequest() | ||
.setSource("volc_cert_center"); | ||
CDN.ListCertInfoResponse resp = service.listCertInfo(req); | ||
System.out.println(JSON.toJSONString(resp)); | ||
} catch (Exception e) { | ||
e.printStackTrace(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.