IPv6 gateway
Retrieve Endpoint
Before configuring the endpoint for SDK usage, please refer to the developer guide section on VPC Service Domain Name to understand endpoint-related concepts. Baidu AI Cloud currently supports multiple regions. Please refer to the VPC section in the Region Selection Guide. IPv6 gateway service is part of the VPC service and adopts the VPC service domain name.
Retrieve AK/SK
To use the Baidu AI Cloud products, you need a Baidu AI Cloud account, a valid AK (Access Key ID) and SK (Secret Access Key) for signature certification. Your AK/SK information can be obtained and understood through the following steps:
Create Ipv6GatewayClient
When creating an Ipv6GatewayClient, first configure the Ipv6GatewayClientConfiguration type config instance using endpoint, AK, and SK, then use the config instance to configure the Ipv6GatewayClient. Configuration example is as follows:
1static final String HOST = "";
2static final String AK = "";
3static final String SK = "";
4Ipv6GatewayClientConfiguration config = new Ipv6GatewayClientConfiguration();
5config.setCredentials(new DefaultBceCredentials(AK, SK));
6config.setEndpoint(HOST);
7Ipv6GatewayClient ipv6GatewayClient = new Ipv6GatewayClient(config);
Create IPv6 gateway
Function declaration
1public CreateIpv6GatewayResponse createIpv6Gateway(String vpcId, String name, int bandwidthInMbps) {
2 ......
3}
4public CreateIpv6GatewayResponse createIpv6Gateway(CreateIpv6GatewayRequest request) {
5 ......
6}
Parameter meaning
Please refer to the OpenAPI documentation: Request Parameters for Creating IPv6 Gateway
Response Value
- Operation succeeded
1{
2 "metadata": For details, refer to the metadata section in the appendix,
3 "gatewayId":"gw-5af4eb65"
4}
- Operation failed
For response exception list of operation failure, refer to the Exception List.
Example code
For specific code examples, refer to ExampleCreateIpv6Gateway.java
Query IPv6 gateway
Function declaration
1public Ipv6GatewayResponse getIpv6Gateway(String vpcId) {
2 ......
3}
Parameter meaning
Please refer to the OpenAPI documentation Request Parameters for Querying IPv6 Gateway
Response Value
- Operation succeeded
1{
2 "name": "test",
3 "gatewayId": "gw-5af4eb65",
4 "bandwidthInMbps": 10,
5 "vpcId": "vpc-dsi78hfsa",
6 "egressOnlyRules": [
7 {
8 "egressOnlyRuleId":"ipv6_seg-c9e3b428",
9 "cidr":"2400:da00:e003:d01::/64"
10 }
11 ],
12 "rateLimitRules":[
13 {
14 "rateLimitRuleId":"ipv6_qos-0b56ec38",
15 "ipv6Address":"240c:4082:0:100::",
16 "ingressBandwidthInMbps":5,
17 "egressBandwidthInMbps":5
18 }
19 ],
20 "metadata": For details, refer to the metadata section in the appendix
21}
- Operation failed
For response exception list of operation failure, refer to the Exception List.
Example code
For specific code examples, refer to ExampleGetIpv6Gateway.java
Delete IPv6 gateway
Function declaration
1public void deleteIpv6Gateway(String gatewayId) {
2 ......
3}
4public void deleteIpv6Gateway(DeleteIpv6GatewayRequest request) {
5 ......
6}
Parameter Meaning
Please refer to the OpenAPI documentation: Request Parameters for Deleting IPv6 Gateway Details
Response Value
- Operation succeeded
No response value
- Operation failed
For response exception list of operation failure, refer to the Exception List.
Example code
For specific code examples, refer to ExampleDeleteIpv6Gateway.java
Bandwidth resizing for IPv6 gateway
Function declaration
1public void resizeIpv6Gateway(String ipv6GatewayId, int newBandwidthInMbps) {
2 ......
3}
4public void resizeIpv6Gateway(ResizeIpv6GatewayRequest request) {
5 ......
6}
Parameter Meaning
Please refer to the OpenAPI documentation Request Parameters for Bandwidth Resizing of IPv6 Gateway
Response Value
- Operation succeeded
No response value
- Operation failed
For response exception list of operation failure, refer to the Exception List.
Example code
For specific code examples, refer to ExampleResizeIpv6Gateway.java
Add IPv6 gateway egress-only policy
Function declaration
1public CreateEgressOnlyRuleResponse createEgressOnlyRule(CreateEgressOnlyRuleRequest request) {
2 ......
3}
Parameter Meaning
Please refer to the OpenAPI documentation Request Parameters for Adding IPv6 Gateway Egress-only Policy
Response Value
- Operation succeeded
1{
2 "metadata": For details, refer to the metadata section in the appendix,
3 "egressOnlyRuleId":"ipv6_seg-c9e3b428"
4}
- Operation failed
For response exception list of operation failure, refer to the Exception List.
Example code
For specific code examples, refer to ExampleCreateIpv6GatewayEgressOnlyRule.java
Delete the IPv6 gateway egress-only policy
Function declaration
1public void deleteIpv6GatewayEgressOnlyRule(String gatewayId, String egressOnlyRuleId) {
2 ......
3}
4public void deleteIpv6GatewayEgressOnlyRule(DeleteIpv6EgressOnlyRuleRequest deleteIpv6EgressOnlyRuleRequest) {
5 ......
6}
Parameter meaning
Please refer to the OpenAPI documentation Request Parameters for Deleting IPv6 Gateway Egress-only Policy
Response value
- Operation succeeded
No response value
- Operation failed
For response exception list of operation failure, refer to the Exception List.
Example code
For specific code examples, refer to ExampleDeleteIpv6GatewayEgressOnlyRule.java
Query the IPv6 gateway egress-only policy
Function declaration
1public ListEgressOnlyRuleResponse listEgressOnlyRule(String gatewayId) {
2 ......
3}
4public ListEgressOnlyRuleResponse listEgressOnlyRule(ListEgressOnlyRuleRequest request) {
5 ......
6}
Parameter meaning
Please refer to the OpenAPI documentation Request Parameters for Querying IPv6 Gateway Egress-only Policy
Response value
- Operation succeeded
1{
2 "metadata": For details, refer to the metadata section in the appendix,
3 "egressOnlyRules":[
4 {
5 "egressOnlyRuleId":"ipv6_seg-c9e3b428",
6 "cidr":"2400:da00:e003:d01::/64"
7 }
8 ],
9 "marker":"ipv6_seg-c9e3b428",
10 "maxKeys":1000
11 "isTruncated":false
12}
- Operation failed
For response exception list of operation failure, refer to the Exception List.
Example code
For specific code examples, refer to ExampleListIpv6GatewayEgressOnlyRule.java
Add IPv6 gateway bandwidth limiting policy
Function declaration
1public RateLimitRuleResponse createRateLimitRule(CreateRateLimitRuleRequest request) {
2 ......
3}
Parameter Meaning
Please refer to the OpenAPI documentation Request Parameters for Adding IPv6 Gateway Bandwidth Limiting Policy
Response Value
- Operation succeeded
1{
2 "metadata": For details, refer to the metadata section in the appendix,
3 "rateLimitRuleId":"ipv6_qos-0b56ec38"
4}
- Operation failed
For response exception list of operation failure, refer to the Exception List.
Example code
For specific code examples, refer to ExampleCreateIpv6GatewayRateLimitRule.java
Query IPv6 gateway bandwidth limiting policy list
Function declaration
1public ListRateLimitRuleResponse listRateLimitRule(String gatewayId) {
2 ......
3}
4public ListRateLimitRuleResponse listRateLimitRule(ListEgressOnlyRuleRequest request) {
5 ......
6}
Parameter Meaning
Please refer to the OpenAPI documentation Request Parameters for Querying IPv6 Gateway Bandwidth Limiting Policy List
Response Value
- Operation succeeded
1{
2 "metadata": For details, refer to the metadata section in the appendix,
3 "rateLimitRules":[
4 {
5 "rateLimitRuleId":"ipv6_qos-0b56ec38"
6 "ipv6Address":"240c:4082:0:100::",
7 "ingressBandwidthInMbps":5,
8 "egressBandwidthInMbps":5
9 }
10 ],
11 "marker":"ipv6_qos-0b56ec38",
12 "maxKeys":1000
13 "isTruncated":false
14}
- Operation failed
For response exception list of operation failure, refer to the Exception List.
Example code
For specific code examples, refer to ExampleListIpv6GatewayRateLimitRule.java
Update IPv6 gateway bandwidth limiting policy
Function declaration
1public void updateRateLimitRule(UpdateRateLimitRuleRequest request) {
2 ......
3}
Parameter meaning
Please refer to the OpenAPI documentation Request Parameters for Updating IPv6 Gateway Bandwidth Limiting Policy
Response value
- Operation succeeded
No response value
- Operation failed
For response exception list of operation failure, refer to the Exception List.
Example code
For specific code examples, refer to ExampleUpdateIpv6GatewayRateLimitRule.java
Delete IPv6 gateway bandwidth limiting policy
Function declaration
1public void deleteIpv6GatewayRateLimitRule(String gatewayId, String rateLimitRuleId) {
2 ......
3}
4public void deleteIpv6GatewayEgressOnlyRule(DeleteIpv6RateLimitRuleRequest request) {
5 ......
6}
Parameter Meaning
Please refer to the OpenAPI documentation Request Parameters for Deleting IPv6 Gateway Bandwidth Limiting Policy
Response value
- Operation succeeded
No response value
- Operation failed
For response exception list of operation failure, refer to the Exception List.
Example code
For specific code examples, refer to ExampleDeleteIpv6GatewayRateLimitRule.java
Appendix
Public response information in Metadata format
1 {
2 "bceRequestId":"f5f0821d-45fe-439b-bbf4-fc48b639f84a",
3 "contentLength":28,
4 "contentType":"application/json;charset=UTF-8",
5 "date":1701917695000,
6 "server":"openresty/1.15.8.1"
7 }
