EipBP Instance
Retrieve Endpoint
Before configuring the endpoint for SDK usage, please refer to the developer guide section on EIP Service Domain Name to understand endpoint-related concepts. Baidu AI Cloud currently supports multiple regions. Please refer to the network product EIP in Region Selection Guide.
Note: EipBp API supports both HTTP and HTTPS calling methods. To enhance data security, it is recommended to call via HTTPS.
Retrieve AK/SK
To access Baidu AI Cloud EipBp, users need a valid AK (Access Key ID) and SK (Secret Access Key) for signature authentication. These system-provided strings identify users and enable secure access to services via signature verification. You can obtain detailed information about your AK/SK by following these steps:
Create EipBpClient
The EipBpClient acts as the client interface for EipBp services, offering a variety of methods for developers to interact with these services. When creating an EipBpClient, you first need to configure a BCE client configuration instance (config) using the endpoint, AK, and SK, and then use the config instance to initialize the EipBpClient. The specific configuration method is as follows:
1static final String ENDPOINT = "";
2static final String AK = "";
3static final String SK = "";
4BceClientConfiguration config = new BceClientConfiguration();
5config.setCredentials(new DefaultBceCredentials(AK, SK));
6config.setEndpoint(ENDPOINT);
7EipBpClient eipBpClient = new EipBpClient(config);
Create bandwidth package
Function declaration
1public CreateEipBpResponse createEipBp(CreateEipBpRequest request) {
2 ......
3}
Parameter meaning
Please refer to the OpenAPI documentation Request Parameters for Creating Bandwidth Package
Response value
Operation succeeded
1{
2 "metadata": For details, refer to the metadata section in the appendix,
3 "id":"bw-2ede9df3"
4}
Operation failed
For response exception list of operation failure, refer to the EIP Exception List.
Code example
For specific code examples, please refer to ExampleCreateEipBp.java
Adjust the bandwidth of the bandwidth package
Function declaration
1public void resizeEipBp(ResizeEipBpRequest request) {
2 ......
3}
4public void resizeEipBp(String id, Integer bandwidthInMbps) {
5 ......
6}
Parameter meaning
Please refer to the OpenAPI documentation Request Parameters for Adjusting Bandwidth of Bandwidth Package
Response value
Operation succeeded
None
Operation failed
For response exception list of operation failure, refer to the EIP Exception List.
Code example
For specific code examples, refer to ExampleResizeEipBp.java
Query bandwidth package details
Function declaration
1public EipBpDetailResponse getEipBpDetail(GetEipBpRequest request) {
2 ......
3}
4public EipBpDetailResponse getEipBpDetail(String id) {
5 ......
6}
Parameter meaning
Please refer to the OpenAPI documentation Request Parameters for Querying Bandwidth Package Details
Response value
Operation succeeded
1{
2 "metadata": For details, refer to the metadata section in the appendix,
3 "name":"bp_1",
4 "id":"bw-IyWRnII7",
5 "bindType":"eip",
6 "bandwidthInMbps":"5",
7 "instanceId":"ip-xefrn257",
8 "eips":[
9 "10.23.54.23"
10 ],
11 "instanceBandwidthInMbps":5,
12 "createTime":"2019-08-03T20:38:43Z",
13 "autoReleaseTime":"2019-09-23T12:38:43Z",
14 "type": "BandwidthPackage",
15 "region": "bj"
16}
Operation failed
For response exception list of operation failure, refer to the EIP Exception List.
Code example
For specific code examples, please refer to ExampleGetEipBpDetail.java
Query bandwidth package list
Function declaration
1public ListEipBpsResponse listEipBps(ListEipBpsRequest request) {
2 ......
3}
4public ListEipBpsResponse listEipBps() {
5 ......
6}
7public ListEipBpsResponse listEipBps(String id, String name, String bindType) {
8 ......
9}
10public ListEipBpsResponse listEipBps(String id, String name, String bindType, String type) {
11 ......
12}
Parameter meaning
Please refer to the OpenAPI documentation Request Parameters for Querying Bandwidth Package List
Response value
Operation succeeded
1{
2 "metadata": For details, refer to the metadata section in the appendix,
3 "nextMarker": "bw-IyWRn123",
4 "marker": "bw-IyWRnII7",
5 "maxKeys": 2,
6 "isTruncated": true,
7 "bpList": [
8 {
9 "name":"bp_1",
10 "id":"bw-IyWRnII7",
11 "bindType":"eip",
12 "bandwidthInMbps":"15",
13 "instanceId":"ip-xefrn257",
14 "eips":[
15 "10.23.54.23"
16 ],
17 "createTime":"2019-08-03T20:38:43Z",
18 "autoReleaseTime":"2019-08-23T12:38:43Z",
19 “type”:"BandwidthPackage",
20 "region":"bj"
21 },
22 {
23 "name":"bp_2",
24 "id":"bw-IyWRnIqw",
25 "bindType":"eipgroup",
26 "bandwidthInMbps":"30",
27 "instanceId":"eg-xsdqn76f",
28 "eips":[
29 "10.23.96.96",
30 "10.23.96.97",
31 "10.23.96.98",
32 "10.23.96.99"
33 ],
34 "createTime":"2019-08-03T20:38:43Z",
35 "autoReleaseTime":"2019-09-23T12:38:43Z",
36 “type”:"BandwidthPackage",
37 "region":"bj"
38 }
39 ]
40}
Operation failed
For response exception list of operation failure, refer to the EIP Exception List.
Code example
For specific code examples, please refer to ExampleListEipBps.java
Update the name of the bandwidth package
Function declaration
1public void renameEipBp(UpdateEipBpNameRequest request) {
2 ......
3}
4public void renameEipBp(String id, String name) {
5 ......
6}
Parameter meaning
Please refer to the OpenAPI documentation Request Parameters for Updating Bandwidth Package Name
Response value
Operation succeeded
None
Operation failed
For response exception list of operation failure, refer to the EIP Exception List.
Code example
For specific code examples, please refer to ExampleRenameEipBp.java
Update the automatic release time of the bandwidth package
Function declaration
1public void updateAutoReleaseTime(UpdateEipBpAutoReleaseTimeRequest request) {
2 ......
3}
4public void updateAutoReleaseTime(String id, String autoReleaseTime) {
5 ......
6}
Parameter meaning
Please refer to the OpenAPI documentation Request Parameters for Updating Auto-release Time of Bandwidth Package
Response value
Operation succeeded
None
Operation failed
For response exception list of operation failure, refer to the EIP Exception List.
Code example
For specific code examples, please refer to ExampleUpdateEipBpAutoReleaseTime.java
Release bandwidth package
Function declaration
1public void releaseEipBp(ReleaseEipBpRequest request) {
2 ......
3}
4public void releaseEipBp(String id) {
5 ......
6}
Parameter meaning
Please refer to the OpenAPI documentation Request Parameters for Releasing Bandwidth Package
Response value
Operation succeeded
None
Operation failed
For response exception list of operation failure, refer to the EIP Exception List.
Code example
For specific code examples, please refer to ExampleReleaseEipBp.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}
